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

darktable: Fix compilation on macOS #44922

Merged
merged 3 commits into from Aug 15, 2018
Merged

Conversation

Enzime
Copy link
Member

@Enzime Enzime commented Aug 12, 2018

Things done
  • Tested without sandbox on macOS
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • 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 nox --run "nox-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)
  • Fits CONTRIBUTING.md.

];

ldLibraryPathPrefix = "$out/lib/darktable" + stdenv.lib.optionalString stdenv.isLinux ":${ocl-icd}/lib";
Copy link
Member

Choose a reason for hiding this comment

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

I would move this into a let statement.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed.

# darktable changed its rpath handling in commit
# 83c70b876af6484506901e6b381304ae0d073d3c and as a result the
# binaries can't find libdarktable.so, so change LD_LIBRARY_PATH in
# the wrappers:
preFixup = ''
gappsWrapperArgs+=(
--prefix LD_LIBRARY_PATH ":" "$out/lib/darktable:${ocl-icd}/lib"
--prefix LD_LIBRARY_PATH ":" "${ldLibraryPathPrefix}"
Copy link
Member

Choose a reason for hiding this comment

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

Do we need this on darwin? If so I'd expect it to be DYLD_LIBRARY_PATH instead.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed.

Only compile X11 and other components on Linux. Use DYLD_LIBRARY_PATH on
macOS instead of LD_LIBRARY_PATH.
@mpickering
Copy link
Contributor

@GrahamcOfBorg build darktable

@GrahamcOfBorg
Copy link

Failure on aarch64-linux (full log)

Attempted: darktable

Partial log (click to expand)

-- Installing: /nix/store/mpfvyra47lhbd7h7crzi02cl88y6zmgp-pugixml-1.9/lib/cmake/pugixml/pugixml-config-release.cmake
post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/mpfvyra47lhbd7h7crzi02cl88y6zmgp-pugixml-1.9
shrinking /nix/store/mpfvyra47lhbd7h7crzi02cl88y6zmgp-pugixml-1.9/lib/libpugixml.so.1.9
strip is /nix/store/ah0va6j4cnwj9nx4j6rwcfc8nh785jwm-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/mpfvyra47lhbd7h7crzi02cl88y6zmgp-pugixml-1.9/lib
patching script interpreter paths in /nix/store/mpfvyra47lhbd7h7crzi02cl88y6zmgp-pugixml-1.9
checking for references to /build in /nix/store/mpfvyra47lhbd7h7crzi02cl88y6zmgp-pugixml-1.9...
cannot build derivation '/nix/store/nv3ypcpgn1hxv5kbnv1a6d376fvma1c5-darktable-2.4.4.drv': 1 dependencies couldn't be built
error: build of '/nix/store/nv3ypcpgn1hxv5kbnv1a6d376fvma1c5-darktable-2.4.4.drv' failed

@GrahamcOfBorg
Copy link

Timed out, unknown build status on x86_64-darwin (full log)

Attempted: darktable

Partial log (click to expand)

[ 24%] Building CXX object lib/Transforms/Scalar/CMakeFiles/LLVMScalarOpts.dir/BDCE.cpp.o
[ 24%] Building CXX object lib/Transforms/Scalar/CMakeFiles/LLVMScalarOpts.dir/CallSiteSplitting.cpp.o
building of '/nix/store/wi3hcgvbsyrvka7xn4wyywzs6hw20064-rustc-1.27.0.drv' timed out after 1800 seconds
cannot build derivation '/nix/store/diz81nm1ks1dia61aqbml8i2dsj8cxb0-cargo-1.27.0.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/lpxmvj2v0bb8v6c4cgyqjj9lj4adxl90-librsvg-2.42.4.drv': 2 dependencies couldn't be built
cannot build derivation '/nix/store/j5m7pisa4v1k0sqnr91ga8rpri4h1pf6-hook.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/dh6qqzphvbzz1w5z244pjw2z4xi5jwla-icon-naming-utils-0.8.90.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/cjflnclagcb73kvq7r0l4xbxm93y84ha-adwaita-icon-theme-3.28.0.drv': 2 dependencies couldn't be built
cannot build derivation '/nix/store/wzr7hi43shwvc5i97nfi0qr2rgm5z9bq-darktable-2.4.4.drv': 3 dependencies couldn't be built
error: build of '/nix/store/wzr7hi43shwvc5i97nfi0qr2rgm5z9bq-darktable-2.4.4.drv' failed

@GrahamcOfBorg
Copy link

Timed out, unknown build status on x86_64-linux (full log)

Attempted: darktable

Partial log (click to expand)

cannot build derivation '/nix/store/4snsw9jp3569xhmrhvclq2x0qb3w2vhv-cargo-1.27.0.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/d5raib3mnl9jrb4r2ky4vycdgyll4567-librsvg-2.42.4.drv': 2 dependencies couldn't be built
copying path '/nix/store/yyim1aa6rp62gv08p7d3fjjhm8bswfrm-colord-1.4.2' from 'https://cache.nixos.org'...
cannot build derivation '/nix/store/fav2d69zgbnrysk6c6p1qzfr8rlpjn94-hook.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/vz3bkpqka0kmzqvnj60b8ndj8f4vbcv2-icon-naming-utils-0.8.90.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/sls3b5hzgjmzrzl741j18bfygy7aq9bj-adwaita-icon-theme-3.28.0.drv': 2 dependencies couldn't be built
warning: unable to download 'https://cache.nixos.org/nar/06wp1la41v283h9sp52wajqa8ra495i78pq83d9l763fjd6m9h57.nar.xz': Error in the HTTP2 framing layer (16); retrying in 280 ms
copying path '/nix/store/97bgwhf18q34lqrgyizg7npysk9c2fh1-colord-gtk-0.1.26' from 'https://cache.nixos.org'...
cannot build derivation '/nix/store/fyizwwg9cwqas60lv063kbwcn1lad3kc-darktable-2.4.4.drv': 3 dependencies couldn't be built
error: build of '/nix/store/fyizwwg9cwqas60lv063kbwcn1lad3kc-darktable-2.4.4.drv' failed

@mpickering
Copy link
Contributor

I built this locally on darwin and the executable starts successfully.

@LnL7
Copy link
Member

LnL7 commented Aug 14, 2018

@GrahamcOfBorg build darktable

@GrahamcOfBorg
Copy link

Failure on aarch64-linux (full log)

Attempted: darktable

Partial log (click to expand)

make[2]: *** [libs/lensfun/CMakeFiles/lensfun.dir/modifier.cpp.o] Error 1
make[2]: *** [libs/lensfun/CMakeFiles/lensfun.dir/auxfun.cpp.o] Error 1
g++: error: unrecognized command line option '-msse'; did you mean '-fdse'?
g++: error: unrecognized command line option '-msse2'
make[2]: *** [libs/lensfun/CMakeFiles/lensfun.dir/lens.cpp.o] Error 1
make[1]: *** [libs/lensfun/CMakeFiles/lensfun.dir/all] Error 2
make: *** [all] Error 2
builder for '/nix/store/iq8lg87zfn0gxg5kbivx32j8kqh0g5bb-lensfun-0.3.2.drv' failed with exit code 2
cannot build derivation '/nix/store/nv3ypcpgn1hxv5kbnv1a6d376fvma1c5-darktable-2.4.4.drv': 1 dependencies couldn't be built
error: build of '/nix/store/nv3ypcpgn1hxv5kbnv1a6d376fvma1c5-darktable-2.4.4.drv' failed

@GrahamcOfBorg
Copy link

Success on x86_64-darwin (full log)

Attempted: darktable

Partial log (click to expand)

/nix/store/5q2pj1jrlj7djv9cvd2a6ahag31vlvw5-darktable-2.4.4/lib/darktable/libdarktable.dylib: fixing dylib
/nix/store/5q2pj1jrlj7djv9cvd2a6ahag31vlvw5-darktable-2.4.4
/nix/store/5q2pj1jrlj7djv9cvd2a6ahag31vlvw5-darktable-2.4.4/lib/darktable/libdarktable.dylib: fixing dylib
/nix/store/5q2pj1jrlj7djv9cvd2a6ahag31vlvw5-darktable-2.4.4/lib/darktable/libdarktable.dylib: fixing dylib
/nix/store/5q2pj1jrlj7djv9cvd2a6ahag31vlvw5-darktable-2.4.4/lib/darktable/libdarktable.dylib: fixing dylib
/nix/store/5q2pj1jrlj7djv9cvd2a6ahag31vlvw5-darktable-2.4.4/lib/darktable/libdarktable.dylib: fixing dylib
/nix/store/5q2pj1jrlj7djv9cvd2a6ahag31vlvw5-darktable-2.4.4/lib/darktable/libdarktable.dylib: fixing dylib
/nix/store/5q2pj1jrlj7djv9cvd2a6ahag31vlvw5-darktable-2.4.4/lib/darktable/libdarktable.dylib: fixing dylib
/nix/store/5q2pj1jrlj7djv9cvd2a6ahag31vlvw5-darktable-2.4.4/lib/darktable/libdarktable.dylib: fixing dylib
/nix/store/5q2pj1jrlj7djv9cvd2a6ahag31vlvw5-darktable-2.4.4/lib/darktable/libdarktable.dylib: fixing dylib

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: darktable

Partial log (click to expand)

shrinking /nix/store/v3yycn6r154swzffk3dwxfdibxjwmf9j-darktable-2.4.4/bin/.darktable-rs-identify-wrapped
shrinking /nix/store/v3yycn6r154swzffk3dwxfdibxjwmf9j-darktable-2.4.4/bin/.darktable-chart-wrapped
shrinking /nix/store/v3yycn6r154swzffk3dwxfdibxjwmf9j-darktable-2.4.4/bin/.darktable-cmstest-wrapped
shrinking /nix/store/v3yycn6r154swzffk3dwxfdibxjwmf9j-darktable-2.4.4/bin/.darktable-generate-cache-wrapped
shrinking /nix/store/v3yycn6r154swzffk3dwxfdibxjwmf9j-darktable-2.4.4/bin/.darktable-wrapped
gzipping man pages under /nix/store/v3yycn6r154swzffk3dwxfdibxjwmf9j-darktable-2.4.4/share/man/
strip is /nix/store/gpc2wld1s0c6qzx9326cwn1wcx29xzsj-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/v3yycn6r154swzffk3dwxfdibxjwmf9j-darktable-2.4.4/lib  /nix/store/v3yycn6r154swzffk3dwxfdibxjwmf9j-darktable-2.4.4/bin
patching script interpreter paths in /nix/store/v3yycn6r154swzffk3dwxfdibxjwmf9j-darktable-2.4.4
checking for references to /build in /nix/store/v3yycn6r154swzffk3dwxfdibxjwmf9j-darktable-2.4.4...

@Mic92 Mic92 merged commit 0a17d08 into NixOS:master Aug 15, 2018
@Enzime Enzime deleted the fix/darktable-on-macos branch August 26, 2018 04:36
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.

None yet

5 participants