summaryrefslogtreecommitdiff
path: root/guix
diff options
context:
space:
mode:
authorDavid Craven <david@craven.ch>2016-07-22 19:50:54 +0200
committerLudovic Courtès <ludo@gnu.org>2016-07-24 19:54:15 +0200
commit99fe215cc1c511a82e326727c6a0d193d246a387 (patch)
tree63adf0c588578a736396de4b1a5d0b2a5dc0d4c9 /guix
parent0f53b886e27ac6ea340d19f3627c273c7f82016e (diff)
lint: 'inputs-should-be-native' checks for intltool, itstool and glib:bin.
* guix/scripts/lint.scm (check-inputs-should-be-native): Warn when intltool, itstool or glib:bin isn't a native-input. * tests/lint.scm (inputs: glib:bin is probably a native input): Add test. Co-authored-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'guix')
-rw-r--r--guix/scripts/lint.scm25
1 files changed, 18 insertions, 7 deletions
diff --git a/guix/scripts/lint.scm b/guix/scripts/lint.scm
index d5e9197cc9..8aab1febb2 100644
--- a/guix/scripts/lint.scm
+++ b/guix/scripts/lint.scm
@@ -203,14 +203,25 @@ by two spaces; possible infraction~p at ~{~a~^, ~}")
(define (check-inputs-should-be-native package)
;; Emit a warning if some inputs of PACKAGE are likely to belong to its
;; native inputs.
- (let ((inputs (package-inputs package)))
+ (let ((linted package)
+ (inputs (package-inputs package))
+ (native-inputs '("pkg-config" "glib:bin" "intltool" "itstool")))
(match inputs
- (((labels packages . _) ...)
- (when (member "pkg-config"
- (map package-name (filter package? packages)))
- (emit-warning package
- (_ "pkg-config should probably be a native input")
- 'inputs))))))
+ (((labels packages . outputs) ...)
+ (for-each (lambda (package output)
+ (when (package? package)
+ (let ((input (string-append
+ (package-name package)
+ (if (> (length output) 0)
+ (string-append ":" (car output))
+ ""))))
+ (when (member input native-inputs)
+ (emit-warning linted
+ (format #f (_ "'~a' should probably \
+be a native input")
+ input)
+ 'inputs)))))
+ packages outputs)))))
(define (package-name-regexp package)
"Return a regexp that matches PACKAGE's name as a word at the beginning of a