diff --git a/pkgs/data/fonts/source-han/default.nix b/pkgs/data/fonts/source-han/default.nix index f68a2c75ca55..06554c1b9af0 100644 --- a/pkgs/data/fonts/source-han/default.nix +++ b/pkgs/data/fonts/source-han/default.nix @@ -2,6 +2,7 @@ lib, stdenvNoCC, fetchurl, + installFonts, unzip, }: @@ -18,16 +19,19 @@ let let Family = lib.toUpper (lib.substring 0 1 family) + lib.substring 1 (lib.stringLength family) family; in - stdenvNoCC.mkDerivation rec { + stdenvNoCC.mkDerivation { pname = "source-han-${family}"; version = lib.removeSuffix "R" rev; + __structuredAttrs = true; + strictDeps = true; + src = fetchurl { url = "https://github.com/adobe-fonts/source-han-${family}/releases/download/${rev}/${prefix}SourceHan${Family}.ttc${zip}"; inherit hash; }; - nativeBuildInputs = lib.optionals (zip == ".zip") [ unzip ]; + nativeBuildInputs = [ installFonts ] ++ lib.optionals (zip == ".zip") [ unzip ]; unpackPhase = lib.optionalString (zip == "") '' @@ -37,14 +41,6 @@ let unzip $src ''; - installPhase = '' - runHook preInstall - - install -Dm444 *.ttc -t $out/share/fonts/opentype/${pname} - - runHook postInstall - ''; - meta = { description = "Open source Pan-CJK ${description} typeface"; homepage = "https://github.com/adobe-fonts/source-han-${family}";