From 7ffdd3a997a51f8a5f7d0400f920641475e95aa5 Mon Sep 17 00:00:00 2001 From: Michael Raskin <7c6f434c@mail.ru> Date: Sun, 2 Mar 2008 18:39:33 +0000 Subject: [PATCH] Bunch of Unicode fonts. svn path=/nixpkgs/trunk/; revision=10909 --- pkgs/data/fonts/clearlyU/1.9.nix | 30 +++++++++++++++++++ pkgs/data/fonts/dejavu-fonts/default.nix | 28 +++++++++++++++++ pkgs/data/fonts/mph-2b-damase/default.nix | 17 +++++++++++ .../fonts/redhat-liberation-fonts/default.nix | 14 +++++++++ pkgs/data/fonts/unifont/default.nix | 26 ++++++++++++++++ pkgs/data/fonts/wqy_zenhei/0.4.23-1.nix | 28 +++++++++++++++++ 6 files changed, 143 insertions(+) create mode 100644 pkgs/data/fonts/clearlyU/1.9.nix create mode 100644 pkgs/data/fonts/dejavu-fonts/default.nix create mode 100644 pkgs/data/fonts/mph-2b-damase/default.nix create mode 100644 pkgs/data/fonts/redhat-liberation-fonts/default.nix create mode 100644 pkgs/data/fonts/unifont/default.nix create mode 100644 pkgs/data/fonts/wqy_zenhei/0.4.23-1.nix diff --git a/pkgs/data/fonts/clearlyU/1.9.nix b/pkgs/data/fonts/clearlyU/1.9.nix new file mode 100644 index 000000000000..1414268cd82a --- /dev/null +++ b/pkgs/data/fonts/clearlyU/1.9.nix @@ -0,0 +1,30 @@ +args : with args; with builderDefs {src="";} null; + let localDefs = builderDefs (rec { + src = /* put a fetchurl here */ + fetchurl { + url = http://crl.nmsu.edu/~mleisher/cu/cu12-1.9.tar.gz; + sha256 = "0256h6f3ky529jc39hh0nvkngy48a0x3gss2z81g5ddi1qzfw0pn"; + }; + buildInputs = [mkfontdir mkfontscale]; + configureFlags = []; + doInstall = FullDepEntry ('' + tar xf ${src} + ensureDir $out/share/fonts/ + cp *.bdf $out/share/fonts + cd $out/share/fonts + mkfontdir + mkfontscale + '') ["minInit" "defEnsureDir" "addInputs"]; + }) null; /* null is a terminator for sumArgs */ + in with localDefs; +stdenv.mkDerivation rec { + name = "clearlyU-12-"+version; + builder = writeScript (name + "-builder") + (textClosure localDefs + [doInstall doForceShare doPropagate]); + meta = { + description = " + A Unicode font. +"; + }; +} diff --git a/pkgs/data/fonts/dejavu-fonts/default.nix b/pkgs/data/fonts/dejavu-fonts/default.nix new file mode 100644 index 000000000000..72eb801fd297 --- /dev/null +++ b/pkgs/data/fonts/dejavu-fonts/default.nix @@ -0,0 +1,28 @@ +args: with args; + +stdenv.mkDerivation { + name = "dejavu-fonts-2.23"; + #fontconfig is needed only for fc-lang (?) + buildInputs = [fontforge perl perlFontTTF]; + src = fetchurl { + url = mirror://sourceforge/dejavu/dejavu-fonts-2.23.tar.bz2; + sha256 = "0gifaxiianls54i05yw5gxhi2a0j9jmy5p0q58ym4l9fxv5drnhn"; + }; + preBuild = '' + sed -e s@/usr/bin/env@$(type -tP env)@ -i scripts/* + sed -e s@/usr/bin/perl@$(type -tP perl)@ -i scripts/* + mkdir resources + tar xf ${fontconfig.src} --wildcards '*/fc-lang' + ln -s $PWD/fontconfig-*/fc-lang resources/ + ln -s ${perl}/lib/*/unicore/* resources/ + ''; + installPhase = '' + ensureDir $out/share/fonts/truetype + for i in $(find build -name '*.ttf'); do + cp $i $out/share/fonts/truetype; + done; + ensureDir $out/share/dejavu-fonts + cp -r build/* $out/share/dejavu-fonts + ''; +} + diff --git a/pkgs/data/fonts/mph-2b-damase/default.nix b/pkgs/data/fonts/mph-2b-damase/default.nix new file mode 100644 index 000000000000..ceca85a0d231 --- /dev/null +++ b/pkgs/data/fonts/mph-2b-damase/default.nix @@ -0,0 +1,17 @@ +{stdenv, fetchurl, unzip}: + +stdenv.mkDerivation { + name = "MPH-2B-Damase"; + src = fetchurl { + url = http://www.wazu.jp/downloads/damase_v.2.zip; + sha256 = "0y7rakbysjjrzcc5y100hkn64j7js434x20pyi6rllnw2w2n1y1h"; + }; + buildInputs = [unzip]; + unpackPhase = '' + unzip $src; + ''; + installPhase = '' + ensureDir $out/share/fonts/truetype + cp *.ttf $out/share/fonts/truetype + ''; +} diff --git a/pkgs/data/fonts/redhat-liberation-fonts/default.nix b/pkgs/data/fonts/redhat-liberation-fonts/default.nix new file mode 100644 index 000000000000..d88d5ff7b1d1 --- /dev/null +++ b/pkgs/data/fonts/redhat-liberation-fonts/default.nix @@ -0,0 +1,14 @@ +{stdenv, fetchurl}: + +stdenv.mkDerivation { + name = "freefont-ttf-20060126"; + src = fetchurl { + url = http://www.redhat.com/f/fonts/liberation-fonts-ttf-3.tar.gz; + sha256 = "13zzyqyi3mf676aj3fg9122asyykpx94mk689r1p2ab1axyg4k0p"; + }; + installPhase = '' + ensureDir $out/share/fonts/truetype + cp *.ttf $out/share/fonts/truetype + ''; +} + diff --git a/pkgs/data/fonts/unifont/default.nix b/pkgs/data/fonts/unifont/default.nix new file mode 100644 index 000000000000..3ffc5eabf93e --- /dev/null +++ b/pkgs/data/fonts/unifont/default.nix @@ -0,0 +1,26 @@ +args: with args; with debPackage; +debBuild ({ + src = fetchurl { + url = mirror://debian/main/u/unifont/unifont_1.0.orig.tar.gz; + sha256 = "0bg8d6c7w51n5409g0n7vqk3aagbzb5aird5r02vw0yz7w6i729l"; + }; + patch = fetchurl { + url = mirror://debian/main/u/unifont/unifont_1.0-4.diff.gz; + sha256 = "08j0rrf7hc05izchmsx9f9hg7vnyqdvbmba4b9jl8wfhvd1b09fd"; + }; + name = "unifont-1.0-4"; + buildInputs = [mkfontscale mkfontdir bdftopcf fontutil perl]; + meta = { + description = "Unicode font for Base Multilingual Plane."; + }; + extraReplacements = ''sed -e s@/usr/bin/perl@${perl}/bin/perl@ -i hex2bdf.unsplit''; + omitConfigure = true; + Install = '' + ensureDir $out/share/fonts + cp unifont.pcf $out/share/fonts + cd $out/share/fonts + mkfontdir + mkfontscale + ''; + extraInstallDeps = ["defEnsureDir"]; +} // args) diff --git a/pkgs/data/fonts/wqy_zenhei/0.4.23-1.nix b/pkgs/data/fonts/wqy_zenhei/0.4.23-1.nix new file mode 100644 index 000000000000..635b3cf9a49d --- /dev/null +++ b/pkgs/data/fonts/wqy_zenhei/0.4.23-1.nix @@ -0,0 +1,28 @@ +args : with args; with builderDefs {src="";} null; + let localDefs = builderDefs (rec { + src = /* put a fetchurl here */ + fetchurl { + url = http://prdownloads.sourceforge.net/wqy/wqy-zenhei-0.4.23-1.tar.gz; + sha256 = "138nn81ai240av0xvcq4ab3rl73n0qlj3gwr3a36i63ry8vdj5qm"; + }; + + buildInputs = []; + configureFlags = []; + doInstall = FullDepEntry ('' + ensureDir $out/share/fonts + cp *.ttf $out/share/fonts + '') ["minInit" "addInputs" "doUnpack" "defEnsureDir"]; + }) null; /* null is a terminator for sumArgs */ + in with localDefs; +stdenv.mkDerivation rec { + name = "wqy-zenhei-"+version; + builder = writeScript (name + "-builder") + (textClosure localDefs + [doInstall doForceShare doPropagate]); + meta = { + description = " + A (mainly) Chinese Unicode font. +"; + }; +} +