summaryrefslogtreecommitdiff
path: root/guix
diff options
context:
space:
mode:
authorLiliana Marie Prikler <liliana.prikler@gmail.com>2023-09-15 18:20:38 +0200
committerLiliana Marie Prikler <liliana.prikler@gmail.com>2023-09-15 18:47:00 +0200
commite9ff5d51e3297089e66c124195e1f1b42dbded65 (patch)
treece3993c90b76a2275b57bf3231628966897ee122 /guix
parent43cdc8a07517e936812782c313fe145bcf5c7ed3 (diff)
parentb696fb41bc0dfcb7130a5aa6d69aff2ae191c283 (diff)
downloadguix-patches-e9ff5d51e3297089e66c124195e1f1b42dbded65.tar
guix-patches-e9ff5d51e3297089e66c124195e1f1b42dbded65.tar.gz
Merge branch 'master' into gnome-team.
Diffstat (limited to 'guix')
-rw-r--r--guix/gnu-maintenance.scm29
-rw-r--r--guix/lint.scm56
-rw-r--r--guix/scripts/shell.scm4
-rw-r--r--guix/search-paths.scm11
-rw-r--r--guix/upstream.scm5
5 files changed, 88 insertions, 17 deletions
diff --git a/guix/gnu-maintenance.scm b/guix/gnu-maintenance.scm
index 5a84fcb117..881e941fbf 100644
--- a/guix/gnu-maintenance.scm
+++ b/guix/gnu-maintenance.scm
@@ -975,17 +975,24 @@ updater."
((url-predicate http-url?) package)))
(define* (import-html-updatable-release package #:key (version #f))
- "Return the latest release of PACKAGE. Do that by crawling the HTML page of
-the directory containing its source tarball. Optionally include a VERSION
-string to fetch a specific version."
- (let* ((uri (string->uri
- (match (origin-uri (package-source package))
- ((and (? string?)
- (? (cut string-prefix? "mirror://" <>) url))
- ;; Retrieve the authoritative HTTP URL from a mirror.
- (http-url? url))
- ((? string? url) url)
- ((url _ ...) url))))
+ "Return the latest release of PACKAGE else #f. Do that by crawling the HTML
+page of the directory containing its source tarball. Optionally include a
+VERSION string to fetch a specific version."
+
+ (define (expand-uri uri)
+ (match uri
+ ((and (? string?) (? (cut string-prefix? "mirror://" <>) url))
+ ;; Retrieve the authoritative HTTP URL from a mirror.
+ (http-url? url))
+ ((? string? url)
+ url)
+ ((url _ ...)
+ ;; This case is for when the URI is a list of possibly
+ ;; mirror URLs as well as HTTP URLs.
+ (expand-uri url))))
+
+ (let* ((uri (string->uri
+ (expand-uri (origin-uri (package-source package)))))
(custom (assoc-ref (package-properties package)
'release-monitoring-url))
(base (or custom
diff --git a/guix/lint.scm b/guix/lint.scm
index d173563e51..7ccf52dec1 100644
--- a/guix/lint.scm
+++ b/guix/lint.scm
@@ -12,7 +12,7 @@
;;; Copyright © 2020 Chris Marusich <cmmarusich@gmail.com>
;;; Copyright © 2020 Timothy Sample <samplet@ngyro.com>
;;; Copyright © 2021 Xinglu Chen <public@yoctocell.xyz>
-;;; Copyright © 2021, 2022 Maxime Devos <maximedevos@telenet.be>
+;;; Copyright © 2021-2023 Maxime Devos <maximedevos@telenet.be>
;;; Copyright © 2021 Brice Waegeneire <brice@waegenei.re>
;;;
;;; This file is part of GNU Guix.
@@ -114,6 +114,7 @@
check-profile-collisions
check-haskell-stackage
check-tests-true
+ check-compiler-for-target
lint-warning
lint-warning?
@@ -311,6 +312,55 @@ superfluous when building natively and incorrect when cross-compiling."
#:field 'arguments))
'()))
+(define (check-compiler-for-target package)
+ "Check that cross-compilers are used when cross-compiling, by inspecting
+#:make-flags."
+ (define (make-compiler-warning variable=value)
+ (define =-index (string-index variable=value #\=))
+ (define variable (substring variable=value 0 =-index))
+ (define value (substring variable=value (+ =-index 1)))
+ (make-warning package
+ (G_ "'~0@*~a' should be set to '~1@*~a' instead of '~2@*~a'")
+ (list variable
+ (match variable
+ ("AR" "(ar-for-target)")
+ ("AS" "(as-for-target)")
+ ("CC" "(cc-for-target)")
+ ("CXX" "(cxx-for-target)")
+ ("LD" "(ld-for-target)")
+ ("PKG_CONFIG" "(pkg-config-for-target)"))
+ value)
+ #:field 'arguments))
+ (define (find-incorrect-compilers l)
+ (match l
+ ((or "AR=ar"
+ "AS=as"
+ ;; 'cc' doesn't actually exist in Guix, but if it did,
+ ;; it would be incorrect to use it w.r.t. cross-compilation.
+ "CC=cc" "CC=gcc" "CC=clang"
+ "CXX=g++"
+ "LD=ld"
+ "PKG_CONFIG=pkg-config")
+ (list (make-compiler-warning l)))
+ ((x . y)
+ (append (find-incorrect-compilers x)
+ (find-incorrect-compilers y)))
+ (_ '())))
+ (parameterize ((%current-target-system "aarch64-linux-gnu"))
+ (apply (lambda* (#:key (target 'not-set)
+ make-flags #:allow-other-keys)
+ (define make-flags/sexp
+ (if (gexp? make-flags/sexp)
+ (gexp->approximate-sexp make-flags)
+ make-flags))
+ ;; Some packages like 'tzdata' are never cross-compiled;
+ ;; the compilers are only used to build tools for
+ ;; compiling the rest of the package.
+ (if (eq? target '#false)
+ '()
+ (find-incorrect-compilers make-flags/sexp)))
+ (package-arguments package))))
+
(define (properly-starts-sentence? s)
(string-match "^[(\"'`[:upper:][:digit:]]" s))
@@ -1865,6 +1915,10 @@ them for PACKAGE."
(description "Check if tests are explicitly enabled")
(check check-tests-true))
(lint-checker
+ (name 'compiler-for-target)
+ (description "Check that cross-compilers are used when cross-compiling")
+ (check check-compiler-for-target))
+ (lint-checker
(name 'description)
(description "Validate package descriptions")
(check check-description-style))
diff --git a/guix/scripts/shell.scm b/guix/scripts/shell.scm
index d67152cef7..83888eee1d 100644
--- a/guix/scripts/shell.scm
+++ b/guix/scripts/shell.scm
@@ -1,5 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2021-2023 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2023 Janneke Nieuwenhuizen <janneke@gnu.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -232,7 +233,8 @@ a hash-prefixed comment, or a blank line."
(port-line port)
(port-column port))))
(warning loc (G_ "ignoring invalid file name: '~a'~%")
- line))))))))))
+ line)
+ (loop))))))))))
(const #f)))
(define (options-with-caching opts)
diff --git a/guix/search-paths.scm b/guix/search-paths.scm
index fcbe7b7953..8dc81861c9 100644
--- a/guix/search-paths.scm
+++ b/guix/search-paths.scm
@@ -37,6 +37,7 @@
$PKG_CONFIG_PATH
$SSL_CERT_DIR
$SSL_CERT_FILE
+ $TZDIR
search-path-specification->sexp
sexp->search-path-specification
@@ -104,16 +105,22 @@
(define $SSL_CERT_DIR
(search-path-specification
(variable "SSL_CERT_DIR")
- (separator #f) ;single entry
+ (separator #f) ;single entry
(files '("etc/ssl/certs"))))
(define $SSL_CERT_FILE
(search-path-specification
(variable "SSL_CERT_FILE")
(file-type 'regular)
- (separator #f) ;single entry
+ (separator #f) ;single entry
(files '("etc/ssl/certs/ca-certificates.crt"))))
+(define $TZDIR
+ (search-path-specification
+ (variable "TZDIR")
+ (files '("share/zoneinfo"))
+ (separator #f))) ;single entry
+
(define (search-path-specification->sexp spec)
"Return an sexp representing SPEC, a <search-path-specification>. The sexp
corresponds to the arguments expected by `set-path-environment-variable'."
diff --git a/guix/upstream.scm b/guix/upstream.scm
index 33248d645c..e28ae12f3f 100644
--- a/guix/upstream.scm
+++ b/guix/upstream.scm
@@ -1,7 +1,7 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2010-2023 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2015 Alex Kost <alezost@gmail.com>
-;;; Copyright © 2019, 2022 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2019, 2022, 2023 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2021 Sarah Morgensen <iskarian@mgsn.dev>
;;; Copyright © 2021, 2022 Maxime Devos <maximedevos@telenet.be>
;;; Copyright © 2022 Hartmut Goebel <h.goebel@crazy-compilers.com>
@@ -534,7 +534,8 @@ specified in SOURCE, an <upstream-source>."
(define old
(match (package-inputs package)
(((labels (? package? packages)) ...)
- labels)
+ labels
+ (map string->symbol labels))
(_
'())))