diff --git a/pkgs/data/fonts/tex-gyre-math/default.nix b/pkgs/data/fonts/tex-gyre-math/default.nix index e99e0bfb342f..3f9726ee094f 100644 --- a/pkgs/data/fonts/tex-gyre-math/default.nix +++ b/pkgs/data/fonts/tex-gyre-math/default.nix @@ -1,4 +1,4 @@ -{ variant, stdenv, fetchzip }: +{ stdenv, fetchzip }: let variants = { @@ -27,40 +27,43 @@ let outputHash = "0pa433cgshlypbyrrlp3qq0wg972rngcp37pr8pxdfshgz13q1mm"; }; }; - current = variants."${variant}"; - dotless_version = builtins.replaceStrings ["."] [""] current.version; -in stdenv.mkDerivation rec { - name = "tex-gyre-${variant}-math-${current.version}"; - version = "${current.version}"; - src = fetchzip { - url = "www.gust.org.pl/projects/e-foundry/tg-math/download/texgyre${variant}-math-${dotless_version}.zip"; - sha256 = current.sha256; - }; + mkVariant = variant: current: + let dotless_version = builtins.replaceStrings ["."] [""] current.version; in + stdenv.mkDerivation rec { + name = "tex-gyre-${variant}-math-${current.version}"; + version = "${current.version}"; - installPhase = '' - mkdir -p $out/share/fonts/opentype/ - mkdir -p $out/share/doc/${name}/ - cp -v opentype/*.otf $out/share/fonts/opentype/ - cp -v doc/*.txt $out/share/doc/${name}/ - ''; + src = fetchzip { + url = "www.gust.org.pl/projects/e-foundry/tg-math/download/texgyre${variant}-math-${dotless_version}.zip"; + sha256 = current.sha256; + }; - outputHashAlgo = "sha256"; - outputHashMode = "recursive"; - outputHash = current.outputHash; + installPhase = '' + mkdir -p $out/share/fonts/opentype/ + mkdir -p $out/share/doc/${name}/ + cp -v opentype/*.otf $out/share/fonts/opentype/ + cp -v doc/*.txt $out/share/doc/${name}/ + ''; - meta = with stdenv.lib; { - longDescription = '' - TeX Gyre ${current.displayName} Math is a math companion for the TeX Gyre - ${current.displayName} family of fonts (see - http://www.gust.org.pl/projects/e-foundry/tex-gyre/) in the OpenType format. - ''; - homepage = http://www.gust.org.pl/projects/e-foundry/tg-math; - # "The TeX Gyre Math fonts are licensed under the GUST Font License (GFL), - # which is a free license, legally equivalent to the LaTeX Project Public - # License (LPPL), version 1.3c or later." - GUST website - license = licenses.lppl13c; - maintainers = with maintainers; [ siddharthist ]; - platforms = platforms.all; - }; -} + outputHashAlgo = "sha256"; + outputHashMode = "recursive"; + outputHash = current.outputHash; + + meta = with stdenv.lib; { + longDescription = '' + TeX Gyre ${current.displayName} Math is a math companion for the TeX Gyre + ${current.displayName} family of fonts (see + http://www.gust.org.pl/projects/e-foundry/tex-gyre/) in the OpenType format. + ''; + homepage = http://www.gust.org.pl/projects/e-foundry/tg-math; + # "The TeX Gyre Math fonts are licensed under the GUST Font License (GFL), + # which is a free license, legally equivalent to the LaTeX Project Public + # License (LPPL), version 1.3c or later." - GUST website + license = licenses.lppl13c; + maintainers = with maintainers; [ siddharthist ]; + platforms = platforms.all; + }; + }; +in + stdenv.lib.mapAttrs mkVariant variants diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index bf3aa8c75ff4..70d40fa9d986 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -212,6 +212,10 @@ mapAliases (rec { telepathy_qt = telepathy-qt; # added 2018-02-25 telepathy_qt5 = libsForQt5.telepathy; # added 2015-12-19 telepathy_salut = telepathy-salut; # added 2018-02-25 + tex-gyre-bonum-math = tex-gyre-math.bonum; # added 2018-04-03 + tex-gyre-pagella-math = tex-gyre-math.pagella; # added 2018-04-03 + tex-gyre-schola-math = tex-gyre-math.schola; # added 2018-04-03 + tex-gyre-termes-math = tex-gyre-math.termes; # added 2018-04-03 tftp_hpa = tftp-hpa; # added 2015-04-03 transmission_gtk = transmission-gtk; # added 2018-01-06 transmission_remote_gtk = transmission-remote-gtk; # added 2018-01-06 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 8f3e3c722483..aee29f5901ed 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -14539,13 +14539,7 @@ with pkgs; tex-gyre = callPackages ../data/fonts/tex-gyre { }; - tex-gyre-bonum-math = callPackage ../data/fonts/tex-gyre-math { variant = "bonum"; }; - - tex-gyre-pagella-math = callPackage ../data/fonts/tex-gyre-math { variant = "pagella"; }; - - tex-gyre-schola-math = callPackage ../data/fonts/tex-gyre-math { variant = "schola"; }; - - tex-gyre-termes-math = callPackage ../data/fonts/tex-gyre-math { variant = "termes"; }; + tex-gyre-math = callPackages ../data/fonts/tex-gyre-math { }; tipa = callPackage ../data/fonts/tipa { };