75 | | test.run yes |
76 | | test.dir ${worksrcpath}/test |
77 | | test.target all |
| 80 | variant qt3Splash description {Qt3 bindings to poppler & Splash output device} { |
| 81 | depends_lib-append port:qt3-mac \ |
| 82 | port:jpeg \ |
| 83 | port:libpng |
| 84 | } |
| 85 | |
| 86 | variant qt4Splash description {Qt4 bindings to poppler & Splash output device} { |
| 87 | depends_lib-append port:qt4-mac \ |
| 88 | port:jpeg \ |
| 89 | port:libpng |
| 90 | } |
| 91 | |
| 92 | #variant qt4Arthur description {Qt4 bindings to poppler & Arthur output device (Qt4 Paint System)} { |
| 93 | #} |
| 94 | |
| 95 | # There is no source code for a variant Qt4Cairo (what about Qt3 ?) |
| 96 | |
| 97 | variant glibSplash description {GLib bindings to poppler & Splash output device} { |
| 98 | depends_lib-append port:gtk2 \ |
| 99 | port:glib2 \ |
| 100 | port:gettext \ |
| 101 | port:libpixman \ |
| 102 | port:jpeg \ |
| 103 | port:libpng \ |
| 104 | port:tiff |
| 105 | |
| 106 | # GDK (GIMP Drawing Kit) is required by the GLib wrapper |
| 107 | # when splash output device is enabled. |
| 108 | # GDK (part of GTK) depends on Pango, Pango depends on Cairo. |
| 109 | |
| 110 | depends_lib-append port:pango \ |
| 111 | port:cairo |
| 112 | } |
| 113 | |
| 114 | variant glibCairo description {GLib bindings to poppler & Cairo output device} { |
| 115 | pre-fetch { |
| 116 | if { ![variant_isset quartz] |
| 117 | && ![file exists "${prefix}/include/cairo/cairo-xlib.h"]} { |
| 118 | ui_error "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" |
| 119 | ui_error "The active port \"cairo\" has been built without X11 support." |
| 120 | ui_error "To build Poppler, use the \"+quartz\" variant." |
| 121 | ui_error "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" |
| 122 | return -code error |
| 123 | } |
| 124 | } |
| 125 | |
| 126 | depends_lib-append port:cairo \ |
| 127 | port:glib2 \ |
| 128 | port:gettext \ |
| 129 | port:libpixman \ |
| 130 | port:jpeg \ |
| 131 | port:libpng |
| 132 | |
| 133 | if {![variant_isset quartz]} { |
| 134 | depends_lib-append port:gtk2 \ |
| 135 | port:pango \ |
| 136 | port:tiff |
| 137 | } |
| 138 | } |
| 139 | |
| 140 | variant abiword description {rendering backend/output device, and pdftoabw command line utility} { |
| 141 | depends_lib-append port:libxml2 |
| 142 | } |
| 143 | |
| 144 | if { ![variant_isset qt3Splash] |
| 145 | && ![variant_isset qt4Splash] |
| 146 | && ![variant_isset glibSplash] |
| 147 | && ![variant_isset glibCairo] |
| 148 | && ![variant_isset abiword] |
| 149 | && ![variant_isset quartz]} { |
| 150 | default_variants +glibSplash +glibCairo +abiword |
| 151 | } |
| 152 | |
| 153 | # not testet: |
| 154 | #platform darwin 6 { |
| 155 | # configure.env-append MACOSX_DEPLOYMENT_TARGET=10.2 |
| 156 | #} |
| 157 | |
| 158 | # not testet: |
| 159 | #platform darwin 7 { |
| 160 | # configure.env-append MACOSX_DEPLOYMENT_TARGET=10.3 |
| 161 | #} |
| 162 | |
| 163 | platform darwin 8 { |
| 164 | configure.env-append MACOSX_DEPLOYMENT_TARGET=10.4 |
| 165 | } |
| 166 | |
| 167 | |
| 168 | pre-configure { |
| 169 | setConfigureOptionsForMinimalInstallationOfSelectedPopplerVariant |
| 170 | } |
| 171 | |
| 172 | |
| 173 | # The following procedure has a lengthy body, but is simple in its purpose. |
| 174 | # Each poppler variant has a set of configure options which are necessary |
| 175 | # to get a minimal installation of poppler. If a combination of variants is |
| 176 | # selected, what is the united set of configure options? |
| 177 | # To get this set, the needed configure options of all selected poppler |
| 178 | # variants are accumulated. The same is done for the NOT needed configure options. |
| 179 | # The difference of the two accumulated sets is the set of configure options |
| 180 | # needed for a minimal installation of poppler. |
| 181 | |
| 182 | proc setConfigureOptionsForMinimalInstallationOfSelectedPopplerVariant {} { |
| 183 | global prefix configure.args |
| 184 | |
| 185 | set listOfConfigureOptions ${configure.args} |
| 186 | set listOfConfigureOptionsToAppend {} |
| 187 | set listOfConfigureOptionsToDelete {} |
| 188 | |
| 189 | proc optionToAppend {option} { |
| 190 | # accumulate all configure options to be included |
| 191 | # of all selected poppler variants |
| 192 | upvar listOfConfigureOptionsToAppend listOfConfigureOptionsToAppend |
| 193 | if {[lsearch -exact "$listOfConfigureOptionsToAppend" "$option"] == -1} then { |
| 194 | lappend listOfConfigureOptionsToAppend "$option" |
| 195 | } |
| 196 | } |
| 197 | |
| 198 | proc optionToDelete {option} { |
| 199 | # accumulate all configure options to be excluded |
| 200 | # of all selected poppler variants |
| 201 | upvar listOfConfigureOptionsToDelete listOfConfigureOptionsToDelete |
| 202 | if {[lsearch -exact "$listOfConfigureOptionsToDelete" "$option"] == -1} then { |
| 203 | lappend listOfConfigureOptionsToDelete "$option" |
| 204 | } |
| 205 | } |
| 206 | |
| 207 | if {[variant_isset quartz]} then { |
| 208 | optionToAppend {--disable-gtk-test} |
| 209 | optionToAppend {--without-x} |
| 210 | } |
| 211 | |
| 212 | if { [variant_isset qt3Splash] |
| 213 | || [variant_isset qt4Splash] |
| 214 | || [variant_isset glibSplash] |
| 215 | || [variant_isset glibCairo] |
| 216 | || [variant_isset abiword]} then { |
| 217 | optionToAppend {--disable-cairo-output} |
| 218 | optionToAppend {--disable-splash-output} |
| 219 | optionToAppend {--disable-gdk} |
| 220 | optionToAppend {--disable-poppler-glib} |
| 221 | optionToAppend {--disable-poppler-qt} |
| 222 | optionToAppend {--disable-poppler-qt4} |
| 223 | optionToAppend {--disable-abiword-output} |
| 224 | optionToAppend {--enable-xpdf-headers} |
| 225 | optionToAppend {--enable-zlib} |
| 226 | optionToAppend "--mandir=${prefix}/share/man" |
| 227 | } |
| 228 | |
| 229 | if {[variant_isset glibSplash]} then { |
| 230 | optionToAppend {--disable-poppler-qt} |
| 231 | optionToAppend {--disable-poppler-qt4} |
| 232 | optionToDelete {--disable-poppler-glib} |
| 233 | #------------------------------------ |
| 234 | optionToAppend {--disable-cairo-output} |
| 235 | optionToAppend {--disable-abiword-output} |
| 236 | optionToDelete {--disable-splash-output} |
| 237 | |
| 238 | # GDK (GIMP Drawing Kit) is required by the GLib wrapper |
| 239 | # when splash output device is enabled. |
| 240 | optionToDelete {--disable-gdk} |
| 241 | } |
| 242 | |
| 243 | if {[variant_isset glibCairo]} then { |
| 244 | optionToAppend {--disable-poppler-qt} |
| 245 | optionToAppend {--disable-poppler-qt4} |
| 246 | optionToDelete {--disable-poppler-glib} |
| 247 | #-------------------------------------- |
| 248 | optionToAppend {--disable-splash-output} |
| 249 | optionToAppend {--disable-gdk} |
| 250 | optionToAppend {--disable-abiword-output} |
| 251 | optionToDelete {--disable-cairo-output} |
| 252 | } |
| 253 | |
| 254 | if {[variant_isset qt3Splash]} then { |
| 255 | optionToAppend {--disable-poppler-glib} |
| 256 | optionToAppend {--disable-gdk} |
| 257 | optionToAppend {--disable-poppler-qt4} |
| 258 | optionToDelete {--disable-poppler-qt} |
| 259 | #-------------------------------------- |
| 260 | optionToAppend {--disable-cairo-output} |
| 261 | optionToAppend {--disable-abiword-output} |
| 262 | optionToDelete {--disable-splash-output} |
| 263 | } |
| 264 | |
| 265 | if {[variant_isset qt4Splash]} then { |
| 266 | optionToAppend {--disable-poppler-glib} |
| 267 | optionToAppend {--disable-gdk} |
| 268 | optionToAppend {--disable-poppler-qt} |
| 269 | optionToDelete {--disable-poppler-qt4} |
| 270 | #---------------------------------------- |
| 271 | optionToAppend {--disable-cairo-output} |
| 272 | optionToAppend {--disable-abiword-output} |
| 273 | optionToDelete {--disable-splash-output} |
| 274 | } |
| 275 | |
| 276 | if {[variant_isset abiword]} then { |
| 277 | optionToAppend {--disable-splash-output} |
| 278 | optionToAppend {--disable-gdk} |
| 279 | optionToAppend {--disable-cairo-output} |
| 280 | optionToDelete {--disable-abiword-output} |
| 281 | } |
| 282 | |
| 283 | ################################ |
| 284 | # balance of configure options # |
| 285 | ################################ |
| 286 | |
| 287 | foreach option $listOfConfigureOptionsToAppend { |
| 288 | if {[lsearch -exact "$listOfConfigureOptions" "$option"] == -1} then { |
| 289 | lappend listOfConfigureOptions "$option" |
| 290 | configure.args-append "$option" |
| 291 | } |
| 292 | } |
| 293 | |
| 294 | foreach option $listOfConfigureOptionsToDelete { |
| 295 | set i [lsearch -exact "$listOfConfigureOptions" "$option"] |
| 296 | if {$i > -1} then { |
| 297 | set listOfConfigureOptions [lreplace $listOfConfigureOptions $i $i] |
| 298 | configure.args-delete "$option" |
| 299 | } |
| 300 | } |
| 301 | |
| 302 | ui_debug "+++++++++++++++++++++++++++++++++++" |
| 303 | ui_debug "configure options:" |
| 304 | ui_debug "${configure.args}" |
| 305 | ui_debug "+++++++++++++++++++++++++++++++++++" |
| 306 | } |
| 307 | |