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

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

ghostscript: work around github's "stealth update". No clue what really went down there and if it will change *again* tomorrow.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 5.5 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 136561 2015-05-21 20:34:41Z ionic@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
29
30# Fix for github's "stealth update". I have no idea how or why that even happened.
31dist_subdir         ${name}/${version}_1
32
33patchfiles          patch-base_unix-dll.mak.diff \
34                    patch-base_stdpre.h.diff \
35                    no-werror.diff
36
37checksums           ${distname}.tar.gz \
38                    rmd160  9c483b93ccd106bae6db36b3335fae4e91177aec \
39                    sha256  746d77280cca8afdd3d4c2c1389e332ed9b0605bd107bcaae1d761b061d1a68d \
40                    ghostscript-fonts-other-6.0.tar.gz \
41                    rmd160  ab60dbf71e7d91283a106c3df381cadfe173082f \
42                    sha256  4fa051e341167008d37fe34c19d241060cd17b13909932cd7ca7fe759243c2de \
43                    ${mappingresources_commit}.zip \
44                    rmd160  b00725e3f5615ac6aaa20a7b4d0dd6e769dca6ee \
45                    sha256  27f87e56092a8293d17f683b008327afbb79fad9f1328227a9916f9be69c9db2
46
47depends_lib         port:expat \
48                    port:fontconfig \
49                    port:freetype \
50                    port:jbig2dec \
51                    port:jpeg \
52                    port:libiconv \
53                    port:libidn \
54                    port:libpaper \
55                    port:libpng \
56                    port:tiff \
57                    port:zlib
58#                   port:lcms2
59#                   port:ijs
60
61depends_build       port:pkgconfig
62
63depends_run         port:perl5
64
65extract.only        ${distname}.tar.gz \
66                    ghostscript-fonts-other-6.0.tar.gz
67
68post-extract {
69    system -W ${workpath} "unzip ${distpath}/${mappingresources_commit}.zip"
70    system -W ${workpath} "unzip ${workpath}/mapping-resources-pdf-${mappingresources_commit}/mappingresources4pdf_2unicode.zip"
71    system -W ${workpath} "unzip ${workpath}/mapping-resources-pdf-${mappingresources_commit}/mappingresources4pdf_other.zip"
72
73#   MacPorts's lcms2 is 2.4 and it doesn't support cmsPluginTHR() yet.
74#   foreach d {freetype jbig2dec jpeg lcms2 libpng tiff zlib}
75    foreach d {freetype jbig2dec jpeg       libpng tiff zlib} {
76        move "${worksrcpath}/${d}" "${worksrcpath}/${d}_local"
77    }
78
79    #move ${workpath}/MappingOther/Adobe-CNS1-ETen-B5 ${workpath}/MappingOther/Adobe-CNS1-ETenms-B5
80    eval copy -force [glob ${workpath}/mappingresources4pdf_2unicode/*] ${worksrcpath}/Resource/CMap
81    eval copy -force [glob ${workpath}/mappingresources4pdf_other/*]    ${worksrcpath}/Resource/CMap
82}
83
84post-patch {
85    reinplace "s|__PREFIX__|${prefix}|" ${worksrcpath}/base/unix-dll.mak
86    reinplace "s|ZLIBDIR=src|ZLIBDIR=${prefix}/include|" configure.ac
87
88    # Ensure that MacPorts perl is used
89    fs-traverse f ${worksrcpath} {
90        if [string match "*.pl" ${f}] {
91            reinplace "s|#!/usr/bin/perl|#!${prefix}/bin/perl|" ${f}
92        }
93    }
94}
95
96use_autoreconf      yes
97autoreconf.args     -fv
98
99# Make included OpenJPEG uses its own headers rather than the system ones
100configure.cppflags-delete \
101                    "-I${prefix}/include"
102configure.cppflags-append \
103                    "-isystem${prefix}/include"
104
105configure.args      --disable-compile-inits \
106                    --disable-cups \
107                    --disable-dbus \
108                    --disable-gtk \
109                    --without-x \
110                    --without-luratech \
111                    --with-system-libtiff
112
113build.target        so
114use_parallel_build  yes
115
116destroot.target     soinstall
117post-destroot {
118    ln -s gsc ${destroot}${prefix}/bin/gs
119
120    xinstall -m 755 -d ${destroot}${prefix}/share/${name}/fonts
121    foreach f {*.afm *.gsf *.pfa *.pfm} {
122        eval xinstall -m 644 [glob ${workpath}/fonts/${f}] ${destroot}${prefix}/share/${name}/fonts
123    }
124
125    xinstall -m 755 -d ${destroot}${prefix}/share/doc
126    ln -s ../${name}/${version}/doc ${destroot}${prefix}/share/doc/${name}
127}
128
129configure.universal_args-delete --disable-dependency-tracking
130
131variant x11 {
132    depends_lib-append      port:xorg-libXext
133    depends_lib-append      port:xorg-libXt
134    configure.args-delete   --without-x
135    configure.args-append   --with-x
136}
137
138variant cups description {Enable CUPS driver} {
139    configure.args-delete   --disable-cups
140    configure.args-append   --enable-cups
141}
142
143default_variants    +x11
144
145livecheck.type      regex
146livecheck.url       http://downloads.ghostscript.com/public/
147livecheck.regex     ${name}-(\\d+(?:\\.\\d+)*)
Note: See TracBrowser for help on using the repository browser.