Skip to content

libgphoto2: fix darwin build - #548661

Open
fullmetalsheep wants to merge 1 commit into
NixOS:masterfrom
fullmetalsheep:libgphoto2-darwin-fix
Open

libgphoto2: fix darwin build#548661
fullmetalsheep wants to merge 1 commit into
NixOS:masterfrom
fullmetalsheep:libgphoto2-darwin-fix

Conversation

@fullmetalsheep

@fullmetalsheep fullmetalsheep commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Hi,

Originally caught this while building darktable on aarch64-darwin (which has a dependency on libgphoto2)
libgphoto2 fails to build on Darwin with linker errors due to missing _libintl_dgettext symbols. Logs below:

error: Cannot build '/nix/store/w65rxjfygfgqrp3svnnkbhg61k4hyjjy-libgphoto2-2.5.34.drv'.
       Reason: builder failed with exit code 2.
       Output paths:
         /nix/store/8bxlsx24xb0ycc77h3i6hdc5zbwx12hk-libgphoto2-2.5.34
       Last 25 log lines:
       >   CC       ax203/la-library.lo
       >   CC       ax203/la-ax203.lo
       >   CC       ax203/la-ax203_decode_yuv.lo
       >   CC       ax203/la-ax203_decode_yuv_delta.lo
       >   CC       ax203/la-ax203_compress_jpeg.lo
       >   CC       ax203/la-jpeg_memsrcdest.lo
       >   CC       ax203/la-tinyjpeg.lo
       >   CC       ax203/la-jidctflt.lo
       >   CCLD     ax203.la
       > Undefined symbols for architecture arm64:
       >   "_libintl_dgettext", referenced from:
       >       _camera_summary in la-library.o
       >       _camera_manual in la-library.o
       >       _camera_about in la-library.o
       >       _camera_get_config in la-library.o
       >       _camera_set_config in la-library.o
       > ld: symbol(s) not found for architecture arm64
       > clang: error: linker command failed with exit code 1 (use -v to see invocation)
       > make[3]: *** [Makefile:2214: ax203.la] Error 1
       > make[3]: Leaving directory '/nix/var/nix/builds/nix-38571-1052516044/source/camlibs'
       > make[2]: *** [Makefile:4944: all-recursive] Error 1
       > make[2]: Leaving directory '/nix/var/nix/builds/nix-38571-1052516044/source/camlibs'
       > make[1]: *** [Makefile:778: all-recursive] Error 1
       > make[1]: Leaving directory '/nix/var/nix/builds/nix-38571-1052516044/source'
       > make: *** [Makefile:602: all] Error 2
       For full logs, run:
         nix-store -l /nix/store/w65rxjfygfgqrp3svnnkbhg61k4hyjjy-libgphoto2-2.5.34.drv

Fixed by adding gettext to buildInputs when building for Darwin hosts. It should not affect any other platforms.
Tested manually by building both libgphoto2 and the downstream package darktable. They build and function as expected.

Hope this helps,
Thanks!

Things done

@nixpkgs-ci
nixpkgs-ci Bot requested a review from jcumming August 3, 2026 03:40
@nixpkgs-ci nixpkgs-ci Bot added 10.rebuild-darwin: 11-100 This PR causes between 11 and 100 packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. labels Aug 3, 2026
@fullmetalsheep

Copy link
Copy Markdown
Contributor Author

I am also happy to add myself to the maintainers list, if that's welcome.

Comment thread pkgs/by-name/li/libgphoto2/package.nix Outdated
gd
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
gettext # prevents darwin builds from breaking

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
gettext # prevents darwin builds from breaking
gettext

In my opinion this comment is not needed

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fair, removed. Thanks!

@nixpkgs-ci nixpkgs-ci Bot added the 12.approvals: 1 This PR was reviewed and approved by one person. label Aug 3, 2026
- amended original commit with suggestion by @BatteredBunny applied. Thanks!
@fullmetalsheep
fullmetalsheep force-pushed the libgphoto2-darwin-fix branch from 334fa61 to 60afd97 Compare August 3, 2026 12:23
@ofborg ofborg Bot added the 6.topic: darwin Running or building packages on Darwin label Aug 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: darwin Running or building packages on Darwin 10.rebuild-darwin: 11-100 This PR causes between 11 and 100 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.

2 participants