Ticket #16056: Portfile_v5.diff

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

update of patch -- fifth 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
     
    5163    if {![variant_isset quartz] && ![variant_isset x11]} {
    5264        error "Either +x11 or +quartz is required"
    5365    }
     66
     67    if {    [variant_isset glibCairo]
     68        && ![variant_isset quartz]
     69        && ![file exists "${prefix}/include/cairo/cairo-xlib.h"]} {
     70        # variant glibCairo requires quartz
     71        ui_error "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
     72        ui_error "The active port \"cairo\" has been built without X11 support."
     73        ui_error "To build Poppler, use the \"+quartz\" variant."
     74        ui_error "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
     75        return -code error
     76    }
     77
     78    if {    [variant_isset qt4Splash]
     79        && ![variant_isset quartz]
     80        && ![file exists "${prefix}/lib/libQtCore.dylib"]
     81        &&  [file exists "${prefix}/Library/Frameworks/QtCore.framework/QtCore"]} {
     82        # variant qt4Splash requires quartz
     83        ui_error "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
     84        ui_error "Variant \"+qt4Splash\" requires variant \"+quartz\","
     85        ui_error "because port \"qt4-mac\" is active"
     86        ui_error "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
     87        return -code error
     88    }
     89
     90    if {    [variant_isset qt4Splash]
     91        && ![variant_isset x11]
     92        &&  [file exists "${prefix}/lib/libQtCore.dylib"]
     93        && ![file exists "${prefix}/Library/Frameworks/QtCore.framework/QtCore"]} {
     94        # variant qt4Splash requires x11
     95        ui_error "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
     96        ui_error "Variant \"+qt4Splash\" requires variant \"+x11\","
     97        ui_error "because port \"qt4-x11\" is active"
     98        ui_error "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
     99        return -code error
     100    }
    54101}
    55102
     103
    56104variant quartz conflicts x11 description { Support for the native Mac OS X interface } {
    57105    configure.args-append --disable-gtk-test --without-x
    58106}
     
    60108variant x11 conflicts quartz description { Support for the X11 user interface } {
    61109    depends_lib-append  \
    62110        lib:libX11.6:XFree86 \
    63         port:xrender
     111        port:xrender
    64112}
    65113
    66 variant qt4 description { Support for the QT toolkit } {
    67     configure.args-delete --disable-poppler-qt4
     114variant qt3Splash requires quartz conflicts qt4Splash description {Qt3 bindings to poppler & Splash output device} {
     115    depends_lib-append \
     116        port:qt3-mac \
     117        port:jpeg \
     118        port:libpng
     119
     120    configure.args-delete \
     121        --disable-poppler-qt \
     122        --disable-splash-output
     123}
     124
     125# variant qt4Splash requires quartz conflicts qt3Splash description {Qt4 bindings to poppler & Splash output device}
     126variant qt4Splash conflicts qt3Splash description {Qt4 bindings to poppler & Splash output device} {
    68127    if ([variant_isset quartz]) {
    69         depends_lib-append  port:qt4-mac
     128        depends_lib-append \
     129            port:qt4-mac
    70130    } else {
    71         depends_lib-append  port:qt4-x11
     131        depends_lib-append \
     132            port:qt4-x11 \
     133            port:glib2 \
     134            port:gtk2 \
     135            port:pango \
     136            port:cairo
     137
     138        configure.args-delete \
     139            --disable-poppler-glib \
     140            --disable-gdk
     141    }
     142
     143    depends_lib-append \
     144        port:jpeg \
     145        port:libpng
     146
     147    configure.args-delete \
     148        --disable-poppler-qt4 \
     149        --disable-splash-output
     150}
     151
     152#variant qt4Arthur description {Qt4 bindings to poppler & Arthur output device (Qt4 Paint System)} {
     153#}
     154
     155# There is no source code for a variant qt4Cairo (what about Qt3 ?)
     156
     157variant glibSplash description {GLib bindings to poppler & Splash output device} {
     158    depends_lib-append \
     159        port:gtk2 \
     160        port:glib2 \
     161        port:gettext \
     162        port:libpixman \
     163        port:jpeg \
     164        port:libpng \
     165        port:tiff
     166
     167    # GDK (GIMP Drawing Kit) is required by the GLib wrapper
     168    # when splash output device is enabled.
     169    # GDK (part of GTK) depends on Pango, Pango depends on Cairo.
     170
     171    depends_lib-append \
     172        port:pango \
     173        port:cairo
     174
     175    configure.args-delete \
     176        --disable-poppler-glib \
     177        --disable-splash-output \
     178        --disable-gdk
     179}
     180
     181variant glibCairo description {GLib bindings to poppler & Cairo output device} {
     182    depends_lib-append \
     183        port:cairo \
     184        port:glib2 \
     185        port:gettext \
     186        port:libpixman \
     187        port:jpeg \
     188        port:libpng
     189                       
     190    if {![variant_isset quartz]} {
     191        depends_lib-append \
     192            port:gtk2 \
     193            port:pango \
     194            port:tiff
    72195    }
     196
     197    configure.args-delete \
     198        --disable-poppler-glib \
     199        --disable-cairo-output
     200}
     201
     202if {   ![variant_isset qt3Splash]
     203    && ![variant_isset qt4Splash]
     204    && ![variant_isset glibSplash]
     205    && ![variant_isset glibCairo]} {
     206
     207    default_variants +glibSplash +glibCairo
    73208}
    74209
    75 test.run    yes
    76 test.dir    ${worksrcpath}/test
    77 test.target all
     210# not testet:
     211#platform darwin 6 {
     212#    configure.env-append MACOSX_DEPLOYMENT_TARGET=10.2
     213#}
     214
     215# not testet:
     216#platform darwin 7 {
     217#    configure.env-append MACOSX_DEPLOYMENT_TARGET=10.3
     218#}
     219
     220platform darwin 8 {
     221    configure.env-append MACOSX_DEPLOYMENT_TARGET=10.4
     222}
     223
     224
     225pre-configure {
     226    ui_debug "+++++++++++++++++++++++++++++++++++"
     227    ui_debug "configure options:"
     228    ui_debug "${configure.args}"
     229    ui_debug "+++++++++++++++++++++++++++++++++++"
     230
     231    ui_debug "+++++++++++++++++++++++++++++++++++"
     232    ui_debug "port dependencies:"
     233    ui_debug "$depends_lib"
     234    ui_debug "+++++++++++++++++++++++++++++++++++"
     235}
     236
     237
     238
    78239
     240# SOME NOTES TO "gtk test" (see variant "quartz"):
     241#
     242# After build of poppler the directory ${worksrcpath}/test
     243# contains five shell scripts:
     244#
     245# (1) gtk-cairo-test
     246# (2) gtk-splash-test
     247# (3) pdf_inspector
     248# (4) pdf-fullrewrite
     249# (5) perf-test
     250#
     251# These shell scripts are wrapper scripts for the identically
     252# named binaries contained in the directory "test/.libs".
     253#
     254# The first three scripts can only be launched on the command line
     255# in a window of the X Window system.
     256#
     257# Usage (change the current directory to ${worksrcpath}/test):
     258#
     259#$ ./gtk-cairo-test PDF-FILES...  (opens each pdf file in a window)
     260#
     261#$ ./gtk-splash-test PDF-FILES... (opens each pdf file in a window)
     262#
     263#$ ./pdf_inspector  (no arguments, it opens a dialog window)
     264#
     265#$ ./pdf-fullrewrite INPUT-FILE OUTPUT-FILE
     266#
     267#$ ./perf-test [-preview|-slowpreview] [-loadonly] [-timings] [-text]
     268#              [-resolution NxM] [-recursive] [-page N] [-out out.txt] PDF-FILES...
     269#
     270# ("perf-test" is a tool to stress-test poppler rendering and measure
     271# rendering times for very simplistic performance measuring.)
     272#
     273# The wrapper scripts should never be moved out of the build directory,
     274# otherwise they will not operate correctly.
     275# Therefore it is not possible to install them in the directory ${prefix}/bin
     276#
     277# To use them, you must keep the work directory ( sudo port -k install poppler )