-
-
Notifications
You must be signed in to change notification settings - Fork 13.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
python3Packages.opencv4: fix installation metadata #153373
Conversation
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/how-to-give-opencv-dependency-to-python-package/16949/8 |
Well, this is a net improvement for now. Going to merge for now, we can do further work if it still falls short in some way. |
Would this allow discarding all the scattered patches that remove $ ag opencv-python
pkgs/applications/science/robotics/mavproxy/default.nix
15: --replace "opencv-python" ""
pkgs/applications/video/manim/remove-dependency-constraints.patch
13:-opencv-python==3.4.2.17
pkgs/servers/home-assistant/component-packages.nix
612: "opencv" = ps: with ps; [ numpy ]; # missing inputs: opencv-python-headless
pkgs/development/python-modules/baselines/default.nix
46: # in nixos anyways. Since opencv-python is not currently packaged, we
48: sed -ie '/opencv-python/d' setup.py
pkgs/development/python-modules/imagecorruptions/default.nix
20: --replace "'opencv-python >= 3.4.5'," ""
pkgs/development/python-modules/imantics/default.nix
32: --replace "'opencv-python>=3'," ""
pkgs/development/python-modules/imgaug/default.nix
28: --replace "opencv-python-headless" ""
30: --replace "opencv-python-headless" "" EDIT: Unfortunately not. Most packages declare a requirement of |
@@ -333,6 +338,21 @@ stdenv.mkDerivation { | |||
postInstall = '' | |||
sed -i "s|{exec_prefix}/$out|{exec_prefix}|;s|{prefix}/$out|{prefix}|" \ | |||
"$out/lib/pkgconfig/opencv4.pc" | |||
'' | |||
# install python distribution information, so other packages can `import opencv` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think other packages do import cv2
and it has always worked with python3Packages.opencv4
? What hadn't worked is setuptools checking for requirements
Motivation for this change
Also install the installation metadata and other python files, so other modules can correctly import the module.
before:
after:
Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)nixos/doc/manual/md-to-db.sh
to update generated release notes