diff --git a/pkgs/additional/koreader-from-src/debug.patch b/pkgs/additional/koreader-from-src/debug.patch new file mode 100644 index 00000000..4f9f5531 --- /dev/null +++ b/pkgs/additional/koreader-from-src/debug.patch @@ -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() diff --git a/pkgs/additional/koreader-from-src/default.nix b/pkgs/additional/koreader-from-src/default.nix index 76c4bd59..7579d88b 100644 --- a/pkgs/additional/koreader-from-src/default.nix +++ b/pkgs/additional/koreader-from-src/default.nix @@ -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, diff --git a/pkgs/additional/koreader-from-src/mupdf_dir.patch b/pkgs/additional/koreader-from-src/mupdf_dir.patch new file mode 100644 index 00000000..7f93d9e5 --- /dev/null +++ b/pkgs/additional/koreader-from-src/mupdf_dir.patch @@ -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 \ diff --git a/pkgs/additional/koreader-from-src/mupdf_no_rm_build_dir.patch b/pkgs/additional/koreader-from-src/mupdf_no_rm_build_dir.patch new file mode 100644 index 00000000..083a9412 --- /dev/null +++ b/pkgs/additional/koreader-from-src/mupdf_no_rm_build_dir.patch @@ -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) \ diff --git a/pkgs/additional/koreader-from-src/sources.nix b/pkgs/additional/koreader-from-src/sources.nix index 0dba71e8..66cb4029 100644 --- a/pkgs/additional/koreader-from-src/sources.nix +++ b/pkgs/additional/koreader-from-src/sources.nix @@ -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=";