2021-01-15 08:29:18 +01:00
|
|
|
{ lib, stdenv, fetchurl, perl, bdftopcf
|
2020-02-17 11:57:28 +01:00
|
|
|
, fontforge, SDL, SDL_image, mkfontscale
|
|
|
|
}:
|
|
|
|
|
2021-06-14 03:23:25 +02:00
|
|
|
let
|
|
|
|
perlenv = perl.withPackages (p: with p; [
|
|
|
|
TextCharWidth
|
|
|
|
]);
|
|
|
|
in
|
2016-12-15 21:19:39 +01:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "unscii";
|
|
|
|
version = "1.1";
|
2020-02-17 11:57:28 +01:00
|
|
|
|
2016-12-15 21:19:39 +01:00
|
|
|
src = fetchurl {
|
2019-08-15 14:41:18 +02:00
|
|
|
url = "http://pelulamu.net/${pname}/${pname}-${version}-src.tar.gz";
|
2016-12-15 21:19:39 +01:00
|
|
|
sha256 = "0qcxcnqz2nlwfzlrn115kkp3n8dd7593h762vxs6vfqm13i39lq1";
|
|
|
|
};
|
2020-02-17 11:57:28 +01:00
|
|
|
|
|
|
|
nativeBuildInputs =
|
2021-06-14 03:23:25 +02:00
|
|
|
[ perlenv
|
2020-02-17 11:57:28 +01:00
|
|
|
bdftopcf fontforge SDL SDL_image
|
|
|
|
mkfontscale
|
|
|
|
];
|
|
|
|
|
2021-06-14 03:23:25 +02: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"
|
|
|
|
];
|
|
|
|
|
2016-12-15 21:19:39 +01:00
|
|
|
preConfigure = ''
|
|
|
|
patchShebangs .
|
|
|
|
'';
|
2020-02-17 11:57:28 +01:00
|
|
|
|
|
|
|
postBuild = ''
|
|
|
|
# compress pcf fonts
|
|
|
|
gzip -9 -n *.pcf
|
|
|
|
'';
|
|
|
|
|
2016-12-15 21:19:39 +01:00
|
|
|
installPhase = ''
|
2020-02-17 11:57:28 +01:00
|
|
|
# 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/*
|
2016-12-15 21:19:39 +01:00
|
|
|
'';
|
2017-08-12 16:22:45 +02:00
|
|
|
|
2020-02-17 11:57:28 +01:00
|
|
|
outputs = [ "out" "extra" ];
|
|
|
|
|
2016-12-15 21:19:39 +01:00
|
|
|
meta = {
|
2021-01-16 05:20:42 +01:00
|
|
|
description = "Bitmapped character-art-friendly Unicode fonts";
|
2016-12-15 21:19:39 +01:00
|
|
|
# Basically GPL2+ with font exception — because of the Unifont-augmented
|
|
|
|
# version. The reduced version is public domain.
|
2020-04-01 03:11:51 +02:00
|
|
|
license = "http://unifoundry.com/LICENSE.txt";
|
2021-01-15 08:29:18 +01:00
|
|
|
maintainers = [ lib.maintainers.raskin ];
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "http://pelulamu.net/unscii/";
|
2016-12-15 21:19:39 +01:00
|
|
|
};
|
|
|
|
}
|