this derivation will be built:
/nix/store/b5v15x6w83xvayfprmzvdhqanz05c53z-nfstream-6.3.5.drv
building '/nix/store/b5v15x6w83xvayfprmzvdhqanz05c53z-nfstream-6.3.5.drv'...
Sourcing python-remove-tests-dir-hook
Sourcing python-catch-conflicts-hook.sh
Sourcing python-remove-bin-bytecode-hook.sh
Sourcing wheel setup hook
Using wheelUnpackPhase
Sourcing pip-install-hook
Using pipInstallPhase
Sourcing python-imports-check-hook.sh
Using pythonImportsCheckPhase
Sourcing python-namespaces-hook
unpacking sources
Executing wheelUnpackPhase
Finished executing wheelUnpackPhase
patching sources
configuring
no configure script, doing nothing
building
no Makefile, doing nothing
installing
Executing pipInstallPhase
/build/dist /build
Processing ./nfstream-6.3.5-cp39-cp39-manylinux1_x86_64.whl
ERROR: Could not find a version that satisfies the requirement psutil>=5.8.0 (from nfstream)
ERROR: No matching distribution found for psutil>=5.8.0
error: builder for '/nix/store/b5v15x6w83xvayfprmzvdhqanz05c53z-nfstream-6.3.5.drv' failed with exit code 1;
last 10 log lines:
> configuring
> no configure script, doing nothing
> building
> no Makefile, doing nothing
> installing
> Executing pipInstallPhase
> /build/dist /build
> Processing ./nfstream-6.3.5-cp39-cp39-manylinux1_x86_64.whl
> ERROR: Could not find a version that satisfies the requirement psutil>=5.8.0 (from nfstream)
> ERROR: No matching distribution found for psutil>=5.8.0
For full logs, run 'nix log /nix/store/b5v15x6w83xvayfprmzvdhqanz05c53z-nfstream-6.3.5.drv'.
with the following derivation:
with import <nixos-unstable> {};
with python39Packages;
assert (isPy39 || isPy38 || isPy37 || isPy36);
let urls = {
"6.3.5" = {
py36 = {
url = https://files.pythonhosted.org/packages/22/c5/9159521b70d70520a66fcf6554d0d22744bfdb602dc9f3adaa8c6e5cbeb6/nfstream-6.3.5-cp36-cp36m-manylinux1_x86_64.whl;
sha256 = "1qs8rrjaplw29gpgq4348y88nm9hfr0mn9hjak3sk4j8qikbi211";
};
py37 = {
url = https://files.pythonhosted.org/packages/15/19/6fe2b23a85ddf45f689a82133605edd8e6ec908da64d0e5692c4921daa2f/nfstream-6.3.5-cp37-cp37m-manylinux1_x86_64.whl;
sha256 = "1350hlyqv1lrvy4qc3i9lvwacx50vzqpcnjf9rqhn8zccs7rpmdz";
};
py38 = {
url = https://files.pythonhosted.org/packages/19/fb/e722fe1aaf66259ce7e038362935dae948d1038744a6eb344cce92eeceb6/nfstream-6.3.5-cp38-cp38-manylinux1_x86_64.whl;
sha256 = "0x0xbsjg5gb34dshzs5vp4f8ljk6wc4p63pw7728dnl2ashly2hz";
};
py39 = {
url = https://files.pythonhosted.org/packages/b7/90/d70d47c166b6a6cf0d386e62e727276ff6b8824633432f59f10ff640e9f0/nfstream-6.3.5-cp39-cp39-manylinux1_x86_64.whl;
sha256 = "1wqcz4vavay56gf8nn55s67wp61rmyw8s1mzki3b3zbbzwl1zbvy";
};
};
"6.3.4" = {
py36 = {
url = https://files.pythonhosted.org/packages/cc/3a/e0058dcdb991d9730b2c1054d601105b9c5abdff1090f477af295f0129d4/nfstream-6.3.4-pp36-pypy36_pp73-manylinux1_x86_64.whl;
sha256 = "02qcqv4m2wjhfwis09i20b5drgvas22njrmk4jihc0ybm131m7dr";
};
py37 = {
url = https://files.pythonhosted.org/packages/7d/42/1c3fefa074fb506f778ab007d35e323f3c5ebd587e9c7183a497ac830825/nfstream-6.3.4-pp37-pypy37_pp73-manylinux1_x86_64.whl;
sha256 = "1f3d5imnaajl74lbqf8grxk0bbb73j6zrbvajxfmyd6b56l4m4cd";
};
};
};
in
buildPythonApplication rec {
pname = "nfstream";
version = "6.3.5";
format = "wheel";
src = builtins.fetchurl (with urls."${version}"; if isPy36 then py36 else if isPy37 then py37 else if isPy38 then py38 else py39);
buildInputs = [ libgpgerror libgcrypt libpcap ndpi ];
propagatedBuildInputs = [ setuptools ];
nativeBuildInputs = [ autoPatchelfHook ];
meta = with lib; {
description = "Python Framework for network data analytics";
homepage = "https://github.com/nfstream/nfstream";
license = licenses.lgpl3;
maintainers = with maintainers; [ heph2 ];
};
}
i’ve added psutil to “propagatedBuildInputs” and now i got this error
Processing ./nfstream-6.3.5-cp39-cp39-manylinux1_x86_64.whl
Requirement already satisfied: psutil>=5.8.0 in /nix/store/9j2pzpxpr5w9r20vc4zrrzllqmy4mssk-python3.9-psutil-5.8.0/lib/python3.9/site-packages (from nfstream==6.3.5) (5.8.0)
ERROR: Could not find a version that satisfies the requirement dpkt>=1.9.7 (from nfstream)
ERROR: No matching distribution found for dpkt>=1.9.7
error: builder for '/nix/store/3dxq3ryb7a6i6sl15q3xd3zc7w5y26bd-nfstream-6.3.5.drv' failed with exit code 1;
last 10 log lines:
> no configure script, doing nothing
> building
> no Makefile, doing nothing
> installing
> Executing pipInstallPhase
> /build/dist /build
> Processing ./nfstream-6.3.5-cp39-cp39-manylinux1_x86_64.whl
> Requirement already satisfied: psutil>=5.8.0 in /nix/store/9j2pzpxpr5w9r20vc4zrrzllqmy4mssk-python3.9-psutil-5.8.0/lib/python3.9/site-packages (from nfstream==6.3.5) (5.8.0)
> ERROR: Could not find a version that satisfies the requirement dpkt>=1.9.7 (from nfstream)
> ERROR: No matching distribution found for dpkt>=1.9.7
For full logs, run 'nix log /nix/store/3dxq3ryb7a6i6sl15q3xd3zc7w5y26bd-nfstream-6.3.5.drv'.
Have you added it to to the propagatedBuildInputs as well? also i don’t think that adding setuptools to that list is the right thing to do if it’s imported only in the setup.py…
If you want a pure nix-environment, then you’ll need to package the missing dependencies, or use a tool like mach2nix, poetry2nix, or something similar to “bridge the gap”.
I’m not that familiar with python and also with Nix, so my attempt to packaging usually are a bit of a mess…
I’ve tried without wheels and found this error:
Executing pipInstallPhase
/build/dist /build
ERROR: You must give at least one requirement to install (see "pip help install")
error: builder for '/nix/store/zg57m67vvqfycg1prpkwxjsmjasv7hg5-nfstream-6.3.5.drv' failed with exit code 1;
last 10 log lines:
> Finished executing wheelUnpackPhase
> patching sources
> configuring
> no configure script, doing nothing
> building
> no Makefile, doing nothing
> installing
> Executing pipInstallPhase
> /build/dist /build
> ERROR: You must give at least one requirement to install (see "pip help install")
For full logs, run 'nix log /nix/store/zg57m67vvqfycg1prpkwxjsmjasv7hg5-nfstream-6.3.5.drv'.
I saw that libgpg-error and libgcrypt must be compiled statically. How can i specify that only those libs should be statically compiled ?
I’ll watch the video that u linked in the afternoon
Uh that’s neat! At first I thought it would be easier Probably my not familiarity with python doesn’t help me too much. And i’m also having trouble finding the resources to make my own patches…