2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv, fetchurl, perl, bdftopcf
|
2020-04-24 23:36:52 +00:00
|
|
|
, fontforge, SDL, SDL_image, mkfontscale
|
|
|
|
}:
|
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
let
|
|
|
|
perlenv = perl.withPackages (p: with p; [
|
|
|
|
TextCharWidth
|
|
|
|
]);
|
|
|
|
in
|
2020-04-24 23:36:52 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "unscii";
|
2023-07-15 17:15:38 +00:00
|
|
|
version = "2.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2023-07-15 17:15:38 +00:00
|
|
|
url = "http://viznut.fi/${pname}/${pname}-${version}-src.tar.gz";
|
|
|
|
sha256 = "0msvqrq7x36p76a2n5bzkadh95z954ayqa08wxd017g4jpa1a4jd";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs =
|
2021-06-28 23:13:55 +00:00
|
|
|
[ perlenv
|
2020-04-24 23:36:52 +00:00
|
|
|
bdftopcf fontforge SDL SDL_image
|
|
|
|
mkfontscale
|
|
|
|
];
|
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
# Fixes shebang -> wrapper problem on Darwin
|
|
|
|
postPatch = ''
|
|
|
|
for perltool in *.pl; do
|
|
|
|
substituteInPlace Makefile \
|
|
|
|
--replace "./$perltool" "${perlenv}/bin/perl ./$perltool"
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
|
|
|
makeFlags = [
|
|
|
|
"CC=${stdenv.cc.targetPrefix}cc"
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
preConfigure = ''
|
|
|
|
patchShebangs .
|
|
|
|
'';
|
|
|
|
|
|
|
|
postBuild = ''
|
|
|
|
# compress pcf fonts
|
|
|
|
gzip -9 -n *.pcf
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
# install fonts for use in X11 and GTK applications
|
|
|
|
install -m444 -Dt "$out/share/fonts/misc" *.pcf.gz
|
|
|
|
install -m444 -Dt "$out/share/fonts/opentype" *.otf
|
|
|
|
mkfontdir "$out/share/fonts/misc"
|
|
|
|
mkfontscale "$out/share/fonts/opentype"
|
|
|
|
|
|
|
|
# install other formats in $extra
|
|
|
|
install -m444 -Dt "$extra/share/fonts/truetype" *.ttf
|
|
|
|
install -m444 -Dt "$extra/share/fonts/svg" *.svg
|
|
|
|
install -m444 -Dt "$extra/share/fonts/web" *.woff
|
|
|
|
install -m444 -Dt "$extra/share/fonts/misc" *.hex
|
|
|
|
mkfontscale "$extra"/share/fonts/*
|
|
|
|
'';
|
|
|
|
|
|
|
|
outputs = [ "out" "extra" ];
|
|
|
|
|
|
|
|
meta = {
|
2021-01-17 00:15:33 +00:00
|
|
|
description = "Bitmapped character-art-friendly Unicode fonts";
|
2020-04-24 23:36:52 +00:00
|
|
|
# Basically GPL2+ with font exception — because of the Unifont-augmented
|
|
|
|
# version. The reduced version is public domain.
|
|
|
|
license = "http://unifoundry.com/LICENSE.txt";
|
2021-01-15 22:18:51 +00:00
|
|
|
maintainers = [ lib.maintainers.raskin ];
|
2023-07-15 17:15:38 +00:00
|
|
|
homepage = "http://viznut.fi/unscii/";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|