From f1b1e556c41aa8b5a9f15690005019a32941c999 Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Wed, 29 Apr 2015 17:44:48 -0500 Subject: [PATCH] source-code-pro: new source --- pkgs/data/fonts/source-code-pro/default.nix | 50 +++++++-------------- 1 file changed, 17 insertions(+), 33 deletions(-) diff --git a/pkgs/data/fonts/source-code-pro/default.nix b/pkgs/data/fonts/source-code-pro/default.nix index dc5bcb5b9a7..b3761bc0b5b 100644 --- a/pkgs/data/fonts/source-code-pro/default.nix +++ b/pkgs/data/fonts/source-code-pro/default.nix @@ -1,42 +1,26 @@ -x@{builderDefsPackage - , unzip - , ...}: -builderDefsPackage -(a : -let - helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++ - []; +{ stdenv, fetchurl }: - buildInputs = map (n: builtins.getAttr n x) - (builtins.attrNames (builtins.removeAttrs x helperArgNames)); - sourceInfo = rec { - version="1.017"; - name="SourceCodePro"; - url="mirror://sourceforge/sourcecodepro.adobe/${name}_FontsOnly-${version}.zip"; - hash="07xjfxin883a3g3admdddxxqyzigihbsnmik0zpjii09cdlb8dl1"; - }; -in -rec { - src = a.fetchurl { - url = sourceInfo.url; - sha256 = sourceInfo.hash; +stdenv.mkDerivation rec { + name = "source-code-pro-${version}"; + version = "1.017"; + + src = fetchurl { + url="https://github.com/adobe-fonts/source-code-pro/archive/${version}R.tar.gz"; + sha256="03q4a0f142c6zlngv6kjaik52y0yzwq5z5qj3j0fvvcbfy9sanjr"; }; - name = "source-code-pro-${sourceInfo.version}"; - inherit buildInputs; + phases = "unpackPhase installPhase"; - phaseNames = ["doUnpack" "installFonts"]; - - doUnpack = a.fullDepEntry ('' - unzip ${src} - cd ${sourceInfo.name}*/OTF/ - '') ["addInputs"]; + installPhase = '' + mkdir -p $out/share/fonts/opentype + find . -name "*.otf" -exec cp {} $out/share/fonts/opentype \; + ''; meta = { description = "A set of monospaced OpenType fonts designed for coding environments"; - maintainers = with a.lib.maintainers; [ relrod ]; - platforms = with a.lib.platforms; all; + maintainers = with stdenv.lib.maintainers; [ relrod ]; + platforms = with stdenv.lib.platforms; all; homepage = "http://blog.typekit.com/2012/09/24/source-code-pro/"; - license = a.lib.licenses.ofl; + license = stdenv.lib.licenses.ofl; }; -}) x +}