Merge: solve unfree xorg.fontbhttf

Fixes #17571.
This commit is contained in:
Vladimír Čunát 2016-08-29 22:41:10 +02:00
commit e6f1028340
9 changed files with 23 additions and 15 deletions

View File

@ -22,7 +22,7 @@ with lib;
config = {
fonts.fonts =
[ pkgs.xorg.fontbhttf
[
pkgs.xorg.fontbhlucidatypewriter100dpi
pkgs.xorg.fontbhlucidatypewriter75dpi
pkgs.dejavu_fonts

View File

@ -13,6 +13,8 @@ stdenv.mkDerivation rec {
sha256 = "1xknlg2h287dx34v2n5r33bpcl4biqf0cv7nak657rjki7s0k4bk";
};
outputs = [ "out" "minimal" ];
buildFlags = "full-ttf";
preBuild = "patchShebangs scripts";
@ -22,6 +24,10 @@ stdenv.mkDerivation rec {
for i in $(find build -name '*.ttf'); do
cp $i $out/share/fonts/truetype;
done;
'' + ''
local fname=share/fonts/truetype/DejaVuSans.ttf
moveToOutput "$fname" "$minimal"
ln -s "$minimal/$fname" "$out/$fname"
'';
meta = {

View File

@ -1,4 +1,4 @@
{ stdenv, fetchurl, fetchpatch, pkgconfig, freetype, expat, libxslt, fontbhttf
{ stdenv, fetchurl, fetchpatch, pkgconfig, freetype, expat, libxslt, dejavu_fonts
, substituteAll }:
/** Font configuration scheme
@ -44,8 +44,8 @@ stdenv.mkDerivation rec {
configureFlags = [
"--with-cache-dir=/var/cache/fontconfig" # otherwise the fallback is in $out/
"--disable-docs"
# just ~1MB; this is what you get when loading config fails for some reason
"--with-default-fonts=${fontbhttf}"
# just <1MB; this is what you get when loading config fails for some reason
"--with-default-fonts=${dejavu_fonts.minimal}"
];
# We should find a better way to access the arch reliably.
@ -66,7 +66,7 @@ stdenv.mkDerivation rec {
postInstall = ''
cd "$out/etc/fonts"
"${libxslt.bin}/bin/xsltproc" --stringparam fontDirectories "${fontbhttf}" \
"${libxslt.bin}/bin/xsltproc" --stringparam fontDirectories "${dejavu_fonts.minimal}" \
--stringparam fontconfigConfigVersion "${configVersion}" \
--path $out/share/xml/fontconfig \
${./make-fonts-conf.xsl} $out/etc/fonts/fonts.conf \

View File

@ -1,4 +1,4 @@
{ runCommand, lib, writeText, fontconfig, fontbhttf, fontDirectories }:
{ runCommand, lib, writeText, fontconfig, fontDirectories }:
runCommand "fc-cache"
rec {

View File

@ -1,10 +1,10 @@
{ runCommand, libxslt, fontconfig, fontbhttf, fontDirectories }:
{ runCommand, libxslt, fontconfig, dejavu_fonts, fontDirectories }:
runCommand "fonts.conf"
{
buildInputs = [ libxslt fontconfig ];
# Add a default font for non-nixos systems. fontbhttf is only about 1mb.
fontDirectories = fontDirectories ++ [ fontbhttf ];
# Add a default font for non-nixos systems, <1MB and in nixos defaults.
fontDirectories = fontDirectories ++ [ dejavu_fonts.minimal ];
}
''
xsltproc --stringparam fontDirectories "$fontDirectories" \

View File

@ -28,6 +28,10 @@ in
buildInputs = attrs.buildInputs ++ [ xorg.mkfontscale ];
};
fontbhttf = attrs: attrs // {
meta = attrs.meta // { license = lib.licenses.unfreeRedistributable; };
};
fontcursormisc = attrs: attrs // {
buildInputs = attrs.buildInputs ++ [ xorg.mkfontscale ];
};

View File

@ -60,7 +60,6 @@ let
sudo launchctl load -w /Library/LaunchDaemons/$daemonName
'';
fontDirs = [
xorg.fontbhttf
xorg.fontbhlucidatypewriter100dpi
xorg.fontbhlucidatypewriter75dpi
ttf_bitstream_vera

View File

@ -29,9 +29,8 @@ stdenv.mkDerivation rec {
buildInputs = [
git autoconf automake gnum4 libtool perl pkgconfig gettext uthash
python freetype zlib glib libungif libpng libjpeg libtiff libxml2
pango
]
++ lib.optionals withGTK [ gtk2 ]
++ lib.optionals withGTK [ gtk2 pango ]
++ lib.optionals (withGTK && stdenv.isDarwin) [ Carbon Cocoa ];
configureFlags =

View File

@ -6537,7 +6537,7 @@ in
licenseAccepted = (config.neoload.accept_license or false);
fontsConf = makeFontsConf {
fontDirectories = [
xorg.fontbhttf
dejavu_fonts.minimal
];
};
};
@ -13726,7 +13726,7 @@ in
bluez5 = bluez5_28;
fontsConf = makeFontsConf {
fontDirectories = [
freefont_ttf xorg.fontmiscmisc xorg.fontbhttf
freefont_ttf xorg.fontmiscmisc
];
};
clucene_core = clucene_core_2;
@ -13745,7 +13745,7 @@ in
bluez5 = bluez5_28;
fontsConf = makeFontsConf {
fontDirectories = [
freefont_ttf xorg.fontmiscmisc xorg.fontbhttf
freefont_ttf xorg.fontmiscmisc
];
};
mdds = mdds_0_12_1;