2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv
|
2020-05-05 07:08:27 +00:00
|
|
|
, fetchurl
|
|
|
|
, makeWrapper
|
2023-05-09 12:00:00 +00:00
|
|
|
, fetchFromGitHub
|
2020-05-05 07:08:27 +00:00
|
|
|
, dpkg
|
2021-06-22 15:53:15 +00:00
|
|
|
, glib
|
|
|
|
, gnutar
|
2020-05-05 07:08:27 +00:00
|
|
|
, gtk3-x11
|
2021-06-22 15:53:15 +00:00
|
|
|
, luajit
|
|
|
|
, sdcv
|
2023-05-09 12:00:00 +00:00
|
|
|
, SDL2 }:
|
|
|
|
stdenv.mkDerivation rec {
|
2020-05-05 07:08:27 +00:00
|
|
|
pname = "koreader";
|
2022-08-31 17:38:28 +00:00
|
|
|
version = "2022.08";
|
2020-05-05 07:08:27 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url =
|
|
|
|
"https://github.com/koreader/koreader/releases/download/v${version}/koreader-${version}-amd64.deb";
|
2022-08-31 17:38:28 +00:00
|
|
|
sha256 = "sha256-+JBJNJTAnC5gpuo8cehfe/3YwGIW5iFA8bZ8nfz9qsk=";
|
2020-05-05 07:08:27 +00:00
|
|
|
};
|
|
|
|
|
2023-05-09 12:00:00 +00:00
|
|
|
src_repo = fetchFromGitHub {
|
|
|
|
repo = "koreader";
|
|
|
|
owner = "koreader";
|
|
|
|
rev = "v${version}";
|
|
|
|
fetchSubmodules = true;
|
|
|
|
sha256 = "sha256-MHQYEzMyZMEQrzR8+Rvci8XjDK2DMUPxjsiWTrrKiAw=";
|
|
|
|
};
|
|
|
|
|
2020-05-05 07:08:27 +00:00
|
|
|
sourceRoot = ".";
|
|
|
|
nativeBuildInputs = [ makeWrapper dpkg ];
|
2021-06-22 15:53:15 +00:00
|
|
|
buildInputs = [
|
|
|
|
glib
|
|
|
|
gnutar
|
|
|
|
gtk3-x11
|
|
|
|
luajit
|
|
|
|
sdcv
|
|
|
|
SDL2
|
|
|
|
];
|
2020-05-05 07:08:27 +00:00
|
|
|
unpackCmd = "dpkg-deb -x ${src} .";
|
|
|
|
|
|
|
|
dontConfigure = true;
|
|
|
|
dontBuild = true;
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out
|
|
|
|
cp -R usr/* $out/
|
2021-06-22 15:53:15 +00:00
|
|
|
ln -sf ${luajit}/bin/luajit $out/lib/koreader/luajit
|
|
|
|
ln -sf ${sdcv}/bin/sdcv $out/lib/koreader/sdcv
|
|
|
|
ln -sf ${gnutar}/bin/tar $out/lib/koreader/tar
|
2023-05-09 12:00:00 +00:00
|
|
|
find ${src_repo}/resources/fonts -type d -execdir cp -r '{}' $out/lib/koreader/fonts \;
|
|
|
|
find $out -xtype l -print -delete
|
2020-05-05 07:08:27 +00:00
|
|
|
wrapProgram $out/bin/koreader --prefix LD_LIBRARY_PATH : ${
|
2021-01-15 05:42:41 +00:00
|
|
|
lib.makeLibraryPath [ gtk3-x11 SDL2 glib ]
|
2020-05-05 07:08:27 +00:00
|
|
|
}
|
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-05-05 07:08:27 +00:00
|
|
|
homepage = "https://github.com/koreader/koreader";
|
|
|
|
description =
|
|
|
|
"An ebook reader application supporting PDF, DjVu, EPUB, FB2 and many more formats, running on Cervantes, Kindle, Kobo, PocketBook and Android devices";
|
2022-06-04 22:19:25 +00:00
|
|
|
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
|
2020-05-05 07:08:27 +00:00
|
|
|
platforms = intersectLists platforms.x86_64 platforms.linux;
|
2020-12-30 21:28:26 +00:00
|
|
|
license = licenses.agpl3Only;
|
2020-12-28 19:56:29 +00:00
|
|
|
maintainers = with maintainers; [ contrun neonfuz];
|
2020-05-05 07:08:27 +00:00
|
|
|
};
|
|
|
|
}
|