13 luajit_lua52 = luajit.override { enable52Compat = true; };
15 stdenv.mkDerivation rec {
21 aarch64-linux = fetchurl {
22 url = "https://github.com/koreader/koreader/releases/download/v${version}/koreader-${version}-arm64.deb";
23 hash = "sha256-FwwB9slKOiYQ3eud2tiqov6yGNxmIicIe6nFpsH28Vk=";
25 armv7l-linux = fetchurl {
26 url = "https://github.com/koreader/koreader/releases/download/v${version}/koreader-${version}-armhf.deb";
27 hash = "sha256-LgeWQcHm5Qq/7MUuidjily0WsOFZAWGWeO52jNHWKMw=";
29 x86_64-linux = fetchurl {
30 url = "https://github.com/koreader/koreader/releases/download/v${version}/koreader-${version}-amd64.deb";
31 hash = "sha256-hqJRZDZqzPNLK/8Bb+Oay70JqKAMKB0Epbbzeu5npLw=";
33 }.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
35 src_repo = fetchFromGitHub {
39 fetchSubmodules = true;
40 sha256 = "sha256-gHn1xqBc7M9wkek1Ja1gry8TKIuUxQP8T45x3z2S4uc=";
44 nativeBuildInputs = [ makeWrapper dpkg ];
53 unpackCmd = "dpkg-deb -x ${src} .";
61 ln -sf ${luajit_lua52}/bin/luajit $out/lib/koreader/luajit
62 ln -sf ${sdcv}/bin/sdcv $out/lib/koreader/sdcv
63 ln -sf ${gnutar}/bin/tar $out/lib/koreader/tar
64 find ${src_repo}/resources/fonts -type d -execdir cp -r '{}' $out/lib/koreader/fonts \;
65 find $out -xtype l -print -delete
66 wrapProgram $out/bin/koreader --prefix LD_LIBRARY_PATH : ${
67 lib.makeLibraryPath [ gtk3-x11 SDL2 glib stdenv.cc.cc.lib ]
72 homepage = "https://github.com/koreader/koreader";
73 changelog = "https://github.com/koreader/koreader/releases/tag/v${version}";
75 "An ebook reader application supporting PDF, DjVu, EPUB, FB2 and many more formats, running on Cervantes, Kindle, Kobo, PocketBook and Android devices";
76 mainProgram = "koreader";
77 sourceProvenance = with sourceTypes; [ binaryNativeCode ];
78 platforms = [ "aarch64-linux" "armv7l-linux" "x86_64-linux" ];
79 license = licenses.agpl3Only;
80 maintainers = with maintainers; [ contrun neonfuz];