[PATCH] gnu: icu4c: Patch zoneinfo directory.

  • Open
  • quality assurance status badge
Details
2 participants
  • Ludovic Courtès
  • Christopher Baines
Owner
unassigned
Submitted by
Christopher Baines
Severity
normal
C
C
Christopher Baines wrote on 17 May 2018 14:58
(address . guix-patches@gnu.org)
20180517125834.7417-1-mail@cbaines.net
Replace the hardcoded /usr/share/zoneinfo file with a reference to the tzdata
package.

* gnu/packages/icu4c.scm (icu4c)[inputs]: Add tzdata.
[arguments]: Add a patch-zoneinfo-directory phase.
---
gnu/packages/icu4c.scm | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)

Toggle diff (39 lines)
diff --git a/gnu/packages/icu4c.scm b/gnu/packages/icu4c.scm
index 57e8fffb3..d34b61745 100644
--- a/gnu/packages/icu4c.scm
+++ b/gnu/packages/icu4c.scm
@@ -22,6 +22,7 @@
(define-module (gnu packages icu4c)
#:use-module (gnu packages)
+ #:use-module (gnu packages base)
#:use-module (gnu packages perl)
#:use-module (guix licenses)
#:use-module (guix packages)
@@ -45,7 +46,8 @@
(base32 "065l3n0q9wqaw8dz20x82srshhm6i987fr9ync5xf9mr6n7ylwzh"))))
(build-system gnu-build-system)
(inputs
- `(("perl" ,perl)))
+ `(("perl" ,perl)
+ ("tzdata" ,tzdata)))
(arguments
`(#:configure-flags
'("--enable-rpath"
@@ -58,7 +60,13 @@
#:phases
(modify-phases %standard-phases
(add-after 'unpack 'chdir-to-source
- (lambda _ (chdir "source") #t)))))
+ (lambda _ (chdir "source") #t))
+ (add-after 'chdir-to-source 'patch-zoneinfo-directory
+ (lambda* (#:key inputs #:allow-other-keys)
+ (substitute* "common/putil.cpp"
+ (("\\/usr\\/share\\/zoneinfo")
+ (string-append (assoc-ref inputs "tzdata")
+ "/share/zoneinfo"))))))))
(synopsis "International Components for Unicode")
(description
"ICU is a set of C/C++ and Java libraries providing Unicode and
--
2.16.3
L
L
Ludovic Courtès wrote on 19 May 2018 22:21
(name . Christopher Baines)(address . mail@cbaines.net)
878t8fpfah.fsf@gnu.org
Hello,

Christopher Baines <mail@cbaines.net> skribis:

Toggle quote (6 lines)
> Replace the hardcoded /usr/share/zoneinfo file with a reference to the tzdata
> package.
>
> * gnu/packages/icu4c.scm (icu4c)[inputs]: Add tzdata.
> [arguments]: Add a patch-zoneinfo-directory phase.

Good catch.

I wonder if icu4c should instead depend on ‘tzdata-for-tests’, which is
changed less frequently to avoid full rebuilds? Maybe Leo can comment.

I hope icu4c also honors the TZDIR environment variable, which would
allow users to have it refer to the latest version. Do you know if
that’s the case?

Last thing: this would probably be for ‘core-updates-next’.

Thanks,
Ludo’.
L
L
Ludovic Courtès wrote on 22 May 2018 14:06
(name . Leo Famulari)(address . leo@famulari.name)
878t8b6giq.fsf@gnu.org
Heya,

Leo Famulari <leo@famulari.name> skribis:

Toggle quote (6 lines)
> It indicates two general problems, IMO:
>
> 1) the lack of build farm capacity
> 2) it should be possible to update the time zone database without
> rebuilding packages (the packages should use TZDIR)

I think tzdata is an example where dynamic composition (i.e., TZDIR) is
what we should use. That way we can update tzdata as frequently as we
want.

For the case where TZDIR is unset, programs can still use
tzdata-for-tests, which could be slightly outdated, but I consider it a
“degraded” mode and I think it’s fine.

Toggle quote (2 lines)
> I wonder what is done in Nixpkgs...

It may be that the majority of their users don’t live in the regions
affected by recent timezone changes…

Ludo’.
C
C
Christopher Baines wrote on 11 Jun 2018 20:18
(name . Ludovic Courtès)(address . ludo@gnu.org)
871sdd426h.fsf@cbaines.net
Ludovic Courtès <ludo@gnu.org> writes:

Toggle quote (19 lines)
> Hello,
>
> Christopher Baines <mail@cbaines.net> skribis:
>
>> Replace the hardcoded /usr/share/zoneinfo file with a reference to the tzdata
>> package.
>>
>> * gnu/packages/icu4c.scm (icu4c)[inputs]: Add tzdata.
>> [arguments]: Add a patch-zoneinfo-directory phase.
>
> Good catch.
>
> I wonder if icu4c should instead depend on ‘tzdata-for-tests’, which is
> changed less frequently to avoid full rebuilds? Maybe Leo can comment.
>
> I hope icu4c also honors the TZDIR environment variable, which would
> allow users to have it refer to the latest version. Do you know if
> that’s the case?

All I remember about this was that I don't think it fixed the problem I
was trying to solve :) I had the patch in a stash for a while before
submitting it.

I don't even know what icu4c actually does, so I'm not very well placed
to look at this further, but I'm glad you and Leo seem to be getting
something from it :)
-----BEGIN PGP SIGNATURE-----

iQKTBAEBCgB9FiEEPonu50WOcg2XVOCyXiijOwuE9XcFAlsevPZfFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF
ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcACgkQXiijOwuE
9XeVTg//V0seCP5tkLh+DE+x66Va8A73fRnfLyUU/u8lER/rMs8TkRhy6u8imgC5
hKYYXc04/MASEum3GKoZfSRZIpaVgaLtMnmMjoSUzx9ZU0mTgPQ8aymrRK8RFzSi
CajPszOANZFZyOeOQeG9X3byUwIAJ70iShjs3MBaQMpRZ36ZYMkMGn8Mmg0vQYC0
Ocz81GSeTYIKt0F12QMuL6s6Nd3coENA1F/2UzNkTIrJ7uY2rwdoiugg5NtEAcf0
jrgyT8pDyCjd+vzN8NvqWXtWhXoAZ72ZKtKwe9YkCSGFJwdAtqNIJFcViHil7wlw
UfrkXH7AJBLHPMP5Hi39g4KM3wfiFjWVBP1f1Qbt0mnHvKOzFC9eHQ/Z8xNY8DXm
sAZhJY2yZGnD9USR10NI6q1RHkGEGzl4ljjDPDvhQdi0WyYADPv6CtwMa8UI/Xic
zpdAieegRN8BAtnrrLFVYqYfJnYqbp59DwY2xSmqthmTA+VOGQ/AZseytzePSDML
zJFUj3KjjjTUVpEVx8W8XoEFdpshJf6w7gE5rkczOf7Z+wxGGrBF1AionWBFlGKn
CeEY3foUjvwOSoN2haCFAooTIYniohUh1tSuWO3/GYvqFdMRqhST9Yo4FNBHMyMc
kgb7+2CRm0nt2j7BhPxrHsv7YKF4jTkN/p+nR6j4aEUxTFoPtNw=
=oMpM
-----END PGP SIGNATURE-----

?