From 8237294f64e1c80665da287c35449a76cba2aac7 Mon Sep 17 00:00:00 2001 From: Changlin Li Date: Fri, 9 Jun 2017 03:05:21 -0400 Subject: [PATCH] Add Unicode Arphic CJK fonts These are a couple of CJK fonts that are on most other Linux distributions that aren't on NixOS --- lib/licenses.nix | 5 +++ pkgs/data/fonts/arphic/default.nix | 69 ++++++++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 3 ++ 3 files changed, 77 insertions(+) create mode 100644 pkgs/data/fonts/arphic/default.nix diff --git a/lib/licenses.nix b/lib/licenses.nix index 0919699b41e3..8dd1c210b7fa 100644 --- a/lib/licenses.nix +++ b/lib/licenses.nix @@ -45,6 +45,11 @@ lib.mapAttrs (n: v: v // { shortName = n; }) rec { fullName = "Apple Public Source License 2.0"; }; + arphicpl = { + fullName = "Arphic Public License"; + url = https://www.freedesktop.org/wiki/Arphic_Public_License/; + }; + artistic1 = spdx { spdxId = "Artistic-1.0"; fullName = "Artistic License 1.0"; diff --git a/pkgs/data/fonts/arphic/default.nix b/pkgs/data/fonts/arphic/default.nix new file mode 100644 index 000000000000..40f5480c0861 --- /dev/null +++ b/pkgs/data/fonts/arphic/default.nix @@ -0,0 +1,69 @@ +{ stdenv, fetchurl, mkfontscale, mkfontdir }: + +{ + arphic-ukai = stdenv.mkDerivation rec { + name = "arphic-ukai-${version}"; + + version = "0.2.20080216.2"; + + src = fetchurl { + url = "http://archive.ubuntu.com/ubuntu/pool/main/f/fonts-arphic-ukai/fonts-arphic-ukai_${version}.orig.tar.bz2"; + sha256 = "1lp3i9m6x5wrqjkh1a8vpyhmsrhvsa2znj2mx13qfkwza5rqv5ml"; + }; + + buildInputs = [ mkfontscale mkfontdir ]; + + phases = [ "unpackPhase" "installPhase" ]; + + installPhase = + '' + mkdir -p $out/share/fonts $out/share/fonts/truetype + cp -v ukai.ttc $out/share/fonts/truetype/arphic-ukai.ttc + cd $out/share/fonts + mkfontdir + mkfontscale + ''; + + meta = with stdenv.lib; { + description = "CJK Unicode font Kai style"; + homepage = https://www.freedesktop.org/wiki/Software/CJKUnifonts/; + + license = licenses.arphicpl; + maintainers = [ maintainers.changlinli ]; + platforms = platforms.all; + }; + }; + + arphic-uming = stdenv.mkDerivation rec { + name = "arphic-uming-${version}"; + + version = "0.2.20080216.2"; + + src = fetchurl { + url = "http://archive.ubuntu.com/ubuntu/pool/main/f/fonts-arphic-uming/fonts-arphic-uming_${version}.orig.tar.bz2"; + sha256 = "1ny11n380vn7sryvy1g3a83y3ll4h0jf9wgnrx55nmksx829xhg3"; + }; + + buildInputs = [ mkfontscale mkfontdir ]; + + phases = [ "unpackPhase" "installPhase" ]; + + installPhase = + '' + mkdir -p $out/share/fonts $out/share/fonts/truetype + cp -v uming.ttc $out/share/fonts/truetype/arphic-uming.ttc + cd $out/share/fonts + mkfontdir + mkfontscale + ''; + + meta = with stdenv.lib; { + description = "CJK Unicode font Ming style"; + homepage = https://www.freedesktop.org/wiki/Software/CJKUnifonts/; + + license = licenses.arphicpl; + maintainers = [ maintainers.changlinli ]; + platforms = platforms.all; + }; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 100f9f9c36fb..b25db850cda0 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -474,6 +474,9 @@ with pkgs; arp-scan = callPackage ../tools/misc/arp-scan { }; + inherit (callPackages ../data/fonts/arphic {}) + arphic-ukai arphic-uming; + artyFX = callPackage ../applications/audio/artyFX {}; as31 = callPackage ../development/compilers/as31 {};