From patchwork Sat Oct 19 12:46:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Danny Milosavljevic X-Patchwork-Id: 15772 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 57A58175DB; Sat, 19 Oct 2019 13:47:16 +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,URIBL_BLOCKED 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 05C21175D6 for ; Sat, 19 Oct 2019 13:47:16 +0100 (BST) Received: from localhost ([::1]:54136 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iLo8Z-00055r-DC for patchwork@mira.cbaines.net; Sat, 19 Oct 2019 08:47:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34969) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iLo8Q-00055U-8H for guix-patches@gnu.org; Sat, 19 Oct 2019 08:47:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iLo8O-0004NU-Kt for guix-patches@gnu.org; Sat, 19 Oct 2019 08:47:06 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:43253) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iLo8O-0004NP-HW for guix-patches@gnu.org; Sat, 19 Oct 2019 08:47:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iLo8O-0004he-Cg for guix-patches@gnu.org; Sat, 19 Oct 2019 08:47:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#37823] [PATCH] gnu: sunxi-tools: Simplify build. Resent-From: Danny Milosavljevic Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 19 Oct 2019 12:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 37823 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 37823@debbugs.gnu.org Cc: Danny Milosavljevic X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.157148919318039 (code B ref -1); Sat, 19 Oct 2019 12:47:02 +0000 Received: (at submit) by debbugs.gnu.org; 19 Oct 2019 12:46:33 +0000 Received: from localhost ([127.0.0.1]:52074 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iLo7s-0004gt-Rc for submit@debbugs.gnu.org; Sat, 19 Oct 2019 08:46:33 -0400 Received: from lists.gnu.org ([209.51.188.17]:39789) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iLo7q-0004gl-UJ for submit@debbugs.gnu.org; Sat, 19 Oct 2019 08:46:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34945) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iLo7p-0004wK-7C for guix-patches@gnu.org; Sat, 19 Oct 2019 08:46:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iLo7n-00041v-LX for guix-patches@gnu.org; Sat, 19 Oct 2019 08:46:29 -0400 Received: from dd26836.kasserver.com ([85.13.145.193]:56504) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iLo7n-0003xr-B5 for guix-patches@gnu.org; Sat, 19 Oct 2019 08:46:27 -0400 Received: from dayas.fritz.box (unknown [185.17.13.127]) by dd26836.kasserver.com (Postfix) with ESMTPSA id 5C6B733655A5; Sat, 19 Oct 2019 14:46:22 +0200 (CEST) From: Danny Milosavljevic Date: Sat, 19 Oct 2019 14:46:16 +0200 Message-Id: <20191019124616.19256-1-dannym@scratchpost.org> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 Tags: patch X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] 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: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/admin.scm (sunxi-tools-source): New procedure. (sunxi-target-tools): New variable. (sunxi-tools)[source]: Use sunxi-tools-source. [native-inputs]: Remove cross-gcc, cross-libc, cross-libc-static. Add sunxi-target-tools. [arguments]<#:make-flags>: Modify. [arguments]<#:phases>[set-environment-up]: Delete phase. [build-armhf]: Delete phase. [install]: Modify. --- gnu/packages/admin.scm | 99 ++++++++++++++++++++++-------------------- 1 file changed, 51 insertions(+), 48 deletions(-) diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm index 82f1bb4eb8..3d967f185e 100644 --- a/gnu/packages/admin.scm +++ b/gnu/packages/admin.scm @@ -2558,11 +2558,7 @@ Kerberos and Heimdal and FAST is supported with recent MIT Kerberos.") ;; clause requiring us to give all recipients a copy. (license license:gpl1+))) -(define-public sunxi-tools - (package - (name "sunxi-tools") - (version "1.4.2") - (source +(define (sunxi-tools-source version) (origin (method git-fetch) (uri (git-reference @@ -2577,14 +2573,49 @@ Kerberos and Heimdal and FAST is supported with recent MIT Kerberos.") '(begin (delete-file-recursively "bin") #t)) - (file-name (git-file-name name version)))) + (file-name (git-file-name "sunxi-tools" version)))) + +(define sunxi-target-tools + (package + (name "sunxi-target-tools") + (version "1.4.2") + (build-system gnu-build-system) + (source + (sunxi-tools-source version)) + (arguments + `(#:system "armhf-linux" + #:tests? #f + #:make-flags (list (string-append "PREFIX=" + (assoc-ref %outputs "out")) + (string-append "CROSS_COMPILE=") + "CC=gcc") + #:phases + (modify-phases %standard-phases + (delete 'configure) + (replace 'build + (lambda* (#:key make-flags #:allow-other-keys) + (apply invoke "make" "target-tools" make-flags))) + (replace 'install + (lambda* (#:key make-flags #:allow-other-keys) + (apply invoke "make" "install-target-tools" + make-flags)))))) + (home-page "https://github.com/linux-sunxi/sunxi-tools") + (synopsis "Hardware management tools for Allwinner computers") + (description "This package contains tools for Allwinner devices: +@enumerate +@item @command{sunxi-meminfo}: Prints memory bus settings. +@end enumerate") + (license license:gpl2+))) + +(define-public sunxi-tools + (package + (name "sunxi-tools") + (version "1.4.2") + (source + (sunxi-tools-source version)) (native-inputs - `(("pkg-config" ,pkg-config) - ("cross-gcc" ,(cross-gcc "arm-linux-gnueabihf" - #:xbinutils (cross-binutils "arm-linux-gnueabihf") - #:libc (cross-libc "arm-linux-gnueabihf"))) - ("cross-libc" ,(cross-libc "arm-linux-gnueabihf")) ; header files - ("cross-libc-static" ,(cross-libc "arm-linux-gnueabihf") "static"))) + `(("sunxi-target-tools" ,sunxi-target-tools) + ("pkg-config" ,pkg-config))) (inputs `(("libusb" ,libusb))) (build-system gnu-build-system) @@ -2592,50 +2623,22 @@ Kerberos and Heimdal and FAST is supported with recent MIT Kerberos.") `(#:tests? #f ; no tests exist #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out")) - (string-append "CROSS_COMPILE=" - "arm-linux-gnueabihf-") + (string-append "CROSS_COMPILE=disabled") "CC=gcc") #:phases (modify-phases %standard-phases (delete 'configure) - (add-before 'build 'set-environment-up - (lambda* (#:key make-flags #:allow-other-keys) - (define (cross? x) - (string-contains x "cross-arm-linux")) - (define (filter-environment! filter-predicate - environment-variable-names) - (for-each - (lambda (env-name) - (when (getenv env-name) - (let* ((env-value (getenv env-name)) - (search-path (search-path-as-string->list env-value)) - (new-search-path (filter filter-predicate - search-path)) - (new-env-value (list->search-path-as-string - new-search-path ":"))) - (setenv env-name new-env-value)))) - environment-variable-names)) - (setenv "CROSS_CPATH" (getenv "CPATH")) - (setenv "CROSS_C_INCLUDE_PATH" (getenv "C_INCLUDE_PATH")) - (setenv "CROSS_CPLUS_INCLUDE_PATH" (getenv "CPLUS_INCLUDE_PATH")) - (setenv "CROSS_LIBRARY_PATH" (getenv "LIBRARY_PATH")) - (filter-environment! cross? - '("CROSS_CPATH" "CROSS_C_INCLUDE_PATH" "CROSS_CPLUS_INCLUDE_PATH" - "CROSS_LIBRARY_PATH")) - (filter-environment! (lambda (e) (not (cross? e))) - '("CPATH" "C_INCLUDE_PATH" "CPLUS_INCLUDE_PATH" - "LIBRARY_PATH")) - #t)) (replace 'build (lambda* (#:key make-flags #:allow-other-keys) (apply invoke "make" "tools" "misc" make-flags))) - (add-after 'build 'build-armhf - (lambda* (#:key make-flags #:allow-other-keys) - (setenv "LIBRARY_PATH" #f) - (apply invoke "make" "target-tools" make-flags))) (replace 'install - (lambda* (#:key make-flags #:allow-other-keys) - (apply invoke "make" "install-all" "install-misc" + (lambda* (#:key inputs outputs make-flags #:allow-other-keys) + ;; Those tools have been built for armhf but are part of the + ;; installation in the upstream package. So do the same + ;; here. + (copy-recursively (assoc-ref inputs "sunxi-target-tools") + (assoc-ref outputs "out")) + (apply invoke "make" "install-tools" "install-misc" make-flags)))))) (home-page "https://github.com/linux-sunxi/sunxi-tools") (synopsis "Hardware management tools for Allwinner computers")