Unverified Commit d8c4d45f authored by Shiphan's avatar Shiphan
Browse files

googlesans-code: init at 6.000

parent b5b67cb8
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -11,7 +11,7 @@ rustPlatform.buildRustPackage rec {
  src = fetchFromGitHub {
    owner = "googlefonts";
    repo = "fontc";
    rev = "fontc-v${version}";
    tag = "fontc-v${version}";
    hash = "sha256-Zr2nJRNY1vLGhVOGC3KSWbd4cQReO/F8Wgzx3y/qPFc=";
  };
  buildAndTestSubdir = "fontc";
@@ -27,8 +27,9 @@ rustPlatform.buildRustPackage rec {
  };

  meta = {
    description = "Wherein we pursue oxidizing (context: https://github.com/googlefonts/oxidize) fontmake";
    description = "Wherein we pursue oxidizing fontmake";
    homepage = "https://github.com/googlefonts/fontc";
    changelog = "https://github.com/googlefonts/fontc/releases/tag/${src.tag}";
    license = lib.licenses.asl20;
    maintainers = with lib.maintainers; [ shiphan ];
    mainProgram = "fontc";
+50 −0
Original line number Diff line number Diff line
{
  lib,
  stdenv,
  fetchFromGitHub,
  fontc,
}:

stdenv.mkDerivation rec {
  pname = "googlesans-code";
  version = "6.000";

  src = fetchFromGitHub {
    owner = "googlefonts";
    repo = "googlesans-code";
    tag = "v${version}";
    hash = "sha256-FPpxJGsx1uAen2QKhJmVBpFIlQk3ObieeZdrWIAR+oQ=";
  };

  nativeBuildInputs = [
    fontc
  ];

  buildPhase = ''
    runHook preBuild

    mkdir -p fonts/variable
    fontc sources/GoogleSansCode.glyphspackage --flatten-components --decompose-transformed-components --output-file "fonts/variable/GoogleSansCode[wght].ttf"
    fontc sources/GoogleSansCode-Italic.glyphspackage --flatten-components --decompose-transformed-components --output-file "fonts/variable/GoogleSansCode-Italic[wght].ttf"

    runHook postBuild
  '';

  installPhase = ''
    runHook preInstall

    mkdir -p $out/share/fonts/googlesans-code
    cp fonts/variable/* $out/share/fonts/googlesans-code/

    runHook postInstall
  '';

  meta = {
    description = "Google Sans Code font family";
    homepage = "https://github.com/googlefonts/googlesans-code";
    changelog = "https://github.com/googlefonts/googlesans-code/blob/${src.tag}/CHANGELOG.md";
    license = lib.licenses.ofl;
    maintainers = with lib.maintainers; [ shiphan ];
    platforms = lib.platforms.all;
  };
}