[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
03/03: gnu: pciutils: Fix cross-compilation.
From: |
guix-commits |
Subject: |
03/03: gnu: pciutils: Fix cross-compilation. |
Date: |
Mon, 16 Dec 2019 10:33:23 -0500 (EST) |
mothacehe pushed a commit to branch core-updates
in repository guix.
commit 6eae90898a8c1bcd23d156b086e7ab03930356f1
Author: Mathieu Othacehe <address@hidden>
Date: Mon Dec 16 14:30:11 2019 +0100
gnu: pciutils: Fix cross-compilation.
* gnu/packages/pciutils.scm (pciutils)[arguments]: Set CROSS_COMPILE, HOST
and
STRIP variables correctly in Makefile to fix cross-compilation.
---
gnu/packages/pciutils.scm | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/gnu/packages/pciutils.scm b/gnu/packages/pciutils.scm
index f8b79cf..18d7c1e 100644
--- a/gnu/packages/pciutils.scm
+++ b/gnu/packages/pciutils.scm
@@ -2,6 +2,7 @@
;;; Copyright © 2014, 2015, 2017 Ludovic Courtès <address@hidden>
;;; Copyright © 2016 Efraim Flashner <address@hidden>
;;; Copyright © 2018 Tobias Geerinckx-Rice <address@hidden>
+;;; Copyright © 2019 Mathieu Othacehe <address@hidden>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -22,6 +23,7 @@
#:use-module (guix packages)
#:use-module (guix download)
#:use-module ((guix licenses) #:prefix license:)
+ #:use-module (guix utils)
#:use-module (guix build-system gnu)
#:use-module (gnu packages compression)
#:use-module (gnu packages pkg-config)
@@ -42,12 +44,26 @@
"1wwkpglvvr1sdj2gxz9khq507y02c4px48njy25divzdhv4jwifv"))))
(build-system gnu-build-system)
(arguments
- '(#:phases
+ `(#:phases
(modify-phases %standard-phases
(replace 'configure
(lambda* (#:key outputs #:allow-other-keys)
;; There's no 'configure' script, just a raw makefile.
(substitute* "Makefile"
+ ,@(if (%current-target-system)
+ `((("^CROSS_COMPILE=.*$")
+ (string-append "CROSS_COMPILE="
+ ,(%current-target-system) "-"
+ "\n"))
+ (("^HOST=.*$")
+ (string-append "HOST="
+ ,(gnu-triplet->nix-system
+ (%current-target-system)) "\n"))
+ ;; Disable 'install' strip option, that would fail when
+ ;; we are cross-compiling.
+ (("^STRIP=.*$")
+ "STRIP=\n"))
+ '())
(("^PREFIX=.*$")
(string-append "PREFIX := " (assoc-ref outputs "out")
"\n"))