Some more corrections to fontDir; now suitable as fontPath for Xvnc

svn path=/nixos/trunk/; revision=9410
This commit is contained in:
Michael Raskin 2007-10-05 12:51:05 +00:00
parent 9ce2dbf8d3
commit 5c08d306e5
2 changed files with 24 additions and 7 deletions

View File

@ -5,16 +5,32 @@ stdenv.mkDerivation
name="X11-fonts";
phases="installPhase";
fontDirs = import ./fonts.nix {inherit pkgs config;};
buildInputs = [mkfontdir mkfontscale];
inherit fontalias;
installCommand = "
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;
mkdir -p \$out/share/X11-fonts/;
for i in \$fontDirs; do
if ! echo \$i | egrep '~|/nix/var/nix/profiles' &>/dev/null; then
j=\${i#/nix/store/}
j=\${j%%/*}
if ! test -e \$out/share/X11-fonts/\${j}; then
ln -s \$i \$out/share/X11-fonts/\${j};
fi;
for i in \$(find \$fontDirs -type f); 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
mkfontdir
mkfontscale
cat \$( find \$fontalias/ -name fonts.alias) >fonts.alias
";
}

View File

@ -166,6 +166,7 @@ rec {
fontDir = import ./fontdir.nix {
inherit (pkgs) stdenv;
inherit pkgs config;
inherit (pkgs.xorg) mkfontdir mkfontscale fontalias;
};
# The wrapper setuid programs (since we can't have setuid programs