From fb0c1c8b02dc37d679b12f5798efb5d4921161a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Sat, 7 Mar 2026 11:24:06 +0100 Subject: [PATCH] =?UTF-8?q?gnu:=20gcc:=20Remove=20unused=20=E2=80=98parent?= =?UTF-8?q?=E2=80=99=20variable.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/gcc.scm (gcc-4.7)[arguments]: Remove now unused ‘parent’ variable. (gcc-4.8)[arguments]: Likewise. (gcc-4.9)[arguments]: Likewise. (gcc-5)[arguments]: Likewise. Change-Id: Idd3b13f6057d0233ef0641b27d14b08d6c601331 --- gnu/packages/gcc.scm | 236 +++++++++++++++++++------------------------ 1 file changed, 106 insertions(+), 130 deletions(-) diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm index 63a2981c62..3b98988c1f 100644 --- a/gnu/packages/gcc.scm +++ b/gnu/packages/gcc.scm @@ -431,36 +431,30 @@ Go. It also includes runtime support libraries for these languages.") '("alpha" "bfin" "i386" "m68k" "pa" "sh" "tilepro" "xtensa"))))) (arguments - ;; Since 'arguments' is a function of the package's version, define - ;; 'parent' such that the 'arguments' thunk gets to see the right - ;; version. - (let ((parent (package - (inherit gcc-base) - (version (package-version this-package))))) - (if (%current-target-system) - (package-arguments parent) - ;; For native builds of some GCC versions the C++ include path needs to - ;; be adjusted so it does not interfere with GCC's own build processes. - (substitute-keyword-arguments arguments - ((#:modules modules %default-gnu-modules) - `((srfi srfi-1) - ,@modules)) - ((#:phases phases) - `(modify-phases ,phases - (add-after 'set-paths 'adjust-CPLUS_INCLUDE_PATH - (lambda* (#:key inputs #:allow-other-keys) - (let ((libc (assoc-ref inputs "libc")) - (gcc (assoc-ref inputs "gcc"))) - (setenv "CPLUS_INCLUDE_PATH" - (string-join (fold delete - (string-split (getenv "CPLUS_INCLUDE_PATH") - #\:) - (list (string-append libc "/include") - (string-append gcc "/include/c++"))) - ":")) - (format #t - "environment variable `CPLUS_INCLUDE_PATH' changed to ~a~%" - (getenv "CPLUS_INCLUDE_PATH"))))))))))) + (if (%current-target-system) + arguments + ;; For native builds of some GCC versions the C++ include path needs to + ;; be adjusted so it does not interfere with GCC's own build processes. + (substitute-keyword-arguments arguments + ((#:modules modules %default-gnu-modules) + `((srfi srfi-1) + ,@modules)) + ((#:phases phases) + `(modify-phases ,phases + (add-after 'set-paths 'adjust-CPLUS_INCLUDE_PATH + (lambda* (#:key inputs #:allow-other-keys) + (let ((libc (assoc-ref inputs "libc")) + (gcc (assoc-ref inputs "gcc"))) + (setenv "CPLUS_INCLUDE_PATH" + (string-join (fold delete + (string-split (getenv "CPLUS_INCLUDE_PATH") + #\:) + (list (string-append libc "/include") + (string-append gcc "/include/c++"))) + ":")) + (format #t + "environment variable `CPLUS_INCLUDE_PATH' changed to ~a~%" + (getenv "CPLUS_INCLUDE_PATH")))))))))) (supported-systems (fold delete %supported-systems '("aarch64-linux" "riscv64-linux" "powerpc64le-linux" "x86_64-gnu"))))) @@ -491,40 +485,34 @@ Go. It also includes runtime support libraries for these languages.") '("aarch64" "alpha" "bfin" "i386" "m68k" "pa" "sh" "tilepro" "xtensa"))))) (arguments - ;; Since 'arguments' is a function of the package's version, define - ;; 'parent' such that the 'arguments' thunk gets to see the right - ;; version. - (let ((parent (package - (inherit gcc-base) - (version (package-version this-package))))) - (if (%current-target-system) - (substitute-keyword-arguments arguments - ((#:configure-flags flags '()) - `(cons "CXX=g++ -std=c++03" ,flags))) - (substitute-keyword-arguments arguments - ((#:modules modules %default-gnu-modules) - `((srfi srfi-1) - ,@modules)) - ((#:configure-flags flags '()) - `(cons "CXX=g++ -std=c++03" ,flags)) - ;; For native builds of some GCC versions the C++ include path needs to - ;; be adjusted so it does not interfere with GCC's own build processes. - ((#:phases phases) - `(modify-phases ,phases - (add-after 'set-paths 'adjust-CPLUS_INCLUDE_PATH - (lambda* (#:key inputs #:allow-other-keys) - (let ((libc (assoc-ref inputs "libc")) - (gcc (assoc-ref inputs "gcc"))) - (setenv "CPLUS_INCLUDE_PATH" - (string-join (fold delete - (string-split (getenv "CPLUS_INCLUDE_PATH") - #\:) - (list (string-append libc "/include") - (string-append gcc "/include/c++"))) - ":")) - (format #t - "environment variable `CPLUS_INCLUDE_PATH' changed to ~a~%" - (getenv "CPLUS_INCLUDE_PATH"))))))))))) + (if (%current-target-system) + (substitute-keyword-arguments arguments + ((#:configure-flags flags '()) + `(cons "CXX=g++ -std=c++03" ,flags))) + (substitute-keyword-arguments arguments + ((#:modules modules %default-gnu-modules) + `((srfi srfi-1) + ,@modules)) + ((#:configure-flags flags '()) + `(cons "CXX=g++ -std=c++03" ,flags)) + ;; For native builds of some GCC versions the C++ include path needs to + ;; be adjusted so it does not interfere with GCC's own build processes. + ((#:phases phases) + `(modify-phases ,phases + (add-after 'set-paths 'adjust-CPLUS_INCLUDE_PATH + (lambda* (#:key inputs #:allow-other-keys) + (let ((libc (assoc-ref inputs "libc")) + (gcc (assoc-ref inputs "gcc"))) + (setenv "CPLUS_INCLUDE_PATH" + (string-join (fold delete + (string-split (getenv "CPLUS_INCLUDE_PATH") + #\:) + (list (string-append libc "/include") + (string-append gcc "/include/c++"))) + ":")) + (format #t + "environment variable `CPLUS_INCLUDE_PATH' changed to ~a~%" + (getenv "CPLUS_INCLUDE_PATH")))))))))) (supported-systems (fold delete %supported-systems '("riscv64-linux" "x86_64-gnu"))) (inputs @@ -560,40 +548,34 @@ Go. It also includes runtime support libraries for these languages.") '("aarch64" "alpha" "bfin" "i386" "m68k" "nios2" "pa" "sh" "tilepro" "xtensa"))))) (arguments - ;; Since 'arguments' is a function of the package's version, define - ;; 'parent' such that the 'arguments' thunk gets to see the right - ;; version. - (let ((parent (package - (inherit gcc-base) - (version (package-version this-package))))) - (if (%current-target-system) - (substitute-keyword-arguments arguments - ((#:configure-flags flags '()) - `(cons "CXX=g++ -std=c++11" ,flags))) - (substitute-keyword-arguments arguments - ((#:modules modules %default-gnu-modules) - `((srfi srfi-1) - ,@modules)) - ((#:configure-flags flags '()) - `(cons "CXX=g++ -std=c++11" ,flags)) - ;; For native builds of some GCC versions the C++ include path needs to - ;; be adjusted so it does not interfere with GCC's own build processes. - ((#:phases phases) - `(modify-phases ,phases - (add-after 'set-paths 'adjust-CPLUS_INCLUDE_PATH - (lambda* (#:key inputs #:allow-other-keys) - (let ((libc (assoc-ref inputs "libc")) - (gcc (assoc-ref inputs "gcc"))) - (setenv "CPLUS_INCLUDE_PATH" - (string-join (fold delete - (string-split (getenv "CPLUS_INCLUDE_PATH") - #\:) - (list (string-append libc "/include") - (string-append gcc "/include/c++"))) - ":")) - (format #t - "environment variable `CPLUS_INCLUDE_PATH' changed to ~a~%" - (getenv "CPLUS_INCLUDE_PATH"))))))))))) + (if (%current-target-system) + (substitute-keyword-arguments arguments + ((#:configure-flags flags '()) + `(cons "CXX=g++ -std=c++11" ,flags))) + (substitute-keyword-arguments arguments + ((#:modules modules %default-gnu-modules) + `((srfi srfi-1) + ,@modules)) + ((#:configure-flags flags '()) + `(cons "CXX=g++ -std=c++11" ,flags)) + ;; For native builds of some GCC versions the C++ include path needs to + ;; be adjusted so it does not interfere with GCC's own build processes. + ((#:phases phases) + `(modify-phases ,phases + (add-after 'set-paths 'adjust-CPLUS_INCLUDE_PATH + (lambda* (#:key inputs #:allow-other-keys) + (let ((libc (assoc-ref inputs "libc")) + (gcc (assoc-ref inputs "gcc"))) + (setenv "CPLUS_INCLUDE_PATH" + (string-join (fold delete + (string-split (getenv "CPLUS_INCLUDE_PATH") + #\:) + (list (string-append libc "/include") + (string-append gcc "/include/c++"))) + ":")) + (format #t + "environment variable `CPLUS_INCLUDE_PATH' changed to ~a~%" + (getenv "CPLUS_INCLUDE_PATH")))))))))) ;; Override inherited texinfo-5 with latest version. (native-inputs (list perl ;for manpages texinfo)) @@ -644,38 +626,32 @@ Go. It also includes runtime support libraries for these languages.") (modules '((guix build utils))) (snippet gcc-canadian-cross-objdump-snippet))) (arguments - ;; Since 'arguments' is a function of the package's version, define - ;; 'parent' such that the 'arguments' thunk gets to see the right - ;; version. - (let ((parent (package - (inherit gcc-base) - (version (package-version this-package))))) - (substitute-keyword-arguments arguments - ((#:modules modules %default-gnu-modules) - `((srfi srfi-1) - ,@modules)) - ((#:configure-flags flags '()) - `(cons "CXX=g++ -std=c++11" ,flags)) - ;; For native builds of some GCC versions the C++ include path needs to - ;; be adjusted so it does not interfere with GCC's own build processes. - ((#:phases phases) - (if (%current-target-system) - phases - `(modify-phases ,phases - (add-after 'set-paths 'adjust-CPLUS_INCLUDE_PATH - (lambda* (#:key inputs #:allow-other-keys) - (let ((libc (assoc-ref inputs "libc")) - (gcc (assoc-ref inputs "gcc"))) - (setenv "CPLUS_INCLUDE_PATH" - (string-join (fold delete - (string-split (getenv "CPLUS_INCLUDE_PATH") - #\:) - (list (string-append libc "/include") - (string-append gcc "/include/c++"))) - ":")) - (format #t - "environment variable `CPLUS_INCLUDE_PATH' changed to ~a~%" - (getenv "CPLUS_INCLUDE_PATH"))))))))))) + (substitute-keyword-arguments arguments + ((#:modules modules %default-gnu-modules) + `((srfi srfi-1) + ,@modules)) + ((#:configure-flags flags '()) + `(cons "CXX=g++ -std=c++11" ,flags)) + ;; For native builds of some GCC versions the C++ include path needs to + ;; be adjusted so it does not interfere with GCC's own build processes. + ((#:phases phases) + (if (%current-target-system) + phases + `(modify-phases ,phases + (add-after 'set-paths 'adjust-CPLUS_INCLUDE_PATH + (lambda* (#:key inputs #:allow-other-keys) + (let ((libc (assoc-ref inputs "libc")) + (gcc (assoc-ref inputs "gcc"))) + (setenv "CPLUS_INCLUDE_PATH" + (string-join (fold delete + (string-split (getenv "CPLUS_INCLUDE_PATH") + #\:) + (list (string-append libc "/include") + (string-append gcc "/include/c++"))) + ":")) + (format #t + "environment variable `CPLUS_INCLUDE_PATH' changed to ~a~%" + (getenv "CPLUS_INCLUDE_PATH")))))))))) (native-inputs (list perl ;for manpages texinfo)) (inputs