mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-17 09:34:36 +00:00
Merge pull request #9510 from rnhmjoj/gohufont-branch
gohufont: add console version
This commit is contained in:
commit
23ea5e89f5
@ -1,26 +1,59 @@
|
|||||||
{ stdenv, fetchurl, mkfontdir, mkfontscale }:
|
{ stdenv, fetchurl, mkfontdir, mkfontscale, bdf2psf }:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
name = "gohufont-2.0";
|
name = "gohufont-2.0";
|
||||||
|
|
||||||
src = fetchurl {
|
pcf = fetchurl {
|
||||||
url = "http://font.gohu.org/gohufont-2.0.tar.gz";
|
url = "http://font.gohu.org/gohufont-2.0.tar.gz";
|
||||||
sha256 = "0vi87fvj3m52piz2k6vqday03cah6zvz3dzrvjch3qjna1i1nb7s";
|
sha256 = "0vi87fvj3m52piz2k6vqday03cah6zvz3dzrvjch3qjna1i1nb7s";
|
||||||
};
|
};
|
||||||
|
|
||||||
buildInputs = [ mkfontdir mkfontscale ];
|
bdf = fetchurl {
|
||||||
|
url = "http://font.gohu.org/gohufont-bdf-2.0.tar.gz";
|
||||||
|
sha256 = "0rqqavhqbs7pajcblg92mjlz2dxk8b60vgdh271axz7kjs2wf9mr";
|
||||||
|
};
|
||||||
|
|
||||||
|
buildInputs = [ mkfontdir mkfontscale bdf2psf ];
|
||||||
|
|
||||||
|
unpackPhase = ''
|
||||||
|
mkdir pcf bdf
|
||||||
|
tar -xzf $pcf --strip-components=1 -C pcf
|
||||||
|
tar -xzf $bdf --strip-components=1 -C bdf
|
||||||
|
'';
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
|
# convert bdf to psf fonts
|
||||||
|
sourceRoot="$(pwd)"
|
||||||
|
mkdir psf
|
||||||
|
|
||||||
|
cd "${bdf2psf}/usr/share/bdf2psf"
|
||||||
|
for i in $sourceRoot/bdf/*.bdf; do
|
||||||
|
bdf2psf --fb $i standard.equivalents \
|
||||||
|
ascii.set+useful.set+linux.set 512 \
|
||||||
|
"$sourceRoot/psf/$(basename $i .bdf).psf"
|
||||||
|
done
|
||||||
|
cd "$sourceRoot"
|
||||||
|
|
||||||
|
# install the psf fonts (for the virtual console)
|
||||||
|
fontDir="$out/share/consolefonts"
|
||||||
|
mkdir -p "$fontDir"
|
||||||
|
mv psf/*.psf "$fontDir"
|
||||||
|
|
||||||
|
|
||||||
|
# install the pcf fonts (for xorg applications)
|
||||||
fontDir="$out/share/fonts/misc"
|
fontDir="$out/share/fonts/misc"
|
||||||
mkdir -p "$fontDir"
|
mkdir -p "$fontDir"
|
||||||
mv *.pcf.gz "$fontDir"
|
mv pcf/*.pcf.gz "$fontDir"
|
||||||
|
|
||||||
cd "$fontDir"
|
cd "$fontDir"
|
||||||
mkfontdir
|
mkfontdir
|
||||||
mkfontscale
|
mkfontscale
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
description = "A monospace bitmap font well suited for programming and terminal use";
|
description = ''
|
||||||
|
A monospace bitmap font well suited for programming and terminal use
|
||||||
|
'';
|
||||||
homepage = http://font.gohu.org/;
|
homepage = http://font.gohu.org/;
|
||||||
license = licenses.wtfpl;
|
license = licenses.wtfpl;
|
||||||
maintainers = with maintainers; [ epitrochoid ];
|
maintainers = with maintainers; [ epitrochoid ];
|
||||||
|
Loading…
Reference in New Issue
Block a user