[PATCH] gnu: sunxi-tools: Build armhf target tools.

  • Done
  • quality assurance status badge
Details
One participant
  • Danny Milosavljevic
Owner
unassigned
Submitted by
Danny Milosavljevic
Severity
normal

Debbugs page

Danny Milosavljevic wrote 8 years ago
(address . guix-patches@gnu.org)(name . Danny Milosavljevic)(address . dannym@scratchpost.org)
20170519184656.11834-1-dannym@scratchpost.org
* gnu/packages/admin.scm (sunxi-tools)
[native-inputs]: Add cross-gcc, cross-libc.
[arguments]: Add "set-environment-up" phase.
Replace "build" phase.
Add "build-armhf" phase.
Update make-flags.
---
gnu/packages/admin.scm | 35 +++++++++++++++++++++++++++++++----
1 file changed, 31 insertions(+), 4 deletions(-)

Toggle diff (63 lines)
diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm
index aa6ccc0a7..1bee5de09 100644
--- a/gnu/packages/admin.scm
+++ b/gnu/packages/admin.scm
@@ -57,6 +57,7 @@
#:use-module (gnu packages perl)
#:use-module (gnu packages tcl)
#:use-module (gnu packages compression)
+ #:use-module (gnu packages cross-base)
#:use-module (gnu packages tls)
#:use-module (gnu packages gnupg)
#:use-module (gnu packages bison)
@@ -1904,7 +1905,11 @@ Kerberos and Heimdal and FAST is supported with recent MIT Kerberos.")
'(delete-file-recursively "bin"))
(file-name (string-append name "-" version ".tar.gz"))))
(native-inputs
- `(("pkg-config" ,pkg-config)))
+ `(("pkg-config" ,pkg-config)
+ ("cross-gcc" ,(cross-gcc "arm-linux-gnueabihf"
+ (cross-binutils "arm-linux-gnueabihf")
+ (cross-libc "arm-linux-gnueabihf")))
+ ("cross-libc" ,(cross-libc "arm-linux-gnueabihf"))))
(inputs
`(("libusb" ,libusb)))
(build-system gnu-build-system)
@@ -1912,12 +1917,34 @@ 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"))
- "CROSS_COMPILE="
- "CC=gcc"
- "all")
+ (string-append "CROSS_COMPILE="
+ "arm-linux-gnueabihf-")
+ "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"))
+ (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"))
+ (for-each
+ (lambda (env-name)
+ (let* ((env-value (getenv env-name))
+ (search-path (search-path-as-string->list env-value))
+ (new-search-path (filter (lambda (e) (not (cross? e))) search-path))
+ (new-env-value (list->search-path-as-string new-search-path ":")))
+ (setenv env-name new-env-value)))
+ '("C_INCLUDE_PATH" "CPLUS_INCLUDE_PATH" "LIBRARY_PATH"))
+ #t))
+ (replace 'build
+ (lambda* (#:key make-flags #:allow-other-keys)
+ (zero? (apply system* "make" "tools" make-flags))))
+ (add-after 'build 'build-armhf
+ (lambda* (#:key make-flags #:allow-other-keys)
+ (zero? (apply system* "make" "target-tools" "misc" make-flags))))
(replace 'install
(lambda* (#:key make-flags #:allow-other-keys)
(zero? (apply system* "make" "install-all" "install-misc"
Danny Milosavljevic wrote 8 years ago
[PATCH v2] gnu: sunxi-tools: Build armhf target tools.
(address . 26999@debbugs.gnu.org)(name . Danny Milosavljevic)(address . dannym@scratchpost.org)
20170519204224.27469-1-dannym@scratchpost.org
* gnu/packages/admin.scm (sunxi-tools)
[native-inputs]: Add cross-gcc, cross-libc.
[arguments]: Add "set-environment-up" phase.
Replace "build" phase.
Add "build-armhf" phase.
Update make-flags.
---
gnu/packages/admin.scm | 39 ++++++++++++++++++++++++++++++++++-----
1 file changed, 34 insertions(+), 5 deletions(-)

Toggle diff (66 lines)
diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm
index aa6ccc0a7..8bcfe065a 100644
--- a/gnu/packages/admin.scm
+++ b/gnu/packages/admin.scm
@@ -57,6 +57,7 @@
#:use-module (gnu packages perl)
#:use-module (gnu packages tcl)
#:use-module (gnu packages compression)
+ #:use-module (gnu packages cross-base)
#:use-module (gnu packages tls)
#:use-module (gnu packages gnupg)
#:use-module (gnu packages bison)
@@ -1904,20 +1905,48 @@ Kerberos and Heimdal and FAST is supported with recent MIT Kerberos.")
'(delete-file-recursively "bin"))
(file-name (string-append name "-" version ".tar.gz"))))
(native-inputs
- `(("pkg-config" ,pkg-config)))
+ `(("pkg-config" ,pkg-config)
+ ("cross-gcc" ,(cross-gcc "arm-linux-gnueabihf"
+ (cross-binutils "arm-linux-gnueabihf")
+ (cross-libc "arm-linux-gnueabihf")))
+ ("cross-libc" ,(cross-libc "arm-linux-gnueabihf"))))
(inputs
`(("libusb" ,libusb)))
(build-system gnu-build-system)
(arguments
- `(#:tests? #f ; no tests exist
+ `(#:tests? #f ; no tests exist
#:make-flags (list (string-append "PREFIX="
(assoc-ref %outputs "out"))
- "CROSS_COMPILE="
- "CC=gcc"
- "all")
+ (string-append "CROSS_COMPILE="
+ "arm-linux-gnueabihf-")
+ "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"))
+ (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"))
+ (for-each
+ (lambda (env-name)
+ (let* ((env-value (getenv env-name))
+ (search-path (search-path-as-string->list env-value))
+ (new-search-path (filter (lambda (e) (not (cross? e)))
+ search-path))
+ (new-env-value (list->search-path-as-string
+ new-search-path ":")))
+ (setenv env-name new-env-value)))
+ '("C_INCLUDE_PATH" "CPLUS_INCLUDE_PATH" "LIBRARY_PATH"))
+ #t))
+ (replace 'build
+ (lambda* (#:key make-flags #:allow-other-keys)
+ (zero? (apply system* "make" "tools" "misc" make-flags))))
+ (add-after 'build 'build-armhf
+ (lambda* (#:key make-flags #:allow-other-keys)
+ (zero? (apply system* "make" "target-tools" make-flags))))
(replace 'install
(lambda* (#:key make-flags #:allow-other-keys)
(zero? (apply system* "make" "install-all" "install-misc"
Danny Milosavljevic wrote 8 years ago
(no subject)
(address . control@debbugs.gnu.org)
20170525130429.537a9197@scratchpost.org
close 26900
close 26906
close 26999
?
Your comment

This issue is archived.

To comment on this conversation send an email to 26999@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 26999
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help