koreader-from-src: get lua-Spore, libzmq, czmq, libffi deps passing

This commit is contained in:
Colin 2023-07-21 07:59:46 +00:00
parent 6a6276c2e0
commit 439eeeeb45
3 changed files with 62 additions and 7 deletions

View File

@ -3,12 +3,12 @@
, automake
, buildPackages
, cmake
, fetchurl
, git
, libtool
, makeWrapper
, fetchgit
, fetchFromGitHub
, fetchgit
, fetchurl
, dpkg
, glib
, gnutar
@ -27,6 +27,32 @@ let
# XXX: koreader assumes lua 5.1 in places -- is this really ok?
luajit_lua52 = luajit.override { enable52Compat = true; };
sources = import ./sources.nix;
# luajson = luajit_lua52.pkgs.buildLuarocksPackage {
# pname = "luajson";
# version = "1.3.4-1";
# source = fetchgit {
# url = "https://github.com/harningt/luajson.git";
# rev = "1.3.4";
# hash = "sha256-JaJsjN5Gp+8qswfzl5XbHRQMfaCAJpWDWj9DYWJ0gEI=";
# };
# };
luaEnv = luajit_lua52.withPackages (ps: with ps; [
luarocks
(buildLuarocksPackage {
pname = "luajson";
version = "1.3.4-1";
src = fetchgit {
url = "https://github.com/harningt/luajson.git";
rev = "1.3.4";
hash = "sha256-JaJsjN5Gp+8qswfzl5XbHRQMfaCAJpWDWj9DYWJ0gEI=";
};
knownRockspec = (fetchurl {
url = "mirror://luarocks/luajson-1.3.4-1.rockspec";
hash = "sha256-+S4gfa6QaOMmOCDX8TxBq3kFWlbaEeiSMxCfefYakv0=";
}).outPath;
propagatedBuildInputs = [ lpeg ];
})
]);
in
stdenv.mkDerivation rec {
pname = "koreader-from-src";
@ -59,6 +85,7 @@ stdenv.mkDerivation rec {
./debug.patch
# ./mupdf_dir.patch #< TODO: needed?
./no_rm_build_dirs.patch
./lua-Spore-no-luajson.patch #< TODO: test this at runtime! we ship luajson, but just don't expose it via luarocks...
(substituteAll (
{
src = ./vendor-external-projects.patch;
@ -84,13 +111,16 @@ stdenv.mkDerivation rec {
pkg-config
ragel
which
luajit_lua52.pkgs.luarocks
# luajit_lua52.pkgs.luarocks
luaEnv.pkgs.luarocks
];
buildInputs = [
glib
gnutar
gtk3-x11
luajit_lua52
# luajit_lua52
# luajson
luaEnv
sdcv
SDL2
];
@ -166,6 +196,10 @@ stdenv.mkDerivation rec {
make TARGET=debian DEBIAN=1 update
'';
passthru = {
inherit luaEnv;
};
meta = with lib; {
homepage = "https://github.com/koreader/koreader";
description =

View File

@ -0,0 +1,13 @@
diff --git a/base/thirdparty/lua-Spore/CMakeLists.txt b/base/thirdparty/lua-Spore/CMakeLists.txt
index 15593193..31140257 100644
--- a/base/thirdparty/lua-Spore/CMakeLists.txt
+++ b/base/thirdparty/lua-Spore/CMakeLists.txt
@@ -29,7 +29,7 @@ set(BUILD_CMD ${ROCKS_CMD} make --tree=${OUTPUT_DIR}/rocks ${LUA_SPORE_ROCKSPEC}
set(BUILD_CMD ${BUILD_CMD} "CC=${CC}" "CFLAGS=${CFLAGS}" "LD=${LD}")
set(BUILD_CMD ${BUILD_CMD} "LUA_INCDIR=${LUA_INCDIR}" "LUA_LIBDIR=${LUA_LIBDIR}")
-set(PATCH_CMD sh -c "mkdir -p doc && ${ISED} \"s| 'luasocket|--'luasocket|g\" ${LUA_SPORE_ROCKSPEC}")
+set(PATCH_CMD sh -c "mkdir -p doc && ${ISED} \"s| 'luajson|--'luajson|g\" ${LUA_SPORE_ROCKSPEC} && ${ISED} \"s| 'luasocket|--'luasocket|g\" ${LUA_SPORE_ROCKSPEC}")
ko_write_gitclone_script(
GIT_CLONE_SCRIPT_FILENAME

View File

@ -6,6 +6,7 @@
source.hash = "sha256-kzozc0Io+1f4UMivSV2IhzJDQXmad4wNhXN/Y2Lsg3Q=";
};
czmq = {
# Completed
source.url = "https://github.com/zeromq/czmq.git";
source.rev = "2a0ddbc4b2dde623220d7f4980ddd60e910cfa78";
source.hash = "sha256-p4Cl2PLVgRQ0S4qr3VClJXjvAd2LUBU9oRUvOCfVnyw=";
@ -40,6 +41,9 @@
source.hash = "sha256-znbY4tliXHXVLBd8sTKrbglOdCUb7xhcCQsDDWcQfhw=";
};
glib = {
# TODO: fails
# GEN xdp-dbus.c
# sh: line 1: python2.7: command not found
source.url = "https://github.com/GNOME/glib.git";
source.rev = "2.58.3";
source.hash = "sha256-KmJXCJ6h2QhPyK1axk+Y9+yJzO0wnCczcogopxGShJc=";
@ -91,6 +95,7 @@
source.hash = "sha256-ddDL/nnBikbm6YznlyCcBgmq2Qzo0MjIwMzN4/kzWqk=";
};
libzmq = {
# Completed
source.url = "https://github.com/zeromq/libzmq";
source.rev = "883e95b22e0bffffa72312ea1fec76199afbe458";
source.hash = "sha256-R76EREtHsqcoKxKrgT8gfEf9pIWdLTBXvF9cDvjEf3E=";
@ -138,9 +143,11 @@
source.hash = "sha256-Y35QYNLznQmErr6rIjxLzw0/6Y7y8TbzD4yaEdgEljA=";
};
lua-Spore = {
# TODO: fails with:
# Missing dependencies for lua-spore 0.3.1-1:
# luajson >= 1.3 (not installed)
# Complete... ish?
# this originally failed like so:
# Missing dependencies for lua-spore 0.3.1-1:
# luajson >= 1.3 (not installed)
# it passes now only because we patch out its build-time check for luajson (which we DO provide at runtime)
source.url = "https://framagit.org/fperrad/lua-Spore";
source.rev = "tags/0.3.3";
source.hash = "sha256-wb7ykJsndoq0DazHpfXieUcBBptowYqD/eTTN/EK/6g=";
@ -231,6 +238,7 @@
hash = "sha256-x30NoxAq7JwH9DZx5gYR6/+JqZbvFZSXzo5Z0HV4axI=";
};
libffi = {
# Completed
url = "https://github.com/libffi/libffi/releases/download/v3.4.4/libffi-3.4.4.tar.gz";
hash = "sha256-1mxWrSWags8qnfxAizK/XaUjcVALhHRff7i2RXEt9nY=";
};