Ticket #44148: Portfile

File Portfile, 5.2 KB (added by RJVB (René Bertin), 9 years ago)
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 129404 2014-12-12 19:15:42Z ryandesign@macports.org $
3
4PortSystem              1.0
5PortGroup               muniversal 1.0
6
7name                    freetype
8set ftversion           2.5.4
9revision                2
10
11if {[variant_isset infinality]} {
12    version             ${ftversion}.20141223
13    worksrcdir          ${name}-${ftversion}
14    distname            ${name}-${ftversion}
15} else {
16    version             ${ftversion}
17}
18
19categories              print graphics
20maintainers             ryandesign
21license                 {FreeType GPL-2}
22homepage                http://freetype.sourceforge.net/
23use_bzip2               yes
24platforms               darwin
25use_parallel_build      yes
26
27description \
28    A software font engine
29
30long_description \
31    FreeType2 is a software font engine that is designed to \
32    be small, efficient, highly customisable and portable while \
33    capable of producing high-quality output (glyph images). \
34    It can be used in graphics libraries, display servers, font \
35    conversion tools, text image generation tools, and many \
36    other products as well.
37
38master_sites            sourceforge:project/freetype/freetype2/${ftversion}:source \
39                        sourceforge:project/freetype/freetype-docs/${ftversion}:docs \
40                        http://download.savannah.gnu.org/releases/freetype/
41
42set docdistname         ${name}-doc-${ftversion}
43
44distfiles               ${distname}${extract.suffix}:source \
45                        ${docdistname}${extract.suffix}:docs
46
47checksums               freetype-${ftversion}.tar.bz2 \
48                        rmd160  3d59c75cad4f77344d75312ead016af75aefd5f5 \
49                        sha256  3b4e2c666b33b32ad29ff0fe5c6538e757d3c73368e5dfa88bd59b4bc95cbabb \
50                        freetype-doc-${ftversion}.tar.bz2 \
51                        rmd160  85712c53439453bf3a1c64c38fb21dc1948d9608 \
52                        sha256  9fa6fb39a324d0b6b744d3745509c51d10a68c7a4f440b23fd00c8b49de6c388
53
54patchfiles \
55    patch-src_base_ftrfork.c.diff \
56    patch-modules.cfg.diff
57
58depends_lib             port:bzip2 \
59                        port:libpng \
60                        port:zlib
61
62# See http://trac.macports.org/ticket/18232
63configure.cppflags-replace  -I${prefix}/include -isystem${prefix}/include
64
65configure.args          --with-bzip2 \
66                        --with-png \
67                        --with-zlib \
68                        --without-harfbuzz
69
70configure.universal_args-delete --disable-dependency-tracking
71
72platform macosx {
73    if {${os.major} < 9} {
74        configure.args-append \
75            --with-old-mac-fonts
76    }
77}
78
79set docdir              ${prefix}/share/doc/${name}
80
81variant infinality description {patched for improved font rendering, bohoomil ultimate style} {
82    # 20140828: I had to redo the builds/unix/configure.raw patch, for reasons unclear.
83# 20141107: something like this could serve to fetch the patch files, but they need to be edited to drop the 1st path component...
84    # 20150118: remove the 2nd hunk from freetype-2.5.4-enable-valid.patch because already done by patch-modules-cfg.diff
85    patchfiles-append   01-freetype-2.5.4-enable-valid.patch \
86                        02-ftsmooth-2.5.4.patch \
87                        03-upstream-2014.12.17.patch \
88                        04-infinality-2.5.4-2014.12.17.patch
89    pre-patch {
90        # make -p0 patches
91        reinplace "s| \[ab\]/| |g" ${filespath}/01-freetype-2.5.4-enable-valid.patch \
92                                ${filespath}/02-ftsmooth-2.5.4.patch \
93                                ${filespath}/03-upstream-2014.12.17.patch \
94                                ${filespath}/04-infinality-2.5.4-2014.12.17.patch
95    }
96    configure.args-replace --without-harfbuzz --with-harfbuzz
97    depends_lib-append    port:harfbuzz
98}
99
100post-destroot {
101    xinstall -m 0755 -d ${destroot}${docdir}
102   
103    xinstall -m 0644 -W ${worksrcpath} \
104        ChangeLog \
105        README \
106        ${destroot}${docdir}
107    xinstall -m 0644 -W ${worksrcpath}/docs \
108        CHANGES \
109        FTL.TXT \
110        GPLv2.TXT \
111        LICENSE.TXT \
112        PROBLEMS \
113        TODO \
114        formats.txt \
115        raster.txt \
116        ${destroot}${docdir}
117   
118    xinstall -m 0755 -d ${destroot}${docdir}/html
119    xinstall -m 0644 -W ${worksrcpath}/docs ft2faq.html ${destroot}${docdir}/html
120    foreach dir {design glyphs reference tutorial} {
121        copy ${worksrcpath}/docs/${dir} ${destroot}${docdir}/html
122    }
123}
124
125if {${os.arch} eq "i386"} {
126    if { ${os.major}>=10 } {
127        set merger_configure_env(ppc) CC_BUILD=${configure.cc}
128    }
129    set merger_configure_env(ppc64)   CC_BUILD=${configure.cc}
130} else {
131    set merger_configure_env(i386)    CC_BUILD=${configure.cc}
132    set merger_configure_env(x86_64)  CC_BUILD=${configure.cc}
133}
134
135livecheck.type          sourceforge
136livecheck.regex         {/freetype2/([0-9.]+)/}
137
138notes-append "Copy `port dir freetype`/files/infinality-settings.sh (or .csh) to an appropriate location
139 and make sure it gets read when you log in. See infinality-settings-explained.sh for explanation
140 of the various settings and variables."