From 82e561d732cbdd9d7bcc3ae7e871cb34462dcb0d Mon Sep 17 00:00:00 2001 From: Michael Daniels Date: Sat, 24 May 2025 10:44:54 -0400 Subject: [PATCH 1/2] mupdf: 1.25.3 -> 1.26.1 Changelog: https://github.com/ArtifexSoftware/mupdf/blob/1.26.1/CHANGES We no longer need the patch, as this was fixed upstream. USE_SONAME must be yes now per https://issues.guix.gnu.org/78401#2-lineno0 Closes: #386518 Closes: #409069 Resolves: #407523 --- .../mu/mupdf/fix-darwin-system-deps.patch | 60 ------------------- pkgs/by-name/mu/mupdf/package.nix | 20 ++++--- 2 files changed, 11 insertions(+), 69 deletions(-) delete mode 100644 pkgs/by-name/mu/mupdf/fix-darwin-system-deps.patch diff --git a/pkgs/by-name/mu/mupdf/fix-darwin-system-deps.patch b/pkgs/by-name/mu/mupdf/fix-darwin-system-deps.patch deleted file mode 100644 index 4a170b4c1d06..000000000000 --- a/pkgs/by-name/mu/mupdf/fix-darwin-system-deps.patch +++ /dev/null @@ -1,60 +0,0 @@ -diff --git a/Makerules b/Makerules -index f582dc061..2da5680b6 100644 ---- a/Makerules -+++ b/Makerules -@@ -178,39 +178,20 @@ ifneq "$(CLUSTER)" "" - endif - - ifeq ($(OS),Linux) -- LINUX_OR_OPENBSD := yes -+ LINUX_OR_OPENBSD_OR_MACOS := yes - endif - ifeq ($(OS),OpenBSD) -- LINUX_OR_OPENBSD := yes -+ LINUX_OR_OPENBSD_OR_MACOS := yes -+endif -+ifeq ($(OS),MACOS) -+ LINUX_OR_OPENBSD_OR_MACOS := yes - endif - - ifeq ($(OS),MINGW) - WINDRES := windres - HAVE_WIN32 := yes - --else ifeq ($(OS),MACOS) -- HAVE_GLUT := yes -- SYS_GLUT_CFLAGS := -Wno-deprecated-declarations -- SYS_GLUT_LIBS := -framework GLUT -framework OpenGL -- CC = xcrun cc -- AR = xcrun ar -- LD = xcrun ld -- RANLIB = xcrun ranlib -- -- ifneq ($(ARCHFLAGS),) -- $(warning "MacOS with ARCHFLAGS set. Assuming we are building for arm64, and setting HAVE_LIBCRYPTO to no.") -- HAVE_LIBCRYPTO := no -- else ifeq (, $(shell command -v pkg-config)) -- $(warning "No pkg-config found, install it for proper integration of libcrypto") -- else -- HAVE_LIBCRYPTO := $(shell pkg-config --exists 'libcrypto >= 1.1.0' && echo yes) -- ifeq ($(HAVE_LIBCRYPTO),yes) -- LIBCRYPTO_CFLAGS := $(shell pkg-config --cflags libcrypto) -DHAVE_LIBCRYPTO -- LIBCRYPTO_LIBS := $(shell pkg-config --libs libcrypto) -- endif -- endif -- --else ifeq ($(LINUX_OR_OPENBSD),yes) -+else ifeq ($(LINUX_OR_OPENBSD_OR_MACOS),yes) - - ifeq ($(OS),Linux) - HAVE_OBJCOPY := yes -@@ -274,6 +255,9 @@ else ifeq ($(LINUX_OR_OPENBSD),yes) - ifeq ($(OS),OpenBSD) - SYS_GLUT_CFLAGS := $(shell pkg-config --cflags glut gl) - SYS_GLUT_LIBS := $(shell pkg-config --libs glut gl) -+ else ifeq ($(OS),MACOS) -+ SYS_GLUT_CFLAGS := -Wno-deprecated-declarations -+ SYS_GLUT_LIBS := -framework GLUT -framework OpenGL - else - SYS_GLUT_CFLAGS := - SYS_GLUT_LIBS := -lglut -lGL diff --git a/pkgs/by-name/mu/mupdf/package.nix b/pkgs/by-name/mu/mupdf/package.nix index 50344eb22589..8d8debef9e44 100644 --- a/pkgs/by-name/mu/mupdf/package.nix +++ b/pkgs/by-name/mu/mupdf/package.nix @@ -36,6 +36,7 @@ swig, xcbuild, gitUpdater, + enableBarcode ? false, # for passthru.tests cups-filters, @@ -61,18 +62,15 @@ let in stdenv.mkDerivation rec { - version = "1.25.3"; + version = "1.26.1"; pname = "mupdf"; src = fetchurl { url = "https://mupdf.com/downloads/archive/${pname}-${version}-source.tar.gz"; - hash = "sha256-uXTXBqloBTPRBLQRIiTHvz3pPye+fKQbS/tRVSYk8Kk="; + hash = "sha256-vc4BfHdnRMKIsCECl37gN4y0NseN+BJ6I/KB8TYEBv0="; }; patches = [ - # Upstream makefile does not work with system deps on macOS by default, so - # we reuse the Linux section instead. - ./fix-darwin-system-deps.patch # Upstream C++ wrap script only defines fixed-sized integers on macOS but # this is required on aarch64-linux too. ./fix-cpp-build.patch @@ -101,7 +99,11 @@ stdenv.mkDerivation rec { ] ++ lib.optionals (!enableX11) [ "HAVE_X11=no" ] ++ lib.optionals (!enableGL) [ "HAVE_GLUT=no" ] - ++ lib.optionals (enableOcr) [ "USE_TESSERACT=yes" ]; + ++ lib.optionals (enableOcr) [ "USE_TESSERACT=yes" ] + ++ lib.optionals (enableBarcode) [ + "barcode=yes" + "USE_SYSTEM_ZXINGCPP=no" + ]; nativeBuildInputs = [ pkg-config ] @@ -159,7 +161,7 @@ stdenv.mkDerivation rec { ]; preConfigure = '' - # Don't remove mujs because upstream version is incompatible + # Don't remove mujs or zxing-cpp because upstream version is incompatible rm -rf thirdparty/{curl,freetype,glfw,harfbuzz,jbig2dec,libjpeg,openjpeg,zlib} ''; @@ -242,7 +244,7 @@ stdenv.mkDerivation rec { ) + (lib.optionalString (enableCxx) '' cp platform/c++/include/mupdf/*.h $out/include/mupdf - cp build/*/libmupdfcpp.so $out/lib + cp build/*/libmupdfcpp.so* $out/lib '') + (lib.optionalString (enablePython) ( '' @@ -257,7 +259,7 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; - env.USE_SONAME = "no"; + env.USE_SONAME = "yes"; passthru = { tests = { From 8e1033656ea15c6c47ad3b3cd890be45ab8e29d5 Mon Sep 17 00:00:00 2001 From: Michael Daniels Date: Sat, 24 May 2025 12:31:09 -0400 Subject: [PATCH 2/2] python3Packages.pymupdf: 1.25.2 -> 1.26.0 Changelog: https://github.com/pymupdf/PyMuPDF/blob/1.26.0/changes.txt --- .../python-modules/pymupdf/default.nix | 25 ++++++++----------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/pkgs/development/python-modules/pymupdf/default.nix b/pkgs/development/python-modules/pymupdf/default.nix index 8db2acf59a3c..0942ab73c432 100644 --- a/pkgs/development/python-modules/pymupdf/default.nix +++ b/pkgs/development/python-modules/pymupdf/default.nix @@ -37,35 +37,25 @@ let enableOcr = true; enableCxx = true; enablePython = true; + enableBarcode = true; python3 = python; }; in buildPythonPackage rec { pname = "pymupdf"; - version = "1.25.2"; + version = "1.26.0"; pyproject = true; - disabled = pythonOlder "3.7"; + disabled = pythonOlder "3.9"; src = fetchFromGitHub { owner = "pymupdf"; repo = "PyMuPDF"; tag = version; - hash = "sha256-6XbHQ8PE9IF0kngUhYkFSGjwgt+r+19v+PeDAQin2Ko="; + hash = "sha256-juBjlS9/ykpji9RbDcyOjAu+cVSDaFc3HAmxYHTylt8="; }; - patches = [ - # Fix build against mupdf-1.25.3: - # https://github.com/pymupdf/PyMuPDF/pull/4248 - (fetchpatch { - name = "mupdf-1.25.3.patch"; - url = "https://github.com/pymupdf/PyMuPDF/commit/f42ef85058fee087d3f5e565f34a7657aad11240.patch"; - hash = "sha256-X5JF8nPLj4uubdEdvUJ5aEf0yZkW+ks99pzua0vCrZc="; - }) - ]; - # swig is not wrapped as Python package - # libclang calls itself just clang in wheel metadata postPatch = '' substituteInPlace setup.py \ --replace-fail "ret.append( 'swig')" "pass" \ @@ -125,6 +115,13 @@ buildPythonPackage rec { "test_color_count" "test_3050" "test_textbox3" + "test_3493" + "test_4180" + # Requires downloads + "test_4457" + "test_4445" + # Not a git repository, so git ls-files fails + "test_open2" ]; pythonImportsCheck = [