From patchwork Mon Sep 2 15:33:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Othacehe X-Patchwork-Id: 15265 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 580B31734D; Mon, 2 Sep 2019 16:39:07 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 15B4017329 for ; Mon, 2 Sep 2019 16:39:07 +0100 (BST) Received: from localhost ([::1]:37700 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i4oQ6-0006L4-IR for patchwork@mira.cbaines.net; Mon, 02 Sep 2019 11:39:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42709) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i4oMK-0002JL-FW for guix-patches@gnu.org; Mon, 02 Sep 2019 11:35:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i4oMH-0004Xe-QP for guix-patches@gnu.org; Mon, 02 Sep 2019 11:35:12 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:50036) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i4oMH-0004XM-NL for guix-patches@gnu.org; Mon, 02 Sep 2019 11:35:09 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1i4oMH-0006dt-JL for guix-patches@gnu.org; Mon, 02 Sep 2019 11:35:09 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#36477] [PATCH v3 32/48] gnu: crda: Fix cross-compilation Resent-From: Mathieu Othacehe Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 02 Sep 2019 15:35:09 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36477 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: 36477@debbugs.gnu.org Received: via spool by 36477-submit@debbugs.gnu.org id=B36477.156743847525213 (code B ref 36477); Mon, 02 Sep 2019 15:35:09 +0000 Received: (at 36477) by debbugs.gnu.org; 2 Sep 2019 15:34:35 +0000 Received: from localhost ([127.0.0.1]:58797 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1i4oLi-0006YQ-Gd for submit@debbugs.gnu.org; Mon, 02 Sep 2019 11:34:35 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:33384) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1i4oLV-0006UH-HC for 36477@debbugs.gnu.org; Mon, 02 Sep 2019 11:34:22 -0400 Received: by mail-wr1-f65.google.com with SMTP id u16so14481189wrr.0 for <36477@debbugs.gnu.org>; Mon, 02 Sep 2019 08:34:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=aklKo+dbX0aVxf0JJx7CZaktBU7tPb8ga9itqxLwWIA=; b=WCBbLlxsmklPHhYkAXgEo+3P36/zrmkwllJDBFbVJnHPt/qVV73/cBBbR/lFACKq0w i+cgHzE37yNvUVezaHuj4ElCMX5gl4mH0id43d1GaMAopf2e4w8NqLWE723jmp14hsmf 1XtmRnTT4vMrSt33GSVVJbj80pF0RKW/LPwmADR+tIltiMW2nTcbWUSY6H+IBUolP3VC BCSuzK4wnldMsovR01fKYCxOTYFTmH5yQZfpJ4DwefOXBqAxzIM3B61yj9ujU4MkRf5q NHqE+hdZjyvhmBW8atBNKRxoLi6ZkDRQRHM2VOOolxX09tDb3oCATPO06HzLdmvSMOkQ 5xvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=aklKo+dbX0aVxf0JJx7CZaktBU7tPb8ga9itqxLwWIA=; b=IN02Z7CxOlh/0f/W77ca2vxWwCvj7ud/Egfuq/qQbiWRkV3oZA9MlLJ7CS1xWi9lA3 Y0w+1IT/aRSa/h/+zC/R6/kq2Pcrqprn3378qy4vJdFrMJZUUFbeNhLc6lNQ6VXO1k9s 8TdX+d/i2GdBocR/ChRO+Fm/zMTfHFWCmUqWmgrHEIHmKnNxjcKTOHZPWsx+zeavDgMd e1p7+zrc1feEEsvfFOVg3IkeJ+bCRT1H+BzPX2CGUDkOagBbbZ3FwFpi1DWwurf/RKfg Rd5Bn0deeKObKRRSjTaKqYKWPBcEp5GzR/YRTH+F8vAI24V/BSCot1Ll67heLtH0RJBO lSQA== X-Gm-Message-State: APjAAAX2WZRp/K+07z/ONsMg2qQNJwBBuy30BGh2ySjb/bzW+0b0Bp9W GKcPfsnsyIz5SNYF95avWUHHsuVS X-Google-Smtp-Source: APXvYqx/bFZ9op9LR/QKbLrsNU534OnrQOEXoEllFx03pOyPN1y0+uZcXf9XcPJf7jkguKaCHxrN4g== X-Received: by 2002:adf:e3ce:: with SMTP id k14mr34485332wrm.303.1567438455766; Mon, 02 Sep 2019 08:34:15 -0700 (PDT) Received: from localhost.localdomain ([80.12.63.115]) by smtp.gmail.com with ESMTPSA id b26sm17232265wmj.14.2019.09.02.08.34.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Sep 2019 08:34:15 -0700 (PDT) From: Mathieu Othacehe Date: Mon, 2 Sep 2019 17:33:17 +0200 Message-Id: <20190902153333.11190-33-m.othacehe@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190902153333.11190-1-m.othacehe@gmail.com> References: <20190902153333.11190-1-m.othacehe@gmail.com> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Pierre-Moana Levesque Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches From: Pierre-Moana Levesque * gnu/packages/linux.scm (crda)[arguments]: Patch Makefile to use cross pkg-config when cross-compiling. Also search for wireless-regdb in both native-inputs and inputs. Set CC variable to cross-compiler when cross-compiling. --- gnu/packages/linux.scm | 67 ++++++++++++++++++++++++++---------------- 1 file changed, 42 insertions(+), 25 deletions(-) diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index 9c38bbcfc0..ed2d21859d 100644 --- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm @@ -2796,13 +2796,23 @@ interface.") (patches (search-patches "crda-optional-gcrypt.patch")))) (build-system gnu-build-system) (arguments - '(#:phases (modify-phases %standard-phases + `(#:phases (modify-phases %standard-phases (delete 'configure) (add-after 'unpack 'gzip-determinism (lambda _ (substitute* "Makefile" (("gzip") "gzip --no-name")) #t)) + ,@(if (%current-target-system) + '((add-after + 'unpack 'fix-pkg-config + (lambda* (#:key target #:allow-other-keys) + (substitute* + "Makefile" + (("pkg-config") + (string-append target "-pkg-config"))) + #t))) + '()) (add-before 'build 'no-werror-no-ldconfig (lambda _ @@ -2812,37 +2822,44 @@ interface.") #t)) (add-before 'build 'set-regulator-db-file-name - (lambda* (#:key inputs #:allow-other-keys) + (lambda* (#:key native-inputs inputs #:allow-other-keys) ;; Tell CRDA where to find our database. - (let ((regdb (assoc-ref inputs "wireless-regdb"))) + (let ((regdb (assoc-ref (or native-inputs inputs) + "wireless-regdb"))) (substitute* "crda.c" (("\"/lib/crda/regulatory.bin\"") (string-append "\"" regdb "/lib/crda/regulatory.bin\""))) #t)))) #:test-target "verify" - #:make-flags (let ((out (assoc-ref %outputs "out")) - (regdb (assoc-ref %build-inputs "wireless-regdb"))) - (list "CC=gcc" "V=1" - - ;; Disable signature-checking on 'regulatory.bin'. - ;; The reason is that this simplifies maintenance - ;; on our side (no need to manage a distro key - ;; pair), and we can guarantee integrity of - ;; 'regulatory.bin' by other means anyway, such as - ;; 'guix gc --verify'. See - ;; - ;; for a discssion. - "USE_OPENSSL=0" - - (string-append "PREFIX=" out) - (string-append "SBINDIR=" out "/sbin/") - (string-append "UDEV_RULE_DIR=" - out "/lib/udev/rules.d") - (string-append "LDFLAGS=-Wl,-rpath=" - out "/lib -L.") - (string-append "REG_BIN=" regdb - "/lib/crda/regulatory.bin"))))) + #:make-flags (let ((out (assoc-ref %outputs "out")) + (regdb (assoc-ref %build-inputs "wireless-regdb")) + (target ,(%current-target-system))) + (list + (string-append + "CC=" (if target + (string-append target "-gcc") "gcc")) + "V=1" + + ;; Disable signature-checking on 'regulatory.bin'. + ;; The reason is that this simplifies maintenance + ;; on our side (no need to manage a distro key + ;; pair), and we can guarantee integrity of + ;; 'regulatory.bin' by other means anyway, such as + ;; 'guix gc --verify'. See + ;; + ;; for a discssion. + "USE_OPENSSL=0" + + (string-append "PREFIX=" out) + (string-append "SBINDIR=" out "/sbin/") + (string-append "UDEV_RULE_DIR=" + out "/lib/udev/rules.d") + (string-append "LDFLAGS=-Wl,-rpath=" + out "/lib -L.") + (string-append "REG_BIN=" regdb + "/lib/crda/regulatory.bin") + "all_noverify")))) (native-inputs `(("pkg-config" ,pkg-config) ("python" ,python-2) ("wireless-regdb" ,wireless-regdb)))