Unverified Commit fa569a33 authored by Pol Dellaiera's avatar Pol Dellaiera Committed by GitHub
Browse files

eb-garamond: add TTF and WOFF (#375307)

parents c84697b2 e031d664
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -2792,6 +2792,12 @@
    githubId = 29384538;
    keys = [ { fingerprint = "D35E C9CE E631 638F F1D8  B401 6F0E 410D C3EE D02"; } ];
  };
  bengsparks = {
    email = "benjamin.sparks@protonmail.com";
    github = "bengsparks";
    githubId = 4313548;
    name = "Ben Sparks";
  };
  benhiemer = {
    name = "Benedikt Hiemer";
    email = "ben.email@posteo.de";
+28 −7
Original line number Diff line number Diff line
{
  lib,
  stdenvNoCC,
  fetchzip,
  fetchFromGitHub,
  python3,
  ttfautohint,
}:

stdenvNoCC.mkDerivation rec {
  pname = "eb-garamond";
  version = "0.016";

  src = fetchzip {
    url = "https://bitbucket.org/georgd/eb-garamond/downloads/EBGaramond-${version}.zip";
    hash = "sha256-P2VCLcqcMBBoTDJyRLP9vlHI+jE0EqPjPziN2MJbgEg=";
  src = fetchFromGitHub {
    owner = "georgd";
    repo = "EB-Garamond";
    tag = "v${version}";
    hash = "sha256-ajieKhTeH6yv2qiE2xqnHFoMS65//4ZKiccAlC2PXGQ=";
  };

  nativeBuildInputs = [
    (python3.withPackages (p: [ p.fontforge ]))
    ttfautohint
  ];

  postPatch = ''
    substituteInPlace Makefile \
      --replace-fail "@\$(SFNTTOOL) -w \$< \$@"   "@fontforge -lang=ff -c 'Open(\$\$1); Generate(\$\$2)' \$< \$@"
  '';

  buildPhase = ''
    runHook preBuild
    make WEB=build EOT="" all
    runHook postBuild
  '';

  installPhase = ''
    runHook preInstall

    install -Dm644 otf/*.otf                                 -t $out/share/fonts/opentype
    install -Dm644 Changes README.markdown README.xelualatex -t $out/share/doc/${pname}-${version}
    install -Dm644 build/*.ttf  -t $out/share/fonts/truetype
    install -Dm644 build/*.otf  -t $out/share/fonts/opentype
    install -Dm644 build/*.woff -t $out/share/fonts/woff

    runHook postInstall
  '';
@@ -26,6 +46,7 @@ stdenvNoCC.mkDerivation rec {
    homepage = "http://www.georgduffner.at/ebgaramond/";
    description = "Digitization of the Garamond shown on the Egenolff-Berner specimen";
    maintainers = with maintainers; [
      bengsparks
      relrod
      rycee
    ];