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