source-han-sans: update, and refactor expressions
Close #5778. @vcunat nitpicks: truetype -> opentype, remove empty buildInputs.
This commit is contained in:
parent
375ba22185
commit
b87da0fa91
|
@ -1,26 +0,0 @@
|
|||
{version ? "1.000", prefix, url, sha256, description}:
|
||||
|
||||
{stdenv, fetchurl, unzip}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
inherit version;
|
||||
name = "${prefix}-${version}";
|
||||
|
||||
src = fetchurl {
|
||||
inherit url sha256;
|
||||
};
|
||||
|
||||
buildInputs = [ unzip ];
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/share/fonts/truetype
|
||||
cp $( find . -name '*.otf' ) $out/share/fonts/truetype
|
||||
'';
|
||||
|
||||
meta = {
|
||||
inherit description;
|
||||
|
||||
homepage = http://sourceforge.net/adobe/source-han-sans/;
|
||||
license = stdenv.lib.licenses.asl20;
|
||||
};
|
||||
}
|
47
pkgs/data/fonts/source-han-sans/default.nix
Normal file
47
pkgs/data/fonts/source-han-sans/default.nix
Normal file
|
@ -0,0 +1,47 @@
|
|||
{stdenv, fetchurl}:
|
||||
|
||||
let
|
||||
makePackage = {language, region, description}: stdenv.mkDerivation rec {
|
||||
version = "1.001R";
|
||||
name = "source-han-sans-${language}-${version}";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://github.com/adobe-fonts/source-han-sans/archive/${version}.tar.gz";
|
||||
sha256 = "0cwz3d8jancl0a7vbjxhnh1vgwsjba62lahfjya9yrjkp1ndxlap";
|
||||
};
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/share/fonts/opentype
|
||||
cp $( find SubsetOTF/${region} -name '*.otf' ) $out/share/fonts/opentype
|
||||
'';
|
||||
|
||||
meta = {
|
||||
inherit description;
|
||||
|
||||
homepage = https://github.com/adobe-fonts/source-han-sans;
|
||||
license = stdenv.lib.licenses.asl20;
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
japanese = makePackage {
|
||||
language = "japanese";
|
||||
region = "JP";
|
||||
description = "Japanese subset of an open source Pan-CJK typeface";
|
||||
};
|
||||
korean = makePackage {
|
||||
language = "korean";
|
||||
region = "KR";
|
||||
description = "Korean subset of an open source Pan-CJK typeface";
|
||||
};
|
||||
simplified-chinese = makePackage {
|
||||
language = "simplified-chinese";
|
||||
region = "CN";
|
||||
description = "Simplified Chinese subset of an open source Pan-CJK typeface";
|
||||
};
|
||||
traditional-chinese = makePackage {
|
||||
language = "traditional-chinese";
|
||||
region = "TW";
|
||||
description = "Traditional Chinese subset of an open source Pan-CJK typeface";
|
||||
};
|
||||
}
|
|
@ -1,6 +0,0 @@
|
|||
import ./base.nix {
|
||||
prefix = "source-han-sans-japanese";
|
||||
url = "mirror://sourceforge/source-han-sans.adobe/SourceHanSansJP-1.000.zip";
|
||||
sha256 = "c5930036660bea22ffceaa9e2df765776494800d330a59be7936ab3c763c4c82";
|
||||
description = "Japanese subset of an open source Pan-CJK typeface";
|
||||
}
|
|
@ -1,6 +0,0 @@
|
|||
import ./base.nix {
|
||||
prefix = "source-han-sans-korean";
|
||||
url = "mirror://sourceforge/source-han-sans.adobe/SourceHanSansKR-1.000.zip";
|
||||
sha256 = "8eed4ad092fcf640e44f73ba510e0ed1c1cabf79776f68d02820734bbba21cf8";
|
||||
description = "Korean subset of an open source Pan-CJK typeface";
|
||||
}
|
|
@ -1,6 +0,0 @@
|
|||
import ./base.nix {
|
||||
prefix = "source-han-sans-simplified-chinese";
|
||||
url = "mirror://sourceforge/source-han-sans.adobe/SourceHanSansCN-1.000.zip";
|
||||
sha256 = "88117aa8f8b4ab65d6f7a919a5e1b06d6c00f75b1abecccf120246536123754d";
|
||||
description = "Simplified Chinese subset of an open source Pan-CJK typeface";
|
||||
}
|
|
@ -1,6 +0,0 @@
|
|||
import ./base.nix {
|
||||
prefix = "source-han-sans-traditional-chinese";
|
||||
url = "mirror://sourceforge/source-han-sans.adobe/SourceHanSansTWHK-1.000.zip";
|
||||
sha256 = "2371a726757a51322243b1ed7a9fde562621b0813b5e6d6443e06847ad7bbd20";
|
||||
description = "Traditional Chinese subset of an open source Pan-CJK typeface";
|
||||
}
|
|
@ -9183,10 +9183,11 @@ let
|
|||
|
||||
source-serif-pro = callPackage ../data/fonts/source-serif-pro { };
|
||||
|
||||
source-han-sans-japanese = callPackage ../data/fonts/source-han-sans/japanese.nix {};
|
||||
source-han-sans-korean = callPackage ../data/fonts/source-han-sans/korean.nix {};
|
||||
source-han-sans-simplified-chinese = callPackage ../data/fonts/source-han-sans/simplified-chinese.nix {};
|
||||
source-han-sans-traditional-chinese = callPackage ../data/fonts/source-han-sans/traditional-chinese.nix {};
|
||||
sourceHanSansPackages = callPackage ../data/fonts/source-han-sans { };
|
||||
source-han-sans-japanese = sourceHanSansPackages.japanese;
|
||||
source-han-sans-korean = sourceHanSansPackages.korean;
|
||||
source-han-sans-simplified-chinese = sourceHanSansPackages.simplified-chinese;
|
||||
source-han-sans-traditional-chinese = sourceHanSansPackages.traditional-chinese;
|
||||
|
||||
tango-icon-theme = callPackage ../data/icons/tango-icon-theme { };
|
||||
|
||||
|
|
Loading…
Reference in a new issue