Skip to content

opencv: fix hardcoded source path#468402

Merged
Aleksanaa merged 1 commit intoNixOS:masterfrom
SFrijters:opencv-fix-hardcoded-source-path
Dec 8, 2025
Merged

opencv: fix hardcoded source path#468402
Aleksanaa merged 1 commit intoNixOS:masterfrom
SFrijters:opencv-fix-hardcoded-source-path

Conversation

@SFrijters
Copy link
Member

This should fix builds for non-default fetchedSourceNameDefault and is a no-op for the default.

Cf. #248528

Things done

  • Built on platform:
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • Package update: when the change is major or breaking.
  • NixOS Release Notes
    • Module addition: when adding a new NixOS module.
    • Module update: when the change is significant.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other READMEs.

Add a 👍 reaction to pull requests you find important.

This should fix builds for non-default fetchedSourceNameDefault and is a no-op for the default.

postUnpack = optionalString buildContrib ''
cp --no-preserve=mode -r "${contribSrc}/modules" "$NIX_BUILD_TOP/source/opencv_contrib"
cp --no-preserve=mode -r "${contribSrc}/modules" "$NIX_BUILD_TOP/${src.name}/opencv_contrib"
Copy link
Member

Choose a reason for hiding this comment

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

TIL $NIX_BUILD_TOP exists... Can we just change these to relative paths?

Copy link
Member Author

Choose a reason for hiding this comment

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

I just tried it and it looks like that one can be removed without issue, but the one that is used to add the CMake flag cannot have it removed without breaking the build (and one more remains further down in the file).
The setup all looks fairly complicated so I'd prefer to keep that kind of change out of this PR.

@nixpkgs-ci nixpkgs-ci 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 Dec 6, 2025
@SFrijters SFrijters requested a review from basvandijk December 6, 2025 12:51
@DieracDelta
Copy link
Member

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 468402
Commit: 9c9668ade470d9dcdff8849351429af5080fb5a2


x86_64-linux

✅ 1 package built:
  • nixpkgs-manual

@nixpkgs-ci nixpkgs-ci bot added the 12.approvals: 1 This PR was reviewed and approved by one person. label Dec 6, 2025
@Aleksanaa Aleksanaa added this pull request to the merge queue Dec 8, 2025
Merged via the queue into NixOS:master with commit f27d0a8 Dec 8, 2025
33 of 35 checks passed
@SFrijters SFrijters deleted the opencv-fix-hardcoded-source-path branch December 8, 2025 13:34
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 person.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants