Ticket #16056: Portfile_v4.diff

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

update of patch -- fourth 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). \
     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
    6477}
    6578
    66 variant qt4 description { Support for the QT toolkit } {
    67     configure.args-delete --disable-poppler-qt4
     79variant qt3Splash requires quartz conflicts qt4Splash 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
     88}
     89
     90# variant qt4Splash requires quartz conflicts qt3Splash description {Qt4 bindings to poppler & Splash output device}
     91variant qt4Splash conflicts qt3Splash description {Qt4 bindings to poppler & Splash output device} {
    6892    if ([variant_isset quartz]) {
    69         depends_lib-append  port:qt4-mac
     93        depends_lib-append \
     94            port:qt4-mac
    7095    } else {
    71         depends_lib-append  port:qt4-x11
     96        depends_lib-append \
     97            port:qt4-x11 \
     98            port:glib2 \
     99            port:gtk2 \
     100            port:pango \
     101            port:cairo
     102
     103        configure.args-delete \
     104            --disable-poppler-glib \
     105            --disable-gdk
     106    }
     107
     108    depends_lib-append \
     109        port:jpeg \
     110        port:libpng
     111
     112    configure.args-delete \
     113        --disable-poppler-qt4 \
     114        --disable-splash-output
     115}
     116
     117#variant qt4Arthur description {Qt4 bindings to poppler & Arthur output device (Qt4 Paint System)} {
     118#}
     119
     120# There is no source code for a variant qt4Cairo (what about Qt3 ?)
     121
     122variant glibSplash description {GLib bindings to poppler & Splash output device} {
     123    depends_lib-append \
     124        port:gtk2 \
     125        port:glib2 \
     126        port:gettext \
     127        port:libpixman \
     128        port:jpeg \
     129        port:libpng \
     130        port:tiff
     131
     132    # GDK (GIMP Drawing Kit) is required by the GLib wrapper
     133    # when splash output device is enabled.
     134    # GDK (part of GTK) depends on Pango, Pango depends on Cairo.
     135
     136    depends_lib-append \
     137        port:pango \
     138        port:cairo
     139
     140    configure.args-delete \
     141        --disable-poppler-glib \
     142        --disable-splash-output \
     143        --disable-gdk
     144}
     145
     146variant glibCairo description {GLib bindings to poppler & Cairo output device} {
     147    pre-fetch {
     148        if {   ![variant_isset quartz]
     149            && ![file exists "${prefix}/include/cairo/cairo-xlib.h"]} {
     150            # variant glibCairo requires quartz
     151            ui_error "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
     152            ui_error "The active port \"cairo\" has been built without X11 support."
     153            ui_error "To build Poppler, use the \"+quartz\" variant."
     154            ui_error "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
     155            return -code error
     156        }
     157    }
     158
     159    depends_lib-append \
     160        port:cairo \
     161        port:glib2 \
     162        port:gettext \
     163        port:libpixman \
     164        port:jpeg \
     165        port:libpng
     166                       
     167    if {![variant_isset quartz]} {
     168        depends_lib-append \
     169            port:gtk2 \
     170            port:pango \
     171            port:tiff
    72172    }
     173
     174    configure.args-delete \
     175        --disable-poppler-glib \
     176        --disable-cairo-output
     177}
     178
     179if {   ![variant_isset qt3Splash]
     180    && ![variant_isset qt4Splash]
     181    && ![variant_isset glibSplash]
     182    && ![variant_isset glibCairo]} {
     183
     184    default_variants +glibSplash +glibCairo
     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 )