nixpkgs/pkgs/tools/misc/nanoemoji/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

73 lines
1.5 KiB
Nix
Raw Normal View History

2023-07-17 21:17:41 +02:00
{ lib
, python3
, fetchFromGitHub
, resvg
, pngquant
}:
python3.pkgs.buildPythonApplication rec {
pname = "nanoemoji";
version = "0.15.1";
src = fetchFromGitHub {
owner = "googlefonts";
repo = pname;
rev = "v${version}";
hash = "sha256-P/lT0PnjTdYzyttICzszu4OL5kj+X8GHZ8doL3tpXQM=";
};
patches = [
# this is necessary because the tests clear PATH/PYTHONPATH otherwise
./test-pythonpath.patch
# minor difference in the test output, most likely due to different dependency versions
./fix-test.patch
];
nativeBuildInputs = with python3.pkgs; [
setuptools-scm
pythonRelaxDepsHook
pngquant
resvg
];
# these two packages are just prebuilt wheels containing the respective binaries
pythonRemoveDeps = [ "pngquant-cli" "resvg-cli" ];
propagatedBuildInputs = with python3.pkgs; [
absl-py
fonttools
lxml
ninja
2023-07-17 21:17:41 +02:00
picosvg
pillow
regex
toml
tomlkit
ufo2ft
ufoLib2
zopfli
];
nativeCheckInputs = with python3.pkgs; [
pytestCheckHook
ninja
2023-07-17 21:17:41 +02:00
picosvg
];
makeWrapperArgs = [
"--prefix PATH : ${lib.makeBinPath [ pngquant resvg ]}"
];
preCheck = ''
# make sure the built binaries (nanoemoji/maximum_color) can be found by the test
2023-07-21 14:57:26 +02:00
export PATH="$out/bin:$PATH"
2023-07-17 21:17:41 +02:00
'';
meta = with lib; {
description = "A wee tool to build color fonts";
homepage = "https://github.com/googlefonts/nanoemoji";
license = licenses.asl20;
maintainers = with maintainers; [ _999eagle ];
};
}