mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 13:41:26 +00:00
4a7f99d55d
Part of: https://github.com/NixOS/nixpkgs/issues/108938 meta = with stdenv.lib; is a widely used pattern. We want to slowly remove the `stdenv.lib` indirection and encourage people to use `lib` directly. Thus let’s start with the meta field. This used a rewriting script to mostly automatically replace all occurances of this pattern, and add the `lib` argument to the package header if it doesn’t exist yet. The script in its current form is available at https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
60 lines
1.4 KiB
Nix
60 lines
1.4 KiB
Nix
{ lib, stdenv, fetchFromGitHub, python3
|
|
, bdftopcf, mkfontscale
|
|
, libfaketime, fonttosfnt
|
|
}:
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "tewi-font";
|
|
version = "2.0.2";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "lucy";
|
|
repo = pname;
|
|
rev = version;
|
|
sha256 = "1axv9bv10xlcmgfyjh3z5kn5fkg3m6n1kskcs5hvlmyb6m1zk91j";
|
|
};
|
|
|
|
nativeBuildInputs =
|
|
[ python3 bdftopcf mkfontscale
|
|
libfaketime 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 = "A 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 ];
|
|
};
|
|
}
|