Hi,
On Thu, 18 Jul 2024 at 15:36, Laurent Gatto <[email protected]> wrote:
>> $ tzselect
>> /gnu/store/bpid2k5sjrry3nj7jnhzlm7g01j2mbph-profile/bin/tzselect:
This ’tzselect’ comes from the package glibc, right?
On foreign distro, I get:
--8<---------------cut here---------------start------------->8---
$ guix shell -C glibc -- tzselect
/gnu/store/6nfnykk15j2cl3z89mq7jwf4zim8h663-profile/bin/tzselect: Sorry, your
'awk' program is not Posix compatible.
--8<---------------cut here---------------end--------------->8---
Hum, I do not know if it is expected.
> export
> TZDIR=/gnu/store/19z4zyx0nykgcmj75izhsbi6z0ascq4i-tzdata-2022a/share/zoneinfo
>
> Does anyone know why the TZDIR variable was set properly on a guix
> system, but not on a foreign distro?
Maybe because operating-system-environment-variables from (gnu system)
reads:
--8<---------------cut here---------------start------------->8---
(define (operating-system-environment-variables os)
"Return the environment variables of OS for
@var{session-environment-service-type}, to be used in @file{/etc/environment}."
`(("LANG" . ,(operating-system-locale os))
;; Note: No need to set 'TZ' since (1) we provide /etc/localtime, and (2)
;; it doesn't work for setuid binaries. See <https://bugs.gnu.org/29212>.
("TZDIR" . ,(file-append tzdata "/share/zoneinfo"))
[...]
--8<---------------cut here---------------end--------------->8---
> Is this expected?
Maybe ’search-paths’ could be set to $TZDIR? Hum, maybe there is a
reason to not do so? Something like:
--8<---------------cut here---------------start------------->8---
diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm
index 66c5b7d237..3f891ac21a 100644
--- a/gnu/packages/base.scm
+++ b/gnu/packages/base.scm
@@ -71,6 +71,7 @@ (define-module (gnu packages base)
#:use-module (guix git-download)
#:use-module (guix build-system gnu)
#:use-module (guix build-system trivial)
+ #:use-module (guix search-paths)
#:use-module (ice-9 format)
#:use-module (ice-9 match)
#:use-module (ice-9 optargs)
@@ -1680,6 +1681,7 @@ (define-public tzdata
(sha256
(base32
"1iysv8fdkm79k8wh8jizmjmq075q4qjhk090vxjy57my6dz5wmzq")))))
+ (native-search-paths (list $TZDIR))
(home-page "https://www.iana.org/time-zones")
(synopsis "Database of current and historical time zones")
(description "The Time Zone Database (often called tz or zoneinfo)
@@ -1697,7 +1699,11 @@ (define-public tzdata
;;;
;;; Please make this a hidden-package if it is different from the primary
tzdata
;;; package.
-(define-public tzdata-for-tests tzdata)
+(define-public tzdata-for-tests
+ (hidden-package
+ (package
+ (inherit tzdata)
+ (native-search-paths '()))))
(define-public libiconv
(package
--8<---------------cut here---------------end--------------->8---
Even, I am missing why ’tzdata-for-tests’ is not already an
hidden-package.
Cheers,
simon