Skip to content
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

opencv: enable videoio on darwin #97633

Merged
merged 1 commit into from Sep 16, 2020
Merged

Conversation

@marsam
Copy link
Contributor

marsam commented Sep 10, 2020

Motivation for this change

Fixes #97575
cc: @jeff-hykin @mjlbach

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
@marsam marsam force-pushed the marsam:enable-opencv-videoio-darwin branch from 41c6edf to 1966a0a Sep 11, 2020
@mjlbach
Copy link
Contributor

mjlbach commented Sep 11, 2020

@jeff-hykin Can you test? I don't use this functionality. Otherwise LGTM.

@jeff-hykin
Copy link

jeff-hykin commented Sep 11, 2020

Yeah, I'm happy too. I might need to wait till next week since I'm got deadlines atm.

Something that might slow it down a bit more is, I'm not sure how point nix towards a specific branch/commit. So advice on that would be appreciated, but I can probably figure it out with the docs if needed. I have to learn it anyways for a separate nix issue.

Edit: Ah looks like you already mentioned how in the issue post
nix-shell -I nixpkgs=/path/to/local/nixpkgs -p opencv4

@jeff-hykin
Copy link

jeff-hykin commented Sep 11, 2020

I'll need python to test with it. e.g. nix-shell -I nixpkgs=./nixpkgs -p opencv4 isn't enough for me to test. Copying from my shell.nix, I tried nix-shell -I nixpkgs=./nixpkgs -p python37.opencv4 but that failed so I'm going to have to spend more time on it another day.

nix-shell -I nixpkgs=./nixpkgs -p opencv4 did compile opencv for me on Sierra without errors though

Note: my system also might not be the most representative since I've got opencv installed in many forms already. I'll use --pure to help limit the external interaction though

@mjlbach
Copy link
Contributor

mjlbach commented Sep 12, 2020

@jeff-hykin There are a lot of ways to test this PR. You might want to look into nixpkgs-review

cd to your local checkout of nixpkgs, and run the following command to test:

nixpkgs-review pr --checkout commit  97633 -p opencv4 -p python3Packages.opencv4

You can also just run the following to get a nix-shell with the package available:

nix-shell -I nixpkgs=https://github.com/marsam/nixpkgs/archive/1966a0a4e1c1e07991406e3b90e3b088df252aea.tar.gz -p opencv4 python3Packages.opencv4
@marsam
Copy link
Contributor Author

marsam commented Sep 16, 2020

I'm merging this as-is, but feel free to open an issue if you find an issue

@marsam marsam merged commit 7dbc323 into NixOS:master Sep 16, 2020
19 of 20 checks passed
19 of 20 checks passed
tests tests
Details
action
Details
opencv, opencv.passthru.tests on x86_64-darwin
Details
Evaluation Performance Report Evaluator Performance Report
Details
Wait for ofborg
Details
grahamcofborg-eval ^.^!
Details
grahamcofborg-eval-check-maintainers matching changed paths to changed attrs...
Details
grahamcofborg-eval-check-meta config.nix: checkMeta = true
Details
grahamcofborg-eval-darwin nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="1966a0a"; rev="1966a0a4e1c1e07991406e3b90e3b088df252aea"; } ./pkgs/t
Details
grahamcofborg-eval-lib-tests nix-build --arg pkgs import ./. {} ./lib/tests/release.nix
Details
grahamcofborg-eval-nixos nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="1966a0a"; rev="1966a0a4e1c1e07991406e3b90e3b088df252aea"; } ./nixos/
Details
grahamcofborg-eval-nixos-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="1966a0a"; rev="1966a0a4e1c1e07991406e3b90e3b088df252aea"; } ./nixos/
Details
grahamcofborg-eval-nixos-options nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="1966a0a"; rev="1966a0a4e1c1e07991406e3b90e3b088df252aea"; } ./nixos/
Details
grahamcofborg-eval-nixpkgs-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="1966a0a"; rev="1966a0a4e1c1e07991406e3b90e3b088df252aea"; } ./pkgs/t
Details
grahamcofborg-eval-nixpkgs-tarball nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="1966a0a"; rev="1966a0a4e1c1e07991406e3b90e3b088df252aea"; } ./pkgs/t
Details
grahamcofborg-eval-nixpkgs-unstable-jobset nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="1966a0a"; rev="1966a0a4e1c1e07991406e3b90e3b088df252aea"; } ./pkgs/t
Details
grahamcofborg-eval-package-list nix-env -qa --json --file .
Details
grahamcofborg-eval-package-list-no-aliases nix-env -qa --json --file . --arg config { allowAliases = false; }
Details
opencv, opencv.passthru.tests on aarch64-linux Success
Details
opencv, opencv.passthru.tests on x86_64-linux Success
Details
@marsam marsam deleted the marsam:enable-opencv-videoio-darwin branch Sep 16, 2020
@jeff-hykin
Copy link

jeff-hykin commented Sep 19, 2020

You can also just run the following to get a nix-shell with the package available:

nix-shell -I nixpkgs=https://github.com/marsam/nixpkgs/archive/1966a0a4e1c1e07991406e3b90e3b088df252aea.tar.gz -p opencv4 python3Packages.opencv4

That is awesome! Thanks @mjlbach

Using that I tested the change just now, and can confirm it works 👍

thanks @marsam for merging this in

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

3 participants
You can’t perform that action at this time.