From eab9d148d22e3407a81efb60800dba9c6f289fb0 Mon Sep 17 00:00:00 2001 From: genga Date: Tue, 4 Feb 2025 02:27:13 +0300 Subject: [PATCH] notonoto: build font from source --- pkgs/by-name/no/notonoto/package.nix | 31 +++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/no/notonoto/package.nix b/pkgs/by-name/no/notonoto/package.nix index ef4447f866b3..36ca284845c7 100644 --- a/pkgs/by-name/no/notonoto/package.nix +++ b/pkgs/by-name/no/notonoto/package.nix @@ -2,7 +2,19 @@ lib, fetchFromGitHub, stdenvNoCC, + fontforge, + python3, }: + +let + python3' = python3.withPackages ( + ps: with ps; [ + fonttools + ttfautohint-py + ] + ); +in + stdenvNoCC.mkDerivation rec { pname = "notonoto"; version = "0.0.3"; @@ -14,10 +26,24 @@ stdenvNoCC.mkDerivation rec { hash = "sha256-1dbx4yC8gL41OEAE/LNDyoDb4xhAwV5h8oRmdlPULUo="; }; + nativeBuildInputs = [ + fontforge + python3' + ]; + + buildPhase = '' + runHook preBuild + + fontforge --script fontforge_script.py + python3 ./fonttools_script.py + + runHook postBuild + ''; + installPhase = '' runHook preInstall - find . -name '*.ttf' -exec install -m444 -Dt $out/share/fonts/notonoto {} \; + install -Dm444 build/*.ttf -t $out/share/fonts/truetype/notonoto runHook postInstall ''; @@ -27,7 +53,6 @@ stdenvNoCC.mkDerivation rec { homepage = "https://github.com/yuru7/NOTONOTO"; license = lib.licenses.ofl; maintainers = with lib.maintainers; [ genga898 ]; - mainProgram = "notonoto"; + platforms = lib.platforms.all; }; - }