koreader-from-src: get mupdf to build

This commit is contained in:
Colin 2023-07-21 01:56:55 +00:00
parent f3edafd11c
commit 98ef5d77c3
5 changed files with 51 additions and 4 deletions

View File

@ -0,0 +1,13 @@
diff --git a/base/thirdparty/cmake_modules/koreader_thirdparty_git.cmake b/base/thirdparty/cmake_modules/koreader_thirdparty_git.cmake
index d8f9207a..32bee97c 100644
--- a/base/thirdparty/cmake_modules/koreader_thirdparty_git.cmake
+++ b/base/thirdparty/cmake_modules/koreader_thirdparty_git.cmake
@@ -24,6 +24,8 @@ endif()
set(run 0)
+message(STATUS \"ko_write_gitclone_script: checking '${gitclone_infofile}' against '${gitclone_stampfile}'\")
+
if(\"${gitclone_infofile}\" IS_NEWER_THAN \"${gitclone_stampfile}\")
set(run 1)
endif()

View File

@ -52,6 +52,9 @@ stdenv.mkDerivation rec {
);
patches = [
./debug.patch
./mupdf_dir.patch #< TODO: needed?
./mupdf_no_rm_build_dir.patch
(substituteAll (
{
src = ./vendor-external-projects.patch;
@ -112,12 +115,15 @@ stdenv.mkDerivation rec {
# koreader will know to skip the `git clone` and `git checkout` calls.
# the logic we're spoofing lives in koreader/base/thirdparty/cmake_modules/koreader_thirdparty_git.cmake
stamp_dir="base/thirdparty/$lib/build/$platform/git_checkout/stamp"
echo "creating stamp in $stamp_dir for rev $rev"
stamp_info="$stamp_dir/$lib-gitinfo-$rev.txt"
stamp_clone="$stamp_dir/$lib-gitclone-lastrun.txt"
echo "creating stamps for $lib: $stamp_clone > $stamp_info"
# mkdir $(dirname ..) to handle the case where `$rev` contains slashes
mkdir -p $(dirname "$stamp_dir/$lib-gitinfo-$rev.txt")
mkdir -p $(dirname "$stamp_info")
# koreader-base decides whether to redo the git checkout based on a timestamp compare of these two stamp files
touch -d "last week" "$stamp_dir/$lib-gitinfo-$rev.txt"
touch -d "next week" "$stamp_dir/$lib-gitclone-lastrun.txt"
touch -d "last week" $(dirname "$stamp_info") #< XXX: necessary?
touch -d "last week" "$stamp_info"
touch -d "next week" "$stamp_clone"
# koreader would copy the checkout into this build/working directory,
# but because we spoof the stamps to work around other git errors,

View File

@ -0,0 +1,15 @@
diff --git a/base/Makefile.defs b/base/Makefile.defs
index dbb95daa..1293e5d5 100644
--- a/base/Makefile.defs
+++ b/base/Makefile.defs
@@ -732,8 +732,8 @@ MINIZIP_DIR=$(CURDIR)/$(MINIZIP_BUILD_DIR)/minizip-prefix/src/minizip
AES_LIB_DIR=$(MINIZIP_DIR)/aes
AES_LIB=$(MINIZIP_DIR)/libaes.a
-MUPDF_BUILD_DIR=$(CURDIR)/$(THIRDPARTY_DIR)/mupdf/build/$(MACHINE)
-MUPDF_DIR=$(MUPDF_BUILD_DIR)/mupdf-prefix/src/mupdf
+MUPDF_BUILD_DIR=$(THIRDPARTY_DIR)/mupdf/build/$(MACHINE)
+MUPDF_DIR=$(CURDIR)/$(MUPDF_BUILD_DIR)/mupdf-prefix/src/mupdf
MUPDF_LIB_DIR=$(MUPDF_DIR)/build/$(if $(KODEBUG),debug,release)
MUPDF_LIB_STATIC=$(MUPDF_LIB_DIR)/libmupdf.a
MUPDF_THIRDPARTY_LIBS=$(MUPDF_LIB_DIR)/libmupdfthird.a \

View File

@ -0,0 +1,12 @@
diff --git a/base/Makefile.third b/base/Makefile.third
index f6a80523..061d2340 100644
--- a/base/Makefile.third
+++ b/base/Makefile.third
@@ -137,7 +137,6 @@ $(MUPDF_LIB) $(MUPDF_DIR)/include: $(JPEG_LIB) \
$(HARFBUZZ_LIB) $(HARFBUZZ_DIR)/include \
$(LIBWEBP_LIB) $(LIBWEBP_DIR)/include \
$(ZLIB) $(AES_LIB) $(THIRDPARTY_DIR)/mupdf/*.*
- -rm -rf $(MUPDF_BUILD_DIR)
install -d $(MUPDF_BUILD_DIR)
cd $(MUPDF_BUILD_DIR) && \
$(CMAKE) $(CMAKE_FLAGS) \

View File

@ -148,6 +148,7 @@
source.hash = "sha256-P/3MMMGYDqD9NmkYvw/thKpUNa3wNOSlBBjANHSonAg=";
};
mupdf = {
# Completed
source.url = "https://github.com/ArtifexSoftware/mupdf.git";
source.rev = "tags/1.13.0";
source.hash = "sha256-pQejRon9fO9A1mhz3oLjBr1j4HveDLcQIWjR1/Rpy5Q=";