feat: add pillow

This commit is contained in:
phaer 2023-02-20 23:14:29 +01:00 committed by DavHau
parent 9b8df26237
commit b1c8c49015
2 changed files with 60 additions and 0 deletions

View File

@ -0,0 +1,10 @@
{
"content": {
"mach-nix": {
"dists": {
"pillow": "9.3.0"
}
}
},
"invalidationHash": "fdc99ee4445b96e19a326eb1a028ee5783d5fc74cb0111c64739e930585e761e"
}

View File

@ -0,0 +1,50 @@
# Build Pillow from source, without a wheel, and rather
# minimal features - only zlib and libjpeg as dependencies.
{config, lib, ...}: let
l = lib // builtins;
python = config.deps.python;
in {
imports = [
../../drv-parts/mach-nix-xs
];
deps = {nixpkgs, ...}: {
python = nixpkgs.python39;
inherit (nixpkgs)
pkg-config
zlib
libjpeg;
};
nativeBuildInputs = [
config.deps.pkg-config
];
propagatedBuildInputs = [
config.deps.zlib config.deps.libjpeg
];
pname = "pillow";
version = "9.3.0";
env.format = "setuptools";
env.pythonImportsCheck = [
"PIL"
];
preUnpack = ''
export src=$(ls ${config.mach-nix.pythonSources}/names/${config.pname}/*);
'';
mach-nix.pythonSources = config.deps.fetchPythonRequirements {
inherit python;
name = config.pname;
requirementsList = ["${config.pname}==${config.version}"];
hash = "sha256-/7MQ/hi+G3Q+xiDpEIw76chcwFmhKpipAq/4pkSvlm4=";
maxDate = "2023-01-01";
pipFlags = [
"--no-binary" ":all:"
];
};
}