2007-10-05 09:25:13 +02:00
|
|
|
args:
|
|
|
|
with args;
|
|
|
|
stdenv.mkDerivation
|
|
|
|
{
|
|
|
|
name="X11-fonts";
|
|
|
|
phases="installPhase";
|
|
|
|
fontDirs = import ./fonts.nix {inherit pkgs config;};
|
2007-10-05 14:51:05 +02:00
|
|
|
buildInputs = [mkfontdir mkfontscale];
|
|
|
|
inherit fontalias;
|
2007-10-05 09:45:56 +02:00
|
|
|
installCommand = "
|
2007-10-05 14:51:05 +02:00
|
|
|
list='';
|
|
|
|
for i in \$fontDirs ; do
|
|
|
|
if [ -d \$i/ ]; then
|
|
|
|
list=\"\$list \$i\";
|
|
|
|
fi;
|
|
|
|
done
|
|
|
|
list=\$(find \$list -name fonts.dir);
|
|
|
|
fontDirs='';
|
|
|
|
for i in \$list ; do
|
|
|
|
fontDirs=\"\$fontDirs \$(dirname \$i)\";
|
|
|
|
done;
|
2007-10-05 09:25:13 +02:00
|
|
|
mkdir -p \$out/share/X11-fonts/;
|
2007-12-25 13:16:38 +01:00
|
|
|
for i in \$(find \$fontDirs -type f -o -type l); do
|
2007-10-05 14:51:05 +02:00
|
|
|
j=\${i##*/}
|
|
|
|
if ! test -e \$out/share/X11-fonts/\${j}; then
|
|
|
|
ln -s \$i \$out/share/X11-fonts/\${j};
|
2007-10-05 09:25:13 +02:00
|
|
|
fi;
|
|
|
|
done;
|
2007-10-05 14:51:05 +02:00
|
|
|
cd \$out/share/X11-fonts/
|
|
|
|
rm fonts.dir
|
|
|
|
rm fonts.scale
|
2007-12-25 13:16:38 +01:00
|
|
|
rm fonts.alias
|
2007-10-05 14:51:05 +02:00
|
|
|
mkfontdir
|
|
|
|
mkfontscale
|
|
|
|
cat \$( find \$fontalias/ -name fonts.alias) >fonts.alias
|
2007-10-05 09:25:13 +02:00
|
|
|
";
|
|
|
|
}
|