shanggu-fonts: make installPhase more readable (#350414)

This commit is contained in:
Jörg Thalheim
2024-10-22 11:18:49 +02:00
committed by GitHub
+7 -8
View File
@@ -23,12 +23,14 @@ let
Sans = "sha256-x5z6GYsfQ+8a8W0djJTY8iutuLNYvaemIpdYh94krk0=";
Serif = "sha256-3WK7vty3zZFNKkwViEsozU3qa+5hymYwXk6ta9AxmNM=";
};
extraOutputs = builtins.attrNames source;
in
stdenvNoCC.mkDerivation {
pname = "shanggu-fonts";
inherit version;
outputs = [ "out" ] ++ builtins.attrNames source;
outputs = [ "out" ] ++ extraOutputs;
nativeBuildInputs = [ p7zip ];
@@ -49,13 +51,10 @@ stdenvNoCC.mkDerivation {
mkdir -p $out/share/fonts/truetype
''
+ lib.strings.concatLines (
lib.lists.forEach (builtins.attrNames source) (
name: (''
install -Dm444 ${name}/*.ttc -t $'' + name + ''/share/fonts/truetype
ln -s $'' + name + ''/share/fonts/truetype/*.ttc $out/share/fonts/truetype
''
)
)
lib.lists.forEach extraOutputs (name: ''
install -Dm444 ${name}/*.ttc -t ${placeholder name}/share/fonts/truetype
ln -s "${placeholder name}" /share/fonts/truetype/*.ttc $out/share/fonts/truetype
'')
) + ''
runHook postInstall
'';