push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,77 @@
diff --git a/helpers/generate-fonts-runner.sh b/helpers/generate-fonts-runner.sh
index 21267e50f..873b5c664 100755
--- a/helpers/generate-fonts-runner.sh
+++ b/helpers/generate-fonts-runner.sh
@@ -25,10 +25,10 @@ mkdir -p "$build_dir"
# Change these to enable/disable formats
# Remember to update font/README.md accordingly
-methods_black=(glyf)
-methods_color=(cbdt glyf_colr_0 glyf_colr_1 sbix picosvgz untouchedsvgz)
+#methods_black=(glyf)
+#methods_color=(cbdt glyf_colr_0 glyf_colr_1 sbix picosvgz untouchedsvgz)
-saturations=(black color)
+#saturations=(black color)
for saturation in "${saturations[@]}"; do
case "$saturation" in
black)
@@ -43,6 +43,7 @@ for saturation in "${saturations[@]}"; do
mkdir -p "$build_dir/$saturation"
for method in "${methods[@]}"; do
+ if [ -z "$method" ]; then continue; fi
cat >"$build_dir/$saturation/OpenMoji-$saturation-$method.toml" <<-EOF
output_file = "$build_dir/$saturation/OpenMoji-$saturation-$method.ttf"
color_format = "$method"
@@ -55,10 +56,7 @@ default = 400
[master.regular]
style_name = "Regular"
-
-# To quickly check build reverse comments below
-srcs = ["/mnt/$saturation/svg/*.svg"]
-# srcs = ["/mnt/$saturation/svg/1F923.svg", "/mnt/$saturation/svg/1F1E9-1F1F0.svg"]
+srcs = ["$(pwd)/$saturation/svg/*.svg"]
[master.regular.position]
wght = 400
@@ -71,7 +69,7 @@ EOF
for method in "${methods[@]}"; do
# Generate XML for font
sed "s/Color/${saturation^}/;" \
- /mnt/data/OpenMoji-Color.ttx \
+ data/OpenMoji-Color.ttx \
> "$build_dir/$saturation/OpenMoji-$saturation-$method.ttx"
# Add version to XML
@@ -89,25 +87,21 @@ EOF
# Compress with WOFF2
woff2_compress "$build_dir/fonts/OpenMoji-$saturation-$method/OpenMoji-$saturation-$method.ttf"
-
- # Generate font demo
- /mnt/helpers/generate-font-demo.js "OpenMoji-$saturation-$method.woff2" "$build_dir/fonts/OpenMoji-$saturation-$method"
done
done
-for colr_version in 0 1; do
+for colr_version in "${maximumColorVersions[@]}"; do
+ if [ -z "$colr_version" ]; then continue; fi
# Make TTF with both COLR and SVG font data in it
mkdir -p "$build_dir/fonts/OpenMoji-color-colr${colr_version}_svg"
- maximum_color \
+ maximum_color --build_dir="$build_dir/color" \
"$build_dir/fonts/OpenMoji-color-glyf_colr_${colr_version}/OpenMoji-color-glyf_colr_${colr_version}.ttf"\
--output_file "$build_dir/fonts/OpenMoji-color-colr${colr_version}_svg/OpenMoji-color-colr${colr_version}_svg.ttf"
woff2_compress "$build_dir/fonts/OpenMoji-color-colr${colr_version}_svg/OpenMoji-color-colr${colr_version}_svg.ttf"
- /mnt/helpers/generate-font-demo.js\
- "OpenMoji-color-colr${colr_version}_svg.woff2"\
- "$build_dir/fonts/OpenMoji-color-colr${colr_version}_svg"
+ rm -rf "$build_dir/fonts/OpenMoji-color-glyf_colr_${colr_version}"
done
echo "Done building fonts!"

View File

@@ -0,0 +1,109 @@
{
lib,
stdenvNoCC,
fetchFromGitHub,
nanoemoji,
python3Packages,
woff2,
xmlstarlet,
# available color formats: ["cbdt" "glyf_colr_0" "glyf_colr_1" "sbix" "picosvgz" "untouchedsvgz"]
# available black formats: ["glyf"]
fontFormats ? [
"glyf"
"cbdt"
"glyf_colr_0"
"glyf_colr_1"
],
# when at least one of the glyf_colr_0/1 formats is specified, whether to build maximum color fonts
# "none" to not build any, "svg" to build colr+svg, "bitmap" to build cbdt+colr+svg fonts
buildMaximumColorFonts ? "bitmap",
}:
let
# all available methods
methods = {
black = [ "glyf" ];
color = [
"cbdt"
"glyf_colr_0"
"glyf_colr_1"
"sbix"
"picosvgz"
"untouchedsvgz"
];
};
in
assert lib.asserts.assertEachOneOf "fontFormats" fontFormats (methods.black ++ methods.color);
assert lib.asserts.assertOneOf "buildMaximumColorFonts" buildMaximumColorFonts [
"none"
"bitmap"
"svg"
];
stdenvNoCC.mkDerivation rec {
pname = "openmoji";
version = "16.0.0";
src = fetchFromGitHub {
owner = "hfg-gmuend";
repo = "openmoji";
rev = version;
hash = "sha256-4dYtLaABu88z25Ud/cuOECajxSJWR01qcTIZNWN7Fhw=";
};
patches = [
# fix paths and variables for nix build and skip generating font demos
./build.patch
];
nativeBuildInputs = [
nanoemoji
python3Packages.fonttools
woff2
xmlstarlet
];
methods_black = builtins.filter (m: builtins.elem m fontFormats) methods.black;
methods_color = builtins.filter (m: builtins.elem m fontFormats) methods.color;
saturations =
lib.optional (methods_black != [ ]) "black" ++ lib.optional (methods_color != [ ]) "color";
maximumColorVersions = lib.optionals (buildMaximumColorFonts != "none") (
lib.optional (builtins.elem "glyf_colr_0" fontFormats) "0"
++ lib.optional (builtins.elem "glyf_colr_1" fontFormats) "1"
);
postPatch = lib.optionalString (buildMaximumColorFonts == "bitmap") ''
substituteInPlace helpers/generate-fonts-runner.sh \
--replace 'maximum_color' 'maximum_color --bitmaps'
'';
buildPhase = ''
runHook preBuild
bash helpers/generate-fonts-runner.sh "$(pwd)/build" "${version}"
runHook postBuild
'';
installPhase = ''
runHook preInstall
mkdir -p $out/share/fonts/truetype $out/share/fonts/woff2
cp build/fonts/*/*.ttf $out/share/fonts/truetype/
cp build/fonts/*/*.woff2 $out/share/fonts/woff2/
runHook postInstall
'';
meta = with lib; {
license = licenses.cc-by-sa-40;
maintainers = with maintainers; [
_999eagle
fgaz
];
platforms = platforms.all;
homepage = "https://openmoji.org/";
downloadPage = "https://github.com/hfg-gmuend/openmoji/releases";
description = "Open-source emojis for designers, developers and everyone else";
};
}