13 luajit_lua52 = luajit.override { enable52Compat = true; };
15 stdenv.mkDerivation rec {
17 version = "2024.03.1";
20 src = if stdenv.isAarch64 then fetchurl {
21 url = "https://github.com/koreader/koreader/releases/download/v${version}/koreader-${version}-arm64.deb";
22 hash = "sha256-9Bu+mWfJuPaH5nV71JMrcGipiZWfcf19KfVauCW92+I=";
24 url = "https://github.com/koreader/koreader/releases/download/v${version}/koreader-${version}-amd64.deb";
25 hash = "sha256-EZ3iqp0A2BZwI343nvvp71RGQx6FPesUBy4Lha4Yz4U=";
28 src_repo = fetchFromGitHub {
32 fetchSubmodules = true;
33 sha256 = "sha256-gHn1xqBc7M9wkek1Ja1gry8TKIuUxQP8T45x3z2S4uc=";
37 nativeBuildInputs = [ makeWrapper dpkg ];
46 unpackCmd = "dpkg-deb -x ${src} .";
54 ln -sf ${luajit_lua52}/bin/luajit $out/lib/koreader/luajit
55 ln -sf ${sdcv}/bin/sdcv $out/lib/koreader/sdcv
56 ln -sf ${gnutar}/bin/tar $out/lib/koreader/tar
57 find ${src_repo}/resources/fonts -type d -execdir cp -r '{}' $out/lib/koreader/fonts \;
58 find $out -xtype l -print -delete
59 wrapProgram $out/bin/koreader --prefix LD_LIBRARY_PATH : ${
60 lib.makeLibraryPath [ gtk3-x11 SDL2 glib ]
65 homepage = "https://github.com/koreader/koreader";
67 "An ebook reader application supporting PDF, DjVu, EPUB, FB2 and many more formats, running on Cervantes, Kindle, Kobo, PocketBook and Android devices";
68 mainProgram = "koreader";
69 sourceProvenance = with sourceTypes; [ binaryNativeCode ];
70 platforms = [ "aarch64-linux" "x86_64-linux" ];
71 license = licenses.agpl3Only;
72 maintainers = with maintainers; [ contrun neonfuz];