1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-20 04:31:52 +00:00
nixpkgs/pkgs/applications/misc/koreader/default.nix

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

64 lines
1.7 KiB
Nix
Raw Normal View History

{ lib, stdenv
2020-05-05 08:08:27 +01:00
, fetchurl
, makeWrapper
, dpkg
, glib
, gnutar
2020-05-05 08:08:27 +01:00
, gtk3-x11
, luajit
, sdcv
2020-05-05 08:08:27 +01:00
, SDL2
, noto-fonts
, nerdfonts }:
let font-droid = nerdfonts.override { fonts = [ "DroidSansMono" ]; };
in stdenv.mkDerivation rec {
pname = "koreader";
2022-03-27 02:14:22 +01:00
version = "2022.03.1";
2020-05-05 08:08:27 +01:00
src = fetchurl {
url =
"https://github.com/koreader/koreader/releases/download/v${version}/koreader-${version}-amd64.deb";
2022-03-27 02:14:22 +01:00
sha256 = "sha256-ZoqITWPR60G4xY9InrtIY9rCWUk0PidGFZokHLWl5ps=";
2020-05-05 08:08:27 +01:00
};
sourceRoot = ".";
nativeBuildInputs = [ makeWrapper dpkg ];
buildInputs = [
glib
gnutar
gtk3-x11
luajit
sdcv
SDL2
];
2020-05-05 08:08:27 +01:00
unpackCmd = "dpkg-deb -x ${src} .";
dontConfigure = true;
dontBuild = true;
installPhase = ''
mkdir -p $out
cp -R usr/* $out/
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
2020-05-05 08:08:27 +01:00
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 : ${
2021-01-15 05:42:41 +00:00
lib.makeLibraryPath [ gtk3-x11 SDL2 glib ]
2020-05-05 08:08:27 +01:00
}
'';
meta = with lib; {
2020-05-05 08:08:27 +01: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;
license = licenses.agpl3Only;
2020-12-28 19:56:29 +00:00
maintainers = with maintainers; [ contrun neonfuz];
2020-05-05 08:08:27 +01:00
};
}