From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 4PHgM7V8x2CwbAAAgWs5BA (envelope-from ) for ; Mon, 14 Jun 2021 17:58:45 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id oJdwL7V8x2CVRgAA1q6Kng (envelope-from ) for ; Mon, 14 Jun 2021 15:58:45 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 54CD734BFF for ; Mon, 14 Jun 2021 17:58:45 +0200 (CEST) Received: from localhost ([::1]:59722 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lsoz6-0004Ri-Cd for larch@yhetil.org; Mon, 14 Jun 2021 11:58:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57078) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lsotc-0001yT-Ux for guix-patches@gnu.org; Mon, 14 Jun 2021 11:53:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:36128) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lsotZ-0007oH-Qa for guix-patches@gnu.org; Mon, 14 Jun 2021 11:53:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lsotZ-0004gC-Ps for guix-patches@gnu.org; Mon, 14 Jun 2021 11:53:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49019] [PATCH 1/1] gnu: Add gccgo-10. Resent-From: Sarah Morgensen Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 14 Jun 2021 15:53:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49019 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 49019@debbugs.gnu.org Received: via spool by 49019-submit@debbugs.gnu.org id=B49019.162368595217935 (code B ref 49019); Mon, 14 Jun 2021 15:53:01 +0000 Received: (at 49019) by debbugs.gnu.org; 14 Jun 2021 15:52:32 +0000 Received: from localhost ([127.0.0.1]:47668 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lsot5-0004fC-Lw for submit@debbugs.gnu.org; Mon, 14 Jun 2021 11:52:32 -0400 Received: from out1.migadu.com ([91.121.223.63]:19147) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lsopC-0004ZP-Bc for 49019@debbugs.gnu.org; Mon, 14 Jun 2021 11:48:31 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mgsn.dev; s=key1; t=1623685708; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QzaWc6QUElbyiP+9s4V34UgiRAfm4oWDwBQsVmI8rvk=; b=NArox45rSvnLNXgc2/KpIEfaOttZcf+G5rILfbvqZ7/0w5zgQMR9F90jr94YUiKfE1w6yX FgNsxbgxuRVmpKt5H0RxrRgeWJXzTtO2bqxwhIf6pGC5HyHM/auXLgZnqzQ4b1lZcrjcF/ t8J8pK5jTIDcPcGZgBHFWglmX4Z4Row= Date: Mon, 14 Jun 2021 08:48:24 -0700 Message-Id: <20210614154824.3465-1-iskarian@mgsn.dev> In-Reply-To: <20210614041653.3085-1-iskarian@mgsn.dev> References: <20210614041653.3085-1-iskarian@mgsn.dev> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Migadu-Auth-User: iskarian@mgsn.dev X-Mailman-Approved-At: Mon, 14 Jun 2021 11:52:30 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" Reply-to: Sarah Morgensen X-ACL-Warn: , Sarah Morgensen via Guix-patches From: Sarah Morgensen via Guix-patches via X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1623686325; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=QzaWc6QUElbyiP+9s4V34UgiRAfm4oWDwBQsVmI8rvk=; b=BHfKR2o9gGLVD6uK5Z0SHOJuQkt3xFGkxgSf/2rg8jZ/6Ki9qVyGzz3/2YvsDgsucDCRTl glMQiWrQvqfdUG4Ngg46GDjyl9N6NEWR/YTkBFPQBvXf93bYjLgE++b0pOil5h+nQ97wIX ks+JG11lYz+3u0bK/x4EuRvDDU4s49u3I2HrDvSttFaUHrIBbm5pf86SUbYPsOWeMWBMO3 LS+pwR4XFD5trZjjwh2UyWoN3I82tcmG3y6L1lBXeHGh/x9PWVpRcJDrJ99xtDviXALD2M +Kd5H7N4tOQ0O4+nJh/BoPLr4AL0vt+zcIgzxCxHoyMus5bF9tZRkSBbENLbxg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1623686325; a=rsa-sha256; cv=none; b=nAfN/CGQ9roDj2lbktD59CJD5jxW5eFglEbc2/bXRTMjezimD/+OL4wDWIu5RgqROMkS8s KLqIPPGGsLD0qYN4yqKwB7nyaQdiwx+ocPlmrJjKV/+7OyuN9/xDfIF1Ib3wwxeB2cXVag 4bUp+a6r7d6O49+JiyGhgqFiS7SKDaeKk1wLijLQPDuIZSmmi06CngTh8ZrWZ3pbH/hmlp bbPfgZhajqxAfpG//in/5ZpWa9KlgSvR8Q+ngdX4XSo7e0PmWPPAuJiocX7F3rhAuLEEZz xG0zGF8QB5qEGbGhtunPm32QeoGeBkcgSeZ1xL3pUxdezpKbepRqSdKR2u9kqA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=mgsn.dev header.s=key1 header.b=NArox45r; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: -2.93 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=mgsn.dev header.s=key1 header.b=NArox45r; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 54CD734BFF X-Spam-Score: -2.93 X-Migadu-Scanner: scn0.migadu.com X-TUID: Qhy+VgbgkIpk Generate gccgo with MAKE-GCCGO to factorize phases, and to fix the cyclic dependency between out and lib (caused by libgo embedding the gotools path) that was worked around in . * gnu/packages/gcc.scm (custom-gcc-gccgo): New procedure. (make-gccgo): New procedure. (gccgo-10): New variable. --- gnu/packages/gcc.scm | 77 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm index 1fd5710e57..df2ba729d8 100644 --- a/gnu/packages/gcc.scm +++ b/gnu/packages/gcc.scm @@ -11,6 +11,7 @@ ;;; Copyright © 2020 Guy Fleury Iteriteka ;;; Copyright © 2020 Simon Tournier ;;; Copyright © 2021 Chris Marusich +;;; Copyright © 2021 Sarah Morgensen ;;; ;;; This file is part of GNU Guix. ;;; @@ -744,6 +745,42 @@ as the 'native-search-paths' field." ".*(c\\+\\+|cpp|g\\+\\+|gcov|gcc|gcc-.*)")) #t)))))))) +(define* (custom-gcc-gccgo gcc name languages + #:optional + (search-paths (package-native-search-paths gcc)) + #:key (separate-lib-output? #t)) + ;; TODO: remove CUSTOM-GCC-GCCGO when regex changes for CUSTOM-GCC are + ;; merged into master + "Return a custom version of GCC that supports LANGUAGES. Use SEARCH-PATHS +as the 'native-search-paths' field." + (package (inherit gcc) + (name name) + (outputs (if separate-lib-output? + (package-outputs gcc) + (delete "lib" (package-outputs gcc)))) + (native-search-paths search-paths) + (properties (alist-delete 'hidden? (package-properties gcc))) + (arguments + (substitute-keyword-arguments (package-arguments gcc) + ((#:modules modules %gnu-build-system-modules) + `(,@modules + (srfi srfi-1) + (srfi srfi-26) + (ice-9 regex))) + ((#:configure-flags flags) + `(cons (string-append "--enable-languages=" + ,(string-join languages ",")) + (remove (cut string-match "--enable-languages.*" <>) + ,flags))) + ((#:phases phases) + `(modify-phases ,phases + (add-after 'install 'remove-broken-or-conflicting-files + (lambda* (#:key outputs #:allow-other-keys) + (for-each + delete-file + (find-files (string-append (assoc-ref outputs "out") "/bin") + ".*(c\\+\\+|cpp|g\\+\\+|gcov|gcc|lto)(-.*)?$")))))))))) + (define %generic-search-paths ;; This is the language-neutral search path for GCC. Entries in $CPATH are ;; not considered "system headers", which means GCC can raise warnings for @@ -813,6 +850,43 @@ It can also be used for ahead-of-time code generation for building standalone compilers. The just-in-time (jit) part of the name is now something of a misnomer."))) +(define (make-gccgo gcc) + "Return a gccgo package based on GCC." + (let ((gccgo (custom-gcc-gccgo gcc "gccgo" '("go") %generic-search-paths))) + (package + (inherit gccgo) + (synopsis "Go frontend to GCC") + (description + "This package is part of the GNU Compiler Collection and +provides the GNU compiler for the Go programming language.") + (arguments + (substitute-keyword-arguments (package-arguments gccgo) + ((#:phases phases) + `(modify-phases ,phases + (add-after 'install 'wrap-go-with-tool-path + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (exedir (string-append out "/libexec/gcc")) + (tooldir (dirname (car (find-files exedir "^cgo$"))))) + (wrap-program (string-append out "/bin/go") + `("GCCGOTOOLDIR" = + (,(string-append "${GCCGOTOOLDIR-" tooldir "}"))) + `("GOROOT" = + (,(string-append "${GOROOT-" out "}"))))))) + (add-before 'configure 'fix-gotools-runpath + (lambda _ + (substitute* "gotools/Makefile.in" + (("AM_LDFLAGS =" all) + (string-append all " -Wl,-rpath=$(libdir) "))))) + (add-before 'configure 'remove-tool-reference-from-libgo + (lambda _ + (substitute* "libgo/Makefile.in" + (("(GccgoToolDir = \\\")[^\\\"]+" _ start) + (string-append start "/nonexistent")) + (("(DefaultGoroot = \\\")[^\\\"]+" _ start) + (string-append start "/nonexistent")) + (("(defaultGOROOTValue.*?return `)[^`]+" _ start) + (string-append start "/nonexistent")))))))))))) (define-public gccgo-4.9 (custom-gcc (package @@ -828,6 +902,9 @@ provides the GNU compiler for the Go programming language.")) ;; a cyclic dependency. #:separate-lib-output? #f)) +(define-public gccgo-10 + (make-gccgo gcc-10)) + (define %objc-search-paths (list (search-path-specification (variable "OBJC_INCLUDE_PATH") -- 2.31.1