Ticket #16056: Portfile_v3.diff

File Portfile_v3.diff, 7.7 KB (added by jens.traube@…, 16 years ago)

update of patch -- third version

  • Portfile

    old new  
    1010homepage    http://${name}.freedesktop.org/
    1111
    1212description     Poppler is a PDF rendering library based on the xpdf-3.0 code base.
    13 long_description \
    14     ${description}
    15 
     13long_description Poppler is a PDF rendering library based on the xpdf-3.0 code base. \
     14                 It consists of frontends (GLib, Qt3, Qt4), the poppler core, \
     15                 and rendering backends (Cairo, Splash, AbiWord). \
     16                 (Poppler Wiki: http://freedesktop.org/wiki/Software/poppler)
    1617master_sites    ${homepage}
    1718checksums   \
    1819    md5 00593d56340b4a635f4a34590c445800 \
    1920    rmd160 26634a62d77471ed668507bd0c287bfff291f881 \
    2021    sha1 993c7ac0e12c20674908a44542f49b43bd417574
    2122
    22 depends_lib \
    23     port:cairo \
    24     port:gtk2 \
    25     port:poppler-data
     23depends_build   port:pkgconfig
     24
     25depends_lib     port:freetype \
     26                port:fontconfig \
     27                port:expat \
     28                port:libiconv \
     29                port:zlib \
     30                port:poppler-data
    2631
    2732post-patch {
    28     reinplace "s|-flat_namespace -undefined suppress||g" \
    29         ${worksrcpath}/configure
    30     reinplace "s|\$includedir|${prefix}/include|g" \
    31         ${worksrcpath}/configure
    3233    reinplace "s|tests||" \
    3334        ${worksrcpath}/qt4/Makefile.in
     35
     36    # replace "\$allow_undefined_flag" with "$allow_undefined_flag":
     37    reinplace {s|\\$allow_undefined_flag|\$allow_undefined_flag|g} \
     38        ${worksrcpath}/configure
    3439}
    3540
    3641configure.args \
    3742    --disable-poppler-qt4 \
    3843    --enable-xpdf-headers \
    3944    --enable-zlib \
    40     --mandir=${prefix}/share/man
     45    --mandir=${prefix}/share/man \
     46    --disable-cairo-output \
     47    --disable-splash-output \
     48    --disable-gdk \
     49    --disable-poppler-glib \
     50    --disable-poppler-qt \
     51    --disable-abiword-output
     52
    4153
    4254if {[variant_isset no_x11]} {
    4355    default_variants    +quartz
     
    5365    }
    5466}
    5567
     68# variant quartz conflicts x11 requires glibCairo description { Support for the native Mac OS X interface } {
    5669variant quartz conflicts x11 description { Support for the native Mac OS X interface } {
    5770    configure.args-append --disable-gtk-test --without-x
    5871}
     
    6073variant x11 conflicts quartz description { Support for the X11 user interface } {
    6174    depends_lib-append  \
    6275        lib:libX11.6:XFree86 \
    63         port:xrender
     76        port:xrender
     77}
     78
     79variant qt3Splash requires quartz description {Qt3 bindings to poppler & Splash output device} {
     80    depends_lib-append \
     81        port:qt3-mac \
     82        port:jpeg \
     83        port:libpng
     84
     85    configure.args-delete \
     86        --disable-poppler-qt \
     87        --disable-splash-output
    6488}
    6589
    66 variant qt4 description { Support for the QT toolkit } {
    67     configure.args-delete --disable-poppler-qt4
     90
     91# variant qt4Splash description {Qt4 bindings to poppler & Splash output device} {
     92variant qt4Splash requires quartz description {Qt4 bindings to poppler & Splash output device} {
    6893    if ([variant_isset quartz]) {
    6994        depends_lib-append  port:qt4-mac
    7095    } else {
    7196        depends_lib-append  port:qt4-x11
    7297    }
     98
     99    depends_lib-append \
     100        port:jpeg \
     101        port:libpng
     102
     103    configure.args-delete \
     104        --disable-poppler-qt4 \
     105        --disable-splash-output
     106}
     107
     108#variant qt4Arthur description {Qt4 bindings to poppler & Arthur output device (Qt4 Paint System)} {
     109#}
     110
     111# There is no source code for a variant qt4Cairo (what about Qt3 ?)
     112
     113variant glibSplash description {GLib bindings to poppler & Splash output device} {
     114    depends_lib-append \
     115        port:gtk2 \
     116        port:glib2 \
     117        port:gettext \
     118        port:libpixman \
     119        port:jpeg \
     120        port:libpng \
     121        port:tiff
     122
     123    # GDK (GIMP Drawing Kit) is required by the GLib wrapper
     124    # when splash output device is enabled.
     125    # GDK (part of GTK) depends on Pango, Pango depends on Cairo.
     126
     127    depends_lib-append \
     128        port:pango \
     129        port:cairo
     130
     131    configure.args-delete \
     132        --disable-poppler-glib \
     133        --disable-splash-output \
     134        --disable-gdk
     135}
     136
     137variant glibCairo description {GLib bindings to poppler & Cairo output device} {
     138    pre-fetch {
     139        if {   ![variant_isset quartz]
     140            && ![file exists "${prefix}/include/cairo/cairo-xlib.h"]} {
     141            # variant glibCairo requires quartz
     142            ui_error "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
     143            ui_error "The active port \"cairo\" has been built without X11 support."
     144            ui_error "To build Poppler, use the \"+quartz\" variant."
     145            ui_error "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
     146            return -code error
     147        }
     148    }
     149
     150    depends_lib-append \
     151        port:cairo \
     152        port:glib2 \
     153        port:gettext \
     154        port:libpixman \
     155        port:jpeg \
     156        port:libpng
     157                       
     158    if {![variant_isset quartz]} {
     159        depends_lib-append \
     160            port:gtk2 \
     161            port:pango \
     162            port:tiff
     163    }
     164
     165    configure.args-delete \
     166        --disable-poppler-glib \
     167        --disable-cairo-output
     168}
     169
     170variant abiword description {rendering backend/output device, and pdftoabw command line utility} {
     171    depends_lib-append \
     172        port:libxml2
     173
     174    configure.args-delete \
     175        --disable-abiword-output
     176}
     177
     178if {   ![variant_isset qt3Splash]
     179    && ![variant_isset qt4Splash]
     180    && ![variant_isset glibSplash]
     181    && ![variant_isset glibCairo]
     182    && ![variant_isset abiword]} {
     183
     184    default_variants +glibSplash +glibCairo +abiword
     185}
     186
     187# not testet:
     188#platform darwin 6 {
     189#    configure.env-append MACOSX_DEPLOYMENT_TARGET=10.2
     190#}
     191
     192# not testet:
     193#platform darwin 7 {
     194#    configure.env-append MACOSX_DEPLOYMENT_TARGET=10.3
     195#}
     196
     197platform darwin 8 {
     198    configure.env-append MACOSX_DEPLOYMENT_TARGET=10.4
     199}
     200
     201
     202pre-configure {
     203    ui_debug "+++++++++++++++++++++++++++++++++++"
     204    ui_debug "configure options:"
     205    ui_debug "${configure.args}"
     206    ui_debug "+++++++++++++++++++++++++++++++++++"
     207
     208    ui_debug "+++++++++++++++++++++++++++++++++++"
     209    ui_debug "port dependencies:"
     210    ui_debug "$depends_lib"
     211    ui_debug "+++++++++++++++++++++++++++++++++++"
    73212}
    74213
    75 test.run    yes
    76 test.dir    ${worksrcpath}/test
    77 test.target all
    78214
     215
     216
     217# SOME NOTES TO "gtk test" (see variant "quartz"):
     218#
     219# After build of poppler the directory ${worksrcpath}/test
     220# contains five shell scripts:
     221#
     222# (1) gtk-cairo-test
     223# (2) gtk-splash-test
     224# (3) pdf_inspector
     225# (4) pdf-fullrewrite
     226# (5) perf-test
     227#
     228# These shell scripts are wrapper scripts for the identically
     229# named binaries contained in the directory "test/.libs".
     230#
     231# The first three scripts can only be launched on the command line
     232# in a window of the X Window system.
     233#
     234# Usage (change the current directory to ${worksrcpath}/test):
     235#
     236#$ ./gtk-cairo-test PDF-FILES...  (opens each pdf file in a window)
     237#
     238#$ ./gtk-splash-test PDF-FILES... (opens each pdf file in a window)
     239#
     240#$ ./pdf_inspector  (no arguments, it opens a dialog window)
     241#
     242#$ ./pdf-fullrewrite INPUT-FILE OUTPUT-FILE
     243#
     244#$ ./perf-test [-preview|-slowpreview] [-loadonly] [-timings] [-text]
     245#              [-resolution NxM] [-recursive] [-page N] [-out out.txt] PDF-FILES...
     246#
     247# ("perf-test" is a tool to stress-test poppler rendering and measure
     248# rendering times for very simplistic performance measuring.)
     249#
     250# The wrapper scripts should never be moved out of the build directory,
     251# otherwise they will not operate correctly.
     252# Therefore it is not possible to install them in the directory ${prefix}/bin
     253#
     254# To use them, you must keep the work directory ( sudo port -k install poppler )