Skip to content

Commit

Permalink
noto-fonts-cjk-serif: add static option
Browse files Browse the repository at this point in the history
  • Loading branch information
leana8959 committed Oct 26, 2024
1 parent 6435c49 commit 1c2e33e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
21 changes: 15 additions & 6 deletions pkgs/by-name/no/noto-fonts-cjk-serif/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
, fetchFromGitHub
, nixosTests
, gitUpdater

, static ? false, # whether to build the static version of the font
}:

stdenvNoCC.mkDerivation rec {
Expand All @@ -13,13 +15,20 @@ stdenvNoCC.mkDerivation rec {
owner = "notofonts";
repo = "noto-cjk";
rev = "Serif${version}";
hash = "sha256-E+Ic7XhomI6cUa+q77gQvMlaLvy+vgTq4NJ58/nPZtk=";
sparseCheckout = [ "Serif/Variable/OTC" ];
hash = "sha256-Bwuu64TAnOnqUgLlBsUw/jnv9emngqFBmVn6zEqySlc=";
sparseCheckout = [
"Serif/OTC"
"Serif/Variable/OTC"
];
};

installPhase = ''
install -m444 -Dt $out/share/fonts/opentype/noto-cjk Serif/Variable/OTC/*.otf.ttc
'';
installPhase =
let
font-path = if static then "Serif/OTC/*.ttc" else "Serif/Variable/OTC/*.otf.ttc";
in
''
install -m444 -Dt $out/share/fonts/opentype/noto-cjk ${font-path}
'';

passthru.tests.noto-fonts = nixosTests.noto-fonts;

Expand All @@ -44,6 +53,6 @@ stdenvNoCC.mkDerivation rec {
'';
license = licenses.ofl;
platforms = platforms.all;
maintainers = with maintainers; [ mathnerd314 emily ];
maintainers = with maintainers; [ mathnerd314 emily leana8959 ];
};
}
2 changes: 2 additions & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -27354,6 +27354,8 @@ with pkgs;

nordzy-icon-theme = callPackage ../data/icons/nordzy-icon-theme { };

noto-fonts-cjk-serif-static = callPackage ../by-name/no/noto-fonts-cjk-serif/package.nix { static = true; };

noto-fonts-lgc-plus = callPackage ../by-name/no/noto-fonts/package.nix {
suffix = "-lgc-plus";
variants = [
Expand Down

0 comments on commit 1c2e33e

Please sign in to comment.