summary refs log tree commit diff
path: root/pkgs/data
diff options
context:
space:
mode:
authorvtaku0 <mxxouy6x3m_github@tatapa.org>2015-01-15 14:05:46 +0100
committerVladimír Čunát <vcunat@gmail.com>2015-01-15 14:09:00 +0100
commitb87da0fa916fcd6ff019dbd3780e20c9d5e1093c (patch)
treed568d1fdf808c93ae4dbf58a1137d1f4a9098595 /pkgs/data
parent375ba22185f4900866d8ee92aff853679fd6872d (diff)
downloadnixlib-b87da0fa916fcd6ff019dbd3780e20c9d5e1093c.tar
nixlib-b87da0fa916fcd6ff019dbd3780e20c9d5e1093c.tar.gz
nixlib-b87da0fa916fcd6ff019dbd3780e20c9d5e1093c.tar.bz2
nixlib-b87da0fa916fcd6ff019dbd3780e20c9d5e1093c.tar.lz
nixlib-b87da0fa916fcd6ff019dbd3780e20c9d5e1093c.tar.xz
nixlib-b87da0fa916fcd6ff019dbd3780e20c9d5e1093c.tar.zst
nixlib-b87da0fa916fcd6ff019dbd3780e20c9d5e1093c.zip
source-han-sans: update, and refactor expressions
Close #5778.
@vcunat nitpicks: truetype -> opentype, remove empty buildInputs.
Diffstat (limited to 'pkgs/data')
-rw-r--r--pkgs/data/fonts/source-han-sans/base.nix26
-rw-r--r--pkgs/data/fonts/source-han-sans/default.nix47
-rw-r--r--pkgs/data/fonts/source-han-sans/japanese.nix6
-rw-r--r--pkgs/data/fonts/source-han-sans/korean.nix6
-rw-r--r--pkgs/data/fonts/source-han-sans/simplified-chinese.nix6
-rw-r--r--pkgs/data/fonts/source-han-sans/traditional-chinese.nix6
6 files changed, 47 insertions, 50 deletions
diff --git a/pkgs/data/fonts/source-han-sans/base.nix b/pkgs/data/fonts/source-han-sans/base.nix
deleted file mode 100644
index d319f41f2e52..000000000000
--- a/pkgs/data/fonts/source-han-sans/base.nix
+++ /dev/null
@@ -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;
-  };
-}
diff --git a/pkgs/data/fonts/source-han-sans/default.nix b/pkgs/data/fonts/source-han-sans/default.nix
new file mode 100644
index 000000000000..9e0bf7505718
--- /dev/null
+++ b/pkgs/data/fonts/source-han-sans/default.nix
@@ -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";
+  };
+}
diff --git a/pkgs/data/fonts/source-han-sans/japanese.nix b/pkgs/data/fonts/source-han-sans/japanese.nix
deleted file mode 100644
index 4aacdbf62e24..000000000000
--- a/pkgs/data/fonts/source-han-sans/japanese.nix
+++ /dev/null
@@ -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";
-}
\ No newline at end of file
diff --git a/pkgs/data/fonts/source-han-sans/korean.nix b/pkgs/data/fonts/source-han-sans/korean.nix
deleted file mode 100644
index cf3ecd9e12e2..000000000000
--- a/pkgs/data/fonts/source-han-sans/korean.nix
+++ /dev/null
@@ -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";
-}
\ No newline at end of file
diff --git a/pkgs/data/fonts/source-han-sans/simplified-chinese.nix b/pkgs/data/fonts/source-han-sans/simplified-chinese.nix
deleted file mode 100644
index 8e920455e453..000000000000
--- a/pkgs/data/fonts/source-han-sans/simplified-chinese.nix
+++ /dev/null
@@ -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";
-}
\ No newline at end of file
diff --git a/pkgs/data/fonts/source-han-sans/traditional-chinese.nix b/pkgs/data/fonts/source-han-sans/traditional-chinese.nix
deleted file mode 100644
index b25db8a2515a..000000000000
--- a/pkgs/data/fonts/source-han-sans/traditional-chinese.nix
+++ /dev/null
@@ -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";
-}
\ No newline at end of file