From b56e41aebe17462a663984dd8a73190582bf7f12 Mon Sep 17 00:00:00 2001 From: Ricky Elrod Date: Wed, 7 May 2014 03:56:41 -0400 Subject: [PATCH] Add eb-garamond font (close #2553) @vcunat added license, changed attribute name according to the [rules], and trivial refactoring. [rules]: http://nixos.org/nixpkgs/manual/#idm140333184443184 ("package naming") --- pkgs/data/fonts/eb-garamond/default.nix | 50 +++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 52 insertions(+) create mode 100644 pkgs/data/fonts/eb-garamond/default.nix diff --git a/pkgs/data/fonts/eb-garamond/default.nix b/pkgs/data/fonts/eb-garamond/default.nix new file mode 100644 index 000000000000..99c9b53217e5 --- /dev/null +++ b/pkgs/data/fonts/eb-garamond/default.nix @@ -0,0 +1,50 @@ +x@{builderDefsPackage + , unzip + , ...}: +builderDefsPackage +(a : +let + helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++ + []; + + buildInputs = map (n: builtins.getAttr n x) + (builtins.attrNames (builtins.removeAttrs x helperArgNames)); + sourceInfo = rec { + version="0.016"; + name="EBGaramond"; + url="https://bitbucket.org/georgd/eb-garamond/downloads/${name}-${version}.zip"; + hash="0y630khn5zh70al3mm84fs767ac94ffyz1w70zzhrhambx07pdx0"; + }; +in +rec { + src = a.fetchurl { + url = sourceInfo.url; + sha256 = sourceInfo.hash; + }; + + name = "eb-garamond-${sourceInfo.version}"; + inherit buildInputs; + + phaseNames = ["doUnpack" "installFonts"]; + + # This will clean up if/when 8263996 lands. + doUnpack = a.fullDepEntry ('' + unzip ${src} + cd ${sourceInfo.name}* + mv {ttf,otf}/* . + '') ["addInputs"]; + + meta = with a.lib; { + description = "Digitization of the Garamond shown on the Egenolff-Berner specimen"; + maintainers = with maintainers; [ relrod ]; + platforms = platforms.all; + license = licenses.ofl; + homepage = http://www.georgduffner.at/ebgaramond/; + }; + passthru = { + updateInfo = { + downloadPage = "https://github.com/georgd/EB-Garamond/releases"; + }; + }; +}) x + diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 6fd1ca0490cc..c206d32eeac1 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -7638,6 +7638,8 @@ let dosemu_fonts = callPackage ../data/fonts/dosemu-fonts { }; + eb-garamond = callPackage ../data/fonts/eb-garamond { }; + freefont_ttf = callPackage ../data/fonts/freefont-ttf { }; freepats = callPackage ../data/misc/freepats { };