Unverified Commit 58d16466 authored by jopejoe1's avatar jopejoe1 Committed by GitHub
Browse files

notonoto: fix font installation issues, notonoto-hs: init at 0.0.3 (#359496)

parents 3210f68b bff45e56
Loading
Loading
Loading
Loading
+58 −0
Original line number Diff line number Diff line
{
  lib,
  fetchFromGitHub,
  stdenvNoCC,
  fontforge,
  python3,
}:

let
  python3' = python3.withPackages (
    ps: with ps; [
      fonttools
      ttfautohint-py
    ]
  );
in

stdenvNoCC.mkDerivation rec {
  pname = "notonoto-hs";
  version = "0.0.3";

  src = fetchFromGitHub {
    owner = "yuru7";
    repo = "NOTONOTO";
    tag = "v${version}";
    hash = "sha256-1dbx4yC8gL41OEAE/LNDyoDb4xhAwV5h8oRmdlPULUo=";
  };

  nativeBuildInputs = [
    fontforge
    python3'
  ];

  buildPhase = ''
    runHook preBuild

    fontforge --script fontforge_script.py --hidden-zenkaku-space
    python3 ./fonttools_script.py

    runHook postBuild
  '';

  installPhase = ''
    runHook preInstall

    install -Dm444 build/*.ttf -t $out/share/fonts/truetype/notonoto-hs

    runHook postInstall
  '';

  meta = {
    description = "Programming font that combines Noto Sans Mono and Noto Sans JP";
    homepage = "https://github.com/yuru7/NOTONOTO";
    license = lib.licenses.ofl;
    maintainers = with lib.maintainers; [ genga898 ];
    platforms = lib.platforms.all;
  };
}
+28 −3
Original line number Diff line number Diff line
@@ -2,7 +2,19 @@
  lib,
  fetchFromGitHub,
  stdenvNoCC,
  fontforge,
  python3,
}:

let
  python3' = python3.withPackages (
    ps: with ps; [
      fonttools
      ttfautohint-py
    ]
  );
in

stdenvNoCC.mkDerivation rec {
  pname = "notonoto";
  version = "0.0.3";
@@ -14,10 +26,24 @@ stdenvNoCC.mkDerivation rec {
    hash = "sha256-1dbx4yC8gL41OEAE/LNDyoDb4xhAwV5h8oRmdlPULUo=";
  };

  nativeBuildInputs = [
    fontforge
    python3'
  ];

  buildPhase = ''
    runHook preBuild

    fontforge --script fontforge_script.py
    python3 ./fonttools_script.py

    runHook postBuild
  '';

  installPhase = ''
    runHook preInstall

    find . -name '*.ttf' -exec install -m444 -Dt $out/share/fonts/notonoto {} \;
    install -Dm444 build/*.ttf -t $out/share/fonts/truetype/notonoto

    runHook postInstall
  '';
@@ -27,7 +53,6 @@ stdenvNoCC.mkDerivation rec {
    homepage = "https://github.com/yuru7/NOTONOTO";
    license = lib.licenses.ofl;
    maintainers = with lib.maintainers; [ genga898 ];
    mainProgram = "notonoto";
    platforms = lib.platforms.all;
  };

}