2008-08-19 07:55:00 +02:00
|
|
|
args : with args; with builderDefs;
|
|
|
|
let localDefs = builderDefs.meta.function rec {
|
2008-08-07 12:23:20 +02:00
|
|
|
src = "";/* put a fetchurl here */
|
2008-01-25 14:31:59 +01:00
|
|
|
|
2008-08-07 12:23:20 +02:00
|
|
|
buildInputs = [mkfontdir mkfontscale ttmkfdir];
|
|
|
|
configureFlags = [];
|
|
|
|
fontDirs = import ./fonts.nix {inherit pkgs config;};
|
|
|
|
installPhase = FullDepEntry ("
|
|
|
|
list='';
|
|
|
|
for i in ${toString 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;
|
|
|
|
mkdir -p \$out/share/X11-fonts/;
|
|
|
|
for i in \$(find \$fontDirs -type f -o -type l); do
|
|
|
|
j=\${i##*/}
|
|
|
|
if ! test -e \$out/share/X11-fonts/\${j}; then
|
|
|
|
ln -s \$i \$out/share/X11-fonts/\${j};
|
|
|
|
fi;
|
|
|
|
done;
|
|
|
|
cd \$out/share/X11-fonts/
|
|
|
|
rm fonts.dir
|
|
|
|
rm fonts.scale
|
|
|
|
rm fonts.alias
|
|
|
|
mkfontdir
|
|
|
|
mkfontscale
|
|
|
|
mv fonts.scale fonts.scale.old
|
|
|
|
mv fonts.dir fonts.dir.old
|
|
|
|
ttmkfdir
|
|
|
|
cat fonts.scale.old >> fonts.scale
|
|
|
|
cat fonts.dir.old >> fonts.dir
|
|
|
|
rm fonts.dir.old
|
|
|
|
rm fonts.scale.old
|
|
|
|
cat \$( find ${fontalias}/ -name fonts.alias) >fonts.alias
|
|
|
|
") ["minInit" "addInputs"];
|
2008-08-19 07:55:00 +02:00
|
|
|
};
|
2008-08-07 12:23:20 +02:00
|
|
|
in with localDefs;
|
2008-01-25 14:31:59 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2008-08-07 12:23:20 +02:00
|
|
|
name = "X11-fonts";
|
|
|
|
builder = writeScript (name + "-builder")
|
|
|
|
(textClosure localDefs
|
|
|
|
[installPhase doForceShare doPropagate]);
|
|
|
|
meta = {
|
|
|
|
description = "
|
|
|
|
Directory to contain all X11 fonts requested.
|
2008-01-25 14:31:59 +01:00
|
|
|
";
|
2008-08-07 12:23:20 +02:00
|
|
|
};
|
2007-10-05 09:25:13 +02:00
|
|
|
}
|