2021-01-11 08:54:33 +01:00
|
|
|
{ lib, stdenv
|
2020-05-05 09:08:27 +02:00
|
|
|
, fetchurl
|
|
|
|
, makeWrapper
|
|
|
|
, dpkg
|
|
|
|
, luajit
|
|
|
|
, gtk3-x11
|
|
|
|
, SDL2
|
|
|
|
, glib
|
|
|
|
, noto-fonts
|
|
|
|
, nerdfonts }:
|
|
|
|
let font-droid = nerdfonts.override { fonts = [ "DroidSansMono" ]; };
|
|
|
|
in stdenv.mkDerivation rec {
|
|
|
|
pname = "koreader";
|
2020-12-28 20:56:10 +01:00
|
|
|
version = "2020.12";
|
2020-05-05 09:08:27 +02:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url =
|
|
|
|
"https://github.com/koreader/koreader/releases/download/v${version}/koreader-${version}-amd64.deb";
|
2020-12-28 20:56:10 +01:00
|
|
|
sha256 = "0x97mm7h8kr1jps0hzdgl9irakma85ikrhzr18wc1plmffgv6kwm";
|
2020-05-05 09:08:27 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
sourceRoot = ".";
|
|
|
|
nativeBuildInputs = [ makeWrapper dpkg ];
|
|
|
|
buildInputs = [ luajit gtk3-x11 SDL2 glib ];
|
|
|
|
unpackCmd = "dpkg-deb -x ${src} .";
|
|
|
|
|
|
|
|
dontConfigure = true;
|
|
|
|
dontBuild = true;
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out
|
|
|
|
cp -R usr/* $out/
|
|
|
|
cp ${luajit}/bin/luajit $out/lib/koreader/luajit
|
|
|
|
find $out -xtype l -delete
|
|
|
|
for i in ${noto-fonts}/share/fonts/truetype/noto/*; do
|
|
|
|
ln -s "$i" $out/lib/koreader/fonts/noto/
|
|
|
|
done
|
|
|
|
ln -s "${font-droid}/share/fonts/opentype/NerdFonts/Droid Sans Mono Nerd Font Complete Mono.otf" $out/lib/koreader/fonts/droid/DroidSansMono.ttf
|
|
|
|
wrapProgram $out/bin/koreader --prefix LD_LIBRARY_PATH : ${
|
|
|
|
stdenv.lib.makeLibraryPath [ gtk3-x11 SDL2 glib ]
|
|
|
|
}
|
|
|
|
'';
|
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2020-05-05 09:08:27 +02: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";
|
|
|
|
platforms = intersectLists platforms.x86_64 platforms.linux;
|
2020-12-30 22:28:26 +01:00
|
|
|
license = licenses.agpl3Only;
|
2020-12-28 20:56:29 +01:00
|
|
|
maintainers = with maintainers; [ contrun neonfuz];
|
2020-05-05 09:08:27 +02:00
|
|
|
};
|
|
|
|
}
|