koreader: cleanup

This commit is contained in:
Colin 2024-03-22 12:07:35 +00:00
parent 1e25f37774
commit cd63fdb510
4 changed files with 4 additions and 60 deletions

View File

@ -32,20 +32,6 @@ in [
# etc, where "date" is like "20240228181608"
# and can be found with `nix-repl > :lf . > lastModifiedDate`
# (fetchpatch' {
# # prUrl = "https://github.com/NixOS/nixpkgs/pull/295712"; #< doesn't apply to master
# saneCommit = "ccd5eb1f6e00739fb003e0c4bd6eafd5d8372c2a";
# title = "luarocks: 3.10.0 -> 3.11.0";
# hash = "sha256-3F5EFKUgeDPVGRqSkT1udcwCYviGCoKhWpUSYhpTGlQ=";
# merged.staging = "20240321000000";
# })
# (fetchpatch' {
# # prUrl = "https://github.com/NixOS/nixpkgs/pull/293619"; #< reverts this!
# saneCommit = "8b0212e67557742c10799a8a36fb4aefd476e58a";
# title = "luarocks: 3.10.0 -> 3.9.2";
# hash = "sha256-EDvkMaUHs1VedbnMNMdXfLfB+uZC4tp8ZWj4T/Z4KUo=";
# })
(fetchpatch' {
prUrl = "https://github.com/NixOS/nixpkgs/pull/298001";
saneCommit = "d599839060400762a67d2c01d15b102ffe75e703";

View File

@ -269,7 +269,6 @@ let
LIBWEBPSHARPYUV_LIB="${lib.getLib libwebp}/lib/libwebpsharpyuv.so" \
LIBWEBP_DIR="${lib.getDev libwebp}" \
LPEG_ROCK="${rockspecFor "lpeg"}" \
LUAROCKS_BINARY="${lib.optionalString (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) (stdenv.hostPlatform.emulator buildPackages)} ${luajit52}/bin/lua ${luaEnv.pkgs.luarocks}/bin/.luarocks-wrapped" \
LUAJIT="${luaEnv}/bin/luajit" \
LUAJIT_JIT="${luaEnv}/share/lua/5.1/jit" \
LUAJIT_LIB="${lib.getLib luaEnv}/lib/libluajit-5.1.so" \
@ -299,6 +298,7 @@ let
ZSTD_DIR="${lib.getDev zstd}" \
ZSTD_DESTDIR="${lib.getDev zstd}" \
'';
# LUAROCKS_BINARY="${lib.optionalString (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) (stdenv.hostPlatform.emulator buildPackages)} ${luajit52}/bin/lua ${luaEnv.pkgs.luarocks}/bin/.luarocks-wrapped" \
# DO_STRIP=0 else it'll try to strip our externally built libraries, and error because those live in the nix store.
makeFlags = ''
@ -361,16 +361,14 @@ stdenv.mkDerivation rec {
);
patches = [
./debug.patch #< not needed to build, just helps debug packaging issues
# ./no_rm_build_dirs.patch
# ./lua-Spore-no-luajson.patch #< TODO: probably not needed now that lua-spore is a nixpkgs lua package
# ./debug.patch #< not needed to build, just helps debug packaging issues
./rss-no-interrupt-on-image-failure.patch # just a preference
];
sourceRoot = "koreader";
nativeBuildInputs = [
buildPackages.stdenv.cc # TODO: move to depsBuildBuild?
buildPackages.stdenv.cc
autoconf # autotools is used by some thirdparty libraries
automake
autoPatchelfHook # used by us, in fixupPhase, to ensure substituted thirdparty deps can be loaded at runtime
@ -379,11 +377,9 @@ stdenv.mkDerivation rec {
libtool
makeWrapper
pkg-config
luaEnv.pkgs.luarocks
];
buildInputs = [
# luajson
luaEnv
luaEnv #< specifically for lua.h
];
postPatch = ''
@ -399,12 +395,6 @@ stdenv.mkDerivation rec {
done
# don't force-rebuild third-party components, else we can't replace them with our own
# substituteInPlace base/Makefile.third \
# --replace-fail '-rm -rf $(MUPDF_BUILD_DIR)' "" \
# --replace-fail '-rm -rf $(LUASOCKET) $(LUASOCKET_BUILD_DIR)' "" \
# --replace-fail '-rm -f $(LUA_SPORE_DIR)/../lua-Spore-stamp/lua-Spore-build' "" \
# --replace-fail '-rm -f $(LUA_SPORE_ROCK)' "" \
# --replace-fail '-rm -f $(LUA_HTMLPARSER_ROCK)' ""
substituteInPlace base/Makefile.third \
--replace-fail ' -rm ' ' # -rm'

View File

@ -1,12 +0,0 @@
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
@@ -26,6 +26,7 @@ list(APPEND BUILD_CMD COMMAND ${ROCKS_CMD} make --tree=${OUTPUT_DIR}/rocks ${LUA_SPORE_ROCKSPEC})
list(APPEND BUILD_CMD "LUA_INCDIR=${LUA_INCDIR}" "LUA_LIBDIR=${LUA_LIBDIR}")
list(APPEND PATCH_CMD COMMAND mkdir -p doc)
+list(APPEND PATCH_CMD COMMAND ${ISED} "s| 'luajson|--&|g" ${LUA_SPORE_ROCKSPEC})
list(APPEND PATCH_CMD COMMAND ${ISED} "s| 'luasocket|--&|g" ${LUA_SPORE_ROCKSPEC})
ko_write_gitclone_script(

View File

@ -1,20 +0,0 @@
diff --git a/base/Makefile.third b/base/Makefile.third
index f6a80523..1080ab98 100644
--- a/base/Makefile.third
+++ b/base/Makefile.third
@@ -138,7 +138,6 @@ $(MUPDF_LIB): $(JPEG_LIB) \
$(LIBWEBP_LIB) \
$(ZLIB) $(AES_LIB) \
$(THIRDPARTY_DIR)/mupdf/*.*
- -rm -rf $(MUPDF_BUILD_DIR)
install -d $(MUPDF_BUILD_DIR)
cd $(MUPDF_BUILD_DIR) && \
$(CMAKE) $(CMAKE_FLAGS) \
@@ -665,7 +664,6 @@ $(OUTPUT_DIR)/data/KoboUSBMS.tar.gz: $(THIRDPARTY_DIR)/kobo-usbms/*.*
# ===========================================================================
# common lua library for networking
$(LUASOCKET): $(THIRDPARTY_DIR)/luasocket/*.*
- -rm -rf $(LUASOCKET) $(LUASOCKET_BUILD_DIR)
install -d $(LUASOCKET_BUILD_DIR)
cd $(LUASOCKET_BUILD_DIR) && \
$(CMAKE) $(CMAKE_FLAGS) \