introduce a name variable
This commit is contained in:
parent
6a98c96f7a
commit
8626e1e2f1
@ -25,10 +25,12 @@ let
|
|||||||
# Function to generate a list of srcs that look like
|
# Function to generate a list of srcs that look like
|
||||||
# [
|
# [
|
||||||
# (fetchurl {
|
# (fetchurl {
|
||||||
|
# name = "namezzxs"
|
||||||
# url = "";
|
# url = "";
|
||||||
# sha256 = "sha256-abc123...";
|
# sha256 = "sha256-abc123...";
|
||||||
# })
|
# })
|
||||||
# (fetchurl {
|
# (fetchurl {
|
||||||
|
# name = "namezzxy"
|
||||||
# url = "";
|
# url = "";
|
||||||
# sha256 = "sha256-def456...";
|
# sha256 = "sha256-def456...";
|
||||||
# })
|
# })
|
||||||
@ -37,6 +39,7 @@ let
|
|||||||
builtins.map (variant:
|
builtins.map (variant:
|
||||||
let sha = fontAttrs.${variant};
|
let sha = fontAttrs.${variant};
|
||||||
in fetchzip {
|
in fetchzip {
|
||||||
|
name = "${fontName}-${variant}";
|
||||||
url = "https://smc.org.in/downloads/fonts/${fontName}/${variant}.zip";
|
url = "https://smc.org.in/downloads/fonts/${fontName}/${variant}.zip";
|
||||||
sha256 = sha;
|
sha256 = sha;
|
||||||
stripRoot = false;
|
stripRoot = false;
|
||||||
@ -51,14 +54,14 @@ in stdenv.mkDerivation (finalAttrs: {
|
|||||||
inherit version;
|
inherit version;
|
||||||
inherit srcs;
|
inherit srcs;
|
||||||
pname = "smc-fonts";
|
pname = "smc-fonts";
|
||||||
# sourceRoot = ".";
|
sourceRoot = ".";
|
||||||
buildPhase = ''
|
buildPhase = ''
|
||||||
echo "selected fonts are ${toString selectedFonts}"
|
echo "selected fonts are ${toString selectedFonts}"
|
||||||
ls *.otf *.ttf
|
ls *.otf *.ttf
|
||||||
'';
|
'';
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
find -name \*.otf -exec mkdir -p $out/share/fonts/opentype/ \; -exec mv {} $out/share/fonts/opentype/ \;
|
find -name \*.otf -exec mkdir -p $out/share/fonts/opentype/SMCFonts \; -exec mv {} $out/share/fonts/opentype/SMCFonts \;
|
||||||
find -name \*.ttf -exec mkdir -p $out/share/fonts/truetype/ \; -exec mv {} $out/share/fonts/truetype/ \;
|
find -name \*.ttf -exec mkdir -p $out/share/fonts/truetype/SMCFonts \; -exec mv {} $out/share/fonts/truetype/SMCFonts \;
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
|
Loading…
Reference in New Issue
Block a user