Merge pull request #79633 from rnhmjoj/ttyp0

uw-ttyp0: split outputs in out and otb
This commit is contained in:
Michele Guerini Rocco 2020-02-14 19:56:20 +01:00 committed by GitHub
commit f2c62a920f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -19,10 +19,6 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ perl bdftopcf bdf2psf fonttosfnt mkfontdir ];
outputHashAlgo = "sha256";
outputHashMode = "recursive";
outputHash = "0hzhaakbbcnz5ksi5p8mavw9578rsqlqadkrirrkhfnyqqlrii4j";
# configure sizes, encodings and variants
preConfigure =
(if targetsDat == null
@ -45,7 +41,7 @@ stdenv.mkDerivation rec {
else ''cp "${variantsDat}" VARIANTS.dat'');
postBuild = ''
# convert bdf to psf and otb fonts
# convert bdf fonts to psf
build=$(pwd)
mkdir {psf,otb}
cd ${bdf2psf}/share/bdf2psf
@ -55,19 +51,37 @@ stdenv.mkDerivation rec {
--fb "$i" standard.equivalents \
ascii.set+useful.set+linux.set 512 \
"$build/psf/$name.psf"
done
cd -
# convert unicode bdf fonts to otb
for i in $build/genbdf/*-uni.bdf; do
name="$(basename $i .bdf)"
fonttosfnt -v -o "$build/otb/$name.otb" "$i"
done
cd $build
'';
postInstall = ''
# install psf fonts
fontDir="$out/share/consolefonts"
mkdir -p "$fontDir"
mv -t "$fontDir" psf/*.psf
mv -t "$out/share/fonts/X11/misc" otb/*.otb
install -m 644 -D psf/*.psf -t "$fontDir"
# install otb fonts
fontDir="$otb/share/fonts/X11/misc"
install -m 644 -D otb/*.otb -t "$fontDir"
mkfontdir "$fontDir"
'';
# Nix with multiple outputs adds several flags
# that the ./configure script doesn't understand.
configurePhase = ''
runHook preConfigure
./configure --prefix="$out"
runHook postConfigure
'';
outputs = [ "out" "otb" ];
meta = with stdenv.lib; {
description = "Monospace bitmap screen fonts for X11";
homepage = https://people.mpi-inf.mpg.de/~uwe/misc/uw-ttyp0/;