all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [PATCH] gnu: Add glibc-locales variants for older versions of glibc.
@ 2019-01-17 13:17 Ricardo Wurmus
  2019-01-17 13:23 ` Ricardo Wurmus
  0 siblings, 1 reply; 5+ messages in thread
From: Ricardo Wurmus @ 2019-01-17 13:17 UTC (permalink / raw)
  To: guix-devel

* gnu/packages/base.scm (make-glibc-locales, make-glibc-utf8-locales): New
procedures.
(glibc-locales): Express in terms of make-glibc-locales.
(glibc-utf8-locales): Express in terms of make-glibc-utf8-locales.
(glibc-locales-2.27, glibc-utf8-locales-2.27): New variables.
---
 gnu/packages/base.scm | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm
index e79d2a987..cf86f0658 100644
--- a/gnu/packages/base.scm
+++ b/gnu/packages/base.scm
@@ -13,7 +13,7 @@
 ;;; Copyright © 2017, 2018 Marius Bakke <mbakke@fastmail.com>
 ;;; Copyright © 2017 Eric Bavier <bavier@member.fsf.org>
 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
-;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -975,7 +975,7 @@ with the Linux kernel.")
                   (("/bin/pwd") "pwd"))
                 #t))))))))
 
-(define-public glibc-locales
+(define-public (make-glibc-locales glibc)
   (package
     (inherit glibc)
     (name "glibc-locales")
@@ -1010,7 +1010,7 @@ the 'share/locale' sub-directory of this package.")
                                         ,(version-major+minor
                                           (package-version glibc)))))))))))
 
-(define-public glibc-utf8-locales
+(define-public (make-glibc-utf8-locales glibc)
   (package
     (name "glibc-utf8-locales")
     (version (package-version glibc))
@@ -1060,6 +1060,18 @@ test environments.")
     (home-page (package-home-page glibc))
     (license (package-license glibc))))
 
+(define-public glibc-locales
+  (make-glibc-locales glibc))
+(define-public glibc-utf8-locales
+  (make-glibc-utf8-locales glibc))
+
+(define-public glibc-locales-2.27
+  (package (inherit (make-glibc-locales glibc-2.27))
+           (name "glibc-locales-2.27")))
+(define-public glibc-utf8-locales-2.27
+  (package (inherit (make-glibc-utf8-locales glibc-2.27))
+           (name "glibc-utf8-locales-2.27")))
+
 (define-public which
   (package
     (name "which")
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] gnu: Add glibc-locales variants for older versions of glibc.
  2019-01-17 13:17 [PATCH] gnu: Add glibc-locales variants for older versions of glibc Ricardo Wurmus
@ 2019-01-17 13:23 ` Ricardo Wurmus
  2019-01-19 22:58   ` Ludovic Courtès
  0 siblings, 1 reply; 5+ messages in thread
From: Ricardo Wurmus @ 2019-01-17 13:23 UTC (permalink / raw)
  To: guix-devel


Ricardo Wurmus <rekado@elephly.net> writes:

> * gnu/packages/base.scm (make-glibc-locales, make-glibc-utf8-locales): New
> procedures.
> (glibc-locales): Express in terms of make-glibc-locales.
> (glibc-utf8-locales): Express in terms of make-glibc-utf8-locales.
> (glibc-locales-2.27, glibc-utf8-locales-2.27): New variables.

This is for the benefit of people who run Guix on top of a foreign
distro.  On a Guix system people can simply use the “locale-libcs” field
of their operating system declaration, but on a foreign distro there is
no way to install a locales package for older versions of glibc.

This patch generates variants for version 2.27 and overrides the name so
that both “glibc-locales” and “glibc-locales-2.27” can be installed into
the same profile.  (Without the name override that’s not possible.)

-- 
Ricardo

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] gnu: Add glibc-locales variants for older versions of glibc.
  2019-01-17 13:23 ` Ricardo Wurmus
@ 2019-01-19 22:58   ` Ludovic Courtès
  2019-01-20 19:54     ` Ricardo Wurmus
  0 siblings, 1 reply; 5+ messages in thread
From: Ludovic Courtès @ 2019-01-19 22:58 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: guix-devel

Hi,

Ricardo Wurmus <rekado@elephly.net> skribis:

> Ricardo Wurmus <rekado@elephly.net> writes:
>
>> * gnu/packages/base.scm (make-glibc-locales, make-glibc-utf8-locales): New
>> procedures.
>> (glibc-locales): Express in terms of make-glibc-locales.
>> (glibc-utf8-locales): Express in terms of make-glibc-utf8-locales.
>> (glibc-locales-2.27, glibc-utf8-locales-2.27): New variables.
>
> This is for the benefit of people who run Guix on top of a foreign
> distro.  On a Guix system people can simply use the “locale-libcs” field
> of their operating system declaration, but on a foreign distro there is
> no way to install a locales package for older versions of glibc.
>
> This patch generates variants for version 2.27 and overrides the name so
> that both “glibc-locales” and “glibc-locales-2.27” can be installed into
> the same profile.  (Without the name override that’s not possible.)

Adding the packages makes sense to me.

I don’t like the package name trick, but I don’t have a better solution.
Perhaps we could have a special property to explicitly allow for several
versions of this package in the same profile (say
‘allow-multiple-versions?’), but that’s a bit more work.

Thanks,
Ludo’.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] gnu: Add glibc-locales variants for older versions of glibc.
  2019-01-19 22:58   ` Ludovic Courtès
@ 2019-01-20 19:54     ` Ricardo Wurmus
  2019-01-22 13:16       ` Ludovic Courtès
  0 siblings, 1 reply; 5+ messages in thread
From: Ricardo Wurmus @ 2019-01-20 19:54 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel


Hi Ludo,

>> * gnu/packages/base.scm (make-glibc-locales, make-glibc-utf8-locales): New
>> procedures.
>> (glibc-locales): Express in terms of make-glibc-locales.
>> (glibc-utf8-locales): Express in terms of make-glibc-utf8-locales.
>> (glibc-locales-2.27, glibc-utf8-locales-2.27): New variables.

[…]

> I don’t like the package name trick, but I don’t have a better solution.
> Perhaps we could have a special property to explicitly allow for several
> versions of this package in the same profile (say
> ‘allow-multiple-versions?’), but that’s a bit more work.

I also don’t like to work around this by changing the package names.  I
thought of allowing multiple versions via property, but it’s not clear
how it should behave.  I’d want to have only major versions appear as
non-conflicting and still prevent the installation of variants of the
same version.

The next question then is if the property should be a procedure that
takes the current and the potentially conflicting package as arguments
and decides whether they are conflicting, or if this should be handled
centrally when the property is present.

--
Ricardo

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] gnu: Add glibc-locales variants for older versions of glibc.
  2019-01-20 19:54     ` Ricardo Wurmus
@ 2019-01-22 13:16       ` Ludovic Courtès
  0 siblings, 0 replies; 5+ messages in thread
From: Ludovic Courtès @ 2019-01-22 13:16 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: guix-devel

Hello,

Ricardo Wurmus <rekado@elephly.net> skribis:

>>> * gnu/packages/base.scm (make-glibc-locales, make-glibc-utf8-locales): New
>>> procedures.
>>> (glibc-locales): Express in terms of make-glibc-locales.
>>> (glibc-utf8-locales): Express in terms of make-glibc-utf8-locales.
>>> (glibc-locales-2.27, glibc-utf8-locales-2.27): New variables.
>
> […]
>
>> I don’t like the package name trick, but I don’t have a better solution.
>> Perhaps we could have a special property to explicitly allow for several
>> versions of this package in the same profile (say
>> ‘allow-multiple-versions?’), but that’s a bit more work.
>
> I also don’t like to work around this by changing the package names.  I
> thought of allowing multiple versions via property, but it’s not clear
> how it should behave.  I’d want to have only major versions appear as
> non-conflicting and still prevent the installation of variants of the
> same version.
>
> The next question then is if the property should be a procedure that
> takes the current and the potentially conflicting package as arguments
> and decides whether they are conflicting, or if this should be handled
> centrally when the property is present.

Would there be other use cases?  If not, I would not worry too much
about the major vs. non-major conflicts.

I have a slight preference for a property that we can ‘write’, which
would simplify for instance interaction with inferior packages, hence
something like a Boolean ‘allow-multiple-versions?’ property.

As a first approach, when this flag is true, the version check in
‘check-for-collisions’ could be bypassed.  The property would have to be
added to the <manifest-entry> though, so that the flag is honored even
after several “guix package” invocations.

How does that sound?

Thanks,
Ludo’.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-01-22 19:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-17 13:17 [PATCH] gnu: Add glibc-locales variants for older versions of glibc Ricardo Wurmus
2019-01-17 13:23 ` Ricardo Wurmus
2019-01-19 22:58   ` Ludovic Courtès
2019-01-20 19:54     ` Ricardo Wurmus
2019-01-22 13:16       ` Ludovic Courtès

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.