From fe224d20cccd6500cdc823899070d2c46fe59ad3 Mon Sep 17 00:00:00 2001 From: Alex Griffin Date: Fri, 22 Jul 2016 12:55:47 -0500 Subject: download: Add SourceForge load balancer. * guix/download.scm (%mirrors)[sourceforge]: Add canonical load balancer for sourceforge.net. Signed-off-by: Leo Famulari --- guix/download.scm | 2 ++ 1 file changed, 2 insertions(+) (limited to 'guix') diff --git a/guix/download.scm b/guix/download.scm index 8f38a4f552..73c0e897b4 100644 --- a/guix/download.scm +++ b/guix/download.scm @@ -2,6 +2,7 @@ ;;; Copyright © 2012, 2013, 2014, 2015, 2016 Ludovic Courtès ;;; Copyright © 2013, 2014, 2015 Andreas Enge ;;; Copyright © 2015 Federico Beffa +;;; Copyright © 2016 Alex Griffin ;;; ;;; This file is part of GNU Guix. ;;; @@ -99,6 +100,7 @@ (define %mirrors "http://www.centervenus.com/mirrors/nongnu/" "http://download.savannah.gnu.org/releases-noredirect/") (sourceforge ; https://sourceforge.net/p/forge/documentation/Mirrors/ + "http://downloads.sourceforge.net/project/" "http://ufpr.dl.sourceforge.net/project/" "http://heanet.dl.sourceforge.net/project/" "http://freefr.dl.sourceforge.net/project/" -- cgit v1.2.3 From 99fe215cc1c511a82e326727c6a0d193d246a387 Mon Sep 17 00:00:00 2001 From: David Craven Date: Fri, 22 Jul 2016 19:50:54 +0200 Subject: lint: 'inputs-should-be-native' checks for intltool, itstool and glib:bin. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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 --- guix/scripts/lint.scm | 25 ++++++++++++++++++------- tests/lint.scm | 12 +++++++++++- 2 files changed, 29 insertions(+), 8 deletions(-) (limited to 'guix') 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 @@ (define (check-end-of-sentence-space description) (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 diff --git a/tests/lint.scm b/tests/lint.scm index ce751c42c9..770f43e57f 100644 --- a/tests/lint.scm +++ b/tests/lint.scm @@ -31,6 +31,7 @@ (define-module (test-lint) #:use-module (guix scripts lint) #:use-module (guix ui) #:use-module (gnu packages) + #:use-module (gnu packages glib) #:use-module (gnu packages pkg-config) #:use-module (web server) #:use-module (web server http) @@ -319,7 +320,16 @@ (define-syntax-rule (with-warnings body ...) (let ((pkg (dummy-package "x" (inputs `(("pkg-config" ,pkg-config)))))) (check-inputs-should-be-native pkg))) - "pkg-config should probably be a native input"))) + "'pkg-config' should probably be a native input"))) + +(test-assert "inputs: glib:bin is probably a native input" + (->bool + (string-contains + (with-warnings + (let ((pkg (dummy-package "x" + (inputs `(("glib" ,glib "bin")))))) + (check-inputs-should-be-native pkg))) + "'glib:bin' should probably be a native input"))) (test-assert "patches: file names" (->bool -- cgit v1.2.3 From 9eb5a449eed7297fdc2e6f3e77c2f625b07fddd1 Mon Sep 17 00:00:00 2001 From: Alex Kost Date: Thu, 30 Jun 2016 22:01:06 +0300 Subject: profiles: Add fonts-dir-file hook. * guix/profiles.scm (fonts-dir-file): New procedure. (%default-profile-hooks): Add it. --- guix/profiles.scm | 43 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) (limited to 'guix') diff --git a/guix/profiles.scm b/guix/profiles.scm index 77df6ad185..1adb143c16 100644 --- a/guix/profiles.scm +++ b/guix/profiles.scm @@ -1,7 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2013, 2014, 2015, 2016 Ludovic Courtès ;;; Copyright © 2013 Nikita Karetnikov -;;; Copyright © 2014 Alex Kost +;;; Copyright © 2014, 2016 Alex Kost ;;; Copyright © 2015 Mark H Weaver ;;; Copyright © 2015 Sou Bunnbu ;;; @@ -756,10 +756,51 @@ (define build #:substitutable? #f) (return #f)))) +(define (fonts-dir-file manifest) + "Return a derivation that builds the @file{fonts.dir} and @file{fonts.scale} +files for the truetype fonts of the @var{manifest} entries." + (define mkfontscale + (module-ref (resolve-interface '(gnu packages xorg)) 'mkfontscale)) + + (define mkfontdir + (module-ref (resolve-interface '(gnu packages xorg)) 'mkfontdir)) + + (define build + #~(begin + (use-modules (srfi srfi-26) + (guix build utils) + (guix build union)) + (let ((ttf-dirs (filter file-exists? + (map (cut string-append <> + "/share/fonts/truetype") + '#$(manifest-inputs manifest))))) + (mkdir #$output) + (if (null? ttf-dirs) + (exit #t) + (let* ((fonts-dir (string-append #$output "/share/fonts")) + (ttf-dir (string-append fonts-dir "/truetype")) + (mkfontscale (string-append #+mkfontscale + "/bin/mkfontscale")) + (mkfontdir (string-append #+mkfontdir + "/bin/mkfontdir"))) + (mkdir-p fonts-dir) + (union-build ttf-dir ttf-dirs + #:log-port (%make-void-port "w")) + (with-directory-excursion ttf-dir + (exit (and (zero? (system* mkfontscale)) + (zero? (system* mkfontdir)))))))))) + + (gexp->derivation "fonts-dir" build + #:modules '((guix build utils) + (guix build union)) + #:local-build? #t + #:substitutable? #f)) + (define %default-profile-hooks ;; This is the list of derivation-returning procedures that are called by ;; default when making a non-empty profile. (list info-dir-file + fonts-dir-file ghc-package-cache-file ca-certificate-bundle gtk-icon-themes -- cgit v1.2.3