summary refs log tree commit diff
diff options
context:
space:
mode:
authorMichael Raskin <7c6f434c@mail.ru>2014-06-30 10:14:14 +0400
committerMichael Raskin <7c6f434c@mail.ru>2014-06-30 10:14:14 +0400
commitd41a7bd9e2844cf7e9bf1c83b7b66de6ab0aab75 (patch)
tree0312c236433f99cd05d27f4bc93dfa74fc975e3d
parentb403893aa220e4f7844778c30feb1461a90dc864 (diff)
parentfad3494f072ffb766a5b65d7ee80e3e17fce327f (diff)
Merge pull request #2871 from auntieNeo/kochi-substitute
Added Kochi substitute Japanese font package
-rw-r--r--lib/licenses.nix6
-rw-r--r--pkgs/build-support/fetchurl/mirrors.nix6
-rw-r--r--pkgs/data/fonts/kochi-substitute-naga10/default.nix34
-rw-r--r--pkgs/data/fonts/kochi-substitute/default.nix43
-rw-r--r--pkgs/top-level/all-packages.nix4
5 files changed, 93 insertions, 0 deletions
diff --git a/lib/licenses.nix b/lib/licenses.nix
index f529288b54fe3..ee13fd10a9425 100644
--- a/lib/licenses.nix
+++ b/lib/licenses.nix
@@ -245,6 +245,12 @@
 
   unfreeRedistributableFirmware = "unfree-redistributable-firmware";
 
+  wadalab = {
+    shortName = "wadalab";
+    fullName = "Wadalab Font License";
+    url = https://fedoraproject.org/wiki/Licensing:Wadalab?rd=Licensing/Wadalab;
+  };
+
   zlib = {
     shortName = "zlib";
     fullName = "zlib license";
diff --git a/pkgs/build-support/fetchurl/mirrors.nix b/pkgs/build-support/fetchurl/mirrors.nix
index 8417499cd00dc..38d3353202b12 100644
--- a/pkgs/build-support/fetchurl/mirrors.nix
+++ b/pkgs/build-support/fetchurl/mirrors.nix
@@ -20,6 +20,12 @@ rec {
     http://kent.dl.sourceforge.net/sourceforge/
   ];
 
+  # SourceForge.jp.
+  sourceforgejp = [
+    http://osdn.dl.sourceforge.jp/
+    http://jaist.dl.sourceforge.jp/
+  ];
+
   # GNU (http://www.gnu.org/prep/ftp.html).
   gnu = [
     # This one redirects to a (supposedly) nearby and (supposedly) up-to-date
diff --git a/pkgs/data/fonts/kochi-substitute-naga10/default.nix b/pkgs/data/fonts/kochi-substitute-naga10/default.nix
new file mode 100644
index 0000000000000..98ab8a3bcac5c
--- /dev/null
+++ b/pkgs/data/fonts/kochi-substitute-naga10/default.nix
@@ -0,0 +1,34 @@
+{ stdenv, fetchurl }:
+
+let version = "20030809";
+in
+stdenv.mkDerivation {
+  name = "kochi-substitute-naga10-${version}";
+
+  src = fetchurl {
+    url = "mirror://sourceforgejp/efont/5411/kochi-substitute-${version}.tar.bz2";
+    sha256 = "f4d69b24538833bf7e2c4de5e01713b3f1440960a6cc2a5993cb3c68cd23148c";
+  };
+
+  sourceRoot = "kochi-substitute-${version}";
+
+  installPhase = ''
+    mkdir -p $out/share/fonts/truetype
+    cp ./kochi-gothic-subst.ttf $out/share/fonts/truetype/kochi-gothic-subst-naga10.ttf
+    cp ./kochi-mincho-subst.ttf $out/share/fonts/truetype/kochi-mincho-subst-naga10.ttf
+  '';
+
+  meta = {
+    description = "Japanese font, non-free replacement for MS Gothic and MS Mincho.";
+    longDescription = ''
+      Kochi Gothic and Kochi Mincho were developed as free replacements for the
+      MS Gothic and MS Mincho fonts from Microsoft. This version of the fonts
+      includes some non-free glyphs from the naga10 font, which stipulate that
+      this font may not be sold commercially. See kochi-substitute for the free
+      Debian version.
+    '';
+    homepage = http://sourceforge.jp/projects/efont/;
+    license = stdenv.lib.licenses.unfreeRedistributable;
+    maintainers = [ stdenv.lib.maintainers.auntie ];
+  };
+}
diff --git a/pkgs/data/fonts/kochi-substitute/default.nix b/pkgs/data/fonts/kochi-substitute/default.nix
new file mode 100644
index 0000000000000..dec20fd51000d
--- /dev/null
+++ b/pkgs/data/fonts/kochi-substitute/default.nix
@@ -0,0 +1,43 @@
+{ stdenv, fetchurl, dpkg }:
+
+let version = "20030809";
+in
+stdenv.mkDerivation {
+  name = "kochi-substitute-${version}";
+
+  src = fetchurl {
+    url = "mirror://debian/pool/main/t/ttf-kochi/ttf-kochi-gothic_${version}-15_all.deb";
+    sha256 = "6e2311cd8e880a9328e4d3eef34a1c1f024fc87fba0dce177a0e1584a7360fea";
+  };
+
+  src2 = fetchurl {
+    url = "mirror://debian/pool/main/t/ttf-kochi/ttf-kochi-mincho_${version}-15_all.deb";
+    sha256 = "91ce6c993a3a0f77ed85db76f62ce18632b4c0cbd8f864676359a17ae5e6fa3c";
+  };
+
+  buildInputs = [ dpkg ];
+
+  unpackCmd = ''
+    dpkg-deb --fsys-tarfile $src | tar xf - ./usr/share/fonts/truetype/kochi/kochi-gothic-subst.ttf
+    dpkg-deb --fsys-tarfile $src2 | tar xf - ./usr/share/fonts/truetype/kochi/kochi-mincho-subst.ttf
+  '';
+
+  installPhase = ''
+    mkdir -p $out/share/fonts/truetype
+    cp ./share/fonts/truetype/kochi/kochi-gothic-subst.ttf $out/share/fonts/truetype/
+    cp ./share/fonts/truetype/kochi/kochi-mincho-subst.ttf $out/share/fonts/truetype/
+  '';
+
+  meta = {
+    description = "Japanese font, a free replacement for MS Gothic and MS Mincho.";
+    longDescription = ''
+      Kochi Gothic and Kochi Mincho were developed as free replacements for the
+      MS Gothic and MS Mincho fonts from Microsoft. These are the Debian
+      versions of the fonts, which remove some non-free glyphs that were added
+      from the naga10 font.
+    '';
+    homepage = http://sourceforge.jp/projects/efont/;
+    license = stdenv.lib.licenses.wadalab;
+    maintainers = [ stdenv.lib.maintainers.auntie ];
+  };
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index ac8f632bff3fc..09abe7765cf28 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -7903,6 +7903,10 @@ let
 
   junicode = callPackage ../data/fonts/junicode { };
 
+  kochi-substitute = callPackage ../data/fonts/kochi-substitute {};
+
+  kochi-substitute-naga10 = callPackage ../data/fonts/kochi-substitute-naga10 {};
+
   liberation_ttf = callPackage ../data/fonts/redhat-liberation-fonts { };
 
   libertine = builderDefsPackage (import ../data/fonts/libertine) {