Skyler Grey | 95c67e0 | 2022-10-30 22:28:42 +0000 | [diff] [blame] | 1 | final: prev: let |
| 2 | lib = prev.lib; |
| 3 | fonts = ["roboto-mono"]; |
Skyler Grey | 0c7d092 | 2022-10-30 22:59:22 +0000 | [diff] [blame] | 4 | ligaturizer = prev.fetchFromGitHub { |
Skyler Grey | 95c67e0 | 2022-10-30 22:28:42 +0000 | [diff] [blame] | 5 | owner = "ToxicFrog"; |
| 6 | repo = "Ligaturizer"; |
| 7 | rev = "v5"; |
Skyler Grey | 0c7d092 | 2022-10-30 22:59:22 +0000 | [diff] [blame] | 8 | sha256 = "sha256-sFzoUvA4DB9CVonW/OZWWpwP0R4So6YlAQeqe7HLq50="; |
| 9 | fetchSubmodules = true; |
Skyler Grey | 95c67e0 | 2022-10-30 22:28:42 +0000 | [diff] [blame] | 10 | }; |
| 11 | in |
| 12 | lib.pipe fonts [ |
| 13 | (builtins.map (name: { |
| 14 | inherit name; |
| 15 | value = prev.${name}; |
| 16 | })) |
Skyler Grey | 0c7d092 | 2022-10-30 22:59:22 +0000 | [diff] [blame] | 17 | builtins.listToAttrs |
Skyler Grey | 95c67e0 | 2022-10-30 22:28:42 +0000 | [diff] [blame] | 18 | (builtins.mapAttrs (name: value: |
| 19 | value.overrideAttrs ( |
| 20 | prevAttrs: { |
Skyler Grey | 0c7d092 | 2022-10-30 22:59:22 +0000 | [diff] [blame] | 21 | outputHash = null; |
| 22 | outputHashMode = null; |
| 23 | outputHashAlgo = null; |
| 24 | nativeBuildInputs = (prevAttrs.nativeBuildInputs or []) ++ [prev.fontforge]; |
| 25 | postFixup = |
| 26 | (prevAttrs.postFixup or "") |
| 27 | + '' |
| 28 | pushd ${ligaturizer} |
| 29 | mkdir -p $out/share/fonts/truetype |
| 30 | mkdir -p $out/share/fonts/opentype |
| 31 | find $out/share/fonts/truetype \ |
| 32 | -name "*.ttf" \ |
| 33 | -exec fontforge \ |
| 34 | -lang py \ |
| 35 | -script ligaturize.py {} \ |
| 36 | --output-dir=$out/share/fonts/truetype \; |
| 37 | find $out/share/fonts/opentype \ |
| 38 | -name "*.otf" \ |
| 39 | -exec fontforge \ |
| 40 | -lang py \ |
| 41 | -script ligaturize.py {} \ |
| 42 | --output-dir=$out/share/fonts/opentype \; |
| 43 | popd |
| 44 | ''; |
Skyler Grey | 95c67e0 | 2022-10-30 22:28:42 +0000 | [diff] [blame] | 45 | } |
| 46 | ))) |
Skyler Grey | 95c67e0 | 2022-10-30 22:28:42 +0000 | [diff] [blame] | 47 | ] |