koreader-from-src: it runs!

This commit is contained in:
Colin 2023-07-22 08:44:11 +00:00
parent f223af584d
commit 13d623201e
1 changed files with 14 additions and 8 deletions

View File

@ -1,6 +1,7 @@
{ lib, stdenv { lib, stdenv
, autoconf , autoconf
, automake , automake
, autoPatchelfHook
, buildPackages , buildPackages
, cmake , cmake
, git , git
@ -25,8 +26,6 @@
, which , which
}: }:
let let
# XXX: koreader assumes lua 5.1 in places -- is this really ok?
luajit_lua52 = luajit.override { enable52Compat = true; };
sources = import ./sources.nix; sources = import ./sources.nix;
# luajson = luajit_lua52.pkgs.buildLuarocksPackage { # luajson = luajit_lua52.pkgs.buildLuarocksPackage {
# pname = "luajson"; # pname = "luajson";
@ -37,8 +36,9 @@ let
# hash = "sha256-JaJsjN5Gp+8qswfzl5XbHRQMfaCAJpWDWj9DYWJ0gEI="; # hash = "sha256-JaJsjN5Gp+8qswfzl5XbHRQMfaCAJpWDWj9DYWJ0gEI=";
# }; # };
# }; # };
luaEnv = luajit_lua52.withPackages (ps: with ps; [ luajit52 = luajit.override { enable52Compat = true; self = luajit52; };
luarocks luaEnv = luajit52.withPackages (ps: with ps; [
luarocks # TODO: needed?
(buildLuarocksPackage { (buildLuarocksPackage {
pname = "luajson"; pname = "luajson";
version = "1.3.4-1"; version = "1.3.4-1";
@ -102,6 +102,7 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ nativeBuildInputs = [
autoconf # autotools is used by some thirdparty libraries autoconf # autotools is used by some thirdparty libraries
automake automake
autoPatchelfHook # TODO: needed?
cmake # for koreader/base submodule cmake # for koreader/base submodule
dpkg dpkg
git git
@ -117,14 +118,14 @@ stdenv.mkDerivation rec {
luaEnv.pkgs.luarocks luaEnv.pkgs.luarocks
]; ];
buildInputs = [ buildInputs = [
glib glib #< TODO: needed?
gnutar gnutar
gtk3-x11 gtk3-x11 #< TODO: needed?
# luajit_lua52 # luajit_lua52
# luajson # luajson
luaEnv luaEnv
sdcv sdcv # TODO: remove this? KOreader builds (and ships) it itself
SDL2 SDL2 # TODO: remove this? KOreader builds (but doesn't ship) it itself
]; ];
postPatch = postPatch =
@ -221,7 +222,12 @@ stdenv.mkDerivation rec {
installPhase = '' installPhase = ''
make TARGET=debian DEBIAN=1 debianupdate make TARGET=debian DEBIAN=1 debianupdate
mv koreader-debian-x86_64-unknown-linux-gnu/debian/usr $out mv koreader-debian-x86_64-unknown-linux-gnu/debian/usr $out
wrapProgram $out/bin/koreader --prefix LD_LIBRARY_PATH : ${
lib.makeLibraryPath [ SDL2 ]
}
''; '';
# XXX: nixpkgs adds glib and gtk3-x11 to LD_LIBRARY_PATH as well
passthru = { passthru = {
inherit luaEnv; inherit luaEnv;