# -*- 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 PortSystem 1.0 PortGroup muniversal 1.0 name ghostscript version 9.50 revision 0 categories print license AGPL-3 BSD maintainers nomaintainer description GPL Ghostscript, An interpreter for PostScript and PDF long_description Ghostscript is the well-known PostScript interpreter which \ is available for all common and most esoteric platforms and \ supports many different printers and some displays. platforms darwin homepage https://www.ghostscript.com/ master_sites https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs[strsed ${version} {g/\.//}]:source \ sourceforge:gs-fonts:fonts \ https://github.com/adobe-type-tools/mapping-resources-pdf/archive/:misc # Note: please update ghostscript-fonts-hiragino Portfile to keep version in sync # Note: this needs to be manually updated for new upstream commits set mappingresources_commit \ a709991e67196a87af053e2c16d7a65108613a41 distfiles ${distname}.tar.gz:source \ ghostscript-fonts-other-6.0.tar.gz:fonts \ ghostscript-fonts-std-8.11.tar.gz:fonts \ ${mappingresources_commit}.zip:misc patchfiles patch-base_unix-dll.mak.diff \ checksums ${distname}.tar.gz \ rmd160 0e345d2ce7122aa973882738210a88a4f8736f36 \ sha256 0f53e89fd647815828fc5171613e860e8535b68f7afbc91bf89aee886769ce89 \ size 44597668 \ ghostscript-fonts-other-6.0.tar.gz \ rmd160 ab60dbf71e7d91283a106c3df381cadfe173082f \ sha256 4fa051e341167008d37fe34c19d241060cd17b13909932cd7ca7fe759243c2de \ size 796086 \ ghostscript-fonts-std-8.11.tar.gz \ rmd160 10a19a10d0388bc084a7c1d3da845068d7169054 \ sha256 0eb6f356119f2e49b2563210852e17f57f9dcc5755f350a69a46a0d641a0c401 \ size 3752871 \ ${mappingresources_commit}.zip \ rmd160 6f327e09590d517760dafd99cc7a197e68d85c6e \ sha256 03bb11a4db4b01f8509e93db469a24f904934fece3b5b9b8be932267ed7173f4 \ size 1600471 depends_lib port:expat \ port:fontconfig \ port:freetype \ port:jbig2dec \ port:jpeg \ port:libiconv \ port:libidn \ port:libpaper \ port:libpng \ port:tiff \ port:zlib \ port:lcms2 depends_build port:pkgconfig depends_run port:perl5 extract.only ${distname}.tar.gz \ ghostscript-fonts-other-6.0.tar.gz \ ghostscript-fonts-std-8.11.tar.gz post-extract { system -W ${workpath} "unzip '${distpath}/${mappingresources_commit}.zip'" foreach d {freetype jbig2dec jpeg lcms2mt libpng tiff zlib} { move ${worksrcpath}/${d} ${worksrcpath}/${d}_local } #move ${workpath}/MappingOther/Adobe-CNS1-ETen-B5 ${workpath}/MappingOther/Adobe-CNS1-ETenms-B5 copy -force {*}[glob ${workpath}/mapping-resources-pdf-${mappingresources_commit}/pdf2unicode/*] ${worksrcpath}/Resource/CMap copy -force {*}[glob ${workpath}/mapping-resources-pdf-${mappingresources_commit}/pdf2other/*] ${worksrcpath}/Resource/CMap } post-patch { reinplace s|__PREFIX__|${prefix}| ${worksrcpath}/base/unix-dll.mak reinplace s|ZLIBDIR=src|ZLIBDIR=${prefix}/include| configure.ac # Ensure that MacPorts perl is used everywhere fs-traverse f ${worksrcpath} { if [string match *.pl ${f}] { reinplace s|/usr/bin/perl|${prefix}/bin/perl| ${f} } } } # https://trac.macports.org/ticket/56137 configure.ldflags-prepend \ -Lsobin use_autoreconf yes autoreconf.args -fv # Make included OpenJPEG uses its own headers rather than the system ones configure.cppflags-replace \ -I${prefix}/include \ -isystem${prefix}/include configure.args --disable-compile-inits \ --disable-cups \ --disable-dbus \ --disable-gtk \ --without-x \ --without-luratech \ --with-system-libtiff build.target so destroot.target soinstall post-destroot { ln -s gsc ${destroot}${prefix}/bin/gs # std fonts - install into FontCache-compatible directory. # Check: could break on case-sensitive file systems... xinstall -m 0755 -d ${destroot}${prefix}/share/fonts/Type1/gsfonts xinstall -m 0644 \ {*}[glob -directory ${workpath}/fonts {[a-z][0-9][0-9][0-9][0-9][0-9][0-9][a-z].*} fonts.scale fonts.dir] \ ${destroot}${prefix}/share/fonts/Type1/gsfonts # Delete the already copied fonts to not copy them again when installing the "other" fonts. delete {*}[glob -directory ${workpath}/fonts {[a-z][0-9][0-9][0-9][0-9][0-9][0-9][a-z].*}] # other fonts - install into private ghostscript directory. xinstall -m 755 -d ${destroot}${prefix}/share/${name}/fonts xinstall -m 644 {*}[glob -directory ${workpath}/fonts *.afm *.gsf *.pfa *.pfm] \ ${destroot}${prefix}/share/${name}/fonts # std fonts - "documentation" xinstall -m 0755 -d ${destroot}${prefix}/share/doc/${name}/fonts xinstall -m 0644 -W ${workpath}/fonts \ COPYING ChangeLog README README.tweaks TODO \ ${destroot}${prefix}/share/doc/${name}/fonts # install missing header xinstall -m 0644 ${worksrcpath}/base/gserrors.h \ ${destroot}${prefix}/include/ghostscript/ } post-activate { system "${prefix}/bin/fc-cache -v ${prefix}/share/fonts/Type1/gsfonts" } configure.universal_args-delete --disable-dependency-tracking variant x11 { depends_lib-append port:xorg-libXext depends_lib-append port:xorg-libXt configure.args-replace --without-x --with-x } variant cups description {Enable CUPS driver} { configure.args-replace --disable-cups --enable-cups } default_variants +x11 livecheck.type regex livecheck.url ${homepage}releases.html livecheck.regex ">Ghostscript (\\d+(?:\\.\\d+)*)<"