Commit 18879293 authored by pancaek's avatar pancaek
Browse files

barlow: use installFonts hook

parent ed2072a5
Loading
Loading
Loading
Loading
+10 −14
Original line number Diff line number Diff line
@@ -2,30 +2,26 @@
  lib,
  stdenvNoCC,
  fetchFromGitHub,
  installFonts,
}:

stdenvNoCC.mkDerivation rec {
stdenvNoCC.mkDerivation (finalAttrs: {
  pname = "barlow";
  version = "1.422";

  outputs = [
    "out"
    "webfont"
  ];

  src = fetchFromGitHub {
    owner = "jpt";
    repo = "barlow";
    tag = version;
    tag = finalAttrs.version;
    hash = "sha256-FG68o6qN/296RhSNDHFXYXbkhlXSZJgGhVjzlJqsksY=";
  };

  installPhase = ''
    runHook preInstall

    install -Dm644 fonts/otf/*.otf -t $out/share/fonts/opentype
    install -Dm644 fonts/ttf/*.ttf fonts/gx/*.ttf -t $out/share/fonts/truetype
    install -Dm644 fonts/eot/*.eot -t $out/share/fonts/eot
    install -Dm644 fonts/woff/*.woff -t $out/share/fonts/woff
    install -Dm644 fonts/woff2/*.woff2 -t $out/share/fonts/woff2

    runHook postInstall
  '';
  nativeBuildInputs = [ installFonts ];

  meta = {
    description = "Grotesk variable font superfamily";
@@ -34,4 +30,4 @@ stdenvNoCC.mkDerivation rec {
    maintainers = [ ];
    platforms = lib.platforms.all;
  };
}
})