From 4ddb64f57d0e9133f8083ee5c6398fa829ed0eab Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 11 Jul 2017 22:47:08 +0200 Subject: system: Refer to native packages when appropriate. * gnu/system/locale.scm (localedef-command): Use the native LIBC. * gnu/system/shadow.scm (default-skeletons): Use the native GUILE-WM. --- gnu/system/locale.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gnu/system/locale.scm') diff --git a/gnu/system/locale.scm b/gnu/system/locale.scm index 3bb9f950a8..51482879f7 100644 --- a/gnu/system/locale.scm +++ b/gnu/system/locale.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2014, 2015, 2016 Ludovic Courtès +;;; Copyright © 2014, 2015, 2016, 2017 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -97,7 +97,7 @@ or #f on failure." #~(begin (format #t "building locale '~a'...~%" #$(locale-definition-name locale)) - (zero? (system* (string-append #$libc "/bin/localedef") + (zero? (system* (string-append #+libc "/bin/localedef") "--no-archive" "--prefix" #$output "-i" #$(locale-definition-source locale) "-f" #$(locale-definition-charset locale) -- cgit 1.4.1 From 6d833b13b77f6b4fb76acab932fd9cec601b71ac Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 17 Jul 2017 23:28:59 +0200 Subject: gnu: Remove glibc@2.21 and its traces. * gnu/packages/base.scm (glibc-2.21): Remove. * gnu/system/locale.scm (localedef-command)[maybe-version-directory]: Remove. Replace call with use of 'package-version'. (single-locale-directory): Remove 'version>=' conditional. --- gnu/packages/base.scm | 14 +------------- gnu/system/locale.scm | 19 ++----------------- 2 files changed, 3 insertions(+), 30 deletions(-) (limited to 'gnu/system/locale.scm') diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm index 81f8b3c8d6..2040f84bf1 100644 --- a/gnu/packages/base.scm +++ b/gnu/packages/base.scm @@ -978,23 +978,11 @@ GLIBC/HURD for a Hurd host" `(modify-phases ,phases (add-before 'configure 'fix-pwd (lambda _ - ;; Use `pwd' instead of `/bin/pwd' for glibc-2.21 + ;; Use `pwd' instead of `/bin/pwd' for glibc-2.22. (substitute* "configure" (("/bin/pwd") "pwd")) #t)))))))) -(define-public glibc-2.21 - (package - (inherit glibc-2.22) - (version "2.21") - (source (origin - (inherit (package-source glibc-2.22)) - (uri (string-append "mirror://gnu/glibc/glibc-" - version ".tar.xz")) - (sha256 - (base32 - "1f135546j34s9bfkydmx2nhh9vwxlx60jldi80zmsnln6wj3dsxf")))))) - (define-public glibc-locales (package (inherit glibc) diff --git a/gnu/system/locale.scm b/gnu/system/locale.scm index 51482879f7..2ee834d9fd 100644 --- a/gnu/system/locale.scm +++ b/gnu/system/locale.scm @@ -22,7 +22,6 @@ #:use-module (guix monads) #:use-module (guix records) #:use-module (guix packages) - #:use-module (guix utils) #:use-module (gnu packages base) #:use-module (gnu packages compression) #:use-module (srfi srfi-26) @@ -85,15 +84,6 @@ or #f on failure." (define* (localedef-command locale #:key (libc (canonical-package glibc))) "Return a gexp that runs 'localedef' from LIBC to build LOCALE." - (define (maybe-version-directory) - ;; XXX: For libc prior to 2.22, GuixSD did not store locale data in a - ;; version-specific sub-directory. Check whether this is the case. - ;; TODO: Remove this hack once libc 2.21 is buried. - (let ((version (package-version libc))) - (if (version>=? version "2.22") - (list version "/") - '()))) - #~(begin (format #t "building locale '~a'...~%" #$(locale-definition-name locale)) @@ -102,7 +92,7 @@ or #f on failure." "-i" #$(locale-definition-source locale) "-f" #$(locale-definition-charset locale) (string-append #$output "/" - #$@(maybe-version-directory) + #$(package-version libc) "/" #$(locale-definition-name locale)))))) (define* (single-locale-directory locales @@ -119,12 +109,7 @@ of LIBC." #~(begin (mkdir #$output) - ;; XXX: For libcs < 2.22, locale data is stored in the top-level - ;; directory. - ;; TODO: Remove this hack once libc 2.21 is buried. - #$(if (version>=? version "2.22") - #~(mkdir (string-append #$output "/" #$version)) - #~(symlink "." (string-append #$output "/" #$version))) + (mkdir (string-append #$output "/" #$version)) ;; 'localedef' executes 'gzip' to access compressed locale sources. (setenv "PATH" (string-append #$gzip "/bin")) -- cgit 1.4.1 From b19a49d015070f9109c157bc39b47574a8dad481 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 17 Jul 2017 23:38:23 +0200 Subject: locale: Demonadify the locale creation API. * gnu/system/locale.scm (single-locale-directory): Use 'computed-file' instead of 'gexp->derivation'. (locale-directory): Adjust accordingly and do the same. * gnu/system.scm (operating-system-directory-base-entries): Adjust accordingly. --- gnu/system.scm | 23 ++++++++++++----------- gnu/system/locale.scm | 26 +++++++++++--------------- 2 files changed, 23 insertions(+), 26 deletions(-) (limited to 'gnu/system/locale.scm') diff --git a/gnu/system.scm b/gnu/system.scm index ee1e10f82d..bffbee7fdb 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -403,17 +403,18 @@ OS." (define* (operating-system-directory-base-entries os #:key container?) "Return the basic entries of the 'system' directory of OS for use as the value of the SYSTEM-SERVICE-TYPE service." - (mlet %store-monad ((locale (operating-system-locale-directory os))) - (if container? - (return `(("locale" ,locale))) - (mlet %store-monad - ((kernel -> (operating-system-kernel os)) - (initrd (operating-system-initrd-file os)) - (params (operating-system-boot-parameters-file os))) - (return `(("kernel" ,kernel) - ("parameters" ,params) - ("initrd" ,initrd) - ("locale" ,locale))))))) ;used by libc + (let ((locale (operating-system-locale-directory os))) + (with-monad %store-monad + (if container? + (return `(("locale" ,locale))) + (mlet %store-monad + ((kernel -> (operating-system-kernel os)) + (initrd (operating-system-initrd-file os)) + (params (operating-system-boot-parameters-file os))) + (return `(("kernel" ,kernel) + ("parameters" ,params) + ("initrd" ,initrd) + ("locale" ,locale)))))))) ;used by libc (define* (essential-services os #:key container?) "Return the list of essential services for OS. These are special services diff --git a/gnu/system/locale.scm b/gnu/system/locale.scm index 2ee834d9fd..75cb855b59 100644 --- a/gnu/system/locale.scm +++ b/gnu/system/locale.scm @@ -19,7 +19,6 @@ (define-module (gnu system locale) #:use-module (guix gexp) #:use-module (guix store) - #:use-module (guix monads) #:use-module (guix records) #:use-module (guix packages) #:use-module (gnu packages base) @@ -118,8 +117,7 @@ of LIBC." (and #$@(map (cut localedef-command <> #:libc libc) locales))))) - (gexp->derivation (string-append "locale-" version) build - #:local-build? #t)) + (computed-file (string-append "locale-" version) build)) (define* (locale-directory locales #:key (libcs %default-locale-libcs)) @@ -133,18 +131,16 @@ data format changes between libc versions." ((libc) (single-locale-directory locales #:libc libc)) ((libcs ..1) - (mlet %store-monad ((dirs (mapm %store-monad - (lambda (libc) - (single-locale-directory locales - #:libc libc)) - libcs))) - (gexp->derivation "locale-multiple-versions" - (with-imported-modules '((guix build union)) - #~(begin - (use-modules (guix build union)) - (union-build #$output (list #$@dirs)))) - #:local-build? #t - #:substitutable? #f))))) + (let ((dirs (map (lambda (libc) + (single-locale-directory locales #:libc libc)) + libcs))) + (computed-file "locale-multiple-versions" + (with-imported-modules '((guix build union)) + #~(begin + (use-modules (guix build union)) + (union-build #$output (list #$@dirs)))) + #:options '(#:local-build? #t + #:substitutable? #f)))))) (define %default-locale-libcs ;; The libcs for which we build locales by default. -- cgit 1.4.1