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

libtiff: switch back to CMake and fix static #366566

Merged
merged 2 commits into from
Jan 5, 2025

Conversation

alyssais
Copy link
Member

@alyssais alyssais commented Dec 19, 2024

Since libwebp was switched to CMake, the .la files that told static builds which libraries had to be linked with libwebp are no longer generated, breaking static builds. By switching libtiff to CMake too, we can use the CMake files instead. A further patch to fix libtiff's linker choice then restores static builds.

CMake was tried once before, and I reverted it, because at the time, it broke cross compilation of libtiff. Things seem to have settled since then, and this now cross compiles correctly.

When this used CMake previously, -DCMAKE_SKIP_BUILD_RPATH=OFF was required for the tests to pass on Darwin. We'll see if that's still necessary, either via OfBorg or if somebody wants to try a test build on Darwin themself.

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/)
  • 25.05 Release Notes (or backporting 24.11 and 25.05 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.

@alyssais alyssais requested review from ajs124, fgaz and L-as December 19, 2024 14:51
@alyssais alyssais mentioned this pull request Dec 19, 2024
13 tasks
@alyssais alyssais marked this pull request as draft December 19, 2024 14:55
@alyssais alyssais marked this pull request as ready for review December 19, 2024 15:30
@alyssais alyssais changed the title libtiff: switch back to CMake (fixes static) libtiff: switch back to CMake and fix static Dec 19, 2024
@alyssais alyssais marked this pull request as draft December 19, 2024 15:50
@alyssais alyssais marked this pull request as ready for review December 19, 2024 16:12
Since libwebp was switched to CMake, the .la files that told static
builds which libraries had to be linked with libwebp are no longer
generated, breaking static builds.  By switching libtiff to CMake too,
we can use the CMake files instead.  (This is necessary, but not
sufficient, for static builds to work — a further patch is required.)

This was tried once before (in 96d5032 ("libtiff: export private
headers for freeimage")), and I reverted it (in
5df9305 ("libtiff: fix cross by switching back to autoconf")),
because at the time, it broke cross compilation of libtiff.  Things
seem to have settled since then, and this now cross compiles
correctly.

Fixes: 909c491 ("libwebp: build with CMake")
Copy link
Contributor

@imincik imincik left a comment

Choose a reason for hiding this comment

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

I like this change and it looks good to me (not tested).

Copy link
Member

@emilazy emilazy left a comment

Choose a reason for hiding this comment

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

When this used CMake previously, -DCMAKE_SKIP_BUILD_RPATH=OFF was required for the tests to pass on Darwin. We'll see if that's still necessary, either via OfBorg or if somebody wants to try a test build on Darwin themself.

Apparently not. Built on x86_64-darwin (rebased on top of master).

@emilazy emilazy merged commit f20f892 into NixOS:staging Jan 5, 2025
42 of 43 checks passed
@imincik
Copy link
Contributor

imincik commented Jan 6, 2025

Thanks @emilazy

@alyssais alyssais deleted the libtiff-cmake branch January 8, 2025 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants