all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#32933] [PATCH] guix: add license prefix hackage imports
@ 2018-10-04 16:17 Joe Hillenbrand
  2018-10-12 13:17 ` Ludovic Courtès
  2021-12-21 17:18 ` bug#32933: " Xinglu Chen
  0 siblings, 2 replies; 9+ messages in thread
From: Joe Hillenbrand @ 2018-10-04 16:17 UTC (permalink / raw)
  To: 32933

---
 guix/import/hackage.scm | 30 ++++++++++++++++--------------
 1 file changed, 16 insertions(+), 14 deletions(-)

diff --git a/guix/import/hackage.scm b/guix/import/hackage.scm
index 766a0b53f..8f4a46534 100644
--- a/guix/import/hackage.scm
+++ b/guix/import/hackage.scm
@@ -35,6 +35,7 @@
   #:use-module (guix store)
   #:use-module (gcrypt hash)
   #:use-module (guix base32)
+  #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix memoization)
   #:use-module (guix upstream)
   #:use-module (guix packages)
@@ -135,20 +136,21 @@ version."
   ;; https://www.haskell.org
   ;; /cabal/release/cabal-latest/doc/API/Cabal/Distribution-License.html.
   (match-lambda
-   ("GPL-2" 'gpl2)
-   ("GPL-3" 'gpl3)
-   ("GPL" "'gpl??")
-   ("AGPL-3" 'agpl3)
-   ("AGPL" "'agpl??")
-   ("LGPL-2.1" 'lgpl2.1)
-   ("LGPL-3" 'lgpl3)
-   ("LGPL" "'lgpl??")
-   ("BSD2" 'bsd-2)
-   ("BSD3" 'bsd-3)
-   ("MIT" 'expat)
-   ("ISC" 'isc)
-   ("MPL" 'mpl2.0)
-   ("Apache-2.0" 'asl2.0)
+   ("GPL-2" 'license:gpl2)
+   ("GPL-3" 'license:gpl3)
+   ("GPL" 'license:gpl??)
+   ("AGPL-3" 'license:agpl3)
+   ("AGPL" 'license:agpl)
+   ("LGPL-2.0" 'license:lgpl2.0)
+   ("LGPL-2.1" 'license:lgpl2.1)
+   ("LGPL-3" 'license:lgpl3)
+   ("LGPL" 'license:lgpl??)
+   ("BSD2" 'license:bsd-2)
+   ("BSD3" 'license:bsd-3)
+   ("MIT" 'license:expat)
+   ("ISC" 'license:isc)
+   ("MPL" 'license:mpl2.0)
+   ("Apache-2.0" 'license:asl2.0)
    ((x) (string->license x))
    ((lst ...) `(list ,@(map string->license lst)))
    (_ #f)))
--
2.19.0

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

* [bug#32933] [PATCH] guix: add license prefix hackage imports
  2018-10-04 16:17 [bug#32933] [PATCH] guix: add license prefix hackage imports Joe Hillenbrand
@ 2018-10-12 13:17 ` Ludovic Courtès
  2018-10-12 17:55   ` Joe Hillenbrand
  2021-12-21 17:18 ` bug#32933: " Xinglu Chen
  1 sibling, 1 reply; 9+ messages in thread
From: Ludovic Courtès @ 2018-10-12 13:17 UTC (permalink / raw)
  To: Joe Hillenbrand; +Cc: Ricardo Wurmus, 32933

Hi Joe,

Joe Hillenbrand <joehillen@gmail.com> skribis:

> ---
>  guix/import/hackage.scm | 30 ++++++++++++++++--------------
>  1 file changed, 16 insertions(+), 14 deletions(-)
>
> diff --git a/guix/import/hackage.scm b/guix/import/hackage.scm
> index 766a0b53f..8f4a46534 100644

[...]

> +   ("GPL-2" 'license:gpl2)

No strong opinion, but apparently none of the importers currently adds
the ‘license:’ prefix and I’d rather keep that consistent, one way or
another.

Ricardo, WDYT?

Thanks for the patch!

Ludo’.

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

* [bug#32933] [PATCH] guix: add license prefix hackage imports
  2018-10-12 13:17 ` Ludovic Courtès
@ 2018-10-12 17:55   ` Joe Hillenbrand
  2018-10-12 20:31     ` Ricardo Wurmus
  0 siblings, 1 reply; 9+ messages in thread
From: Joe Hillenbrand @ 2018-10-12 17:55 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: rekado, 32933

Sorry, I meant to add justification in the commit message, but apparently I
forgot.

The motivation was to be consistent with the `gnu/packages/haskell.scm` which
uses the `license:` prefix. I noticed this when I imported a bunch of packages
and all of them were missing the prefix, which then had to be manually added.

On Fri, Oct 12, 2018 at 6:17 AM Ludovic Courtès <ludo@gnu.org> wrote:
>
> No strong opinion, but apparently none of the importers currently adds
> the ‘license:’ prefix and I’d rather keep that consistent, one way or
> another.

That's not entirely true. crate calls `spdx-string->license` which adds the
prefix, but it doesn't appear to actually work because it looks for the license
in the wrong part of the json output from crates.io.

I'd be happy to add it to the other importers as it looks like almost all of
`gnu/packages/*.scm` has the `license:` prefix. If so, should I do them all
in a new patch?

Thanks,
Joe

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

* [bug#32933] [PATCH] guix: add license prefix hackage imports
  2018-10-12 17:55   ` Joe Hillenbrand
@ 2018-10-12 20:31     ` Ricardo Wurmus
  2018-10-15  8:07       ` Ludovic Courtès
  0 siblings, 1 reply; 9+ messages in thread
From: Ricardo Wurmus @ 2018-10-12 20:31 UTC (permalink / raw)
  To: Joe Hillenbrand; +Cc: 32933


Hi Joe,

> The motivation was to be consistent with the `gnu/packages/haskell.scm` which
> uses the `license:` prefix. I noticed this when I imported a bunch of packages
> and all of them were missing the prefix, which then had to be manually added.
>
> On Fri, Oct 12, 2018 at 6:17 AM Ludovic Courtès <ludo@gnu.org> wrote:
>>
>> No strong opinion, but apparently none of the importers currently adds
>> the ‘license:’ prefix and I’d rather keep that consistent, one way or
>> another.
>
> That's not entirely true. crate calls `spdx-string->license` which adds the
> prefix, but it doesn't appear to actually work because it looks for the license
> in the wrong part of the json output from crates.io.

I have a slight preference to not adding the prefix.  It is true that
most modules do use this prefix, but I think the importers should be
agnostic of that.  Some modules don’t use this prefix (e.g. web.scm) or
no prefix at all (especially user modules that don’t exist yet).

I’d rather have the importers be more flexible and do the right thing
dependent on context, but I have no good idea how to accomplish this
considering that they are used outside of any context (unless they were
called as part of an updater).

--
Ricardo

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

* [bug#32933] [PATCH] guix: add license prefix hackage imports
  2018-10-12 20:31     ` Ricardo Wurmus
@ 2018-10-15  8:07       ` Ludovic Courtès
  2018-10-15  9:47         ` Ricardo Wurmus
  0 siblings, 1 reply; 9+ messages in thread
From: Ludovic Courtès @ 2018-10-15  8:07 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: 32933

Hello,

Ricardo Wurmus <rekado@elephly.net> skribis:

>> The motivation was to be consistent with the `gnu/packages/haskell.scm` which
>> uses the `license:` prefix. I noticed this when I imported a bunch of packages
>> and all of them were missing the prefix, which then had to be manually added.
>>
>> On Fri, Oct 12, 2018 at 6:17 AM Ludovic Courtès <ludo@gnu.org> wrote:
>>>
>>> No strong opinion, but apparently none of the importers currently adds
>>> the ‘license:’ prefix and I’d rather keep that consistent, one way or
>>> another.
>>
>> That's not entirely true. crate calls `spdx-string->license` which adds the
>> prefix, but it doesn't appear to actually work because it looks for the license
>> in the wrong part of the json output from crates.io.
>
> I have a slight preference to not adding the prefix.  It is true that
> most modules do use this prefix, but I think the importers should be
> agnostic of that.  Some modules don’t use this prefix (e.g. web.scm) or
> no prefix at all (especially user modules that don’t exist yet).
>
> I’d rather have the importers be more flexible and do the right thing
> dependent on context, but I have no good idea how to accomplish this
> considering that they are used outside of any context (unless they were
> called as part of an updater).

Right, I sort of feel along the same lines.

OTOH, the goal of ‘guix import’ is to provide templates as close as
possible to working package definitions.  In that sense, if adding the
‘license:’ prefix lowers the barrier a little bit (and it certainly
does, as Joe wrote), the better.

For the sake of consistency though, it may be best to do it for all the
importers, if we were to take that route.

WDYT, Ricardo?

Thanks,
Ludo’.

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

* [bug#32933] [PATCH] guix: add license prefix hackage imports
  2018-10-15  8:07       ` Ludovic Courtès
@ 2018-10-15  9:47         ` Ricardo Wurmus
  2018-10-15 13:42           ` Joe Hillenbrand
  0 siblings, 1 reply; 9+ messages in thread
From: Ricardo Wurmus @ 2018-10-15  9:47 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 32933


Ludovic Courtès <ludo@gnu.org> writes:

> OTOH, the goal of ‘guix import’ is to provide templates as close as
> possible to working package definitions.  In that sense, if adding the
> ‘license:’ prefix lowers the barrier a little bit (and it certainly
> does, as Joe wrote), the better.
>
> For the sake of consistency though, it may be best to do it for all the
> importers, if we were to take that route.

Adding the same prefix to all importers sounds good to me.

--
Ricardo

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

* [bug#32933] [PATCH] guix: add license prefix hackage imports
  2018-10-15  9:47         ` Ricardo Wurmus
@ 2018-10-15 13:42           ` Joe Hillenbrand
  2018-10-15 13:47             ` Ricardo Wurmus
  0 siblings, 1 reply; 9+ messages in thread
From: Joe Hillenbrand @ 2018-10-15 13:42 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: 32933

[-- Attachment #1: Type: text/plain, Size: 396 bytes --]

On Mon, Oct 15, 2018, 02:49 Ricardo Wurmus <rekado@elephly.net> wrote:

>
> Ludovic Courtès <ludo@gnu.org> writes:
> >
> > For the sake of consistency though, it may be best to do it for all the
> > importers, if we were to take that route.
>
> Adding the same prefix to all importers sounds good to me.
>

Should I create a patch for each importer or do them all in one patch?

>

[-- Attachment #2: Type: text/html, Size: 946 bytes --]

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

* [bug#32933] [PATCH] guix: add license prefix hackage imports
  2018-10-15 13:42           ` Joe Hillenbrand
@ 2018-10-15 13:47             ` Ricardo Wurmus
  0 siblings, 0 replies; 9+ messages in thread
From: Ricardo Wurmus @ 2018-10-15 13:47 UTC (permalink / raw)
  To: Joe Hillenbrand; +Cc: 32933


Joe Hillenbrand <joehillen@gmail.com> writes:

> On Mon, Oct 15, 2018, 02:49 Ricardo Wurmus <rekado@elephly.net> wrote:
>
>>
>> Ludovic Courtès <ludo@gnu.org> writes:
>> >
>> > For the sake of consistency though, it may be best to do it for all the
>> > importers, if we were to take that route.
>>
>> Adding the same prefix to all importers sounds good to me.
>>
>
> Should I create a patch for each importer or do them all in one patch?

Either way is fine.  If you create one patch for all importers please
make sure to list all the changes to the different files explicitly in
the commit summary.

Thank you!

--
Ricardo

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

* bug#32933: [PATCH] guix: add license prefix hackage imports
  2018-10-04 16:17 [bug#32933] [PATCH] guix: add license prefix hackage imports Joe Hillenbrand
  2018-10-12 13:17 ` Ludovic Courtès
@ 2021-12-21 17:18 ` Xinglu Chen
  1 sibling, 0 replies; 9+ messages in thread
From: Xinglu Chen @ 2021-12-21 17:18 UTC (permalink / raw)
  To: Joe Hillenbrand, 32933-done

[-- Attachment #1: Type: text/plain, Size: 76 bytes --]

This was done in commit cfec09a9928e171a724f630ba652ea0241d52e92.

Closing!

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 861 bytes --]

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

end of thread, other threads:[~2021-12-21 17:28 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-10-04 16:17 [bug#32933] [PATCH] guix: add license prefix hackage imports Joe Hillenbrand
2018-10-12 13:17 ` Ludovic Courtès
2018-10-12 17:55   ` Joe Hillenbrand
2018-10-12 20:31     ` Ricardo Wurmus
2018-10-15  8:07       ` Ludovic Courtès
2018-10-15  9:47         ` Ricardo Wurmus
2018-10-15 13:42           ` Joe Hillenbrand
2018-10-15 13:47             ` Ricardo Wurmus
2021-12-21 17:18 ` bug#32933: " Xinglu Chen

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.