Ticket #44148: fontconfig+infinality.diff

File fontconfig+infinality.diff, 11.5 KB (added by RJVB (René Bertin), 9 years ago)

fontconfig portfile diff

  • Portfile

    old new  
    22# $Id: Portfile 118682 2014-04-08 02:56:30Z ryandesign@macports.org $
    33
    44PortSystem                  1.0
    5 PortGroup                   muniversal 1.0
    65
    76name                        fontconfig
    8 version                     2.11.1
     7
     8subport "${name}-ultimate" {
     9    # sadly we need to provide a senseless univ. variant because
     10    # freetype +infinality+universal would require it.
     11    #variant universal description {this is a stub variant for dependency reasons only} {
     12    #}
     13    supported_archs         noarch
     14}
     15
    916categories                  graphics
    10 maintainers                 ryandesign
    11 license                     fontconfig
    12 homepage                    http://fontconfig.org/
    1317platforms                   darwin
    14 use_parallel_build          yes
    1518
    16 description                 An XML-based font configuration API for X Windows
     19set INFRELEASE              2015-01-01
     20
     21if {${subport} eq "${name}-ultimate"} {
     22    name                        fontconfig-ultimate
     23    version                     2015.01.01
     24    license                     MIT
     25    homepage                    http://bohoomil.com
     26    platforms                   darwin
     27
     28    description                 fontconfig-infinality-ultimate & fonts
     29
     30    long_description            Fontconfig is a library for configuring and \
     31                                customising font access. Fontconfig-ultimate is a collection \
     32                                of configuration files that leverage the power of the Infinality \
     33                                patches to FreeType to provide the ultimate experience in \
     34                                customisable font rendering quality. \
     35                                This port provides the configuration files\; it requires fontconfig \
     36                                to be installed with the +infinality variant.
     37    master_sites                https://github.com/bohoomil/fontconfig-ultimate/archive
     38    distname                    ${INFRELEASE}
     39
     40    checksums                   ${distname}${extract.suffix} \
     41                                    rmd160  907feca10f32cc777193cc686536a244416a763e \
     42                                    sha256  7227af7909c0c72b5014d605ff5acd9db063c056889f22b3e7fa1960b5ad55cb
     43
     44    depends_lib                 port:freetype-infinality
     45    depends_run                 port:bash
     46
     47    use_configure               no
     48    # this appears to be required despite an empty build block!
     49    build.cmd                   echo
     50    configure {}
     51    build {}
     52    worksrcdir                  ${name}-${distname}
     53    patchfiles                  patch-presets-nocolours.diff
     54
     55    post-destroot {
     56        xinstall -m 0755 -d ${destroot}${prefix}/share/fonts/fontconfig-ultimate/${INFRELEASE}
     57        copy ${worksrcpath}/conf.d.infinality ${destroot}${prefix}/share/fonts/fontconfig-ultimate/${INFRELEASE}
     58        reinplace "s|\"/etc|\"${prefix}/etc|g" ${worksrcpath}/fontconfig_patches/fc-presets
     59        reinplace "s|/bin/bash|${prefix}/bin/bash|g" ${worksrcpath}/fontconfig_patches/fc-presets
     60        foreach f {CHANGELOG fc-presets fonts-settings free ms} {
     61            copy ${worksrcpath}/fontconfig_patches/${f} ${destroot}${prefix}/share/fonts/fontconfig-ultimate/${INFRELEASE}
     62        }
     63        copy ${worksrcpath}/fontconfig_patches/combi ${destroot}${prefix}/share/fonts/fontconfig-ultimate/${INFRELEASE}/combi-complete
     64        copy ${worksrcpath}/doc/fontconfig-infinality-ultimate/fontconfig-global/combi-minimal ${destroot}${prefix}/share/fonts/fontconfig-ultimate/${INFRELEASE}/combi
     65    }
     66    notes-append "fontconfig must be now be (re)build and (re)installed with the +infinality variant."
     67} else {
    1768
    18 long_description            Fontconfig is a library for configuring and \
    19                             customizing font access.
     69    PortGroup                   muniversal 1.0
    2070
    21 master_sites                http://www.freedesktop.org/software/fontconfig/release/
    22 use_bzip2                   yes
     71    version                     2.11.1
     72    maintainers                 ryandesign
     73    license                     fontconfig
     74    homepage                    http://fontconfig.org/
     75    use_parallel_build          yes
    2376
    24 checksums                   rmd160  9d0a242ec05737f5dba3949ffe095f3c100217c7 \
    25                             sha256  dc62447533bca844463a3c3fd4083b57c90f18a70506e7a9f4936b5a1e516a99
     77    description                 An XML-based font configuration API for X Windows
    2678
    27 depends_build               port:pkgconfig
     79    long_description            Fontconfig is a library for configuring and \
     80                                customising font access.
    2881
    29 depends_lib                 port:libiconv \
    30                             port:expat \
    31                             port:freetype
     82    master_sites                http://www.freedesktop.org/software/fontconfig/release/
     83    use_bzip2                   yes
    3284
    33 if {${os.platform} eq "darwin" && ${os.major} < 9} {
    34     set add_fonts           /usr/X11R6/lib/X11/fonts
    35 } else {
    36     set add_fonts           /usr/X11/lib/X11/fonts
    37 }
    38 lappend add_fonts           ${prefix}/share/fonts
    39 set docdir                  ${prefix}/share/doc/${name}
     85    checksums                   ${distname}${extract.suffix} \
     86                                    rmd160  9d0a242ec05737f5dba3949ffe095f3c100217c7 \
     87                                    sha256  dc62447533bca844463a3c3fd4083b57c90f18a70506e7a9f4936b5a1e516a99
    4088
    41 patchfiles                  patch-docbook-4.2.diff
     89    depends_build               port:pkgconfig
     90
     91    depends_lib                 port:libiconv \
     92                                port:expat \
     93                                port:freetype
     94
     95    if {${os.platform} eq "darwin" && ${os.major} < 9} {
     96        set add_fonts           /usr/X11R6/lib/X11/fonts
     97    } else {
     98        set add_fonts           /usr/X11/lib/X11/fonts
     99    }
     100    lappend add_fonts           ${prefix}/share/fonts
     101    set docdir                  ${prefix}/share/doc/${name}
     102
     103    patchfiles                  patch-docbook-4.2.diff
    42104
    43105# *** No scandir function available.
    44106# https://bugs.freedesktop.org/show_bug.cgi?id=77034
    45107# Can be removed when ccache 3.2 is released with proper clang compatibility
    46 if {[string match *clang* ${configure.compiler}]} {
    47     configure.ccache        no
    48 }
     108    if {[string match *clang* ${configure.compiler}]} {
     109        configure.ccache        no
     110    }
    49111
    50 configure.args              --disable-silent-rules HASDOCBOOK=no
     112    configure.args              --disable-silent-rules HASDOCBOOK=no
    51113
    52114# We put this into a pre-configure block so it can be evaluated _after_ platform selection.
    53 pre-configure {
    54     configure.args-append   --with-add-fonts=[join ${add_fonts} ,]
    55 }
     115    pre-configure {
     116        configure.args-append   --with-add-fonts=[join ${add_fonts} ,]
     117    }
    56118
    57 post-destroot {
    58     xinstall -d ${destroot}${docdir}
    59     xinstall -m 0644 -W ${worksrcpath} \
    60         AUTHORS \
    61         COPYING \
    62         ChangeLog \
    63         NEWS \
    64         README \
    65         ${destroot}${docdir}
    66 }
    67119
    68 post-activate {
    69     # fc-cache can fail due to /Network/Library/Fonts being unavailable, so force success.
    70     system "${prefix}/bin/fc-cache -sv || true"
    71     system "${prefix}/bin/fc-cache -v || true"
    72 }
     120    post-destroot {
     121        xinstall -d ${destroot}${docdir}
     122        xinstall -m 0644 -W ${worksrcpath} \
     123            AUTHORS \
     124            COPYING \
     125            ChangeLog \
     126            NEWS \
     127            README \
     128            ${destroot}${docdir}
     129
     130        if {[variant_isset infinality]} {
     131            catch {eval exec sh ${filespath}/install-conf-files.sh ${prefix} ${workpath} ${destroot} ${INFRELEASE}} result
     132            ui_debug "install-conf-files.sh : $result"
     133        }
     134    }
    73135
    74 platform macosx {
    75     lappend add_fonts       /Library/Fonts \
    76                             /Network/Library/Fonts \
    77                             /System/Library/Fonts
    78 }
     136    post-activate {
     137        # fc-cache can fail due to /Network/Library/Fonts being unavailable, so force success.
     138        system "${prefix}/bin/fc-cache -sv || true"
     139        system "${prefix}/bin/fc-cache -v || true"
     140    }
    79141
    80 merger_arch_flag            no
    81 merger_arch_compiler        yes
    82 if {${os.arch} eq "i386"} {
    83     if { ${os.major} >= 10 } {
    84         set merger_configure_args(ppc) --with-arch=ppc
    85         set merger_configure_env(ppc)  CC_FOR_BUILD=${configure.cc}
     142    platform macosx {
     143        lappend add_fonts       /Library/Fonts \
     144                                /Network/Library/Fonts \
     145                                /System/Library/Fonts
    86146    }
    87     set merger_configure_args(ppc64)   --with-arch=ppc64
    88     set merger_configure_env(ppc64)    CC_FOR_BUILD=${configure.cc}
    89 } else {
    90     set merger_configure_args(i386)    --with-arch=i386
    91     set merger_configure_args(x86_64)  --with-arch=x86_64
    92     set merger_configure_env(i386)     CC_FOR_BUILD=${configure.cc}
    93     set merger_configure_env(x86_64)   CC_FOR_BUILD=${configure.cc}
    94 }
    95147
    96 livecheck.type              regex
    97 livecheck.url               [lindex ${master_sites} 0]
    98 livecheck.regex             ${name}-(\\d+(?:\\.\\d+)*\\.(?:\\d|\[0-8\]\\d))\\.tar
     148    merger_arch_flag            no
     149    merger_arch_compiler        yes
     150    if {${os.arch} eq "i386"} {
     151        if { ${os.major} >= 10 } {
     152            set merger_configure_args(ppc) --with-arch=ppc
     153            set merger_configure_env(ppc)  CC_FOR_BUILD=${configure.cc}
     154        }
     155        set merger_configure_args(ppc64)   --with-arch=ppc64
     156        set merger_configure_env(ppc64)    CC_FOR_BUILD=${configure.cc}
     157    } else {
     158        set merger_configure_args(i386)    --with-arch=i386
     159        set merger_configure_args(x86_64)  --with-arch=x86_64
     160        set merger_configure_env(i386)     CC_FOR_BUILD=${configure.cc}
     161        set merger_configure_env(x86_64)   CC_FOR_BUILD=${configure.cc}
     162    }
     163
     164    if {[file exists ${prefix}/share/fonts/fontconfig-ultimate/${INFRELEASE}]} {
     165        default_variants    +infinality
     166    }
     167
     168    set TEMPLINFDIR ${prefix}/etc/fonts/conf.avail.infinality
     169    variant infinality description {patched for improved font rendering, bohoomil ultimate style} {
     170        depends_lib-append port:fontconfig-ultimate
     171
     172        patchfiles-append  00-fonts.conf.in.patch \
     173                           01-configure.patch \
     174                           02-configure.ac.patch \
     175                           03-Makefile.in.patch \
     176                           04-Makefile.conf.d.patch \
     177                           05-Makefile.am.in.patch \
     178                           fc-cache.c.patch
     179        pre-configure {
     180            configure.args-append   --with-templatedir=${prefix}/etc/fonts/conf.avail --with-templateinfdir=${TEMPLINFDIR}
     181            delete ${worksrcpath}/conf.d.infinality
     182            copy ${prefix}/share/fonts/fontconfig-ultimate/${INFRELEASE}/conf.d.infinality ${worksrcpath}
     183            catch {eval exec sh -c "\"cd ${worksrcpath} ; aclocal\""} result
     184            ui_debug "aclocal: $result"
     185            catch {eval exec sh -c "\"cd ${worksrcpath} ; glibtoolize -f\""} result
     186            ui_debug "glibtoolize: $result"
     187            catch {eval exec sh -c "\"cd ${worksrcpath} ; automake --add-missing -fi\""} result
     188            ui_debug "automake: $result"
     189        }
     190
     191        notes-append "Be sure to call fc-presets as root to select one of the provided font configuration presets!"
     192    }
     193
     194    livecheck.type              regex
     195    livecheck.url               [lindex ${master_sites} 0]
     196    livecheck.regex             ${name}-(\\d+(?:\\.\\d+)*\\.(?:\\d|\[0-8\]\\d))\\.tar
     197}