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