gnu: Use 'cc-for-target' instead of custom implementations.

* gnu/packages/compression.scm (ecm)[arguments]: In #:make-flags, remove
TARGET binding and use CC-FOR-TARGET instead.
* gnu/packages/linux.scm (powerstat, crda, cachefilesd)[arguments]: Likewise.
* gnu/packages/mail.scm (alpine)[arguments]: Likewise.
* gnu/packages/music.scm (lsp-plugins)[arguments]: Likewise.
* gnu/packages/radio.scm (dump1090)[arguments]: Likewise.
* gnu/packages/suckless.scm (blind, dmenu, spoon, slock, st, surf, sent,
wificurse, sbm, prout, noice, human, fortify-headers, colors, libutf,
scron)[arguments]: Likewise.
This commit is contained in:
Marius Bakke 2020-05-28 18:57:46 +02:00
parent fb9a57a8e6
commit 1ca44ae34c
No known key found for this signature in database
GPG key ID: A2A06DF2A33A54FA
6 changed files with 52 additions and 129 deletions

View file

@ -2207,11 +2207,8 @@ (define-public ecm
(arguments
`(#:tests? #f ; no check target
#:make-flags
(let ((target ,(%current-target-system)))
(list (string-append "CC=" (if target
(string-append target "-gcc")
"gcc"))
(string-append "DESTDIR=" (assoc-ref %outputs "out"))))
(list (string-append "CC=" ,(cc-for-target))
(string-append "DESTDIR=" (assoc-ref %outputs "out")))
#:phases
(modify-phases %standard-phases
(replace 'configure

View file

@ -1222,11 +1222,8 @@ (define-public powerstat
(build-system gnu-build-system)
(arguments
`(#:make-flags
(let* ((target ,(%current-target-system)))
(list (string-append "CC=" (if target
(string-append target "-gcc")
"gcc"))
(string-append "prefix=" (assoc-ref %outputs "out"))))
(list (string-append "CC=" ,(cc-for-target))
(string-append "prefix=" (assoc-ref %outputs "out")))
#:tests? #f ; no test suite
#:phases
(modify-phases %standard-phases
@ -3377,12 +3374,9 @@ (define-public crda
#t))))
#:test-target "verify"
#:make-flags (let ((out (assoc-ref %outputs "out"))
(regdb (assoc-ref %build-inputs "wireless-regdb"))
(target ,(%current-target-system)))
(regdb (assoc-ref %build-inputs "wireless-regdb")))
(list
(string-append
"CC=" (if target
(string-append target "-gcc") "gcc"))
(string-append "CC=" ,(cc-for-target))
"V=1"
;; Disable signature-checking on 'regulatory.bin'.
@ -7040,12 +7034,8 @@ (define-public cachefilesd
`(#:tests? #f ; there are no tests
#:make-flags
(let ((prefix-dir (lambda (var dir)
(string-append var "=" %output "/" dir)))
(target ,(%current-target-system)))
(list (string-append "CC="
(if target
(string-append target "-gcc")
"gcc"))
(string-append var "=" %output "/" dir))))
(list (string-append "CC=" ,(cc-for-target))
(prefix-dir "SBINDIR" "sbin/")
(prefix-dir "ETCDIR" "etc/")
(prefix-dir "MANDIR" "share/man/")))

View file

@ -2697,10 +2697,7 @@ (define-public alpine
(build-system gnu-build-system)
(arguments
`(#:make-flags
(let ((target ,(%current-target-system)))
(list (string-append "CC=" (if target
(string-append target "-gcc")
"gcc"))))
(list (string-append "CC=" ,(cc-for-target)))
#:configure-flags (list (string-append "--with-ssl-include-dir="
(assoc-ref %build-inputs "openssl")
"/include/openssl")

View file

@ -4886,11 +4886,7 @@ (define-public lsp-plugins
(arguments
`(#:make-flags
(list
(string-append "CC="
(if ,(%current-target-system)
(string-append (assoc-ref %build-inputs "cross-gcc")
"/bin/" ,(%current-target-system) "-gcc")
"gcc"))
(string-append "CC=" ,(cc-for-target))
"BUILD_MODULES=\"lv2 ladspa jack\"" "VST_UI=0"
(string-append "PREFIX=" (assoc-ref %outputs "out"))
(string-append "ETC_PATH=" (assoc-ref %outputs "out") "/etc"))

View file

@ -1018,11 +1018,8 @@ (define-public dump1090
(arguments
`(#:test-target "test"
#:make-flags
(let ((target ,(%current-target-system)))
(list (string-append "CC=" (if target
(string-append target "-gcc")
"gcc"))
"BLADERF=no"))
(list (string-append "CC=" ,(cc-for-target))
"BLADERF=no")
#:phases
(modify-phases %standard-phases
(delete 'configure)

View file

@ -46,6 +46,7 @@ (define-module (gnu packages suckless)
#:use-module (guix download)
#:use-module (guix git-download)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (guix utils)
#:use-module (guix packages))
(define-public blind
@ -62,12 +63,8 @@ (define-public blind
(build-system gnu-build-system)
(arguments
`(#:tests? #f ; no check target
#:make-flags
(let ((target ,(%current-target-system)))
(list (string-append "CC=" (if target
(string-append target "-gcc")
"gcc"))
(string-append "PREFIX=" %output)))
#:make-flags (list (string-append "CC=" ,(cc-for-target))
(string-append "PREFIX=" %output))
#:phases
(modify-phases %standard-phases
(delete 'configure)))) ; no configure script
@ -152,14 +149,11 @@ (define-public dmenu
(arguments
`(#:tests? #f ; no tests
#:make-flags
(let ((target ,(%current-target-system)))
(list (string-append "CC=" (if target
(string-append target "-gcc")
"gcc"))
(string-append "PREFIX=" %output)
(string-append "FREETYPEINC="
(assoc-ref %build-inputs "freetype")
"/include/freetype2")))
(list (string-append "CC=" ,(cc-for-target))
(string-append "PREFIX=" %output)
(string-append "FREETYPEINC="
(assoc-ref %build-inputs "freetype")
"/include/freetype2"))
#:phases
(modify-phases %standard-phases (delete 'configure))))
(inputs
@ -190,11 +184,8 @@ (define-public spoon
(arguments
`(#:tests? #f ; no tests
#:make-flags
(let ((target ,(%current-target-system)))
(list (string-append "CC=" (if target
(string-append target "-gcc")
"gcc"))
(string-append "PREFIX=" %output)))))
(list (string-append "CC=" ,(cc-for-target))
(string-append "PREFIX=" %output))))
(inputs
`(("libx11" ,libx11)
("libxkbfile" ,libxkbfile)
@ -221,11 +212,8 @@ (define-public slock
(arguments
`(#:tests? #f ; no tests
#:make-flags
(let ((target ,(%current-target-system)))
(list (string-append "CC=" (if target
(string-append target "-gcc")
"gcc"))
(string-append "PREFIX=" %output)))
(list (string-append "CC=" ,(cc-for-target))
(string-append "PREFIX=" %output))
#:phases (modify-phases %standard-phases (delete 'configure))))
(inputs
`(("libx11" ,libx11)
@ -253,11 +241,8 @@ (define-public st
(arguments
`(#:tests? #f ; no tests
#:make-flags
(let ((target ,(%current-target-system)))
(list (string-append "CC=" (if target
(string-append target "-gcc")
"gcc"))
(string-append "PREFIX=" %output)))
(list (string-append "CC=" ,(cc-for-target))
(string-append "PREFIX=" %output))
#:phases
(modify-phases %standard-phases
(delete 'configure)
@ -298,11 +283,8 @@ (define-public surf
(arguments
`(#:tests? #f ; no tests
#:make-flags
(let ((target ,(%current-target-system)))
(list (string-append "CC=" (if target
(string-append target "-gcc")
"gcc"))
(string-append "PREFIX=" %output)))
(list (string-append "CC=" ,(cc-for-target))
(string-append "PREFIX=" %output))
#:phases
(modify-phases %standard-phases
(delete 'configure)
@ -347,14 +329,11 @@ (define-public sent
(delete 'configure)) ; no configuration
#:tests? #f ; no test suite
#:make-flags
(let ((target ,(%current-target-system))
(pkg-config (lambda (flag)
(let ((pkg-config (lambda (flag)
(string-append
"$(shell pkg-config " flag " "
"xft fontconfig x11 libpng)"))))
(list (string-append "CC=" (if target
(string-append target "-gcc")
"gcc"))
(list (string-append "CC=" ,(cc-for-target))
(string-append "PREFIX=" %output)
(string-append "INCS=-I. " (pkg-config "--cflags"))
(string-append "LIBS=" (pkg-config "--libs") " -lm")))))
@ -390,11 +369,8 @@ (define-public xbattmon
(arguments
`(#:tests? #f ; no tests
#:make-flags
(let ((target ,(%current-target-system)))
(list (string-append "CC=" (if target
(string-append target "-gcc")
"gcc"))
(string-append "PREFIX=" %output)))))
(list (string-append "CC=" ,(cc-for-target))
(string-append "PREFIX=" %output))))
(inputs
`(("libx11" ,libx11)))
(home-page "https://git.2f30.org/xbattmon/")
@ -452,11 +428,8 @@ (define-public skroll
(arguments
`(#:tests? #f ; no tests
#:make-flags
(let ((target ,(%current-target-system)))
(list (string-append "CC=" (if target
(string-append target "-gcc")
"gcc"))
(string-append "PREFIX=" %output)))
(list (string-append "CC=" ,(cc-for-target))
(string-append "PREFIX=" %output))
#:phases
(modify-phases %standard-phases
(delete 'configure)))) ; no configure script
@ -484,11 +457,8 @@ (define-public sbm
(arguments
`(#:tests? #f ; no tests
#:make-flags
(let ((target ,(%current-target-system)))
(list (string-append "CC=" (if target
(string-append target "-gcc")
"gcc"))
(string-append "PREFIX=" %output)))
(list (string-append "CC=" ,(cc-for-target))
(string-append "PREFIX=" %output))
#:phases
(modify-phases %standard-phases
(delete 'configure)))) ; no configure script
@ -514,11 +484,8 @@ (define-public prout
(arguments
`(#:tests? #f ; no tests
#:make-flags
(let ((target ,(%current-target-system)))
(list (string-append "CC=" (if target
(string-append target "-gcc")
"gcc"))
(string-append "PREFIX=" %output)))
(list (string-append "CC=" ,(cc-for-target))
(string-append "PREFIX=" %output))
#:phases
(modify-phases %standard-phases
(delete 'configure)))) ; no configure script
@ -550,11 +517,8 @@ (define-public noice
(arguments
`(#:tests? #f ; no tests
#:make-flags
(let ((target ,(%current-target-system)))
(list (string-append "CC=" (if target
(string-append target "-gcc")
"gcc"))
(string-append "PREFIX=" %output)))
(list (string-append "CC=" ,(cc-for-target))
(string-append "PREFIX=" %output))
#:phases
(modify-phases %standard-phases
(delete 'configure) ; no configure script
@ -588,11 +552,8 @@ (define-public human
(arguments
`(#:tests? #f ; no tests
#:make-flags
(let ((target ,(%current-target-system)))
(list (string-append "CC=" (if target
(string-append target "-gcc")
"gcc"))
(string-append "PREFIX=" %output)))
(list (string-append "CC=" ,(cc-for-target))
(string-append "PREFIX=" %output))
#:phases
(modify-phases %standard-phases
(delete 'configure)))) ; no configure script
@ -621,11 +582,8 @@ (define-public fortify-headers
(arguments
`(#:tests? #f ; no tests
#:make-flags
(let ((target ,(%current-target-system)))
(list (string-append "CC=" (if target
(string-append target "-gcc")
"gcc"))
(string-append "PREFIX=" %output)))
(list (string-append "CC=" ,(cc-for-target))
(string-append "PREFIX=" %output))
#:phases
(modify-phases %standard-phases
(delete 'configure)))) ; no configure script
@ -666,11 +624,8 @@ (define-public colors
(arguments
`(#:tests? #f ; no tests
#:make-flags
(let ((target ,(%current-target-system)))
(list (string-append "CC=" (if target
(string-append target "-gcc")
"gcc"))
(string-append "PREFIX=" %output)))
(list (string-append "CC=" ,(cc-for-target))
(string-append "PREFIX=" %output))
#:phases
(modify-phases %standard-phases
(delete 'configure)))) ; no configure script
@ -707,11 +662,8 @@ (define-public libutf
(arguments
`(#:tests? #f ; no tests
#:make-flags
(let ((target ,(%current-target-system)))
(list (string-append "CC=" (if target
(string-append target "-gcc")
"gcc"))
(string-append "PREFIX=" %output)))
(list (string-append "CC=" ,(cc-for-target))
(string-append "PREFIX=" %output))
#:phases
(modify-phases %standard-phases
(delete 'configure)))) ; no configure script
@ -756,11 +708,8 @@ (define-public lchat
(arguments
`(#:test-target "test"
#:make-flags
(let ((target ,(%current-target-system)))
(list (string-append "CC=" (if target
(string-append target "-gcc")
"gcc"))
(string-append "PREFIX=" %output)))
(list (string-append "CC=" ,(cc-for-target))
(string-append "PREFIX=" %output))
#:phases
(modify-phases %standard-phases
(delete 'configure) ; no configure script
@ -805,11 +754,8 @@ (define-public scron
(arguments
`(#:tests? #f ; no tests
#:make-flags
(let ((target ,(%current-target-system)))
(list (string-append "CC=" (if target
(string-append target "-gcc")
"gcc"))
(string-append "PREFIX=" %output)))
(list (string-append "CC=" ,(cc-for-target))
(string-append "PREFIX=" %output))
#:phases
(modify-phases %standard-phases
(delete 'configure)))) ; no configure script