diff options
Diffstat (limited to 'gnu/packages/patches')
-rw-r--r-- | gnu/packages/patches/hubbub-maybe-uninitialized.patch | 40 | ||||
-rw-r--r-- | gnu/packages/patches/libcss-check-format.patch | 13 | ||||
-rw-r--r-- | gnu/packages/patches/libtommath-fix-linkage.patch | 55 | ||||
-rw-r--r-- | gnu/packages/patches/libtommath-integer-overflow.patch | 140 | ||||
-rw-r--r-- | gnu/packages/patches/netsurf-message-timestamp.patch | 4 | ||||
-rw-r--r-- | gnu/packages/patches/podman-program-lookup.patch | 120 | ||||
-rw-r--r-- | gnu/packages/patches/python-3.12-fix-tests.patch | 334 | ||||
-rw-r--r-- | gnu/packages/patches/scribus-1.5.8-poppler-22.03.0.patch | 52 | ||||
-rw-r--r-- | gnu/packages/patches/scribus-1.5.8-poppler-22.04.0.patch | 291 | ||||
-rw-r--r-- | gnu/packages/patches/scribus-1.5.8-poppler-22.09.0.patch | 20 | ||||
-rw-r--r-- | gnu/packages/patches/scribus-1.5.8-poppler-22.2.0-1.patch | 129 | ||||
-rw-r--r-- | gnu/packages/patches/scribus-1.5.8-poppler-22.2.0-2.patch | 28 | ||||
-rw-r--r-- | gnu/packages/patches/sioyek-fix-build.patch | 82 |
13 files changed, 551 insertions, 757 deletions
diff --git a/gnu/packages/patches/hubbub-maybe-uninitialized.patch b/gnu/packages/patches/hubbub-maybe-uninitialized.patch deleted file mode 100644 index 6f289a770e..0000000000 --- a/gnu/packages/patches/hubbub-maybe-uninitialized.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 69d81a8a4d4c223aad67cde0fdf64d64351b9802 Mon Sep 17 00:00:00 2001 -From: Andy Tai <[email protected]> -Date: Sat, 27 May 2023 00:01:34 -0700 -Subject: [PATCH] prevent -Werror=maybe-uninitialized build failure with gcc 11 - when building tests tokeniser2 and tokeniser3 - ---- - test/tokeniser2.c | 2 +- - test/tokeniser3.c | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/test/tokeniser2.c b/test/tokeniser2.c -index c8ab9c0..4caae38 100644 ---- a/test/tokeniser2.c -+++ b/test/tokeniser2.c -@@ -438,7 +438,7 @@ hubbub_error token_handler(const hubbub_token *token, void *pw) - /* Expected token only contained part of the data - * Calculate how much is left, then try again with - * the next expected token */ -- hubbub_token t; -+ hubbub_token t = { 0 }; - - t.type = HUBBUB_TOKEN_CHARACTER; - t.data.character.ptr += len; -diff --git a/test/tokeniser3.c b/test/tokeniser3.c -index e33d018..b3be901 100644 ---- a/test/tokeniser3.c -+++ b/test/tokeniser3.c -@@ -447,7 +447,7 @@ hubbub_error token_handler(const hubbub_token *token, void *pw) - /* Expected token only contained part of the data - * Calculate how much is left, then try again with - * the next expected token */ -- hubbub_token t; -+ hubbub_token t = { 0 }; - - t.type = HUBBUB_TOKEN_CHARACTER; - t.data.character.ptr += len; --- -2.40.1 - diff --git a/gnu/packages/patches/libcss-check-format.patch b/gnu/packages/patches/libcss-check-format.patch new file mode 100644 index 0000000000..b297ac1c92 --- /dev/null +++ b/gnu/packages/patches/libcss-check-format.patch @@ -0,0 +1,13 @@ +Submitted upstream at https://bugs.netsurf-browser.org/mantis/view.php?id=2870 + +--- libcss-0.9.2/test/dump.h.orig ++++ libcss-0.9.2/test/dump.h +@@ -131,7 +131,7 @@ void dump_rule_media(css_rule_media *s, char **buf, size_t *buflen) + char *ptr = *buf; + css_rule *rule; + +- ptr += sprintf(ptr, "| @media %s%03lx", ++ ptr += sprintf(ptr, "| @media %s%03" PRIx64, + s->media->negate_type ? "not " : "", + s->media->type); + diff --git a/gnu/packages/patches/libtommath-fix-linkage.patch b/gnu/packages/patches/libtommath-fix-linkage.patch deleted file mode 100644 index 1a9d46eb7c..0000000000 --- a/gnu/packages/patches/libtommath-fix-linkage.patch +++ /dev/null @@ -1,55 +0,0 @@ -https://github.com/libtom/libtommath/commit/93dea3a4162527346cd8856bfda6f17ffe98ab04.patch - -From 93dea3a4162527346cd8856bfda6f17ffe98ab04 Mon Sep 17 00:00:00 2001 -From: Steffen Jaeckel <[email protected]> -Date: Thu, 31 Jan 2019 14:12:03 +0100 -Subject: [PATCH] makefile.shared: fix compilation and linkage - ---- - makefile.shared | 15 ++++++++------- - 1 file changed, 8 insertions(+), 7 deletions(-) - -diff --git a/makefile.shared b/makefile.shared -index 3955f830..870b18d1 100644 ---- a/makefile.shared -+++ b/makefile.shared -@@ -18,6 +18,7 @@ ifndef LIBTOOL - endif - endif - LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(CC) -+LTLINK = $(LIBTOOL) --mode=link --tag=CC $(CC) - - LCOV_ARGS=--directory .libs --directory . - -@@ -59,7 +60,7 @@ objs: $(OBJECTS) - LOBJECTS = $(OBJECTS:.o=.lo) - - $(LIBNAME): $(OBJECTS) -- $(LIBTOOL) --mode=link --tag=CC $(CC) $(LDFLAGS) $(LOBJECTS) -o $(LIBNAME) -rpath $(LIBPATH) -version-info $(VERSION_SO) $(LIBTOOLFLAGS) -+ $(LTLINK) $(LDFLAGS) $(LOBJECTS) -o $(LIBNAME) -rpath $(LIBPATH) -version-info $(VERSION_SO) $(LIBTOOLFLAGS) - - install: $(LIBNAME) - install -d $(DESTDIR)$(LIBPATH) -@@ -76,16 +77,16 @@ uninstall: - rm $(DESTDIR)$(LIBPATH)/pkgconfig/libtommath.pc - - test: $(LIBNAME) demo/demo.o -- $(CC) $(CFLAGS) -c demo/demo.c -o demo/demo.o -- $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -o test demo/demo.o $(LIBNAME) -+ $(LTCOMPILE) $(CFLAGS) -c demo/demo.c -o demo/demo.o -+ $(LTLINK) $(LDFLAGS) -o test demo/demo.o $(LIBNAME) - - test_standalone: $(LIBNAME) demo/demo.o -- $(CC) $(CFLAGS) -c demo/demo.c -o demo/demo.o -- $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -o test demo/demo.o $(LIBNAME) -+ $(LTCOMPILE) $(CFLAGS) -c demo/demo.c -o demo/demo.o -+ $(LTLINK) $(LDFLAGS) -o test demo/demo.o $(LIBNAME) - - .PHONY: mtest - mtest: -- cd mtest ; $(CC) $(CFLAGS) $(LDFLAGS) mtest.c -o mtest -+ cd mtest ; $(CC) $(CFLAGS) -O0 mtest.c $(LDFLAGS) -o mtest - - timing: $(LIBNAME) demo/timing.c -- $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -DTIMER demo/timing.c $(LIBNAME) -o timing -+ $(LTLINK) $(CFLAGS) $(LDFLAGS) -DTIMER demo/timing.c $(LIBNAME) -o timing diff --git a/gnu/packages/patches/libtommath-integer-overflow.patch b/gnu/packages/patches/libtommath-integer-overflow.patch deleted file mode 100644 index 5241726775..0000000000 --- a/gnu/packages/patches/libtommath-integer-overflow.patch +++ /dev/null @@ -1,140 +0,0 @@ -This patch is from upstream: -https://github.com/libtom/libtommath/pull/546 - -From beba892bc0d4e4ded4d667ab1d2a94f4d75109a9 Mon Sep 17 00:00:00 2001 -From: czurnieden <[email protected]> -Date: Tue, 9 May 2023 17:17:12 +0200 -Subject: [PATCH] Fix possible integer overflow - ---- - bn_mp_2expt.c | 4 ++++ - bn_mp_grow.c | 4 ++++ - bn_mp_init_size.c | 5 +++++ - bn_mp_mul_2d.c | 4 ++++ - bn_s_mp_mul_digs.c | 4 ++++ - bn_s_mp_mul_digs_fast.c | 4 ++++ - bn_s_mp_mul_high_digs.c | 4 ++++ - bn_s_mp_mul_high_digs_fast.c | 4 ++++ - 8 files changed, 33 insertions(+) - -diff --git a/bn_mp_2expt.c b/bn_mp_2expt.c -index 0ae3df1bf..23de0c3c5 100644 ---- a/bn_mp_2expt.c -+++ b/bn_mp_2expt.c -@@ -12,6 +12,10 @@ mp_err mp_2expt(mp_int *a, int b) - { - mp_err err; - -+ if (b < 0) { -+ return MP_VAL; -+ } -+ - /* zero a as per default */ - mp_zero(a); - -diff --git a/bn_mp_grow.c b/bn_mp_grow.c -index 9e904c547..2b1682651 100644 ---- a/bn_mp_grow.c -+++ b/bn_mp_grow.c -@@ -9,6 +9,10 @@ mp_err mp_grow(mp_int *a, int size) - int i; - mp_digit *tmp; - -+ if (size < 0) { -+ return MP_VAL; -+ } -+ - /* if the alloc size is smaller alloc more ram */ - if (a->alloc < size) { - /* reallocate the array a->dp -diff --git a/bn_mp_init_size.c b/bn_mp_init_size.c -index d62268721..99573833f 100644 ---- a/bn_mp_init_size.c -+++ b/bn_mp_init_size.c -@@ -6,6 +6,11 @@ - /* init an mp_init for a given size */ - mp_err mp_init_size(mp_int *a, int size) - { -+ -+ if (size < 0) { -+ return MP_VAL; -+ } -+ - size = MP_MAX(MP_MIN_PREC, size); - - /* alloc mem */ -diff --git a/bn_mp_mul_2d.c b/bn_mp_mul_2d.c -index 87354de20..bfeaf2eb2 100644 ---- a/bn_mp_mul_2d.c -+++ b/bn_mp_mul_2d.c -@@ -9,6 +9,10 @@ mp_err mp_mul_2d(const mp_int *a, int b, mp_int *c) - mp_digit d; - mp_err err; - -+ if (b < 0) { -+ return MP_VAL; -+ } -+ - /* copy */ - if (a != c) { - if ((err = mp_copy(a, c)) != MP_OKAY) { -diff --git a/bn_s_mp_mul_digs.c b/bn_s_mp_mul_digs.c -index 64509d4cb..3682b4980 100644 ---- a/bn_s_mp_mul_digs.c -+++ b/bn_s_mp_mul_digs.c -@@ -16,6 +16,10 @@ mp_err s_mp_mul_digs(const mp_int *a, const mp_int *b, mp_int *c, int digs) - mp_word r; - mp_digit tmpx, *tmpt, *tmpy; - -+ if (digs < 0) { -+ return MP_VAL; -+ } -+ - /* can we use the fast multiplier? */ - if ((digs < MP_WARRAY) && - (MP_MIN(a->used, b->used) < MP_MAXFAST)) { -diff --git a/bn_s_mp_mul_digs_fast.c b/bn_s_mp_mul_digs_fast.c -index b2a287b02..3c4176a87 100644 ---- a/bn_s_mp_mul_digs_fast.c -+++ b/bn_s_mp_mul_digs_fast.c -@@ -26,6 +26,10 @@ mp_err s_mp_mul_digs_fast(const mp_int *a, const mp_int *b, mp_int *c, int digs) - mp_digit W[MP_WARRAY]; - mp_word _W; - -+ if (digs < 0) { -+ return MP_VAL; -+ } -+ - /* grow the destination as required */ - if (c->alloc < digs) { - if ((err = mp_grow(c, digs)) != MP_OKAY) { -diff --git a/bn_s_mp_mul_high_digs.c b/bn_s_mp_mul_high_digs.c -index 2bb2a5098..c9dd355f8 100644 ---- a/bn_s_mp_mul_high_digs.c -+++ b/bn_s_mp_mul_high_digs.c -@@ -15,6 +15,10 @@ mp_err s_mp_mul_high_digs(const mp_int *a, const mp_int *b, mp_int *c, int digs) - mp_word r; - mp_digit tmpx, *tmpt, *tmpy; - -+ if (digs < 0) { -+ return MP_VAL; -+ } -+ - /* can we use the fast multiplier? */ - if (MP_HAS(S_MP_MUL_HIGH_DIGS_FAST) - && ((a->used + b->used + 1) < MP_WARRAY) -diff --git a/bn_s_mp_mul_high_digs_fast.c b/bn_s_mp_mul_high_digs_fast.c -index a2c4fb692..4ce7f590c 100644 ---- a/bn_s_mp_mul_high_digs_fast.c -+++ b/bn_s_mp_mul_high_digs_fast.c -@@ -19,6 +19,10 @@ mp_err s_mp_mul_high_digs_fast(const mp_int *a, const mp_int *b, mp_int *c, int - mp_digit W[MP_WARRAY]; - mp_word _W; - -+ if (digs < 0) { -+ return MP_VAL; -+ } -+ - /* grow the destination as required */ - pa = a->used + b->used; - if (c->alloc < pa) { diff --git a/gnu/packages/patches/netsurf-message-timestamp.patch b/gnu/packages/patches/netsurf-message-timestamp.patch index 8df9dbf8f7..03bfdfde3f 100644 --- a/gnu/packages/patches/netsurf-message-timestamp.patch +++ b/gnu/packages/patches/netsurf-message-timestamp.patch @@ -1,5 +1,5 @@ ---- netsurf-3.8/utils/split-messages.pl.orig 1969-12-31 18:00:00.000000000 -0600 -+++ netsurf-3.8/utils/split-messages.pl 2018-08-30 00:18:58.158367530 -0500 +--- netsurf-3.11/tools/split-messages.pl.orig ++++ netsurf-3.11/tools/split-messages.pl @@ -238,7 +238,7 @@ if( $opt{gzip} ) diff --git a/gnu/packages/patches/podman-program-lookup.patch b/gnu/packages/patches/podman-program-lookup.patch new file mode 100644 index 0000000000..27a9421285 --- /dev/null +++ b/gnu/packages/patches/podman-program-lookup.patch @@ -0,0 +1,120 @@ +From 914aed3e04f71453fbdc30f4287e13ca3ce63a36 Mon Sep 17 00:00:00 2001 +From: Tomas Volf <[email protected]> +Date: Wed, 14 Feb 2024 20:02:03 +0100 +Subject: [PATCH] Modify search for binaries to fit Guix model + +Podman basically looked into the $PATH and into its libexec. That does not fit +Guix's model very well, to an additional option to specify additional +directories during compilation was added. + +* pkg/rootless/rootless_linux.go +(tryMappingTool): Also check /run/setuid-programs. +* vendor/github.com/containers/common/pkg/config/config.go +(extraGuixDir): New function. +(FindHelperBinary): Use it. +* vendor/github.com/containers/storage/pkg/unshare/unshare_linux.go +(guixLookupSetuidPath): New function. +(Start): Use it. +--- + pkg/rootless/rootless_linux.go | 3 +++ + .../containers/common/pkg/config/config.go | 23 +++++++++++++++++++ + .../storage/pkg/unshare/unshare_linux.go | 14 +++++++++-- + 3 files changed, 38 insertions(+), 2 deletions(-) + +diff --git a/pkg/rootless/rootless_linux.go b/pkg/rootless/rootless_linux.go +index d303c8b..0191d90 100644 +--- a/pkg/rootless/rootless_linux.go ++++ b/pkg/rootless/rootless_linux.go +@@ -102,6 +102,9 @@ func tryMappingTool(uid bool, pid int, hostID int, mappings []idtools.IDMap) err + idtype = "setgid" + } + path, err := exec.LookPath(tool) ++ if err != nil { ++ path, err = exec.LookPath("/run/setuid-programs/" + tool) ++ } + if err != nil { + return fmt.Errorf("command required for rootless mode with multiple IDs: %w", err) + } +diff --git a/vendor/github.com/containers/common/pkg/config/config.go b/vendor/github.com/containers/common/pkg/config/config.go +index 75b917f..ed2f131 100644 +--- a/vendor/github.com/containers/common/pkg/config/config.go ++++ b/vendor/github.com/containers/common/pkg/config/config.go +@@ -1102,6 +1102,24 @@ func findBindir() string { + return bindirCached + } + ++func extraGuixDir(bin_name string) string { ++ if (bin_name == "slirp4netns") { ++ return "@SLIRP4NETNS_DIR@"; ++ } else if (bin_name == "pasta") { ++ return "@PASST_DIR@"; ++ } else if (strings.HasPrefix(bin_name, "qemu-")) { ++ return "@QEMU_DIR@"; ++ } else if (bin_name == "gvproxy") { ++ return "@GVPROXY_DIR@"; ++ } else if (bin_name == "netavark") { ++ return "@NETAVARK_DIR@"; ++ } else if (bin_name == "aardvark-dns") { ++ return "@AARDVARK_DNS_DIR@"; ++ } else { ++ return ""; ++ } ++} ++ + // FindHelperBinary will search the given binary name in the configured directories. + // If searchPATH is set to true it will also search in $PATH. + func (c *Config) FindHelperBinary(name string, searchPATH bool) (string, error) { +@@ -1109,6 +1127,11 @@ func (c *Config) FindHelperBinary(name string, searchPATH bool) (string, error) + bindirPath := "" + bindirSearched := false + ++ if dir := extraGuixDir(name); dir != "" { ++ /* If there is a Guix dir, skip the PATH search. */ ++ dirList = append([]string{dir}, dirList...) ++ } ++ + // If set, search this directory first. This is used in testing. + if dir, found := os.LookupEnv("CONTAINERS_HELPER_BINARY_DIR"); found { + dirList = append([]string{dir}, dirList...) +diff --git a/vendor/github.com/containers/storage/pkg/unshare/unshare_linux.go b/vendor/github.com/containers/storage/pkg/unshare/unshare_linux.go +index a8dc1ba..0b0d755 100644 +--- a/vendor/github.com/containers/storage/pkg/unshare/unshare_linux.go ++++ b/vendor/github.com/containers/storage/pkg/unshare/unshare_linux.go +@@ -26,6 +26,16 @@ import ( + "github.com/syndtr/gocapability/capability" + ) + ++func guixLookupSetuidPath(prog string) (string, error) { ++ path, err := exec.LookPath(prog) ++ if err != nil { ++ path, err = exec.LookPath("/run/setuid-programs/" + prog) ++ } ++ return path, err ++} ++ ++ ++ + // Cmd wraps an exec.Cmd created by the reexec package in unshare(), and + // handles setting ID maps and other related settings by triggering + // initialization code in the child. +@@ -237,7 +247,7 @@ func (c *Cmd) Start() error { + gidmapSet := false + // Set the GID map. + if c.UseNewgidmap { +- path, err := exec.LookPath("newgidmap") ++ path, err := guixLookupSetuidPath("newgidmap") + if err != nil { + return fmt.Errorf("finding newgidmap: %w", err) + } +@@ -297,7 +307,7 @@ func (c *Cmd) Start() error { + uidmapSet := false + // Set the UID map. + if c.UseNewuidmap { +- path, err := exec.LookPath("newuidmap") ++ path, err := guixLookupSetuidPath("newuidmap") + if err != nil { + return fmt.Errorf("finding newuidmap: %w", err) + } +-- +2.41.0 + diff --git a/gnu/packages/patches/python-3.12-fix-tests.patch b/gnu/packages/patches/python-3.12-fix-tests.patch new file mode 100644 index 0000000000..fa5c8027ce --- /dev/null +++ b/gnu/packages/patches/python-3.12-fix-tests.patch @@ -0,0 +1,334 @@ +From f0698133e7d6c353a3e6ae0fc62e57ba558a9bc0 Mon Sep 17 00:00:00 2001 +From: Maxim Cournoyer <[email protected]> +Date: Wed, 28 Oct 2020 22:55:05 -0400 +Subject: [PATCH] Skip problematic Python 3 tests in Guix. + +A subset of the hunks in this patch is tracked upstream at +https://bugs.python.org/issue38845, which was contributed by Tanguy Le +Carrour <[email protected]>. + +diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py +index e42c7ab4bd..8087c84dab 100644 +--- a/Lib/test/_test_multiprocessing.py ++++ b/Lib/test/_test_multiprocessing.py +@@ -1695,6 +1695,7 @@ def _test_wait_result(cls, c, pid): + if pid is not None: + os.kill(pid, signal.SIGINT) + ++ @unittest.skipIf(True, "This fails for unknown reasons on Guix") + def test_wait_result(self): + if isinstance(self, ProcessesMixin) and sys.platform != 'win32': + pid = os.getpid() +@@ -4150,6 +4151,7 @@ def test_shared_memory_across_processes(self): + sms.close() + + @unittest.skipIf(os.name != "posix", "not feasible in non-posix platforms") ++ @unittest.skipUnless(sys.stdin.isatty(), "KeyboardInterrupts require a TTY device") + def test_shared_memory_SharedMemoryServer_ignores_sigint(self): + # bpo-36368: protect SharedMemoryManager server process from + # KeyboardInterrupt signals. +diff --git a/Lib/test/test_asyncio/test_base_events.py b/Lib/test/test_asyncio/test_base_events.py +index 85c8152d49..e35cfffe84 100644 +--- a/Lib/test/test_asyncio/test_base_events.py ++++ b/Lib/test/test_asyncio/test_base_events.py +@@ -1377,6 +1377,8 @@ def test_create_connection_no_inet_pton(self, m_socket): + self._test_create_connection_ip_addr(m_socket, False) + + @patch_socket ++ @unittest.skipUnless(support.is_resource_enabled('network'), ++ 'network is not enabled') + def test_create_connection_service_name(self, m_socket): + m_socket.getaddrinfo = socket.getaddrinfo + sock = m_socket.socket.return_value +diff --git a/Lib/test/test_ctypes/test_find.py b/Lib/test/test_ctypes/test_find.py +index a41e94971d..1291af3057 100644 +--- a/Lib/test/test_ctypes/test_find.py ++++ b/Lib/test/test_ctypes/test_find.py +@@ -117,6 +117,7 @@ def test_find_library_with_gcc(self): + with unittest.mock.patch("ctypes.util._findSoname_ldconfig", lambda *args: None): + self.assertNotEqual(find_library('c'), None) + ++ @unittest.skipIf(True, 'Fails on Guix.') + def test_find_library_with_ld(self): + with unittest.mock.patch("ctypes.util._findSoname_ldconfig", lambda *args: None), \ + unittest.mock.patch("ctypes.util._findLib_gcc", lambda *args: None): +diff --git a/Lib/test/test_generators.py b/Lib/test/test_generators.py +index 1ee9958445..ab6b41befe 100644 +--- a/Lib/test/test_generators.py ++++ b/Lib/test/test_generators.py +@@ -34,6 +34,7 @@ def generator2(self): + else: + return "FAILED" + ++ @unittest.skipIf(True, 'Keyboard interrupts do not work in the Guix build environment') + def test_raise_and_yield_from(self): + gen = self.generator1() + gen.send(None) +diff --git a/Lib/test/test_pathlib.py b/Lib/test/test_pathlib.py +index ec105ae1a0..ae4c5b672e 100644 +--- a/Lib/test/test_pathlib.py ++++ b/Lib/test/test_pathlib.py +@@ -3069,6 +3069,7 @@ def test_rglob(self): + 'pwd module does not expose getpwall()') + @unittest.skipIf(sys.platform == "vxworks", + "no home directory on VxWorks") ++ @unittest.skipIf(True, "Guix builder home is '/' which causes trouble for these tests") + def test_expanduser(self): + P = self.cls + import_helper.import_module('pwd') +diff --git a/Lib/test/test_pdb.py b/Lib/test/test_pdb.py +index 51b844262e..004d3133cf 100644 +--- a/Lib/test/test_pdb.py ++++ b/Lib/test/test_pdb.py +@@ -1580,6 +1580,7 @@ def test_pdb_next_command_subiterator(): + (Pdb) continue + """ + [email protected](True, 'Fails on Guix… but skipIf not taken into account?!') + def test_pdb_issue_20766(): + """Test for reference leaks when the SIGINT handler is set. + +@@ -1598,11 +1599,11 @@ def test_pdb_issue_20766(): + > <doctest test.test_pdb.test_pdb_issue_20766[0]>(6)test_function() + -> print('pdb %d: %s' % (i, sess._previous_sigint_handler)) + (Pdb) continue +- pdb 1: <built-in function default_int_handler> ++ pdb 1: 1 + > <doctest test.test_pdb.test_pdb_issue_20766[0]>(6)test_function() + -> print('pdb %d: %s' % (i, sess._previous_sigint_handler)) + (Pdb) continue +- pdb 2: <built-in function default_int_handler> ++ pdb 2: 1 + """ + + def test_pdb_issue_43318(): +diff --git a/Lib/test/test_regrtest.py b/Lib/test/test_regrtest.py +index 2ab6f6a986..8cf6b4d1c8 100644 +--- a/Lib/test/test_regrtest.py ++++ b/Lib/test/test_regrtest.py +@@ -1049,6 +1049,7 @@ def test_fromfile(self): + output = self.run_tests('--fromfile', filename) + self.check_executed_tests(output, tests, stats=stats) + ++ @unittest.skipIf(True, 'Keyboard interrupts do not work in the Guix build environment.') + def test_interrupted(self): + code = TEST_INTERRUPTED + test = self.create_test('sigint', code=code) +@@ -1066,6 +1067,7 @@ def test_slowest(self): + % (self.TESTNAME_REGEX, len(tests))) + self.check_line(output, regex) + ++ @unittest.skipIf(True, 'Keyboard interrupts do not work in the Guix build environment.') + def test_slowest_interrupted(self): + # Issue #25373: test --slowest with an interrupted test + code = TEST_INTERRUPTED +diff --git a/Lib/test/test_resource.py b/Lib/test/test_resource.py +index 317e7ca8f8..7f272daf24 100644 +--- a/Lib/test/test_resource.py ++++ b/Lib/test/test_resource.py +@@ -151,6 +151,7 @@ def test_freebsd_contants(self): + + @unittest.skipUnless(hasattr(resource, 'prlimit'), 'no prlimit') + @support.requires_linux_version(2, 6, 36) ++ @unittest.skipIf(True, "Bug: the PermissionError is not raised") + def test_prlimit(self): + self.assertRaises(TypeError, resource.prlimit) + self.assertRaises(ProcessLookupError, resource.prlimit, +diff --git a/Lib/test/test_shutil.py b/Lib/test/test_shutil.py +index bf60f37934..5e3a96380a 100644 +--- a/Lib/test/test_shutil.py ++++ b/Lib/test/test_shutil.py +@@ -1743,6 +1743,7 @@ def test_make_archive(self): + base_name = os.path.join(tmpdir, 'archive') + self.assertRaises(ValueError, make_archive, base_name, 'xxx') + ++ @unittest.skipIf(True, "The Guix build container has no root user") + @support.requires_zlib() + def test_make_archive_owner_group(self): + # testing make_archive with owner and group, with various combinations +@@ -1771,6 +1772,7 @@ def test_make_archive_owner_group(self): + self.assertTrue(os.path.isfile(res)) + + ++ @unittest.skipIf(True, "The Guix build container has no root user") + @support.requires_zlib() + @unittest.skipUnless(UID_GID_SUPPORT, "Requires grp and pwd support") + def test_tarfile_root_owner(self): +diff --git a/Lib/test/test_signal.py b/Lib/test/test_signal.py +index 637a0ca3b3..2fb804e340 100644 +--- a/Lib/test/test_signal.py ++++ b/Lib/test/test_signal.py +@@ -160,6 +160,7 @@ def test_valid_signals(self): + self.assertLess(signum, signal.NSIG) + + @unittest.skipUnless(sys.executable, "sys.executable required.") ++ @unittest.skipUnless(sys.stdin.isatty(), "KeyboardInterrupts require a TTY device") + @support.requires_subprocess() + def test_keyboard_interrupt_exit_code(self): + """KeyboardInterrupt triggers exit via SIGINT.""" +@@ -211,6 +212,7 @@ def test_issue9324(self): + signal.signal(7, handler) + + @unittest.skipUnless(sys.executable, "sys.executable required.") ++ @unittest.skipUnless(sys.stdin.isatty(), "KeyboardInterrupts require a TTY device") + @support.requires_subprocess() + def test_keyboard_interrupt_exit_code(self): + """KeyboardInterrupt triggers an exit using STATUS_CONTROL_C_EXIT.""" +@@ -1407,6 +1409,7 @@ def cycle_handlers(): + + class RaiseSignalTest(unittest.TestCase): + ++ @unittest.skipUnless(sys.stdin.isatty(), "KeyboardInterrupts require a TTY device") + def test_sigint(self): + with self.assertRaises(KeyboardInterrupt): + signal.raise_signal(signal.SIGINT) +@@ -1452,6 +1455,7 @@ def __del__(self): + + class PidfdSignalTest(unittest.TestCase): + ++ @unittest.skipUnless(sys.stdin.isatty(), "KeyboardInterrupts require a TTY device") + @unittest.skipUnless( + hasattr(signal, "pidfd_send_signal"), + "pidfd support not built in", +diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py +index 4eb5af99d6..9c7b8f6dbc 100644 +--- a/Lib/test/test_socket.py ++++ b/Lib/test/test_socket.py +@@ -1016,6 +1016,8 @@ def testHostnameRes(self): + if not fqhn in all_host_names: + self.fail("Error testing host resolution mechanisms. (fqdn: %s, all: %s)" % (fqhn, repr(all_host_names))) + ++ @unittest.skipUnless(support.is_resource_enabled('network'), ++ 'network is not enabled') + def test_host_resolution(self): + for addr in [socket_helper.HOSTv4, '10.0.0.1', '255.255.255.255']: + self.assertEqual(socket.gethostbyname(addr), addr) +@@ -1161,6 +1163,8 @@ def testNtoHErrors(self): + self.assertRaises(OverflowError, socket.ntohl, k) + self.assertRaises(OverflowError, socket.htonl, k) + ++ @unittest.skipUnless(os.path.exists("/etc/services"), ++ "getservbyname uses /etc/services, which is not in the chroot") + def testGetServBy(self): + eq = self.assertEqual + # Find one service that exists, then check all the related interfaces. +@@ -1521,6 +1525,8 @@ def test_sio_loopback_fast_path(self): + raise + self.assertRaises(TypeError, s.ioctl, socket.SIO_LOOPBACK_FAST_PATH, None) + ++ @unittest.skipUnless(os.path.exists("/etc/gai.conf"), ++ "getaddrinfo() will fail") + def testGetaddrinfo(self): + try: + socket.getaddrinfo('localhost', 80) +@@ -1653,6 +1659,8 @@ def test_getnameinfo(self): + # only IP addresses are allowed + self.assertRaises(OSError, socket.getnameinfo, ('mail.python.org',0), 0) + ++ @unittest.skipUnless(os.path.exists("/etc/gai.conf"), ++ "getaddrinfo() will fail") + @unittest.skipUnless(support.is_resource_enabled('network'), + 'network is not enabled') + def test_idna(self): +diff --git a/Lib/test/test_spwd.py b/Lib/test/test_spwd.py +index 50766c2548..0c7eb7a83a 100644 +--- a/Lib/test/test_spwd.py ++++ b/Lib/test/test_spwd.py +@@ -9,8 +9,7 @@ + spwd = import_helper.import_module('spwd') + + [email protected](hasattr(os, 'geteuid') and os.geteuid() == 0, +- 'root privileges required') [email protected](os.path.exists("/etc/shadow"), 'spwd tests require /etc/shadow') + class TestSpwdRoot(unittest.TestCase): + + def test_getspall(self): +@@ -60,8 +59,7 @@ def test_getspnam(self): + self.assertRaises(TypeError, spwd.getspnam, bytes_name) + + [email protected](hasattr(os, 'geteuid') and os.geteuid() != 0, +- 'non-root user required') [email protected](os.path.exists("/etc/shadow"), 'spwd tests require /etc/shadow') + class TestSpwdNonRoot(unittest.TestCase): + + def test_getspnam_exception(self): +diff --git a/Lib/test/test_tarfile.py b/Lib/test/test_tarfile.py +index 71489ea493..33351919fe 100644 +--- a/Lib/test/test_tarfile.py ++++ b/Lib/test/test_tarfile.py +@@ -2911,9 +2911,12 @@ def root_is_uid_gid_0(): + import pwd, grp + except ImportError: + return False +- if pwd.getpwuid(0)[0] != 'root': +- return False +- if grp.getgrgid(0)[0] != 'root': ++ try: ++ if pwd.getpwuid(0)[0] != 'root': ++ return False ++ if grp.getgrgid(0)[0] != 'root': ++ return False ++ except KeyError: + return False + return True + +diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py +index 00d9e591c7..2515603715 100644 +--- a/Lib/test/test_threading.py ++++ b/Lib/test/test_threading.py +@@ -1962,6 +1962,7 @@ def check_interrupt_main_noerror(self, signum): + # Restore original handler + signal.signal(signum, handler) + ++ @unittest.skipIf(True, 'Keyboard interrupts do not work in the Guix build container.') + def test_interrupt_main_subthread(self): + # Calling start_new_thread with a function that executes interrupt_main + # should raise KeyboardInterrupt upon completion. +@@ -1973,6 +1974,8 @@ def call_interrupt(): + t.join() + t.join() + ++ ++ @unittest.skipIf(True, 'Keyboard interrupts do not work in the Guix build container.') + def test_interrupt_main_mainthread(self): + # Make sure that if interrupt_main is called in main thread that + # KeyboardInterrupt is raised instantly. +diff --git a/Lib/test/test_tools/test_freeze.py b/Lib/test/test_tools/test_freeze.py +index 0e7ed67de7..6539a2983b 100644 +--- a/Lib/test/test_tools/test_freeze.py ++++ b/Lib/test/test_tools/test_freeze.py +@@ -23,6 +23,7 @@ + 'test is too slow with PGO') + class TestFreeze(unittest.TestCase): + ++ @unittest.skipIf(True, 'Fails on Guix.') + @support.requires_resource('cpu') # Building Python is slow + def test_freeze_simple_script(self): + script = textwrap.dedent(""" +diff --git a/Lib/test/test_unicodedata.py b/Lib/test/test_unicodedata.py +index 515c3840cb..a96dfad0fe 100644 +--- a/Lib/test/test_unicodedata.py ++++ b/Lib/test/test_unicodedata.py +@@ -342,6 +342,7 @@ def test_linebreak_7643(self): + self.assertEqual(len(lines), 1, + r"\u%.4x should not be a linebreak" % i) + ++@requires_resource('network') + class NormalizationTest(unittest.TestCase): + @staticmethod + def check_version(testfile): +diff --git a/Tools/scripts/run_tests.py b/Tools/scripts/run_tests.py +index 445a34ae3e..8f750537c3 100644 +--- a/Tools/scripts/run_tests.py ++++ b/Tools/scripts/run_tests.py +@@ -69,7 +69,7 @@ def main(regrtest_args): + else: + args.extend(['-j', '0']) # Use all CPU cores + if not any(is_resource_use_flag(arg) for arg in regrtest_args): +- args.extend(['-u', 'all,-largefile,-audio,-gui']) ++ args.extend(['-u', 'all,-largefile,-audio,-gui,-network']) + + if cross_compile and hostrunner: + # If HOSTRUNNER is set and -p/--python option is not given, then diff --git a/gnu/packages/patches/scribus-1.5.8-poppler-22.03.0.patch b/gnu/packages/patches/scribus-1.5.8-poppler-22.03.0.patch deleted file mode 100644 index f7a0c03fdd..0000000000 --- a/gnu/packages/patches/scribus-1.5.8-poppler-22.03.0.patch +++ /dev/null @@ -1,52 +0,0 @@ -From f19410ac3b27e33dd62105746784e61e85b90a1d Mon Sep 17 00:00:00 2001 -From: Jean Ghali <[email protected]> -Date: Wed, 2 Mar 2022 22:22:53 +0000 -Subject: [PATCH] #16764: Build break with poppler 22.03.0 - -git-svn-id: svn://scribus.net/trunk/Scribus@24982 11d20701-8431-0410-a711-e3c959e3b870 ---- - scribus/plugins/import/pdf/importpdf.cpp | 13 +++++++++++++ - 1 file changed, 13 insertions(+) - -diff --git a/scribus/plugins/import/pdf/importpdf.cpp b/scribus/plugins/import/pdf/importpdf.cpp -index 154e58a3f0..392dcd9e64 100644 ---- a/scribus/plugins/import/pdf/importpdf.cpp -+++ b/scribus/plugins/import/pdf/importpdf.cpp -@@ -89,7 +89,11 @@ QImage PdfPlug::readThumbnail(const QString& fName) - #endif
- globalParams->setErrQuiet(gTrue);
-
-+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
-+ PDFDoc pdfDoc{ std::make_unique<GooString>(fname) };
-+#else
- PDFDoc pdfDoc{fname, nullptr, nullptr, nullptr};
-+#endif
- if (!pdfDoc.isOk() || pdfDoc.getErrorCode() == errEncrypted)
- return QImage();
-
-@@ -342,7 +346,11 @@ bool PdfPlug::convert(const QString& fn) - globalParams->setErrQuiet(gTrue);
- // globalParams->setPrintCommands(gTrue);
- QList<OptionalContentGroup*> ocgGroups;
-+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
-+ auto pdfDoc = std::make_unique<PDFDoc>(std::make_unique<GooString>(fname));
-+#else
- auto pdfDoc = std::unique_ptr<PDFDoc>(new PDFDoc(fname, nullptr, nullptr, nullptr));
-+#endif
- if (pdfDoc)
- {
- if (pdfDoc->getErrorCode() == errEncrypted)
-@@ -361,8 +369,13 @@ bool PdfPlug::convert(const QString& fn) - #else
- auto fname = new GooString(QFile::encodeName(fn).data());
- #endif
-+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
-+ std::optional<GooString> userPW(std::in_place, text.toLocal8Bit().data());
-+ pdfDoc.reset(new PDFDoc(std::make_unique<GooString>(fname), userPW, userPW, nullptr));
-+#else
- auto userPW = new GooString(text.toLocal8Bit().data());
- pdfDoc.reset(new PDFDoc(fname, userPW, userPW, nullptr));
-+#endif
- qApp->changeOverrideCursor(QCursor(Qt::WaitCursor));
- }
- if ((!pdfDoc) || (pdfDoc->getErrorCode() != errNone))
diff --git a/gnu/packages/patches/scribus-1.5.8-poppler-22.04.0.patch b/gnu/packages/patches/scribus-1.5.8-poppler-22.04.0.patch deleted file mode 100644 index 290484e7e8..0000000000 --- a/gnu/packages/patches/scribus-1.5.8-poppler-22.04.0.patch +++ /dev/null @@ -1,291 +0,0 @@ -https://bugs.gentoo.org/843287 -https://github.com/scribusproject/scribus/commit/f2237b8f0b5cf7690e864a22ef7a63a6d769fa36.patch - -From f2237b8f0b5cf7690e864a22ef7a63a6d769fa36 Mon Sep 17 00:00:00 2001 -From: Jean Ghali <[email protected]> -Date: Fri, 1 Apr 2022 23:52:32 +0000 -Subject: [PATCH] Fix build with poppler 22.04.0 - -git-svn-id: svn://scribus.net/trunk/Scribus@25074 11d20701-8431-0410-a711-e3c959e3b870 ---- - scribus/plugins/import/pdf/slaoutput.cpp | 123 ++++++++++++++--------- - 1 file changed, 78 insertions(+), 45 deletions(-) - -diff --git a/scribus/plugins/import/pdf/slaoutput.cpp b/scribus/plugins/import/pdf/slaoutput.cpp -index e20a81f99e..5626fe3477 100644 ---- a/scribus/plugins/import/pdf/slaoutput.cpp -+++ b/scribus/plugins/import/pdf/slaoutput.cpp -@@ -174,8 +174,13 @@ void AnoOutputDev::drawString(GfxState *state, POPPLER_CONST GooString *s) - int shade = 100;
- currColorText = getColor(state->getFillColorSpace(), state->getFillColor(), &shade);
- fontSize = state->getFontSize();
-+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
-+ if (state->getFont() && state->getFont()->getName())
-+ fontName = new GooString(state->getFont()->getName().value());
-+#else
- if (state->getFont())
- fontName = state->getFont()->getName()->copy();
-+#endif
- itemText = s->copy();
- }
-
-@@ -357,7 +362,12 @@ std::unique_ptr<LinkAction> SlaOutputDev::SC_getAdditionalAction(const char *key - GBool SlaOutputDev::annotations_callback(Annot *annota, void *user_data)
- {
- SlaOutputDev *dev = (SlaOutputDev*)user_data;
-+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
-+ const PDFRectangle& annotRect = annota->getRect();;
-+ const PDFRectangle* box = &annotRect;
-+#else
- PDFRectangle *box = annota->getRect();
-+#endif
- double xCoor = dev->m_doc->currentPage()->xOffset() + box->x1 - dev->cropOffsetX;
- double yCoor = dev->m_doc->currentPage()->yOffset() + dev->m_doc->currentPage()->height() - box->y2 + dev->cropOffsetY;
- double width = box->x2 - box->x1;
-@@ -684,7 +694,12 @@ bool SlaOutputDev::handleWidgetAnnot(Annot* annota, double xCoor, double yCoor, - if (apa || !achar)
- {
- AnoOutputDev *annotOutDev = new AnoOutputDev(m_doc, m_importedColors);
-+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
-+ const PDFRectangle& annotaRect = annota->getRect();
-+ Gfx* gfx = new Gfx(pdfDoc, annotOutDev, pdfDoc->getPage(m_actPage)->getResourceDict(), &annotaRect, nullptr);
-+#else
- Gfx *gfx = new Gfx(pdfDoc, annotOutDev, pdfDoc->getPage(m_actPage)->getResourceDict(), annota->getRect(), nullptr);
-+#endif
- ano->draw(gfx, false);
- if (!bgFound)
- m_currColorFill = annotOutDev->currColorFill;
-@@ -2916,22 +2931,27 @@ void SlaOutputDev::markPoint(POPPLER_CONST char *name, Dict *properties) -
- void SlaOutputDev::updateFont(GfxState *state)
- {
-- GfxFont *gfxFont;
--#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
-+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
-+ std::optional<GfxFontLoc> fontLoc;
-+ std::string fileName;
-+ std::unique_ptr<FoFiTrueType> ff;
-+ std::optional<std::vector<unsigned char>> tmpBuf;
-+#elif POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
- std::optional<GfxFontLoc> fontLoc;
- const GooString * fileName = nullptr;
- std::unique_ptr<FoFiTrueType> ff;
-+ char* tmpBuf = nullptr;
- #else
- GfxFontLoc * fontLoc = nullptr;
- GooString * fileName = nullptr;
- FoFiTrueType * ff = nullptr;
-+ char* tmpBuf = nullptr;
- #endif
- GfxFontType fontType;
- SlaOutFontFileID *id;
- SplashFontFile *fontFile;
- SplashFontSrc *fontsrc = nullptr;
- Object refObj, strObj;
-- char *tmpBuf = nullptr;
- int tmpBufLen = 0;
- int *codeToGID = nullptr;
- const double *textMat = nullptr;
-@@ -2943,7 +2963,11 @@ void SlaOutputDev::updateFont(GfxState *state) -
- m_font = nullptr;
-
-- gfxFont = state->getFont();
-+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
-+ GfxFont* gfxFont = state->getFont().get();
-+#else
-+ GfxFont* gfxFont = state->getFont();
-+#endif
- if (!gfxFont)
- goto err1;
-
-@@ -2968,15 +2992,23 @@ void SlaOutputDev::updateFont(GfxState *state) - if (fontLoc->locType == gfxFontLocEmbedded)
- {
- // if there is an embedded font, read it to memory
-- tmpBuf = gfxFont->readEmbFontFile(xref, &tmpBufLen);
-+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
-+ tmpBuf = gfxFont->readEmbFontFile((xref) ? xref : pdfDoc->getXRef());
- if (! tmpBuf)
- goto err2;
-+#else
-+ tmpBuf = gfxFont->readEmbFontFile(xref, &tmpBufLen);
-+ if (!tmpBuf)
-+ goto err2;
-+#endif
-
- // external font
- }
- else
- { // gfxFontLocExternal
--#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
-+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
-+ fileName = fontLoc->path;
-+#elif POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
- fileName = fontLoc->pathAsGooString();
- #else
- fileName = fontLoc->path;
-@@ -2985,52 +3017,54 @@ void SlaOutputDev::updateFont(GfxState *state) - }
-
- fontsrc = new SplashFontSrc;
-+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
-+ if (!fileName.empty())
-+ fontsrc->setFile(fileName);
-+ else
-+ fontsrc->setBuf(std::move(tmpBuf.value()));
-+#else
- if (fileName)
- fontsrc->setFile(fileName, gFalse);
- else
- fontsrc->setBuf(tmpBuf, tmpBufLen, gTrue);
-+#endif
-
- // load the font file
- switch (fontType) {
- case fontType1:
-- if (!(fontFile = m_fontEngine->loadType1Font(
-- id,
-- fontsrc,
-- (const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
-+ if (!(fontFile = m_fontEngine->loadType1Font(id, fontsrc, (const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
- {
-- error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
-- gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
-+ error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
- goto err2;
- }
- break;
- case fontType1C:
-- if (!(fontFile = m_fontEngine->loadType1CFont(
-- id,
-- fontsrc,
-- (const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
-+ if (!(fontFile = m_fontEngine->loadType1CFont(id, fontsrc, (const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
- {
-- error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
-- gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
-+ error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
- goto err2;
- }
- break;
- case fontType1COT:
-- if (!(fontFile = m_fontEngine->loadOpenTypeT1CFont(
-- id,
-- fontsrc,
-- (const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
-+ if (!(fontFile = m_fontEngine->loadOpenTypeT1CFont(id, fontsrc, (const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
- {
-- error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
-- gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
-+ error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
- goto err2;
- }
- break;
- case fontTrueType:
- case fontTrueTypeOT:
-+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
-+ if (!fileName.empty())
-+ ff = FoFiTrueType::load(fileName.c_str());
-+ else
-+ ff = FoFiTrueType::make(fontsrc->buf.data(), fontsrc->buf.size());
-+#else
- if (fileName)
- ff = FoFiTrueType::load(fileName->getCString());
- else
- ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
-+#endif
- if (ff)
- {
- #if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
-@@ -3047,24 +3081,17 @@ void SlaOutputDev::updateFont(GfxState *state) - codeToGID = nullptr;
- n = 0;
- }
-- if (!(fontFile = m_fontEngine->loadTrueTypeFont(
-- id,
-- fontsrc,
-- codeToGID, n)))
-+ if (!(fontFile = m_fontEngine->loadTrueTypeFont(id, fontsrc, codeToGID, n)))
- {
-- error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
-- gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
-+ error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
- goto err2;
- }
- break;
- case fontCIDType0:
- case fontCIDType0C:
-- if (!(fontFile = m_fontEngine->loadCIDFont(
-- id,
-- fontsrc)))
-+ if (!(fontFile = m_fontEngine->loadCIDFont(id, fontsrc)))
- {
-- error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
-- gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
-+ error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
- goto err2;
- }
- break;
-@@ -3080,10 +3107,7 @@ void SlaOutputDev::updateFont(GfxState *state) - codeToGID = nullptr;
- n = 0;
- }
-- if (!(fontFile = m_fontEngine->loadOpenTypeCFFFont(
-- id,
-- fontsrc,
-- codeToGID, n)))
-+ if (!(fontFile = m_fontEngine->loadOpenTypeCFFFont(id, fontsrc, codeToGID, n)))
- {
- error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
- gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
-@@ -3105,10 +3129,17 @@ void SlaOutputDev::updateFont(GfxState *state) - }
- else
- {
-+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
-+ if (!fileName.empty())
-+ ff = FoFiTrueType::load(fileName.c_str());
-+ else
-+ ff = FoFiTrueType::make(fontsrc->buf.data(), fontsrc->buf.size());
-+#else
- if (fileName)
- ff = FoFiTrueType::load(fileName->getCString());
- else
- ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
-+#endif
- if (! ff)
- goto err2;
- #if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
-@@ -3119,13 +3150,9 @@ void SlaOutputDev::updateFont(GfxState *state) - delete ff;
- #endif
- }
-- if (!(fontFile = m_fontEngine->loadTrueTypeFont(
-- id,
-- fontsrc,
-- codeToGID, n, faceIndex)))
-+ if (!(fontFile = m_fontEngine->loadTrueTypeFont(id, fontsrc, codeToGID, n, faceIndex)))
- {
-- error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
-- gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
-+ error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
- goto err2;
- }
- break;
-@@ -3269,9 +3296,15 @@ void SlaOutputDev::drawChar(GfxState* state, double x, double y, double dx, doub - GBool SlaOutputDev::beginType3Char(GfxState *state, double x, double y, double dx, double dy, CharCode code, POPPLER_CONST_082 Unicode *u, int uLen)
- {
- // qDebug() << "beginType3Char";
-+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
- GfxFont *gfxFont;
-+ if (!(gfxFont = state->getFont().get()))
-+ return gTrue;
-+#else
-+ GfxFont* gfxFont;
- if (!(gfxFont = state->getFont()))
- return gTrue;
-+#endif
- if (gfxFont->getType() != fontType3)
- return gTrue;
- F3Entry f3e;
diff --git a/gnu/packages/patches/scribus-1.5.8-poppler-22.09.0.patch b/gnu/packages/patches/scribus-1.5.8-poppler-22.09.0.patch deleted file mode 100644 index 106a6f5162..0000000000 --- a/gnu/packages/patches/scribus-1.5.8-poppler-22.09.0.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- a/scribus/plugins/import/pdf/slaoutput.cpp -+++ b/scribus/plugins/import/pdf/slaoutput.cpp -@@ -3741,9 +3741,16 @@ void SlaOutputDev::getPenState(GfxState *state) - break;
- }
- double lw = state->getLineWidth();
-- double *dashPattern;
- int dashLength;
-+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 9, 0)
-+ const double *dashPattern;
-+ const std::vector<double> &dash = state->getLineDash(&DashOffset);
-+ dashPattern = dash.data();
-+ dashLength = dash.size();
-+#else
-+ double *dashPattern;
- state->getLineDash(&dashPattern, &dashLength, &DashOffset);
-+#endif
- QVector<double> pattern(dashLength);
- for (int i = 0; i < dashLength; ++i)
- {
diff --git a/gnu/packages/patches/scribus-1.5.8-poppler-22.2.0-1.patch b/gnu/packages/patches/scribus-1.5.8-poppler-22.2.0-1.patch deleted file mode 100644 index 4e0f607c6a..0000000000 --- a/gnu/packages/patches/scribus-1.5.8-poppler-22.2.0-1.patch +++ /dev/null @@ -1,129 +0,0 @@ -From 85c0dff3422fa3c26fbc2e8d8561f597ec24bd92 Mon Sep 17 00:00:00 2001 -From: Jean Ghali <[email protected]> -Date: Wed, 2 Feb 2022 23:12:52 +0000 -Subject: [PATCH] #16734: Build break with poppler 22.2.0 - -git-svn-id: svn://scribus.net/trunk/Scribus@24884 11d20701-8431-0410-a711-e3c959e3b870 ---- - scribus/plugins/import/pdf/slaoutput.cpp | 47 +++++++++++++++++++----- - 1 file changed, 37 insertions(+), 10 deletions(-) - -diff --git a/scribus/plugins/import/pdf/slaoutput.cpp b/scribus/plugins/import/pdf/slaoutput.cpp -index 5894bf2ad6..3650c96f52 100644 ---- a/scribus/plugins/import/pdf/slaoutput.cpp -+++ b/scribus/plugins/import/pdf/slaoutput.cpp -@@ -7,6 +7,11 @@ for which a new license (GPL+exception) is in place. -
- #include "slaoutput.h"
-
-+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
-+#include <memory>
-+#include <optional>
-+#endif
-+
- #include <poppler/GlobalParams.h>
- #include <poppler/poppler-config.h>
- #include <poppler/FileSpec.h>
-@@ -3027,18 +3032,24 @@ void SlaOutputDev::markPoint(POPPLER_CONST char *name, Dict *properties) - void SlaOutputDev::updateFont(GfxState *state)
- {
- GfxFont *gfxFont;
-- GfxFontLoc *fontLoc;
-+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
-+ std::optional<GfxFontLoc> fontLoc;
-+ const GooString * fileName = nullptr;
-+ std::unique_ptr<FoFiTrueType> ff;
-+#else
-+ GfxFontLoc * fontLoc = nullptr;
-+ GooString * fileName = nullptr;
-+ FoFiTrueType * ff = nullptr;
-+#endif
- GfxFontType fontType;
- SlaOutFontFileID *id;
- SplashFontFile *fontFile;
- SplashFontSrc *fontsrc = nullptr;
-- FoFiTrueType *ff;
- Object refObj, strObj;
-- GooString *fileName;
-- char *tmpBuf;
-+ char *tmpBuf = nullptr;
- int tmpBufLen = 0;
-- int *codeToGID;
-- const double *textMat;
-+ int *codeToGID = nullptr;
-+ const double *textMat = nullptr;
- double m11, m12, m21, m22, fontSize;
- SplashCoord mat[4];
- int n = 0;
-@@ -3046,9 +3057,6 @@ void SlaOutputDev::updateFont(GfxState *state) - SplashCoord matrix[6];
-
- m_font = nullptr;
-- fileName = nullptr;
-- tmpBuf = nullptr;
-- fontLoc = nullptr;
-
- gfxFont = state->getFont();
- if (!gfxFont)
-@@ -3083,7 +3091,11 @@ void SlaOutputDev::updateFont(GfxState *state) - }
- else
- { // gfxFontLocExternal
-+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
-+ fileName = fontLoc->pathAsGooString();
-+#else
- fileName = fontLoc->path;
-+#endif
- fontType = fontLoc->fontType;
- }
-
-@@ -3136,9 +3148,14 @@ void SlaOutputDev::updateFont(GfxState *state) - ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
- if (ff)
- {
-+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
-+ codeToGID = ((Gfx8BitFont*) gfxFont)->getCodeToGIDMap(ff.get());
-+ ff.reset();
-+#else
- codeToGID = ((Gfx8BitFont *)gfxFont)->getCodeToGIDMap(ff);
-- n = 256;
- delete ff;
-+#endif
-+ n = 256;
- }
- else
- {
-@@ -3209,8 +3226,13 @@ void SlaOutputDev::updateFont(GfxState *state) - ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
- if (! ff)
- goto err2;
-+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
-+ codeToGID = ((GfxCIDFont*) gfxFont)->getCodeToGIDMap(ff.get(), &n);
-+ ff.reset();
-+#else
- codeToGID = ((GfxCIDFont *)gfxFont)->getCodeToGIDMap(ff, &n);
- delete ff;
-+#endif
- }
- if (!(fontFile = m_fontEngine->loadTrueTypeFont(
- id,
-@@ -3247,14 +3269,19 @@ void SlaOutputDev::updateFont(GfxState *state) - mat[3] = -m22;
- m_font = m_fontEngine->getFont(fontFile, mat, matrix);
-
-+#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(22, 2, 0)
- delete fontLoc;
-+#endif
- if (fontsrc && !fontsrc->isFile)
- fontsrc->unref();
- return;
-
- err2:
- delete id;
-+#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(22, 2, 0)
- delete fontLoc;
-+#endif
-+
- err1:
- if (fontsrc && !fontsrc->isFile)
- fontsrc->unref();
diff --git a/gnu/packages/patches/scribus-1.5.8-poppler-22.2.0-2.patch b/gnu/packages/patches/scribus-1.5.8-poppler-22.2.0-2.patch deleted file mode 100644 index 73beac2d70..0000000000 --- a/gnu/packages/patches/scribus-1.5.8-poppler-22.2.0-2.patch +++ /dev/null @@ -1,28 +0,0 @@ -From f75c1613db67f4067643d0218a2db3235e42ec9f Mon Sep 17 00:00:00 2001 -From: Jean Ghali <[email protected]> -Date: Thu, 3 Feb 2022 19:46:13 +0000 -Subject: [PATCH] Small update vs latest code in poppler - -git-svn-id: svn://scribus.net/trunk/Scribus@24885 11d20701-8431-0410-a711-e3c959e3b870 ---- - scribus/plugins/import/pdf/slaoutput.cpp | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/scribus/plugins/import/pdf/slaoutput.cpp b/scribus/plugins/import/pdf/slaoutput.cpp -index 3650c96f52..a6f4e00fa9 100644 ---- a/scribus/plugins/import/pdf/slaoutput.cpp -+++ b/scribus/plugins/import/pdf/slaoutput.cpp -@@ -3072,10 +3072,10 @@ void SlaOutputDev::updateFont(GfxState *state) - delete id;
- else
- {
-- if (!(fontLoc = gfxFont->locateFont(xref, nullptr)))
-+ fontLoc = gfxFont->locateFont((xref) ? xref : pdfDoc->getXRef(), nullptr);
-+ if (!fontLoc)
- {
-- error(errSyntaxError, -1, "Couldn't find a font for '{0:s}'",
-- gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
-+ error(errSyntaxError, -1, "Couldn't find a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
- goto err2;
- }
-
diff --git a/gnu/packages/patches/sioyek-fix-build.patch b/gnu/packages/patches/sioyek-fix-build.patch new file mode 100644 index 0000000000..521b361f2a --- /dev/null +++ b/gnu/packages/patches/sioyek-fix-build.patch @@ -0,0 +1,82 @@ +Patch fetched from https://git.alpinelinux.org/aports/tree/community/sioyek/mupdf-0.23.0.patch + +From 86e913eccf19b97a16f25d9b6cdf0f50232f1226 Mon Sep 17 00:00:00 2001 +From: ptrcnull <[email protected]> +Date: Fri, 25 Aug 2023 22:44:26 +0200 +Subject: community/sioyek: fix build with mupdf-0.23.0 + +--- + +diff --git a/pdf_viewer/document_view.cpp b/pdf_viewer/document_view.cpp +index f48d05e..0bc3855 100644 +--- a/pdf_viewer/document_view.cpp ++++ b/pdf_viewer/document_view.cpp +@@ -1121,7 +1121,7 @@ std::vector<DocumentPos> DocumentView::find_line_definitions() { + + std::optional<PdfLink> pdf_link = current_document->get_link_in_page_rect(get_center_page_number(), line_rects[line_index]); + if (pdf_link.has_value()) { +- auto parsed_uri = parse_uri(mupdf_context, pdf_link.value().uri); ++ auto parsed_uri = parse_uri(mupdf_context, current_document->doc, pdf_link.value().uri); + result.push_back({ parsed_uri.page - 1, parsed_uri.x, parsed_uri.y }); + return result; + } +diff --git a/pdf_viewer/main_widget.cpp b/pdf_viewer/main_widget.cpp +index 19b568b..335a93f 100644 +--- a/pdf_viewer/main_widget.cpp ++++ b/pdf_viewer/main_widget.cpp +@@ -170,7 +170,7 @@ void MainWidget::set_overview_position(int page, float offset) { + + void MainWidget::set_overview_link(PdfLink link) { + +- auto [page, offset_x, offset_y] = parse_uri(mupdf_context, link.uri); ++ auto [page, offset_x, offset_y] = parse_uri(mupdf_context, doc()->doc, link.uri); + if (page >= 1) { + set_overview_position(page - 1, offset_y); + } +@@ -3178,7 +3178,7 @@ void MainWidget::handle_pending_text_command(std::wstring text) { + open_web_url(utf8_decode(selected_link->uri)); + } + else{ +- auto [page, offset_x, offset_y] = parse_uri(mupdf_context, selected_link->uri); ++ auto [page, offset_x, offset_y] = parse_uri(mupdf_context, doc()->doc, selected_link->uri); + long_jump_to_destination(page-1, offset_y); + } + } +@@ -3863,7 +3863,7 @@ void MainWidget::handle_link_click(const PdfLink& link) { + return; + } + +- auto [page, offset_x, offset_y] = parse_uri(mupdf_context, link.uri); ++ auto [page, offset_x, offset_y] = parse_uri(mupdf_context, doc()->doc, link.uri); + + // convert one indexed page to zero indexed page + page--; +diff --git a/pdf_viewer/utils.cpp b/pdf_viewer/utils.cpp +index 22d4265..3150e66 100644 +--- a/pdf_viewer/utils.cpp ++++ b/pdf_viewer/utils.cpp +@@ -116,8 +116,9 @@ bool rects_intersect(fz_rect rect1, fz_rect rect2) { + return range_intersects(rect1.x0, rect1.x1, rect2.x0, rect2.x1) && range_intersects(rect1.y0, rect1.y1, rect2.y0, rect2.y1); + } + +-ParsedUri parse_uri(fz_context* mupdf_context, std::string uri) { +- fz_link_dest dest = pdf_parse_link_uri(mupdf_context, uri.c_str()); ++ParsedUri parse_uri(fz_context* mupdf_context, fz_document* fz_doc, std::string uri) { ++ pdf_document* doc = pdf_document_from_fz_document(mupdf_context, fz_doc); ++ fz_link_dest dest = pdf_resolve_link_dest(mupdf_context, doc, uri.c_str()); + return { dest.loc.page + 1, dest.x, dest.y }; + } + +diff --git a/pdf_viewer/utils.h b/pdf_viewer/utils.h +index 2a12211..643b030 100644 +--- a/pdf_viewer/utils.h ++++ b/pdf_viewer/utils.h +@@ -55,7 +55,7 @@ void get_flat_toc(const std::vector<TocNode*>& roots, std::vector<std::wstring>& + int mod(int a, int b); + bool range_intersects(float range1_start, float range1_end, float range2_start, float range2_end); + bool rects_intersect(fz_rect rect1, fz_rect rect2); +-ParsedUri parse_uri(fz_context* mupdf_context, std::string uri); ++ParsedUri parse_uri(fz_context* mupdf_context, fz_document* fz_doc, std::string uri); + char get_symbol(int key, bool is_shift_pressed, const std::vector<char>&special_symbols); + + template<typename T> |