nixpkgs-suyu/pkgs/data/fonts/dejavu-fonts/default.nix

47 lines
1.3 KiB
Nix
Raw Normal View History

{fetchurl, stdenv, fontforge, perl, fontconfig, FontTTF}:
2015-06-22 22:42:40 +02:00
let version = "2.35" ; in
stdenv.mkDerivation rec {
name = "dejavu-fonts-${version}";
#fontconfig is needed only for fc-lang (?)
buildInputs = [fontforge perl FontTTF];
unicodeData = fetchurl {
2013-11-25 23:28:09 +01:00
url = http://www.unicode.org/Public/6.1.0/ucd/UnicodeData.txt ;
sha256 = "1bd6zkzvxfnifrn5nh171ywk7q56sgk8gdvdn43z9i53hljjcrih";
};
blocks = fetchurl {
2013-11-25 23:28:09 +01:00
url = http://www.unicode.org/Public/6.1.0/ucd/Blocks.txt;
sha256 = "0w0vkb09nrlc6mrhqyl9npszdi828afgvhvlb1vs5smjv3h8y3dz";
};
src = fetchurl {
url = "mirror://sourceforge/dejavu/dejavu-fonts-${version}.tar.bz2";
2015-06-22 22:42:40 +02:00
sha256 = "1xdbi4llrq1qbkd73352ibrfqcbz93dww8hab216qz5szd95yvv4";
};
buildFlags = "full-ttf";
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 -t resources/
ln -s ${unicodeData} resources/UnicodeData.txt
ln -s ${blocks} resources/Blocks.txt
'';
installPhase = ''
mkdir -p $out/share/fonts/truetype
for i in $(find build -name '*.ttf'); do
cp $i $out/share/fonts/truetype;
done;
'';
meta = {
platforms = stdenv.lib.platforms.linux;
};
}