summary refs log tree commit diff
path: root/gnu/packages/patches/libpaper-free-systempapername.patch
diff options
context:
space:
mode:
authorMarius Bakke <marius@gnu.org>2022-07-06 22:45:54 +0200
committerMarius Bakke <marius@gnu.org>2022-07-16 23:25:17 +0200
commit12e77c03bcc41c143157d12d75d9b8a94457019d (patch)
tree5a53b7b03e025680af6a953ff4b1c885967d0d39 /gnu/packages/patches/libpaper-free-systempapername.patch
parent397147aaad2e5d357479c0ff3ac3042432e320ae (diff)
downloadguix-12e77c03bcc41c143157d12d75d9b8a94457019d.tar.gz
gnu: libpaper: Update to 1.2.1.
* gnu/packages/ghostscript.scm (libpaper): Update to 1.2.1.
[source]: Switch to currently maintained fork.
[home-page]: Likewise.
[arguments]: Remove #:phases.  Add "--enable-relocatable" to #:configure-flags.
[native-inputs]: Remove AUTOMAKE.  Add HELP2MAN.
[outputs]: Add "debug".
* gnu/packages/tex.scm (texlive-bin)[arguments]: Add phase to patch test
expected test result with libpaper 1.2.
* gnu/packages/patches/libpaper-free-systempapername.patch,
gnu/packages/patches/libpaper-free-xdg-config-home.patch,
gnu/packages/patches/libpaper-invalid-paperspecs.patch: New files.
* gnu/local.mk (dist_patch_DATA): Adjust accordingly.
Diffstat (limited to 'gnu/packages/patches/libpaper-free-systempapername.patch')
-rw-r--r--gnu/packages/patches/libpaper-free-systempapername.patch38
1 files changed, 38 insertions, 0 deletions
diff --git a/gnu/packages/patches/libpaper-free-systempapername.patch b/gnu/packages/patches/libpaper-free-systempapername.patch
new file mode 100644
index 0000000000..12fea8ee10
--- /dev/null
+++ b/gnu/packages/patches/libpaper-free-systempapername.patch
@@ -0,0 +1,38 @@
+Ensure backwards compatibility with libpaper 1.1 by returning a value that
+must be free()'d.
+
+Taken from upstream:
+
+  https://github.com/rrthomas/libpaper/commit/9a4f7cdd6b749fd9d08ec92b6e3b434f7d322b6d
+
+diff --git a/lib/libpaper.c.in.in b/lib/libpaper.c.in.in
+index aa86d06..19e3332 100644
+--- a/lib/libpaper.c.in.in
++++ b/lib/libpaper.c.in.in
+@@ -316,9 +316,9 @@ const char *defaultpapername(void) {
+     return paperstr;
+ }
+ 
+-/* Alias for defaultpapername. */
++/* Alias for defaultpapername; its return value must be freed! */
+ const char *systempapername(void) {
+-    return defaultpapername();
++    return strdup(defaultpapername());
+ }
+ 
+ /* Get the default paper size. */
+diff --git a/lib/paper.h b/lib/paper.h
+index c940bed..fe5d4be 100644
+--- a/lib/paper.h
++++ b/lib/paper.h
+@@ -123,8 +123,8 @@ const struct paper *defaultpaper(void);
+ const char *defaultpapername(void);
+ 
+ /*
+- * Deprecated, only for backwards compatibility; an alias for
+- * defaultpapername().
++ * Deprecated, only for backwards compatibility; does the same as
++ * defaultpapername(), but returns a value that must be freed.
+  */
+ const char *systempapername(void);
+