From 6440b352c92e01aab1756e287a0271ccf0346dff Mon Sep 17 00:00:00 2001 From: Z572 <873216071@qq.com> Date: Fri, 26 May 2023 18:23:45 +0800 Subject: gnu: libtree: fix building on non-x86 systems. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/linux.scm (libtree): fix building on non-x86 systems. [source]: add patch. * gnu/packages/patches/libtree-fix-check-non-x86.patch: New file. * gnu/local.mk (dist_path_DATA): Register it. Signed-off-by: Ludovic Courtès --- gnu/packages/linux.scm | 2 + .../patches/libtree-fix-check-non-x86.patch | 50 ++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 gnu/packages/patches/libtree-fix-check-non-x86.patch (limited to 'gnu/packages') diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index 6a6cbc118d..c81740a5a1 100644 --- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm @@ -73,6 +73,7 @@ ;;; Copyright © 2022, 2023 Demis Balbach ;;; Copyright © 2023 Bruno Victal ;;; Copyright © 2023 Yovan Naumovski +;;; Copyright © 2023 Zheng Junjie <873216071@qq.com> ;;; ;;; This file is part of GNU Guix. ;;; @@ -9822,6 +9823,7 @@ (define-public libtree (url "https://github.com/haampie/libtree") (commit (string-append "v" version)))) (file-name (git-file-name name version)) + (patches (search-patches "libtree-fix-check-non-x86.patch")) (sha256 (base32 "1jbc60cslzcfxk9jwva51ncr1zl1nz0fkgfjdckgv81is11nswmb")))) (arguments diff --git a/gnu/packages/patches/libtree-fix-check-non-x86.patch b/gnu/packages/patches/libtree-fix-check-non-x86.patch new file mode 100644 index 0000000000..51f020c5d3 --- /dev/null +++ b/gnu/packages/patches/libtree-fix-check-non-x86.patch @@ -0,0 +1,50 @@ +From 061d3ec62707a526a83482e57d202a66f9d776cd Mon Sep 17 00:00:00 2001 +From: Ismael Luceno +Date: Tue, 23 Aug 2022 19:34:39 +0200 +Subject: [PATCH] Test the -m32 and -m64 compiler flags before use + +Fixes: https://github.com/haampie/libtree/issues/78 +Signed-off-by: Ismael Luceno +--- + tests/05_32_bits/Makefile | 20 +++++++++++++++----- + 1 file changed, 15 insertions(+), 5 deletions(-) + +diff --git a/tests/05_32_bits/Makefile b/tests/05_32_bits/Makefile +index 2c0bece..5628f42 100644 +--- a/tests/05_32_bits/Makefile ++++ b/tests/05_32_bits/Makefile +@@ -3,7 +3,7 @@ + + LD_LIBRARY_PATH= + +-.PHONY: clean ++.PHONY: clean check + + all: check + +@@ -21,11 +21,21 @@ exe64: lib64/libx.so + exe32: lib32/libx.so + echo 'extern int a(); int _start(){return a();}' | $(CC) -m32 "-Wl,-rpath,$(CURDIR)/lib64" "-Wl,-rpath,$(CURDIR)/lib32" -o $@ -nostdlib -x c - -Llib32 -lx + +-check: exe32 exe64 +- ../../libtree exe32 +- ../../libtree exe64 +- + clean: + rm -rf lib32 lib64 exe* + + CURDIR ?= $(.CURDIR) ++ ++test-flag = 2>/dev/null ${CC} -E /dev/null ++test-end = && echo y || echo n ++support-m32 != ${test-flag} -m32 ${test-end} ++support-m64 != ${test-flag} -m64 ${test-end} ++ ++check${support-m32:y=}:: exe32 ++ ../../libtree exe32 ++ ++check${support-m64:y=}:: exe64 ++ ../../libtree exe64 ++ ++check${support-m32:n=} check${support-m64:n=}:: ++ @echo WARNING: test skipped at ${CURDIR} -- cgit v1.2.3