From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id IF71Merwz14cQQAA0tVLHw (envelope-from ) for ; Thu, 28 May 2020 17:12:10 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id 0F2uLerwz17pPQAAbx9fmQ (envelope-from ) for ; Thu, 28 May 2020 17:12:10 +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 7E0519400C3 for ; Thu, 28 May 2020 17:12:10 +0000 (UTC) Received: from localhost ([::1]:38752 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jeM4f-0006pG-EJ for larch@yhetil.org; Thu, 28 May 2020 13:12:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48202) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jeM4Y-0006of-Pj for guix-patches@gnu.org; Thu, 28 May 2020 13:12:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:41398) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jeM4Y-0002BZ-Fu for guix-patches@gnu.org; Thu, 28 May 2020 13:12:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jeM4Y-0006WP-Bx for guix-patches@gnu.org; Thu, 28 May 2020 13:12:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#41579] [PATCH 0/2] Introduce 'cc-for-target'. Resent-From: Marius Bakke Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 28 May 2020 17:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 41579 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 41579@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.159068590525043 (code B ref -1); Thu, 28 May 2020 17:12:02 +0000 Received: (at submit) by debbugs.gnu.org; 28 May 2020 17:11:45 +0000 Received: from localhost ([127.0.0.1]:52944 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jeM4H-0006Vr-Gz for submit@debbugs.gnu.org; Thu, 28 May 2020 13:11:45 -0400 Received: from lists.gnu.org ([209.51.188.17]:40822) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jeM4G-0006Vk-25 for submit@debbugs.gnu.org; Thu, 28 May 2020 13:11:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48144) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jeM4F-0006gh-Ta for guix-patches@gnu.org; Thu, 28 May 2020 13:11:43 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:37248) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jeM4F-0001qW-L9 for guix-patches@gnu.org; Thu, 28 May 2020 13:11:43 -0400 Received: from ti0006q161-2604.bb.online.no ([84.202.68.75]:41846 helo=localhost) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jeM4C-0001yf-Ep for guix-patches@gnu.org; Thu, 28 May 2020 13:11:41 -0400 From: Marius Bakke Date: Thu, 28 May 2020 19:11:37 +0200 Message-Id: <20200528171137.29146-1-marius@gnu.org> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -3.3 (---) 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" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; 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-Spam-Score: 3.99 X-TUID: 2AI311MUcoO5 Many packages specify a compiler "manually", which leads to this stanza in order to work when cross-compiling: (string-append "CC=" (let ((target ,(%current-target-system))) (if target (string-append target "-gcc") "gcc"))) To reduce duplication, the following patch introduces a 'cc-for-target' procedure, so one can instead do: (string-append "CC=" ,(cc-for-target)) ...and it will DTRT. Thoughts? Marius Bakke (2): utils: Add 'cc-for-target'. gnu: Use 'cc-for-target' instead of custom implementations. gnu/packages/compression.scm | 7 +- gnu/packages/linux.scm | 22 ++---- gnu/packages/mail.scm | 5 +- gnu/packages/music.scm | 6 +- gnu/packages/radio.scm | 7 +- gnu/packages/suckless.scm | 134 +++++++++++------------------------ guix/utils.scm | 9 ++- 7 files changed, 60 insertions(+), 130 deletions(-) -- 2.26.2