Ticket #44148: freetype+infinality-20150131.diff

File freetype+infinality-20150131.diff, 10.8 KB (added by RJVB (René Bertin), 9 years ago)
  • trunk/dports/print/freetype/Portfile

    diff --git a/trunk/dports/print/freetype/Portfile b/trunk/dports/print/freetype/Portfile
    a b  
    22# $Id$
    33
    44PortSystem              1.0
    5 PortGroup               muniversal 1.0
    65
    76name                    freetype
    8 version                 2.5.5
     7
     8subport "${name}-infinality" {
     9    # sadly we need to provide a senseless univ. variant because
     10    # freetype +infinality+universal would require it.
     11    #universal_variant   no
     12    #variant universal description {this is a stub variant for dependency reasons only} {
     13    #}
     14    supported_archs     noarch
     15}
     16
    917categories              print graphics
    10 maintainers             ryandesign
    11 license                 {FreeType GPL-2}
    12 homepage                http://freetype.sourceforge.net/
    13 use_bzip2               yes
    1418platforms               darwin
    15 use_parallel_build      yes
    1619
    17 description \
    18     A software font engine
     20if {${subport} eq "${name}-infinality"} {
     21    version             2015.01.31
     22    maintainers         gmail.com:rjvbertin
     23    license             MIT
     24    homepage            http://bohoomil.com
     25    description         The Freetype Infinality patches
     26    long_description    This is a s(t)ub port providing versioning information \
     27                        for the Infinality patches maintained by Bohoomil and that \
     28                        are available through freetype's +infinality variant.
     29    distfiles
     30    use_configure       no
     31    # this appears to be required despite an empty build block!
     32    build.cmd           echo
     33    fetch {}
     34    checksum {}
     35    extract {
     36        xinstall -m 0755 -d ${worksrcpath}
     37    }
     38    patch {}
     39    post-patch {}
     40    configure {}
     41    build {}
     42    post-destroot {
     43        xinstall -m 0755 -d ${destroot}${prefix}/share/fonts/fontconfig-ultimate
     44        foreach f [glob ${filespath}/infinality-settings*] {
     45            copy ${f} ${destroot}${prefix}/share/fonts/fontconfig-ultimate
     46        }
     47        xinstall -m 0755 ${filespath}/launchctl-infinality-settings.sh ${destroot}${prefix}/share/fonts/fontconfig-ultimate
     48        xinstall -m 0644 ${filespath}/Infinality-CHANGELOG ${destroot}${prefix}/share/fonts/fontconfig-ultimate
     49    }
     50    notes-append "freetype must be now be (re)build and (re)installed with the +infinality variant."
    1951
    20 long_description \
    21     FreeType2 is a software font engine that is designed to \
    22     be small, efficient, highly customizable and portable while \
    23     capable of producing high-quality output (glyph images). \
    24     It can be used in graphics libraries, display servers, font \
    25     conversion tools, text image generation tools, and many \
    26     other products as well.
     52} else {
     53    PortGroup               muniversal 1.0
    2754
    28 master_sites            sourceforge:project/freetype/freetype2/${version}:source \
    29                         sourceforge:project/freetype/freetype-docs/${version}:docs \
    30                         http://download.savannah.gnu.org/releases/freetype/
     55    version                 2.5.5
     56    maintainers             ryandesign
     57    license                 {FreeType GPL-2}
     58    homepage                http://freetype.sourceforge.net/
     59    use_bzip2               yes
    3160
    32 set docdistname         ${name}-doc-${version}
     61    description \
     62        A software font engine
    3363
    34 distfiles               ${distname}${extract.suffix}:source \
    35                         ${docdistname}${extract.suffix}:docs
     64    long_description \
     65        FreeType2 is a software font engine that is designed to \
     66        be small, efficient, highly customisable and portable while \
     67        capable of producing high-quality output (glyph images). \
     68        It can be used in graphics libraries, display servers, font \
     69        conversion tools, text image generation tools, and many \
     70        other products as well.
    3671
    37 checksums               ${distname}${extract.suffix} \
    38                         rmd160  49093b839e6cc0639383d6baacfb73da80a4ee1a \
    39                         sha256  387bcc4b780b12484aa2ec9f7db1a55d8286eb5639f45fbc0fbba7a4e5a1afb9 \
    40                         ${docdistname}${extract.suffix} \
    41                         rmd160  59309bbd1cced9e982c327b8217329d64b69d649 \
    42                         sha256  68becbae3578a8101e9f3c55f10e435fb75535011d3f7a523719371e86e368e7
    4372
    44 patchfiles \
    45     patch-src_base_ftrfork.c.diff \
    46     patch-modules.cfg.diff
     73    use_parallel_build      yes
    4774
    48 depends_lib             port:bzip2 \
    49                         port:libpng \
    50                         port:zlib
     75    master_sites            sourceforge:project/freetype/freetype2/${version}:source \
     76                            sourceforge:project/freetype/freetype-docs/${version}:docs \
     77                            http://download.savannah.gnu.org/releases/freetype/
    5178
     79    set docdistname         ${name}-doc-${version}
     80
     81    distfiles               ${distname}${extract.suffix}:source \
     82                            ${docdistname}${extract.suffix}:docs
     83
     84    checksums               freetype-${version}.tar.bz2 \
     85                            rmd160  49093b839e6cc0639383d6baacfb73da80a4ee1a \
     86                            sha256  387bcc4b780b12484aa2ec9f7db1a55d8286eb5639f45fbc0fbba7a4e5a1afb9 \
     87                            freetype-doc-${version}.tar.bz2 \
     88                            rmd160  59309bbd1cced9e982c327b8217329d64b69d649 \
     89                            sha256  68becbae3578a8101e9f3c55f10e435fb75535011d3f7a523719371e86e368e7
     90
     91    patchfiles              patch-src_base_ftrfork.c.diff \
     92                            patch-modules.cfg.diff
     93
     94    depends_lib             port:bzip2 \
     95                            port:libpng \
     96                            port:zlib
     97
    5298# See http://trac.macports.org/ticket/18232
    53 configure.cppflags-replace  -I${prefix}/include -isystem${prefix}/include
     99    configure.cppflags-replace  -I${prefix}/include -isystem${prefix}/include
    54100
    55 configure.args          --with-bzip2 \
    56                         --with-png \
    57                         --with-zlib \
    58                         --without-harfbuzz
     101    configure.args          --with-bzip2 \
     102                            --with-png \
     103                            --with-zlib \
     104                            --without-harfbuzz
    59105
    60 configure.universal_args-delete --disable-dependency-tracking
     106    configure.universal_args-delete --disable-dependency-tracking
    61107
    62 platform macosx {
    63     if {${os.major} < 9} {
    64         configure.args-append \
    65             --with-old-mac-fonts
     108    platform macosx {
     109        if {${os.major} < 9} {
     110            configure.args-append \
     111                --with-old-mac-fonts
     112        }
    66113    }
    67 }
    68114
    69 set docdir              ${prefix}/share/doc/${name}
     115    set docdir              ${prefix}/share/doc/${name}
    70116
    71 post-destroot {
    72     xinstall -m 0755 -d ${destroot}${docdir}
    73    
    74     xinstall -m 0644 -W ${worksrcpath} \
    75         ChangeLog \
    76         README \
    77         ${destroot}${docdir}
    78     xinstall -m 0644 -W ${worksrcpath}/docs \
    79         CHANGES \
    80         FTL.TXT \
    81         GPLv2.TXT \
    82         LICENSE.TXT \
    83         PROBLEMS \
    84         TODO \
    85         formats.txt \
    86         raster.txt \
    87         ${destroot}${docdir}
    88    
    89     xinstall -m 0755 -d ${destroot}${docdir}/html
    90     xinstall -m 0644 -W ${worksrcpath}/docs ft2faq.html ${destroot}${docdir}/html
    91     foreach dir {design glyphs reference tutorial} {
    92         copy ${worksrcpath}/docs/${dir} ${destroot}${docdir}/html
     117    if {[file exists ${prefix}/share/fonts/fontconfig-ultimate/infinality-settings.sh]} {
     118        default_variants    +infinality
    93119    }
    94 }
    95120
    96 if {${os.arch} eq "i386"} {
    97     if { ${os.major}>=10 } {
    98         set merger_configure_env(ppc) CC_BUILD=${configure.cc}
     121    variant infinality description {patched for improved font rendering, bohoomil ultimate style} {
     122
     123        depends_run-append  port:${name}-infinality
     124
     125        # 20150118: remove the 2nd hunk from freetype-2.5.x-enable-valid.patch because already done by patch-modules-cfg.diff
     126        patchfiles-append           01-freetype-2.5.5-enable-valid.patch \
     127                                    02-ftsmooth-2.5.5.patch \
     128                                    03-upstream-2015.01.23.patch \
     129                                    04-infinality-2.5.5-2015.01.23.patch
     130# 03-upstream-2015.01.23.patch contains a byte sequence that reinplace doesn't like ...
     131#        pre-patch {
     132#            # make -p0 patches
     133#            set pf [split ${patchfiles} " "]
     134#            foreach f ${pf} {
     135#                reinplace -W ${filespath} "s| \[ab\]/| |g" ${f}
     136#            }
     137#        }
     138        configure.args-replace --without-harfbuzz --with-harfbuzz
     139        depends_lib-append    port:harfbuzz
     140
     141        notes-append "Copy ${prefix}/share/fonts/fontconfig-ultimate/infinality-settings.sh (or .csh) to an appropriate location
     142         and make sure it gets read when you log in. See infinality-settings-explained.sh for explanation
     143         of the various settings and variables. Then, use launchctl-infinality-settings.sh to copy the
     144         selected environment variables to those managed by LaunchServices"
    99145    }
    100     set merger_configure_env(ppc64)   CC_BUILD=${configure.cc}
    101 } else {
    102     set merger_configure_env(i386)    CC_BUILD=${configure.cc}
    103     set merger_configure_env(x86_64)  CC_BUILD=${configure.cc}
     146
     147    post-destroot {
     148        xinstall -m 0755 -d ${destroot}${docdir}
     149       
     150        xinstall -m 0644 -W ${worksrcpath} \
     151            ChangeLog \
     152            README \
     153            ${destroot}${docdir}
     154        xinstall -m 0644 -W ${worksrcpath}/docs \
     155            CHANGES \
     156            FTL.TXT \
     157            GPLv2.TXT \
     158            LICENSE.TXT \
     159            PROBLEMS \
     160            TODO \
     161            formats.txt \
     162            raster.txt \
     163            ${destroot}${docdir}
     164       
     165        xinstall -m 0755 -d ${destroot}${docdir}/html
     166        xinstall -m 0644 -W ${worksrcpath}/docs ft2faq.html ${destroot}${docdir}/html
     167        foreach dir {design glyphs reference tutorial} {
     168            copy ${worksrcpath}/docs/${dir} ${destroot}${docdir}/html
     169        }
     170        if {[variant_isset infinality]} {
     171            ln -s ${prefix}/share/fonts/fontconfig-ultimate/launchctl-infinality-settings.sh ${destroot}${prefix}/bin
     172        }
     173    }
     174
     175    if {${os.arch} eq "i386"} {
     176        if { ${os.major}>=10 } {
     177            set merger_configure_env(ppc) CC_BUILD=${configure.cc}
     178        }
     179        set merger_configure_env(ppc64)   CC_BUILD=${configure.cc}
     180    } else {
     181        set merger_configure_env(i386)    CC_BUILD=${configure.cc}
     182        set merger_configure_env(x86_64)  CC_BUILD=${configure.cc}
     183    }
     184
     185    livecheck.type          sourceforge
     186    livecheck.regex         {/freetype2/([0-9.]+)/}
     187
    104188}
    105 
    106 livecheck.type          sourceforge
    107 livecheck.regex         {/freetype2/([0-9.]+)/}