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

Fix Zathura on Darwin #61295

Merged
merged 3 commits into from May 13, 2019
Merged

Fix Zathura on Darwin #61295

merged 3 commits into from May 13, 2019

Conversation

rvolosatovs
Copy link
Member

@rvolosatovs rvolosatovs commented May 11, 2019

Motivation for this change

Currently Zathura package cannot be built on Darwin due to incorrect usage of lib.optional in master derivation, as well as being dependent on Linux-only packages

Things done
  • Fixed the lib.optional usage and made some dependencies Linux-only.
  • Opening pdf's using MuPDF on Darwin fails with
error: Could not load plugin '/nix/store/27fc303khwdkqkbb3skr7dsrkdmlsld6-zathura-pdf-mupdf-0.3.4/lib/zathura/libpdf-mupdf.dylib' (dlopen(/nix/store/27fc303khwdkqkbb3skr7dsrkdmlsld6-zathura-pdf-mupdf-0.3.4/lib/zathura/libpdf-mupdf.dylib, 2): Symbol not found: _opj_create_decompress
  Referenced from: /nix/store/27fc303khwdkqkbb3skr7dsrkdmlsld6-zathura-pdf-mupdf-0.3.4/lib/zathura/libpdf-mupdf.dylib
  Expected in: flat namespace
 in /nix/store/27fc303khwdkqkbb3skr7dsrkdmlsld6-zathura-pdf-mupdf-0.3.4/lib/zathura/libpdf-mupdf.dylib).
error: Unknown file type: 'com.adobe.pdf'

but works with poppler plugin, hence made derivation use poppler pdf plugin by default on Darwin.

Note that I tried adding fixDarwinDylibNames to buildInputs of openjpeg, but this did not fix the issue.

  • 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 nix-review --run "nix-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)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@rvolosatovs rvolosatovs changed the title Fix Zathura build on Darwin Fix Zathura on Darwin May 11, 2019
@ofborg ofborg bot added 6.topic: darwin Running or building packages on Darwin 10.rebuild-darwin: 1-10 10.rebuild-linux: 1-10 labels May 11, 2019
@@ -1,5 +1,5 @@
{ config, pkgs
, useMupdf ? config.zathura.useMupdf or true
, useMupdf ? config.zathura.useMupdf or (!pkgs.stdenv.isDarwin)
Copy link
Member

Choose a reason for hiding this comment

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

Maybe make a comment that mupdf plugin is broken on darwin because it can't load a symbol at runtime (I guess from openjpeg?).

Copy link
Member

Choose a reason for hiding this comment

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

Yeah might just be a bad link. Not required for merging, but if you could look at the output of:

$ otool -L /nix/store/27fc303khwdkqkbb3skr7dsrkdmlsld6-zathura-pdf-mupdf-0.3.4/lib/zathura/libpdf-mupdf.dylib

that would be helpful

Copy link
Member

Choose a reason for hiding this comment

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

/nix/store/bbyhvy2yp7blcaai0cfkkgr59m6647lx-zathura-pdf-mupdf-0.3.4/lib/zathura/libpdf-mupdf.dylib:
        /nix/store/7c3nyrkwsfa2025kcf8v47x5hb0iykqi-girara-0.3.2/lib/libgirara-gtk3.3.dylib (compatibility version 3.0.0, current version 3.0.0)
        /nix/store/fb33y6z6ck2j2jmn69i9z7sbd7bx4iqr-cairo-1.16.0/lib/libcairo.2.dylib (compatibility version 11603.0.0, current version 11603.0.0)
        /nix/store/dj9ljyzlh6yzjpvg7hdm49ym8m7s0b9b-glib-2.60.1/lib/libglib-2.0.0.dylib (compatibility version 6001.0.0, current version 6001.1.0)
        /nix/store/g3c2jpj31bya2x3b8q50f5ix0lgalhgb-Libsystem-osx-10.12.6/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)

@rvolosatovs
Copy link
Member Author

@veprbl @matthewbauer any update on this?

@veprbl veprbl merged commit 2ddcab0 into NixOS:master May 13, 2019
@rvolosatovs rvolosatovs deleted the fix/zathura branch May 13, 2019 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants