nixpkgs/pkgs/by-name/te/tewi-font/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

60 lines
1.4 KiB
Nix

{ lib, stdenv, fetchFromGitHub, python3
, bdftopcf, xorg
, libfaketime,
}:
stdenv.mkDerivation rec {
pname = "tewi-font";
version = "2.0.2";
src = fetchFromGitHub {
owner = "lucy";
repo = pname;
rev = version;
sha256 = "1axv9bv10xlcmgfyjh3z5kn5fkg3m6n1kskcs5hvlmyb6m1zk91j";
};
nativeBuildInputs =
[ python3 bdftopcf xorg.mkfontscale
libfaketime xorg.fonttosfnt
];
postPatch = ''
# make gzip deterministic
sed 's/gzip -9/gzip -9 -n/g' -i Makefile
# fix python not found
patchShebangs scripts/merge
'';
postBuild = ''
# convert bdf fonts to otb
for i in *.bdf; do
name=$(basename "$i" .bdf)
faketime -f "1970-01-01 00:00:01" \
fonttosfnt -v -o "$name.otb" "$i"
done
'';
installPhase = ''
fontDir="$out/share/fonts/misc"
install -m 644 -D *.otb out/* -t "$fontDir"
mkfontdir "$fontDir"
'';
meta = with lib; {
description = "Nice bitmap font, readable even at small sizes";
longDescription = ''
Tewi is a bitmap font, readable even at very small font sizes. This is
particularily useful while programming, to fit a lot of code on your
screen.
'';
homepage = "https://github.com/lucy/tewi-font";
license = {
fullName = "GNU General Public License with a font exception";
url = "https://www.gnu.org/licenses/gpl-faq.html#FontException";
};
maintainers = [ maintainers.fro_ozen ];
};
}