feat: add Fira Project fonts
Signed-off-by: sisungo <[email protected]>
This commit is contained in:
+19
-29
@@ -3,6 +3,13 @@ import os
|
|||||||
from lib import arch, common, make, pkgcomposer
|
from lib import arch, common, make, pkgcomposer
|
||||||
|
|
||||||
|
|
||||||
|
def do(f):
|
||||||
|
try:
|
||||||
|
f()
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
def is_abslink(path):
|
def is_abslink(path):
|
||||||
try:
|
try:
|
||||||
return os.readlink(path).startswith("/")
|
return os.readlink(path).startswith("/")
|
||||||
@@ -51,36 +58,19 @@ def autolink_milestones():
|
|||||||
if i.is_file() and os.access(i.path, os.F_OK):
|
if i.is_file() and os.access(i.path, os.F_OK):
|
||||||
make.link(f"share/milestones/{i.name}", "/share/milestones/" + i.name)
|
make.link(f"share/milestones/{i.name}", "/share/milestones/" + i.name)
|
||||||
|
|
||||||
|
def autolink_fonts():
|
||||||
|
for i in common.treedir("share/fonts"):
|
||||||
|
if i.is_file() and os.access(i.path, os.F_OK):
|
||||||
|
make.link(f"share/fonts/{i.name}", "/share/fonts/" + i.name)
|
||||||
|
|
||||||
|
|
||||||
def autolink(composer: pkgcomposer.PkgComposer):
|
def autolink(composer: pkgcomposer.PkgComposer):
|
||||||
os.chdir(composer.workdir + "/bundle/")
|
os.chdir(composer.workdir + "/bundle/")
|
||||||
|
|
||||||
try:
|
do(autolink_bin)
|
||||||
autolink_bin()
|
do(autolink_lib)
|
||||||
except:
|
do(autolink_include)
|
||||||
pass
|
do(autolink_share_pkgconfig)
|
||||||
|
do(autolink_services)
|
||||||
try:
|
do(autolink_milestones)
|
||||||
autolink_lib()
|
do(autolink_fonts)
|
||||||
except:
|
|
||||||
pass
|
|
||||||
|
|
||||||
try:
|
|
||||||
autolink_include()
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
|
|
||||||
try:
|
|
||||||
autolink_share_pkgconfig()
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
|
|
||||||
try:
|
|
||||||
autolink_services()
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
|
|
||||||
try:
|
|
||||||
autolink_milestones()
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
command -v fc-cache >/dev/null 2>&1 || exit 0
|
||||||
|
|
||||||
|
fc-cache -fs
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
import os
|
||||||
|
|
||||||
|
from lib.make import *
|
||||||
|
|
||||||
|
upstream_version = "3.206"
|
||||||
|
|
||||||
|
version(upstream_version)
|
||||||
|
description("Monospaced variant of the Fira Sans font series")
|
||||||
|
maintainer("sisungo <[email protected]>")
|
||||||
|
source_url("https://carrois.com/downloads/Fira/Fira_Mono_3_2.zip")
|
||||||
|
|
||||||
|
|
||||||
|
def build():
|
||||||
|
os.chdir("Fonts/FiraMono_OTF_32")
|
||||||
|
|
||||||
|
on_build(build)
|
||||||
|
|
||||||
|
|
||||||
|
def declare_seperate(name):
|
||||||
|
def pack(composer):
|
||||||
|
composer.makedirs("share/fonts/FiraMono")
|
||||||
|
composer.add(f"{name}.otf", f"share/fonts/FiraMono/{name}.otf")
|
||||||
|
|
||||||
|
package(name)
|
||||||
|
arch_any()
|
||||||
|
configure_script("configure/fontconfig")
|
||||||
|
on_pack(pack)
|
||||||
|
|
||||||
|
declare_seperate("FiraMono-Bold")
|
||||||
|
declare_seperate("FiraMono-Medium")
|
||||||
|
declare_seperate("FiraMono-Regular")
|
||||||
|
|
||||||
|
package("FiraMono-Fonts")
|
||||||
|
arch_any()
|
||||||
|
dep("FiraMono-Bold (same-version) @any")
|
||||||
|
dep("FiraMono-Medium (same-version) @any")
|
||||||
|
dep("FiraMono-Regular (same-version) @any")
|
||||||
|
on_pack(lambda x: print("Packing FiraMono-Fonts."))
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
command -v fc-cache >/dev/null 2>&1 || exit 0
|
||||||
|
|
||||||
|
fc-cache -fs
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
import os
|
||||||
|
|
||||||
|
from lib.make import *
|
||||||
|
|
||||||
|
upstream_version = "4.301"
|
||||||
|
|
||||||
|
version(upstream_version)
|
||||||
|
description("a humanist sans-serif typeface designed by Carrois Type Design and Mozilla")
|
||||||
|
maintainer("sisungo <[email protected]>")
|
||||||
|
source_url("https://carrois.com/downloads/Fira/Download_Folder_FiraSans_4301.zip")
|
||||||
|
|
||||||
|
|
||||||
|
widths = ["Compressed", "Condensed", "Normal"]
|
||||||
|
styles = ["Italic", "Roman"]
|
||||||
|
weights = ["Bold", "Book", "Eight", "ExtraBold", "ExtraLight", "Four", "Hair", "Heavy", "", "Light", "Medium", "SemiBold", "Thin", "Two", "Ultra", "UltraLight"]
|
||||||
|
|
||||||
|
|
||||||
|
def find_file(width, style, weight):
|
||||||
|
modify = width
|
||||||
|
if width == "Normal":
|
||||||
|
modify = ""
|
||||||
|
filename = f"FiraSans{modify}-{weight}{style}.otf"
|
||||||
|
if os.path.exists(f"{width}/{style}/{filename}"):
|
||||||
|
return filename
|
||||||
|
return None
|
||||||
|
|
||||||
|
def on_pack_by(width, style, weight):
|
||||||
|
def pack(composer):
|
||||||
|
composer.makedirs("share/fonts/FiraSans")
|
||||||
|
filename = find_file(width, style, weight)
|
||||||
|
composer.add(
|
||||||
|
f"{width}/{style}/{filename}",
|
||||||
|
f"share/fonts/FiraSans/{filename}",
|
||||||
|
)
|
||||||
|
on_pack(pack)
|
||||||
|
|
||||||
|
|
||||||
|
def build():
|
||||||
|
filename_version = upstream_version.replace('.', '')
|
||||||
|
os.chdir(f"Download_Folder_FiraSans_{filename_version}/Fonts/Fira_Sans_OTF_{filename_version}")
|
||||||
|
|
||||||
|
packages = []
|
||||||
|
for width in widths:
|
||||||
|
for style in styles:
|
||||||
|
for weight in weights:
|
||||||
|
filename = find_file(width, style, weight)
|
||||||
|
if filename:
|
||||||
|
pkgname = filename.replace(".otf", "")
|
||||||
|
package(pkgname)
|
||||||
|
configure_script("configure/fontconfig")
|
||||||
|
arch_any()
|
||||||
|
on_pack_by(width, style, weight)
|
||||||
|
packages += [pkgname]
|
||||||
|
|
||||||
|
package("FiraSans-Fonts")
|
||||||
|
arch_any()
|
||||||
|
for pkgname in packages:
|
||||||
|
dep(f"{pkgname} (same-version) @any")
|
||||||
|
on_pack(lambda x: print("Packing FiraSans-Fonts."))
|
||||||
|
|
||||||
|
on_build(build)
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
|
import glob
|
||||||
|
|
||||||
from lib import cpp
|
from lib import cpp
|
||||||
from lib.make import *
|
from lib.make import *
|
||||||
|
|
||||||
@@ -20,6 +22,7 @@ builddep("libpng-dev @target")
|
|||||||
|
|
||||||
def build():
|
def build():
|
||||||
cpp.meson_setup([
|
cpp.meson_setup([
|
||||||
|
"--prefix=/",
|
||||||
f"--datadir={get_prefix('libfontconfig')}/share",
|
f"--datadir={get_prefix('libfontconfig')}/share",
|
||||||
"--sysconfdir=/var/config",
|
"--sysconfdir=/var/config",
|
||||||
"-Dnls=enabled",
|
"-Dnls=enabled",
|
||||||
@@ -27,6 +30,9 @@ def build():
|
|||||||
"-Dcache-build=disabled",
|
"-Dcache-build=disabled",
|
||||||
"-Dxml-backend=expat",
|
"-Dxml-backend=expat",
|
||||||
"-Ddefault-fonts-dirs=/share/fonts",
|
"-Ddefault-fonts-dirs=/share/fonts",
|
||||||
|
"-Dcache-dir=/var/cache/fontconfig",
|
||||||
|
f"-Dbaseconfig-dir={get_prefix('libfontconfig')}/share/base-config",
|
||||||
|
"-Dconfig-dir=/var/config/fontconfig",
|
||||||
])
|
])
|
||||||
cpp.meson_compile()
|
cpp.meson_compile()
|
||||||
cpp.meson_install()
|
cpp.meson_install()
|
||||||
@@ -34,10 +40,26 @@ def build():
|
|||||||
on_build(build)
|
on_build(build)
|
||||||
|
|
||||||
|
|
||||||
|
def pack_lib(composer):
|
||||||
|
composer.makedir("lib")
|
||||||
|
for i in glob.glob("lib/*.so*"):
|
||||||
|
composer.add(i)
|
||||||
|
composer.makedir("share")
|
||||||
|
composer.add("share/base-config")
|
||||||
|
composer.add("share/fontconfig")
|
||||||
|
|
||||||
|
def pack_dev(composer):
|
||||||
|
composer.makedir("lib")
|
||||||
|
composer.add("include")
|
||||||
|
composer.add("lib/pkgconfig")
|
||||||
|
composer.makedir("share")
|
||||||
|
composer.add("share/gettext")
|
||||||
|
composer.add("share/xml")
|
||||||
|
|
||||||
package("libfontconfig")
|
package("libfontconfig")
|
||||||
dep("libexpat @same-arch")
|
dep("libexpat @same-arch")
|
||||||
dep("libfreetype @same-arch")
|
dep("libfreetype @same-arch")
|
||||||
cpp.use_auto_pack(["lib"])
|
on_pack(pack_lib)
|
||||||
|
|
||||||
package("fontconfig")
|
package("fontconfig")
|
||||||
dep("libfontconfig (same)")
|
dep("libfontconfig (same)")
|
||||||
@@ -47,4 +69,4 @@ package("libfontconfig-dev")
|
|||||||
dep("libfontconfig (same)")
|
dep("libfontconfig (same)")
|
||||||
dep("libexpat-dev @same-arch")
|
dep("libexpat-dev @same-arch")
|
||||||
dep("libfreetype-dev @same-arch")
|
dep("libfreetype-dev @same-arch")
|
||||||
cpp.use_auto_pack(["dev"])
|
on_pack(pack_dev)
|
||||||
|
|||||||
Reference in New Issue
Block a user