source: trunk/dports/graphics/fontforge/Portfile

Last change on this file was 133830, checked in by larryv@…, 3 years ago

fontforge: Quote paths properly in post-extract

These system calls fail if any of those paths contain spaces.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 6.1 KB
Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4
2# $Id: Portfile 133830 2015-03-12 20:04:37Z ryandesign@macports.org $
3
4PortSystem      1.0
5
6name            fontforge
7version         20120731
8revision        3
9set docversion  ${version}
10set ftversion   2.4.10
11categories      graphics fonts
12platforms       darwin
13maintainers     nomaintainer
14license         BSD
15description     Outline and bitmap font editor/converter for many formats
16
17long_description \
18    FontForge allows you to edit outline and bitmap fonts.  You may create \
19    new ones or modify old ones.  It is also a format converter and can \
20    interconvert between PostScript (ascii & binary Type1, some Type3, \
21    some Type0), TrueType, OpenType (Type2), CID, SVG.  Previously known as \
22    pfaedit.
23
24homepage        http://fontforge.org/
25master_sites    sourceforge:project/fontforge/fontforge-source \
26                sourceforge:project/fontforge/fontforge-docs:docs \
27                ${homepage}:cidmaps \
28                http://download.savannah.gnu.org/releases/freetype/:freetype \
29                sourceforge:project/freetype/freetype2/${ftversion}:freetype
30distname        ${name}_full-${version}
31dist_subdir     ${name}/${version}
32use_bzip2       yes
33
34set docdistfile ${name}_htdocs-${docversion}${extract.suffix}
35
36distfiles-append \
37                cidmaps.tgz:cidmaps \
38                ${docdistfile}:docs
39checksums       ${distname}${extract.suffix} \
40                rmd160  351af6022d1c1c80e61788b699ff882bcde1b55f \
41                sha256  e5cb9e9e64a99d1dfc549950741eb9b44c3162a4c62f71053905c1f2d024295f \
42                cidmaps.tgz \
43                rmd160  d194355e61813d31fe4813bdf10a62d66a9f6d04 \
44                sha256  1bf9c7eb8835e6ed94e62cb49f1141bc046c562849e52e6c3c7f1d7cfc95c7b3 \
45                ${docdistfile} \
46                rmd160  8afd7d4eb9d590c989f16047e3ff4c926d1eab31 \
47                sha256  a938c08e66c1ff1e853e0833fbde6cb5d92d900f66b1958b6769f5b7d32ad1e7 \
48                freetype-${ftversion}${extract.suffix} \
49                rmd160  9da7fcde9c42f81c399201d055d85109b2ae7814 \
50                sha256  0c8e242c33c45928de560d7d595db06feb41d1b22167e37260ceabe72f9e992f
51
52worksrcdir      ${name}-${version}
53extract.only    ${distname}${extract.suffix}
54
55post-extract {
56    xinstall -d \
57        ${worksrcpath}/cidmap \
58        ${worksrcpath}/htdocs
59
60    system "tar xzf '${distpath}/cidmaps.tgz' -C '${worksrcpath}/cidmap'"
61    system "tar xjf '${distpath}/${docdistfile}' -C '${worksrcpath}/htdocs'"
62}
63
64patchfiles      patch-Makefile.dynamic.in.diff \
65                patch-configure.in.diff \
66                patch-fontforge__libffstamp.h-integer-versiondate.diff \
67                patch-fontforge_start.c.diff \
68                patch-gutils_dynamic.c.diff \
69                patch-xcode-43.diff
70
71post-patch {
72    if {${os.major} > 11 && ${os.platform} eq "darwin"} {
73        eval reinplace -W {${worksrcpath}/fontforge} "s|AnchorPoint|FFAnchorPoint|g" \
74            [glob -tails -directory ${worksrcpath}/fontforge *.c] \
75            splinefont.h baseviews.h views.h
76    }
77    reinplace "s|@PREFIX@|${prefix}|g" \
78        ${worksrcpath}/gutils/dynamic.c
79    reinplace "/^applicationsdir/s|/Applications|${applications_dir}|" \
80        ${worksrcpath}/Makefile.dynamic.in
81}
82
83depends_lib \
84                port:freetype \
85                port:gettext \
86                port:giflib \
87                port:jpeg \
88                port:libiconv \
89                port:libpng \
90                port:libuninameslist \
91                port:libxml2 \
92                port:tiff \
93                port:xorg-libXi \
94                port:xorg-libXt \
95                port:xorg-libxkbui \
96                port:zlib
97
98use_autoconf    yes
99
100configure.args  --mandir=${prefix}/share/man \
101                --enable-type3 \
102                --enable-devicetables \
103                --enable-gb12345 \
104                --without-python \
105                --without-freetype-bytecode \
106                --without-pango \
107                --without-cairo \
108                --x-includes=${prefix}/include \
109                --x-libraries=${prefix}/lib
110
111configure.ldflags-append \
112                -lintl
113
114# https://trac.macports.org/ticket/29840
115compiler.blacklist \
116                llvm-gcc-4.2
117
118set docdir      ${prefix}/share/doc/${name}
119destroot.args   docdir=${docdir}
120
121post-destroot {
122    xinstall -d ${destroot}${docdir}
123    xinstall -m 644 -W ${worksrcpath} \
124        AUTHORS INSTALL LICENSE README-Mac.html README-Unix.html README-unix \
125        ${destroot}${docdir}
126    # Fix permissions problem on this file
127    xinstall -m 0644 -W ${destroot}${applications_dir}/FontForge.app/Contents/Resources FontForge.icns \
128        ${destroot}${applications_dir}/FontForge.app/Contents/Resources
129}
130
131variant freetype_bytecode description {Enable support for bytecode interpreter} {
132    distfiles-append        freetype-${ftversion}${extract.suffix}:freetype
133    extract.only-append     freetype-${ftversion}${extract.suffix}
134    configure.args-delete   --without-freetype-bytecode
135    configure.args-append   --with-freetype-src=${workpath}/freetype-${ftversion}
136}
137
138variant python26 conflicts python27 description {Enable Python support (Python 2.6)} {
139    configure.args-delete   --without-python
140    configure.args-append   --enable-pyextension \
141                            --with-python=${prefix}/bin/python2.6 \
142                            --with-python-headers=${frameworks_dir}/Python.framework/Versions/2.6/include/python2.6
143    destroot.args-append    PYTHON=${prefix}/bin/python2.6 PYTHONPREFIX=${frameworks_dir}/Python.framework/Versions/2.6
144    depends_lib-append      port:python26
145}
146
147variant python27 conflicts python26 description {Enable Python support (Python 2.7)} {
148    configure.args-delete   --without-python
149    configure.args-append   --enable-pyextension \
150                            --with-python=${prefix}/bin/python2.7 \
151                            --with-python-headers=${frameworks_dir}/Python.framework/Versions/2.7/include/python2.7
152    destroot.args-append    PYTHON=${prefix}/bin/python2.7 PYTHONPREFIX=${frameworks_dir}/Python.framework/Versions/2.7
153    depends_lib-append      port:python27
154}
155
156livecheck.regex     ${name}_full-(\\d+)\.
Note: See TracBrowser for help on using the repository browser.