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 missing lensfun files #76529
Conversation
When darktable starts we get an error that looks like this: [iop_lens]: could not load lensfun database in `/nix/store/...-darktable-3.0.0/share/lensfun/version_2'!
preFixup = let | ||
libPathEnvVar = if stdenv.isDarwin then "DYLD_LIBRARY_PATH" else "LD_LIBRARY_PATH"; | ||
libPathPrefix = "$out/lib/darktable" + stdenv.lib.optionalString stdenv.isLinux ":${ocl-icd}/lib"; | ||
in '' | ||
gappsWrapperArgs+=( | ||
--prefix ${libPathEnvVar} ":" "${libPathPrefix}" | ||
) | ||
ln -s ${lensfun}/share/lensfun $out/share |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of having lensefun a dependency is it possible to point darktable to the directory via an environment variable? We could then just have a wrapper around darktable setting that instead of triggering a rebuild of darktable when lensefun changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice to avoid rebuilds, but:
- It does not seem like there is an env variable to use (based on this)
lensfun
is already one of thebuildInputs
ofdarktable
(so it already triggers a rebuild)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would not it be preferable to patch the path here: https://github.com/darktable-org/darktable/blob/d9d279a1e1b38baaab07981dfa6bc87fe16238cf/src/iop/lens.cc#L1259
Or open an issue to respect XDG_DATA_DIRS
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh. Interesting. I had not looked in there. I am on macOS so it might be that the only problem is that the lensfun Load
function is not actually being tried first if __APPLE__
is defined https://github.com/darktable-org/darktable/blob/d9d279a1e1b38baaab07981dfa6bc87fe16238cf/src/iop/lens.cc#L1246-L1249
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, on Linux, the correct system path should be hopefully tried: https://github.com/lensfun/lensfun/blob/b58ac41f0f62000acdf6e73e0b5ef7c9af72efef/libs/lensfun/database.cpp#L93-L117
Maybe patching it to use Load
on macOS too would be enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see this issue on Linux. I'm not sure if darktable's cmake detects the platform as macOS and tries to build everything into one bundle, as masOS expects it, but this fix sholdn't be necessary on linux.
Thank you for your contributions. This has been automatically marked as stale because it has had no activity for 180 days. If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity. Here are suggestions that might help resolve this more quickly:
|
Also note that the version of lensfun shipped in 20.03 doesn't work correctly. In my own setup, I've reverted to 0.3.2 |
Is this still an issue on master/20.09? I can use lensfun here just fine (NixOS Unstable), but #76529 (comment) seems to suggest it's a Darwin-only problem. |
I marked this as stale due to inactivity. → More info |
Closing due to lack of feedback. If this is still an issue on MacOS, please reopen. |
Motivation for this change
When darktable starts we get an error that looks like this:
Lens correction fails to work correctly (no thing is found).
Things done
A symlink to the
lensfun
database is added inpreFixup
.It looks like there might be an error in
lensfun
or the darktablecode that uses it. With the missing database fixed the following
error is reported on startup:
And when the program exits it gives:
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)Notify maintainers
cc @