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

koreader: init at 2020.09 #86894

Merged
merged 1 commit into from Oct 13, 2020
Merged

koreader: init at 2020.09 #86894

merged 1 commit into from Oct 13, 2020

Conversation

contrun
Copy link
Contributor

@contrun contrun commented May 5, 2020

Motivation for this change
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • 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 nixpkgs-review --run "nixpkgs-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)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

I am currently unable to build the binary from source code. Instead, I used the debian package upstream provided. I don't know what is the equivalent platforms for the upstream provide arm package. I only packaged the x86_64 version.

Copy link
Contributor

@matthuszagh matthuszagh left a comment

Choose a reason for hiding this comment

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

This looks good to me!

@contrun contrun changed the title koreader: init at 2020.04.1 koreader: init at 2020.09 Oct 4, 2020
@ryantm
Copy link
Member

ryantm commented Oct 13, 2020

Result of nixpkgs-review pr 86894 1

1 package built:
- koreader

@ryantm ryantm merged commit 9c4fe53 into NixOS:master Oct 13, 2020
Copy link
Contributor

@jtojnar jtojnar left a comment

Choose a reason for hiding this comment

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

Ugh, sorry, looks like my review did not went through.


sourceRoot = ".";
nativeBuildInputs = [ makeWrapper dpkg ];
buildInputs = [ luajit gtk3-x11 SDL2 glib ];
Copy link
Contributor

Choose a reason for hiding this comment

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

gtk3-x11 is just an alias of gtk3.

dontBuild = true;

installPhase = ''
mkdir -p $out
Copy link
Contributor

Choose a reason for hiding this comment

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

When overriding installPhase, you should also provide runHook preInstall and runHook postInstall.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have pushed some updates. For now, please review it here. If that is desirable, I will make a new pr.

Comment on lines +40 to +41
wrapProgram $out/bin/koreader --prefix LD_LIBRARY_PATH : ${
stdenv.lib.makeLibraryPath [ gtk3-x11 SDL2 glib ]
}
Copy link
Contributor

Choose a reason for hiding this comment

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

LD_LIBRARY_PATH can have side effects. Is autoPatchelfHook not sufficient?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The reason to use LD_LIBRARY_PATH is because libSDL2-2.0.so.0 is loaded from the lua ffi api (i.e. the file https://github.com/koreader/koreader/blob/master/setupkoenv.lua), which is not a elf executable. I think I need to patch the file itself or inject LD_LIBRARY_PATH.

description =
"An ebook reader application supporting PDF, DjVu, EPUB, FB2 and many more formats, running on Cervantes, Kindle, Kobo, PocketBook and Android devices";
platforms = intersectLists platforms.x86_64 platforms.linux;
license = licenses.agpl3;
Copy link
Contributor

Choose a reason for hiding this comment

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

agpl3 is unclear, use agpl3Plus or agpl3Only. See https://discourse.nixos.org/t/lib-licenses-gpl3-co-are-now-deprecated/8206 for more details.

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

4 participants