source: trunk/dports/print/ghostscript/Portfile @ 136513

Last change on this file since 136513 was 136513, checked in by jmr@…, 4 years ago

ghostscript: remove use of -Werror instead of blacklisting compilers

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 5.4 KB
Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
2# $Id: Portfile 136513 2015-05-20 03:11:57Z jmr@macports.org $
3
4PortSystem          1.0
5PortGroup           muniversal 1.0
6
7name                ghostscript
8version             9.16
9categories          print
10license             AGPL-3
11maintainers         takanori openmaintainer
12description         GPL Ghostscript, An interpreter for PostScript and PDF
13long_description    Ghostscript is the well-known PostScript interpreter which \
14                    is available for all common and most esoteric platforms and \
15                    supports many different printers and some displays.
16platforms           darwin
17homepage            http://www.cs.wisc.edu/~ghost/
18master_sites        http://downloads.ghostscript.com/public/:source \
19                    sourceforge:gs-fonts:fonts \
20                    https://github.com/adobe-type-tools/mapping-resources-pdf/archive/:misc
21
22# Note: this needs to be manually updated for new upstream commits
23set mappingresources_commit \
24                    3128b3872aa14a4c066d5cbcdde66a3b6bba0982
25
26distfiles           ${distname}.tar.gz:source \
27                    ghostscript-fonts-other-6.0.tar.gz:fonts \
28                    ${mappingresources_commit}.zip:misc
29patchfiles          patch-base_unix-dll.mak.diff \
30                    patch-base_stdpre.h.diff \
31                    no-werror.diff
32
33checksums           ${distname}.tar.gz \
34                    rmd160  9c483b93ccd106bae6db36b3335fae4e91177aec \
35                    sha256  746d77280cca8afdd3d4c2c1389e332ed9b0605bd107bcaae1d761b061d1a68d \
36                    ghostscript-fonts-other-6.0.tar.gz \
37                    rmd160  ab60dbf71e7d91283a106c3df381cadfe173082f \
38                    sha256  4fa051e341167008d37fe34c19d241060cd17b13909932cd7ca7fe759243c2de \
39                    ${mappingresources_commit}.zip \
40                    rmd160  1bb3b507ec48b559e4388553391ebece2468dc73 \
41                    sha256  769bf8961b1dbf443a865f7c26363ea143854be5eefe3e61b3ee4c0ebe80a50a
42
43depends_lib         port:expat \
44                    port:fontconfig \
45                    port:freetype \
46                    port:jbig2dec \
47                    port:jpeg \
48                    port:libiconv \
49                    port:libidn \
50                    port:libpaper \
51                    port:libpng \
52                    port:tiff \
53                    port:zlib
54#                   port:lcms2
55#                   port:ijs
56
57depends_build       port:pkgconfig
58
59depends_run         port:perl5
60
61extract.only        ${distname}.tar.gz \
62                    ghostscript-fonts-other-6.0.tar.gz
63
64post-extract {
65    system -W ${workpath} "unzip ${distpath}/${mappingresources_commit}.zip"
66    system -W ${workpath} "unzip ${workpath}/mapping-resources-pdf-${mappingresources_commit}/mappingresources4pdf_2unicode.zip"
67    system -W ${workpath} "unzip ${workpath}/mapping-resources-pdf-${mappingresources_commit}/mappingresources4pdf_other.zip"
68
69#   MacPorts's lcms2 is 2.4 and it doesn't support cmsPluginTHR() yet.
70#   foreach d {freetype jbig2dec jpeg lcms2 libpng tiff zlib}
71    foreach d {freetype jbig2dec jpeg       libpng tiff zlib} {
72        move "${worksrcpath}/${d}" "${worksrcpath}/${d}_local"
73    }
74
75    #move ${workpath}/MappingOther/Adobe-CNS1-ETen-B5 ${workpath}/MappingOther/Adobe-CNS1-ETenms-B5
76    eval copy -force [glob ${workpath}/mappingresources4pdf_2unicode/*] ${worksrcpath}/Resource/CMap
77    eval copy -force [glob ${workpath}/mappingresources4pdf_other/*]    ${worksrcpath}/Resource/CMap
78}
79
80post-patch {
81    reinplace "s|__PREFIX__|${prefix}|" ${worksrcpath}/base/unix-dll.mak
82    reinplace "s|ZLIBDIR=src|ZLIBDIR=${prefix}/include|" configure.ac
83
84    # Ensure that MacPorts perl is used
85    fs-traverse f ${worksrcpath} {
86        if [string match "*.pl" ${f}] {
87            reinplace "s|#!/usr/bin/perl|#!${prefix}/bin/perl|" ${f}
88        }
89    }
90}
91
92use_autoreconf      yes
93autoreconf.args     -fv
94
95# Make included OpenJPEG uses its own headers rather than the system ones
96configure.cppflags-delete \
97                    "-I${prefix}/include"
98configure.cppflags-append \
99                    "-isystem${prefix}/include"
100
101configure.args      --disable-compile-inits \
102                    --disable-cups \
103                    --disable-dbus \
104                    --disable-gtk \
105                    --without-x \
106                    --without-luratech \
107                    --with-system-libtiff
108
109build.target        so
110use_parallel_build  yes
111
112destroot.target     soinstall
113post-destroot {
114    ln -s gsc ${destroot}${prefix}/bin/gs
115
116    xinstall -m 755 -d ${destroot}${prefix}/share/${name}/fonts
117    foreach f {*.afm *.gsf *.pfa *.pfm} {
118        eval xinstall -m 644 [glob ${workpath}/fonts/${f}] ${destroot}${prefix}/share/${name}/fonts
119    }
120
121    xinstall -m 755 -d ${destroot}${prefix}/share/doc
122    ln -s ../${name}/${version}/doc ${destroot}${prefix}/share/doc/${name}
123}
124
125configure.universal_args-delete --disable-dependency-tracking
126
127variant x11 {
128    depends_lib-append      port:xorg-libXext
129    depends_lib-append      port:xorg-libXt
130    configure.args-delete   --without-x
131    configure.args-append   --with-x
132}
133
134variant cups description {Enable CUPS driver} {
135    configure.args-delete   --disable-cups
136    configure.args-append   --enable-cups
137}
138
139default_variants    +x11
140
141livecheck.type      regex
142livecheck.url       http://downloads.ghostscript.com/public/
143livecheck.regex     ${name}-(\\d+(?:\\.\\d+)*)
Note: See TracBrowser for help on using the repository browser.