openmoji-color,openmoji-black: use upstream js builder

+9 -23
+9 -23
pkgs/data/fonts/openmoji/default.nix
··· 2 , stdenv 3 , fetchFromGitHub 4 , scfbuild 5 , python3Packages 6 , variant ? "color" # "color" or "black" 7 }: ··· 25 26 nativeBuildInputs = [ 27 scfbuild 28 ]; 29 30 buildPhase = '' 31 - # Bash reimplementation of helpers/export-svg-font.js 32 - # so we don't need to build all the node deps first 33 - hexcodes=() 34 - missingGlyphBlack='./black/svg/25A1.svg' 35 - missingGlyphColor='./color/svg/25A1.svg' 36 - for f in ./color/svg/*.svg; do 37 - basename=$(basename "$f" .svg) 38 - hexcodes+=(''${basename//-/ }) 39 - filename=$(basename "$f"); 40 - cp "./color/svg/$filename" "./font/tmp-color/$filename" 41 - cp "./black/svg/$filename" "./font/tmp-black/$filename" 42 - done 43 - 44 - hexcodes=($(uniq<<<"''${hexcodes[@]}")) 45 46 - for h in ''${hexcodes[@]}; do 47 - filename="$h.svg" 48 - if [ ! -e "./color/svg/$filename" ]; then 49 - echo "$h is missing -> substitute with \"Missing Glyph\": $filename" 50 - cp $missingGlyphColor "./font/tmp-color/$filename" 51 - cp $missingGlyphBlack "./font/tmp-black/$filename" 52 - fi 53 - done 54 55 - # Actually build the font: 56 cd font 57 scfbuild -c scfbuild-${variant}.yml 58 ''; 59 60 installPhase = ''
··· 2 , stdenv 3 , fetchFromGitHub 4 , scfbuild 5 + , nodejs 6 + , nodePackages 7 , python3Packages 8 , variant ? "color" # "color" or "black" 9 }: ··· 27 28 nativeBuildInputs = [ 29 scfbuild 30 + nodejs 31 + nodePackages.glob 32 + nodePackages.lodash 33 ]; 34 35 buildPhase = '' 36 + runHook preBuild 37 38 + node helpers/generate-font-glyphs.js 39 40 cd font 41 scfbuild -c scfbuild-${variant}.yml 42 + 43 + runHook postBuild 44 ''; 45 46 installPhase = ''