Skip to content

Commit 8e089f9

Browse files
serenityos-emoji-font: init at 0-unstable-2025-05-31 (#407778)
2 parents 01d0ce7 + cc5baeb commit 8e089f9

File tree

2 files changed

+118
-0
lines changed

2 files changed

+118
-0
lines changed

maintainers/maintainer-list.nix

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26579,6 +26579,12 @@
2657926579
githubId = 45292658;
2658026580
name = "Julius Schmitt";
2658126581
};
26582+
voidnoi = {
26583+
email = "[email protected]";
26584+
github = "VoidNoi";
26585+
githubId = 83523507;
26586+
name = "voidnoi";
26587+
};
2658226588
vojta001 = {
2658326589
email = "[email protected]";
2658426590
github = "vojta001";
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
{
2+
lib,
3+
stdenvNoCC,
4+
fetchFromGitHub,
5+
fetchzip,
6+
python3Packages,
7+
fetchpatch2,
8+
parallel,
9+
}:
10+
let
11+
12+
pixart2svg = stdenvNoCC.mkDerivation {
13+
name = "pixart2svg";
14+
version = "0-unstable-2021-07-18";
15+
16+
src = fetchzip {
17+
name = "pixart2svg";
18+
url = "https://gist.github.com/m13253/66284bc244deeff0f0f8863c206421c7/archive/f9454958dc0a33cea787cc6fbd7e8e34ba6eb23b.zip";
19+
hash = "sha256-lNA3qWK/bnUcMM/jrCGEgaX+HAk/DjKJnkE8niYmBDU=";
20+
};
21+
22+
patches =
23+
let
24+
urlFor =
25+
name:
26+
"https://raw.githubusercontent.com/linusg/serenityos-emoji-font/11c84f33777a5d5bbe97ef2ffe8b74af7d72d27f/patches/${name}.patch";
27+
in
28+
[
29+
(fetchpatch2 {
30+
url = urlFor "0001-pixart2svg-rgba";
31+
extraPrefix = "./";
32+
hash = "sha256-/4a6btqp/6yiBnFhr4vI+SWfOopUjzDfOeW1Fs6Z5yU=";
33+
})
34+
(fetchpatch2 {
35+
url = urlFor "0002-pixart2svg-no-style";
36+
extraPrefix = "./";
37+
hash = "sha256-FVurs+bEOat74d2egl21JS5ywdkFKKIsqXSFGSJI8MI=";
38+
})
39+
(fetchpatch2 {
40+
url = urlFor "0003-pixart2svg-imageio-deprecation-warning";
41+
extraPrefix = "./";
42+
hash = "sha256-Vo3JIcXof+AtuEbsczNS3CUaBUEncCR0pnIuY4uF7R4=";
43+
})
44+
];
45+
46+
installPhase = ''
47+
mkdir -p $out
48+
cp ./pixart2svg.py $out
49+
'';
50+
};
51+
52+
in
53+
stdenvNoCC.mkDerivation {
54+
name = "serenityos-emoji-font";
55+
version = "0-unstable-2025-05-31";
56+
57+
src = fetchFromGitHub {
58+
name = "serenity";
59+
owner = "SerenityOS";
60+
repo = "serenity";
61+
rev = "35fd7a6770144259a05d41dfffbc8092495c4bf2";
62+
hash = "sha256-i48egESwQKhcEAObSg2zqubgNdkXE5FlNa+Jukvg2X8=";
63+
};
64+
65+
strictDeps = true;
66+
67+
nativeBuildInputs =
68+
[
69+
pixart2svg
70+
parallel
71+
]
72+
++ (with python3Packages; [
73+
imageio
74+
nanoemoji
75+
numpy
76+
]);
77+
78+
buildPhase = ''
79+
runHook preBuild
80+
81+
mkdir -p svgfiles
82+
83+
total=$(ls -1 Base/res/emoji/*.png | wc -l)
84+
85+
parallel -j$NIX_BUILD_CORES \
86+
echo [{#}/$total] Converting {/} \; python3 ${pixart2svg}/pixart2svg.py {} svgfiles/{/.}.svg \
87+
::: Base/res/emoji/*.png;
88+
89+
nanoemoji --family "SerenityOS Emoji" --output_file "SerenityOS-Emoji.ttf" --color_format glyf_colr_1 svgfiles/*.svg
90+
91+
runHook postBuild
92+
'';
93+
94+
installPhase = ''
95+
runHook preInstall
96+
97+
mkdir -p $out/share/fonts/truetype
98+
cp build/SerenityOS-Emoji.ttf $out/share/fonts/truetype
99+
100+
runHook postInstall
101+
'';
102+
103+
meta = {
104+
description = "SerenityOS pixel art emojis as a TTF";
105+
homepage = "https://emoji.serenityos.org/";
106+
license = lib.licenses.bsd2;
107+
maintainers = with lib.maintainers; [
108+
voidnoi
109+
];
110+
platforms = lib.platforms.all;
111+
};
112+
}

0 commit comments

Comments
 (0)