~kaction/aports

f51aaf0ef03b024877ffa3e84e2ef4813a225f12 — Jakub Jirutka 4 months ago ec33332
testing/font-jetbrains-mono: add fontconfig configs
A testing/font-jetbrains-mono/40-jetbrains-mono-nl.conf => testing/font-jetbrains-mono/40-jetbrains-mono-nl.conf +17 -0
@@ 0,0 1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
<fontconfig>
  <alias>
    <family>JetBrains Mono NL</family>
    <default>
      <family>monospace</family>
    </default>
  </alias>

  <alias binding="same">
    <family>JetBrains Mono</family>
    <accept>
      <family>JetBrains Mono NL</family>
    </accept>
  </alias>
</fontconfig>

A testing/font-jetbrains-mono/40-jetbrains-mono.conf => testing/font-jetbrains-mono/40-jetbrains-mono.conf +17 -0
@@ 0,0 1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
<fontconfig>
  <alias>
    <family>JetBrains Mono</family>
    <default>
      <family>monospace</family>
    </default>
  </alias>

  <alias binding="same">
    <family>JetBrains Mono NL</family>
    <accept>
      <family>JetBrains Mono</family>
    </accept>
  </alias>
</fontconfig>

A testing/font-jetbrains-mono/59-jetbrains-mono-nl.conf => testing/font-jetbrains-mono/59-jetbrains-mono-nl.conf +18 -0
@@ 0,0 1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
<fontconfig>
  <!--
   | This should be after 50-user.conf and 51-local.conf to not override user
   | and local system overrides, after 58-*.conf to not override higher
   | priority fonts, and before 60-generic.conf to take precedence over the
   | font-config's default preferables.
   |-->
  <description>Set JetBrains Mono NL as a preferable monospace font</description>

  <alias>
    <family>monospace</family>
    <prefer>
      <family>JetBrains Mono NL</family>
    </prefer>
  </alias>
</fontconfig>

A testing/font-jetbrains-mono/65-jetbrains-mono.conf => testing/font-jetbrains-mono/65-jetbrains-mono.conf +10 -0
@@ 0,0 1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
<fontconfig>
  <alias>
    <family>monospace</family>
    <prefer>
      <family>JetBrains Mono</family>
    </prefer>
  </alias>
</fontconfig>

M testing/font-jetbrains-mono/APKBUILD => testing/font-jetbrains-mono/APKBUILD +32 -1
@@ 1,4 1,5 @@
# Contributor: Grigory Kirillov <txgk@bk.ru>
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Grigory Kirillov <txgk@bk.ru>
pkgname=font-jetbrains-mono
_fontname=${pkgname#font-}


@@ 11,11 12,20 @@ license="OFL-1.1"
options="!check" # no test suite
depends="fontconfig mkfontscale"
subpackages="$pkgname-nl $pkgname-vf"
source="https://download.jetbrains.com/fonts/JetBrainsMono-$pkgver.zip"
source="https://download.jetbrains.com/fonts/JetBrainsMono-$pkgver.zip
	40-$_fontname.conf
	40-$_fontname-nl.conf
	59-$_fontname-nl.conf
	65-$_fontname.conf
	"
builddir="$srcdir"

package() {
	install -D -m644 fonts/ttf/JetBrainsMono-*.ttf -t "$pkgdir"/usr/share/fonts/$_fontname/

	cd "$pkgdir"
	_install_conf "$srcdir"/40-$_fontname.conf
	_install_conf "$srcdir"/65-$_fontname.conf
}

nl() {


@@ 23,6 33,10 @@ nl() {

	cd "$builddir"
	install -D -m644 fonts/ttf/JetBrainsMonoNL-*.ttf -t "$subpkgdir"/usr/share/fonts/$_fontname/

	cd "$subpkgdir"
	_install_conf "$srcdir"/40-$_fontname-nl.conf
	_install_conf "$srcdir"/59-$_fontname-nl.conf
}

vf() {


@@ 30,8 44,25 @@ vf() {

	cd "$builddir"
	install -D -m644 fonts/variable/*.ttf -t "$subpkgdir"/usr/share/fonts/$_fontname/

	cd "$subpkgdir"
	_install_conf "$srcdir"/40-$_fontname.conf 40-$_fontname-vf.conf
	_install_conf "$srcdir"/65-$_fontname.conf 65-$_fontname-vf.conf
}

_install_conf() {
	local src=$1
	local cfgname=${2:-${src##*/}}

	install -D -m644 "$src" usr/share/fontconfig/conf.avail/$cfgname
	mkdir -p etc/fonts/conf.d
	ln -s /usr/share/fontconfig/conf.avail/$cfgname etc/fonts/conf.d/
}

sha512sums="
03c08a2cf5603103baaeed4fcef8aa7bdfced92fdc71b207caa7f913eea49dbe178d020f15a3396b11417f9b906778cc8bc8483f4eff2b04f25163fa373186a2  JetBrainsMono-2.242.zip
175b458b94aec39202810c0b3354f7647ccc064ea389f1e292dfed8bf6a6e7e23c8ab7dd18e854e9d919d13a82fbc52746688d8892eb40cd38b6414331c55193  40-jetbrains-mono.conf
ffd7000d93ecaeaa37f763a2f80335082151e4d3afc14d19f7c967628bdaa68a03484c09ef299b920d7118793ff30afb262518e79afffc7c5abe122b151b4a32  40-jetbrains-mono-nl.conf
4ec69f863568ef5eb6f494e61999ea74750c47725f40b80a9b5aaa68cef64025aa4e2d3e259a3cd4850b541ec95ad21303d5e07accc84208dfabeaccaf2e9ba7  59-jetbrains-mono-nl.conf
cf5e49b31c09f76b6960c8e980e8020b2ce5136d8ea40559f77a32228a770a2f0ed08ddede908be405ab24773bfb88b9233a478d003dfd1fdcba0209385b8531  65-jetbrains-mono.conf
"