Ticket #51912: Portfile-mupdf.diff

File Portfile-mupdf.diff, 3.2 KB (added by harciga, 8 years ago)
  • Portfile

    old new  
    44PortSystem          1.0
    55
    66name                mupdf
    7 version             1.8
     7version             1.9a
    88categories          graphics
    99platforms           darwin
    1010maintainers         gmail.com:starkhalo openmaintainer
     
    3131master_sites        ${homepage}downloads/
    3232distname            ${name}-${version}-source
    3333
    34 checksums           rmd160  2708f5650f23101a66cef92b7903aafb716f9c02 \
    35                     sha256  a2a3c64d8b24920f87cf4ea9339a25abf7388496440f13b37482d1403c33c206
     34checksums           rmd160  0cb0d098c603b16be217e42299052a928d95c3fc \
     35                    sha256  8015c55f4e6dd892d3c50db4f395c1e46660a10b460e2ecd180a497f55bbc4cc
    3636
    3737depends_build       port:pkgconfig
    3838
    3939depends_lib         port:freetype \
    40                     port:glfw \
     40                    port:harfbuzz \
    4141                    port:jbig2dec \
    4242                    port:jpeg \
    4343                    port:mesa \
     
    4747                    port:xorg-libXrandr \
    4848                    port:zlib
    4949
     50patchfiles          patch-Makerules.diff
     51
    5052use_configure       no
    5153
    5254variant universal   {}
    5355
    54 # When not using the bundled copies, we have to tell mupdf's build system where
    55 # to find the headers
    56 configure.cflags-append \
    57                     -I${prefix}/include/freetype2
    58 
    5956build.args          PREFIX=${prefix}
    6057build.args-append   CC=${configure.cc} \
    6158                    CXX=${configure.cxx} \
    62                     CPP=${configure.cpp}
    63 
    64 build.env           CFLAGS="${configure.cflags} [get_canonical_archflags cc]" \
    65                     LDFLAGS="${configure.ldflags} [get_canonical_archflags ld]" \
     59                    CPP=${configure.cpp} \
     60                    XCFLAGS="${configure.cflags} [get_canonical_archflags cc]" \
     61                    XLIBS="${configure.ldflags} [get_canonical_archflags ld]" \
    6662                    build=release \
    6763                    verbose=yes
    6864
    69 eval destroot.env   ${build.env}
    70 
    7165destroot.destdir    prefix=${destroot}${prefix}
    7266
     67variant glfw description {OpenGL viewer} {
     68    build.args-append   HAVE_GLFW=yes
     69}
     70
    7371post-extract {
     72# delete thirdparty software other than mujs and openjpeg
    7473    delete ${worksrcpath}/thirdparty/curl
    7574    delete ${worksrcpath}/thirdparty/freetype
    76     delete ${worksrcpath}/thirdparty/glfw
     75    delete ${worksrcpath}/thirdparty/harfbuzz
    7776    delete ${worksrcpath}/thirdparty/jbig2dec
    7877    delete ${worksrcpath}/thirdparty/jpeg
    79     # Got compile errors with openjpeg-2.1 and openjpeg-1.5
    80     #delete ${worksrcpath}/thirdparty/openjpeg
    8178    delete ${worksrcpath}/thirdparty/zlib
    82 }
    83 
    84 post-destroot {
    85 # mupdf has its own javascript interpreter which is maintained in a separate
    86 # repository (git://git.ghostscript.com/mujs.git) but shipped with the source
    87 # code as a third-party library. Since there hasn't been a versioned release of
    88 # it yet and `mujs' is developed especially for mupdf it will be installed via
    89 # post-destroot.
    90     set libdir ${destroot}${prefix}/lib
    91     xinstall -m 644 -W ${worksrcpath} \
    92         build/release/libmujs.a \
    93         ${libdir}
     79    if {![variant_isset glfw]} {
     80        delete ${worksrcpath}/thirdparty/glfw
     81    }
    9482}
    9583
    9684# https://trac.macports.org/ticket/33240