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

Last change on this file since 82385 was 82385, checked in by takanori@…, 8 years ago

ghostscript:

  • quick fix to avoid segfault in gs_glyph_data_free()
  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 5.2 KB
Line 
1# $Id: Portfile 82385 2011-08-13 00:13:37Z takanori@macports.org $
2
3PortSystem      1.0
4PortGroup       muniversal 1.0
5
6name            ghostscript
7version         9.04
8revision        1
9categories      print
10license         GPL-3+
11maintainers     takanori openmaintainer
12description     GPL Ghostscript, An interpreter for PostScript and PDF
13long_description \
14                Ghostscript is the well-known PostScript interpreter which \
15                is available for all common and most esoteric platforms and \
16                supports many different printers and some displays.
17platforms       darwin
18homepage        http://www.cs.wisc.edu/~ghost/
19master_sites    sourceforge:${name}:source \
20                sourceforge:gs-fonts:fonts \
21                sourceforge:mapping-for-pdf.adobe:misc
22set mrversion   20091116
23distfiles       ${distname}.tar.gz:source \
24                ghostscript-fonts-other-6.0.tar.gz:fonts \
25                mappingresources4pdf_2unicode_${mrversion}.tar.Z:misc \
26                mappingresources4pdf_other_${mrversion}.tar.Z:misc
27patchfiles      patch-base_unix-dll.mak.diff \
28                patch-base_stdpre.h.diff \
29                patch-base_unixinst.mak.diff \
30                patch-base_gsgdata.c.diff \
31                patch-base_gsgdata.h.diff
32#               patch-configure.ac.diff
33
34checksums           ${distname}.tar.gz \
35                    md5     9c2fb4af1eb609d09dba5bb0fa76173a \
36                    sha1    75370060d0a272e66be20152a058e4135976f2e5 \
37                    rmd160  30a49c1cc12e3b449117762b3edbb121d5d2766c \
38                    ghostscript-fonts-other-6.0.tar.gz \
39                    md5     1a643ae62ef166562e4d422b1a601272 \
40                    sha1    da62dfcb9c10d96743c7e30c1eebe7166489798c \
41                    rmd160  ab60dbf71e7d91283a106c3df381cadfe173082f \
42                    mappingresources4pdf_2unicode_${mrversion}.tar.Z \
43                    md5     59267a7d0b818267c8ce85d1dbc4479a \
44                    sha1    aaf44cb1e5dd2043c932e641b0e41432aee2ca0d \
45                    rmd160  bc1b86e6a5f0e022f88070195eb3e01e167114a7 \
46                    mappingresources4pdf_other_${mrversion}.tar.Z \
47                    md5     202fa0a291fc1f5b50cfa239106c1b92 \
48                    sha1    fc4eabff932c1623f7ee0a34085e79a44d51d0e5 \
49                    rmd160  1e2ea9af6be8b60c9a54963e542fa06ceb2daccd
50
51depends_lib     port:expat \
52                port:fontconfig \
53                port:jpeg \
54                port:libiconv \
55                port:libidn \
56                port:libpaper \
57                port:libpng \
58                port:perl5 \
59                port:tiff \
60                port:xorg-libXext \
61                port:xorg-libXt \
62                port:zlib
63
64depends_build   port:pkgconfig
65
66post-extract {
67    foreach d {zlib libpng jpeg} {
68        move "${worksrcpath}/${d}" "${worksrcpath}/${d}_local"
69    }
70
71    move ${workpath}/MappingOther/Adobe-CNS1-ETen-B5 ${workpath}/MappingOther/Adobe-CNS1-ETenms-B5
72    eval copy -force [glob ${workpath}/ToUnicode/*]    ${worksrcpath}/Resource/CMap
73    eval copy -force [glob ${workpath}/MappingOther/*] ${worksrcpath}/Resource/CMap
74}
75
76post-patch {
77    reinplace "s|__PREFIX__|${prefix}|" ${worksrcpath}/base/unix-dll.mak
78
79    # Ensure that MacPorts perl is used
80    fs-traverse f ${worksrcpath} {
81        if [string match "*.pl" ${f}] {
82            reinplace "s|#!/usr/bin/perl|#!${prefix}/bin/perl|" ${f}
83        }
84    }
85}
86
87use_autoreconf yes
88autoreconf.args -fv
89
90# Make included JasPer uses its own headers rather than the system ones
91configure.cppflags-delete       "-I${prefix}/include"
92configure.cppflags-append       "-isystem${prefix}/include"
93
94# gs9.xx: The default optimization flag (-O2) causes pdfwrite's strange 'passed invalid object' problem.
95#configure.optflags  -O0
96
97# gs compiled by clang/llvm-gcc-4.2 sometimes produces 'Segmentation fault: 11'
98#if {${configure.compiler} == "llvm-gcc-4.2"} {
99#    if {[rpm-vercomp $xcodeversion 4.1] >= 0} {
100#        configure.compiler clang
101#    } else {
102#        configure.compiler gcc-4.2
103#    }
104#}
105
106configure.args  --disable-compile-inits \
107                --disable-cups \
108                --disable-gtk \
109                --with-system-libtiff
110#               --disable-freetype
111
112build.target        so
113use_parallel_build  yes
114
115destroot.target     soinstall
116post-destroot {
117    system "strip ${destroot}${prefix}/bin/gsc ${destroot}${prefix}/bin/gsx"
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 no_x11 {
132    depends_lib-delete port:xorg-libXext
133    depends_lib-delete port:xorg-libXt
134    configure.args-append --without-x
135}
136
137variant cups description {Enable cups support} {
138    configure.args-delete --disable-cups
139    configure.args-append --enable-cups
140
141    # Informing user enable cups will install files outside of the common directory structure
142    destroot.violate_mtree yes
143}
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.