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

rPackages.opencv: fixed build #293081

Merged
merged 1 commit into from
Mar 17, 2024
Merged

rPackages.opencv: fixed build #293081

merged 1 commit into from
Mar 17, 2024

Conversation

b-rodrigues
Copy link
Contributor

@b-rodrigues b-rodrigues commented Mar 3, 2024

Description of changes

Fixed build and tested basic functionality.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.05 Release Notes (or backporting 23.05 and 23.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@b-rodrigues b-rodrigues requested a review from jbedo as a code owner March 3, 2024 20:14
@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux labels Mar 3, 2024
Copy link
Contributor

@Kupac Kupac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It builds, but something is still missing:

ocv_display(faces)
Error: OpenCV(4.9.0) /build/source/modules/highgui/src/window.cpp:1255: error: (-2:Unspecified error) The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Cocoa support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script in function 'cvNamedWindow'

In addition, native and buildInputs should be split correctly.

@b-rodrigues
Copy link
Contributor Author

I've added pkgs.gtk2-x11.dev but the same error still pops up. Any ideas?

pkgs/development/r-modules/default.nix Outdated Show resolved Hide resolved
@b-rodrigues b-rodrigues marked this pull request as ready for review March 9, 2024 15:03
@b-rodrigues
Copy link
Contributor Author

b-rodrigues commented Mar 9, 2024

Ok, think I got it, the error message was related to opencv, not the R package. So I needed to override opencv to build with gtk2 support (thanks to https://stackoverflow.com/a/53757886). That seems to have done the trick, could you test it on your end as well?

@Kupac
Copy link
Contributor

Kupac commented Mar 9, 2024

OK, I'm building it on x86_64 Linux. If someone could check on darwin, that would be awesome. Not sure they have gtk there? Does it need Cocoa or something?

Copy link
Contributor

@Kupac Kupac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice detective work! Compiles and works for me and displays images too

image

@delroth delroth added the 12.approvals: 1 This PR was reviewed and approved by one reputable person label Mar 9, 2024
@philipp-baumann
Copy link
Contributor

Confirm it compiles and is functional on aarch64-darwin

Screenshot 2024-03-11 at 22 11 31

@wegank wegank merged commit c4fc639 into NixOS:master Mar 17, 2024
19 checks passed
@b-rodrigues b-rodrigues deleted the fix_opencv branch March 17, 2024 22:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux 12.approvals: 1 This PR was reviewed and approved by one reputable person
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants