[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#50201] [PATCH 40/52] gnu: xorg: Unify --disable-malloc0-returnsnull
From: |
Maxime Devos |
Subject: |
[bug#50201] [PATCH 40/52] gnu: xorg: Unify --disable-malloc0-returnsnull code. |
Date: |
Wed, 25 Aug 2021 20:03:20 +0200 |
The idea is to keep the comments in one place, instead of copying
them over and over. It's also documented more now.
* gnu/packages/xorg.scm
(malloc0-flags): New procedure.
(libxext,libxrender,libx11,libxt): Use new procedures.
---
gnu/packages/xorg.scm | 32 ++++++++++++++------------------
1 file changed, 14 insertions(+), 18 deletions(-)
diff --git a/gnu/packages/xorg.scm b/gnu/packages/xorg.scm
index def751c62c..0197e785cb 100644
--- a/gnu/packages/xorg.scm
+++ b/gnu/packages/xorg.scm
@@ -102,6 +102,16 @@
+;; When cross-compiling certain packages, "--disable-malloc0returnsnull"
+;; needs to be passed. Otherwise, the configure script will try to run a
+;; binary for the host on the build machine.
+(define (malloc0-flags)
+ (if (%current-target-system)
+ ;; At least on glibc-based systems, malloc(0) evaluates to a non-NULL
+ ;; pointer (except in out-of-memory situations). On other systems,
+ ;; --enable-malloc0returnsnull might be required instead.
+ '("--disable-malloc0returnsnull")
+ '()))
;; packages without propagated input
;; (rationale for this separation: The packages in PROPAGATED_INPUTS need to
@@ -4792,10 +4802,7 @@ cannot be adequately worked around on the client side of
the wire.")
(string-append "--mandir="
(assoc-ref %outputs "doc")
"/share/man")
- ;; Disable zero malloc check that fails when cross-compiling.
- ,@(if (%current-target-system)
- '("--disable-malloc0returnsnull")
- '()))))
+ ,@(malloc0-flags))))
(propagated-inputs
`(("xorgproto" ,xorgproto)))
(inputs
@@ -4885,11 +4892,7 @@ cannot be adequately worked around on the client side of
the wire.")
(build-system gnu-build-system)
(arguments
`(#:configure-flags
- (list "--disable-static"
- ;; Disable zero malloc check that fails when cross-compiling.
- ,@(if (%current-target-system)
- '("--disable-malloc0returnsnull")
- '()))))
+ (list "--disable-static" ,@(malloc0-flags))))
(propagated-inputs
`(("xorgproto" ,xorgproto)))
(inputs
@@ -5562,11 +5565,7 @@ draggable titlebars and borders.")
(assoc-ref %outputs "doc")
"/share/man")
"--disable-static"
-
- ;; Disable zero malloc check that fails when cross-compiling.
- ,@(if (%current-target-system)
- '("--disable-malloc0returnsnull")
- '()))))
+ ,@(malloc0-flags))))
(propagated-inputs
`(("xorgproto" ,xorgproto)
("libxcb" ,libxcb)))
@@ -5644,10 +5643,7 @@ draggable titlebars and borders.")
(assoc-ref %outputs "doc")
"/share/man")
"--disable-static"
- ;; Disable zero malloc check that fails when cross-compiling.
- ,@(if (%current-target-system)
- '("--disable-malloc0returnsnull")
- '()))))
+ ,@(malloc0-flags))))
(propagated-inputs
`(("libx11" ,libx11)
("libice" ,libice)
--
2.33.0
- [bug#50201] [PATCH 15/52] gobject-introspection: Fix inputs when cross-compiling., (continued)
- [bug#50201] [PATCH 15/52] gobject-introspection: Fix inputs when cross-compiling., Maxime Devos, 2021/08/25
- [bug#50201] [PATCH 21/52] gnu: gamin: Fix 'configure' script when cross-compiling., Maxime Devos, 2021/08/25
- [bug#50201] [PATCH 24/52] gnu: heimdal: Fix linking error when cross-compiling., Maxime Devos, 2021/08/25
- [bug#50201] [PATCH 28/52] gnu: heimdal: Use libcom_err from input when cross-compiling., Maxime Devos, 2021/08/25
- [bug#50201] [PATCH 26/52] gnu: heimdal: Use the cross-compiled bash in "su"., Maxime Devos, 2021/08/25
- [bug#50201] [PATCH 27/52] gnu: heimdal: Find tools when cross-compiling., Maxime Devos, 2021/08/25
- [bug#50201] [PATCH 30/52] gnu: json-glib: Find docbook inputs when cross-compiling., Maxime Devos, 2021/08/25
- [bug#50201] [PATCH 29/52] gnu: json-glib: Add missing 'bash-minimal' input., Maxime Devos, 2021/08/25
- [bug#50201] [PATCH 39/52] gnu: at-spi2-core: Add missing "bash-minimal" input., Maxime Devos, 2021/08/25
- [bug#50201] [PATCH 41/52] gnu: libxinerama: Add --disable-malloc0-returnsnull when necessary., Maxime Devos, 2021/08/25
- [bug#50201] [PATCH 40/52] gnu: xorg: Unify --disable-malloc0-returnsnull code.,
Maxime Devos <=
- [bug#50201] [PATCH 38/52] gnu: at-spi2-core: Find docbook when cross-compiling., Maxime Devos, 2021/08/25
- [bug#50201] [PATCH 31/52] gnu: json-glib: Don't build gtk documentation when cross-compiling., Maxime Devos, 2021/08/25
- [bug#50201] [PATCH 44/52] gnu: libxxf85vm: Add --disable-malloc0-returnsnull when necessary., Maxime Devos, 2021/08/25
- [bug#50201] [PATCH 46/52] gnu: wayland: Find wayland-scanner when cross-compiling., Maxime Devos, 2021/08/25
- [bug#50201] [PATCH 48/52] gnu: libproxy: Don't run tests when cross-compiling., Maxime Devos, 2021/08/25
- [bug#50201] [PATCH 42/52] gnu: libxi: Add --disable-malloc0-returnsnull when necessary., Maxime Devos, 2021/08/25
- [bug#50201] [PATCH 47/52] gnu: wayland: Find docbook-xml when cross-compiling., Maxime Devos, 2021/08/25
- [bug#50201] [PATCH 50/52] gnu: gdk-pixbuf: Add bash-minimal input when cross-compiling., Maxime Devos, 2021/08/25
- [bug#50201] [PATCH 52/52] gnu: at-spi2-atk: Don't compile tests when cross-compiling., Maxime Devos, 2021/08/25
- [bug#50201] [PATCH 33/52] gnu: libthai: Add datrie as native-input when cross-compiling., Maxime Devos, 2021/08/25