nixpkgs/pkgs/applications/misc/koreader/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

75 lines
2.1 KiB
Nix
Raw Permalink Normal View History

{ lib, stdenv
2020-05-05 09:08:27 +02:00
, fetchurl
, makeWrapper
, fetchFromGitHub
2020-05-05 09:08:27 +02:00
, dpkg
, glib
, gnutar
2020-05-05 09:08:27 +02:00
, gtk3-x11
, luajit
, sdcv
, SDL2 }:
let
luajit_lua52 = luajit.override { enable52Compat = true; };
in
stdenv.mkDerivation rec {
2020-05-05 09:08:27 +02:00
pname = "koreader";
version = "2024.03.1";
2020-05-05 09:08:27 +02:00
src = if stdenv.isAarch64 then fetchurl {
url = "https://github.com/koreader/koreader/releases/download/v${version}/koreader-${version}-arm64.deb";
hash = "sha256-9Bu+mWfJuPaH5nV71JMrcGipiZWfcf19KfVauCW92+I=";
} else fetchurl {
url = "https://github.com/koreader/koreader/releases/download/v${version}/koreader-${version}-amd64.deb";
hash = "sha256-EZ3iqp0A2BZwI343nvvp71RGQx6FPesUBy4Lha4Yz4U=";
2020-05-05 09:08:27 +02:00
};
src_repo = fetchFromGitHub {
repo = "koreader";
owner = "koreader";
rev = "v${version}";
fetchSubmodules = true;
sha256 = "sha256-gHn1xqBc7M9wkek1Ja1gry8TKIuUxQP8T45x3z2S4uc=";
};
2020-05-05 09:08:27 +02:00
sourceRoot = ".";
nativeBuildInputs = [ makeWrapper dpkg ];
buildInputs = [
glib
gnutar
gtk3-x11
luajit_lua52
sdcv
SDL2
];
2020-05-05 09:08:27 +02:00
unpackCmd = "dpkg-deb -x ${src} .";
dontConfigure = true;
dontBuild = true;
installPhase = ''
mkdir -p $out
cp -R usr/* $out/
ln -sf ${luajit_lua52}/bin/luajit $out/lib/koreader/luajit
ln -sf ${sdcv}/bin/sdcv $out/lib/koreader/sdcv
ln -sf ${gnutar}/bin/tar $out/lib/koreader/tar
find ${src_repo}/resources/fonts -type d -execdir cp -r '{}' $out/lib/koreader/fonts \;
find $out -xtype l -print -delete
2020-05-05 09:08:27 +02:00
wrapProgram $out/bin/koreader --prefix LD_LIBRARY_PATH : ${
2021-01-15 06:42:41 +01:00
lib.makeLibraryPath [ gtk3-x11 SDL2 glib ]
2020-05-05 09:08:27 +02: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";
mainProgram = "koreader";
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
platforms = [ "aarch64-linux" "x86_64-linux" ];
license = licenses.agpl3Only;
2020-12-28 20:56:29 +01:00
maintainers = with maintainers; [ contrun neonfuz];
2020-05-05 09:08:27 +02:00
};
}