# -*- 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

name                font-misc-ethiopic
version             1.0.4
revision            0
categories          x11 x11-font graphics
maintainers         {jeremyhu @jeremyhu} openmaintainer
license             MIT
supported_archs     noarch

description         X.org Ethiopic TrueType fonts
long_description    {*}${description}

platforms           any

homepage            https://www.x.org/
master_sites        xorg:individual/font/
use_bzip2           yes

checksums           rmd160  763351712ac2163bd0b756fe7c3c19f653da861f \
                    sha256  698c0f6ddf9ca482250bdafa08293893148393bb9cb23e0a9ca313c6dbfc4ae0 \
                    size    270076

depends_build       port:pkgconfig bin:bdftopcf:bdftopcf port:xorg-font-util \
                    bin:gzip:gzip

# Not just a build dep, as required during activate/deactivate
depends_lib-append  port:mkfontscale

set myfontbasedir   ${prefix}/share/fonts

configure.args      --with-ttf-fontdir=${myfontbasedir}/TTF \
                    --with-otf-fontdir=${myfontbasedir}/OTF

post-destroot {
   foreach fontsFile {fonts.alias fonts.dir fonts.list fonts.scale fonts.cache-1} {
      foreach fontType {OTF TTF} {
         if {[file exists ${destroot}${myfontbasedir}/${fontType}/${fontsFile}]} {
            delete ${destroot}${myfontbasedir}/${fontType}/${fontsFile}
         }
      }
   }
}

post-activate {
   foreach fontType {OTF TTF} {
      system "mkfontscale ${myfontbasedir}/${fontType}"
      system "mkfontdir ${myfontbasedir}/${fontType}"
   }
}

post-deactivate {
   foreach fontType {OTF TTF} {
      system "mkfontscale ${myfontbasedir}/${fontType}"
      system "mkfontdir ${myfontbasedir}/${fontType}"
   }
}

livecheck.type      regex
livecheck.regex     ${name}-(\[\\d.\]+)${extract.suffix}
livecheck.url       https://xorg.freedesktop.org/archive/individual/font/?C=M&O=D
