source: trunk/dports/print/ghostscript/Portfile

Last change on this file was 154244, checked in by devans@…, 11 months ago

ghostscript: update livecheck url and regex.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 6.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 154244 2016-10-25 09:58:21Z ryandesign@macports.org $
3
4PortSystem          1.0
5PortGroup           muniversal 1.0
6
7name                ghostscript
8version             9.19
9categories          print
10license             AGPL-3 BSD
11maintainers         nomaintainer
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.ghostscript.com/
18master_sites        https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs919: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                    0bdcfbe5e394d4519e5969918c34d4eebf76a386
25
26distfiles           ${distname}.tar.gz:source \
27                    ghostscript-fonts-other-6.0.tar.gz:fonts \
28                    ghostscript-fonts-std-8.11.tar.gz:fonts \
29                    ${mappingresources_commit}.zip:misc
30
31patchfiles          patch-base_unix-dll.mak.diff \
32                    no-werror.diff
33
34checksums           ${distname}.tar.gz \
35                    rmd160  26acb114f30cbfa8f0e4912829a4ac38a35f5ea0 \
36                    sha256  cf3c0dce67db1557a87366969945f9c5235887989c0b585e037af366dc035989 \
37                    ghostscript-fonts-other-6.0.tar.gz \
38                    rmd160  ab60dbf71e7d91283a106c3df381cadfe173082f \
39                    sha256  4fa051e341167008d37fe34c19d241060cd17b13909932cd7ca7fe759243c2de \
40                    ghostscript-fonts-std-8.11.tar.gz \
41                    rmd160  10a19a10d0388bc084a7c1d3da845068d7169054 \
42                    sha256  0eb6f356119f2e49b2563210852e17f57f9dcc5755f350a69a46a0d641a0c401 \
43                    ${mappingresources_commit}.zip \
44                    rmd160  ee0acf3e8a37c75db1a22af0248a0be25b31de93 \
45                    sha256  64b1a28060fe04518ee152d1d479a5e8989519db756c35848257d29478936d1c
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
60depends_build       port:pkgconfig
61
62depends_run         port:perl5
63
64extract.only        ${distname}.tar.gz \
65                    ghostscript-fonts-other-6.0.tar.gz \
66                    ghostscript-fonts-std-8.11.tar.gz
67
68post-extract {
69    system -W ${workpath} "unzip '${distpath}/${mappingresources_commit}.zip'"
70
71    foreach d {freetype jbig2dec jpeg lcms2 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    copy -force {*}[glob ${workpath}/mapping-resources-pdf-${mappingresources_commit}/mappingresources4pdf_2unicode/*] ${worksrcpath}/Resource/CMap
77    copy -force {*}[glob ${workpath}/mapping-resources-pdf-${mappingresources_commit}/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-replace \
97                    -I${prefix}/include \
98                    -isystem${prefix}/include
99
100configure.args      --disable-compile-inits \
101                    --disable-cups \
102                    --disable-dbus \
103                    --disable-gtk \
104                    --without-x \
105                    --without-luratech \
106                    --with-system-libtiff
107
108build.target        so
109
110destroot.target     soinstall
111post-destroot {
112    ln -s gsc ${destroot}${prefix}/bin/gs
113
114    # std fonts - install into FontCache-compatible directory.
115    # Check: could break on case-sensitive file systems...
116    xinstall -m 0755 -d ${destroot}${prefix}/share/fonts/Type1/gsfonts
117    xinstall -m 0644 \
118            {*}[glob -directory ${workpath}/fonts {[a-z][0-9][0-9][0-9][0-9][0-9][0-9][a-z].*} fonts.scale fonts.dir] \
119            ${destroot}${prefix}/share/fonts/Type1/gsfonts
120
121    # Delete the already copied fonts to not copy them again when installing the "other" fonts.
122    delete {*}[glob -directory ${workpath}/fonts {[a-z][0-9][0-9][0-9][0-9][0-9][0-9][a-z].*}]
123
124    # other fonts - install into private ghostscript directory.
125    xinstall -m 755 -d ${destroot}${prefix}/share/${name}/fonts
126    xinstall -m 644 {*}[glob -directory ${workpath}/fonts *.afm *.gsf *.pfa *.pfm] \
127            ${destroot}${prefix}/share/${name}/fonts
128
129    xinstall -m 755 -d ${destroot}${prefix}/share/doc
130    ln -s ../${name}/${version}/doc ${destroot}${prefix}/share/doc/${name}
131
132    # std fonts - "documentation"
133    xinstall -m 0755 -d ${destroot}${prefix}/share/doc/${name}/fonts
134    xinstall -m 0644 -W ${workpath}/fonts \
135            COPYING ChangeLog README README.tweaks TODO \
136            ${destroot}${prefix}/share/doc/${name}/fonts
137
138    # install missing header
139    xinstall -m 0644 ${worksrcpath}/base/gserrors.h \
140            ${destroot}${prefix}/include/ghostscript/
141}
142
143post-activate {
144    system "${prefix}/bin/fc-cache -v ${prefix}/share/fonts/Type1/gsfonts"
145}
146
147configure.universal_args-delete --disable-dependency-tracking
148
149variant x11 {
150    depends_lib-append      port:xorg-libXext
151    depends_lib-append      port:xorg-libXt
152    configure.args-replace  --without-x --with-x
153}
154
155variant cups description {Enable CUPS driver} {
156    configure.args-replace  --disable-cups --enable-cups
157}
158
159default_variants    +x11
160
161livecheck.type      regex
162livecheck.url       http://www.ghostscript.com/Releases.html
163livecheck.regex     ">Ghostscript (\\d+(?:\\.\\d+)*)<"
Note: See TracBrowser for help on using the repository browser.