diff mbox series

[bug#57055,2/2] gnu: Add guile-srfi-146.

Message ID 20220808083601.16323-2-pukkamustard@posteo.net
State Accepted
Headers show
Series gnu: Add guile-srfi-146. | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git-branch success View Git branch
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue

Commit Message

pukkamustard Aug. 8, 2022, 8:36 a.m. UTC
* gnu/packages/guile-xyz.scm (guile-srfi-146): New variable.
---
 gnu/packages/guile-xyz.scm | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

Comments

M Aug. 8, 2022, 9:30 a.m. UTC | #1
On 08-08-2022 10:36, pukkamustard wrote:
> +    (inputs (list guile-3.0))

guile-3.0 is used as a compiler, so it needs to be in native-inputs.  
Does "guix build guile-srfi-146 --target=aarch64-linux-gnu" (or with 
another target) work?

> +    (license license:lgpl3+)))

There are also some (ISC?) bits on 
<https://inqlab.net/git/guile-srfi-146.git/tree/srfi/srfi-146.scm>.

Also, Guix does not yet install the 'LICENSES' subdirectory, see 
<https://issues.guix.gnu.org/54234#1>.

Greetings,
Maxime.
pukkamustard Aug. 8, 2022, 12:43 p.m. UTC | #2
Maxime Devos <maximedevos@telenet.be> writes:

> [[PGP Signed Part:Undecided]]
>
> On 08-08-2022 10:36, pukkamustard wrote:
>> +    (inputs (list guile-3.0))
>
> guile-3.0 is used as a compiler, so it needs to be in native-inputs. 
> Does "guix build guile-srfi-146 --target=aarch64-linux-gnu" (or with
> another target) work?

It does not!

Adding guile-3.0 to both native-inputs and inputs seems to solve this
(also for guile-srfi-158).

However, I then get following error:

```
no code for module (srfi srfi-128)
```

guile-srfi-128 is built using the guile-build-system. Maybe something
not working properly with guile-build-system and cross-compilation?

Do you have any ideas or suggestions on how to fix this?

>> +    (license license:lgpl3+)))
>
> There are also some (ISC?) bits on
> <https://inqlab.net/git/guile-srfi-146.git/tree/srfi/srfi-146.scm>.

Yes, the sample SRFI implementation is licensed under ISC. Afaiu,
there's no problem in relicensing this as LGPL-3.0-or-later. I think a
lot of the guile-srfi-* libraries do this.

> Also, Guix does not yet install the 'LICENSES' subdirectory, see
> <https://issues.guix.gnu.org/54234#1>.

Noted.

Cheers,
pukkamustard
\( Aug. 8, 2022, 1:12 p.m. UTC | #3
On Mon Aug 8, 2022 at 1:43 PM BST, pukkamustard wrote:
> Adding guile-3.0 to both native-inputs and inputs seems to solve this
> (also for guile-srfi-158).
You should only need to add it in native-inputs.

    -- (
pukkamustard Aug. 8, 2022, 1:47 p.m. UTC | #4
"(" <paren@disroot.org> writes:

> On Mon Aug 8, 2022 at 1:43 PM BST, pukkamustard wrote:
>> Adding guile-3.0 to both native-inputs and inputs seems to solve this
>> (also for guile-srfi-158).
> You should only need to add it in native-inputs.

If I only add guile-3.0 to native-inputs (and not to inputs), the build
fails like this:

```
configure: checking for guile 3.0
configure: checking for guile 2.2
configure: checking for guile 2.0
configure: error: 
No Guile development packages were found.

Please verify that you have Guile installed.  If you installed Guile
from a binary distribution, please verify that you have also installed
the development packages.  If you installed it yourself, you might need
to adjust your PKG_CONFIG_PATH; see the pkg-config man page for more.

error: in phase 'configure': uncaught exception:
%exception #<&invoke-error program: "/gnu/store/4y5m9lb8k3qkb1y9m02sw9w9a6hacd16-bash-minimal-5.1.8/bin/bash" arguments: ("./configure" "CC_FOR_BUILD=gcc" "CONFIG_SHELL=/gnu/store/4y5m9lb8k3qkb1y9m02sw9w9a6hacd16-bash-minimal-5.1.8/bin/bash" "SHELL=/gnu/store/4y5m9lb8k3qkb1y9m02sw9w9a6hacd16-bash-minimal-5.1.8/bin/bash" "--prefix=/gnu/store/qhcnb9giiahhb2p7y7q05gs4ndhln4yk-guile-srfi-146-0.1.0" "--enable-fast-install" "--build=x86_64-unknown-linux-gnu" "--host=arm-linux-gnueabihf") exit-status: 1 term-signal: #f stop-signal: #f> 
phase `configure' failed after 0.6 seconds
```

Quite possibly that something is wrong with the configure.ac. Same thing
also happens with guile-srfi-158.

-pukkamustard
M Aug. 8, 2022, 6:22 p.m. UTC | #5
On 08-08-2022 14:43, pukkamustard wrote:
>>> +    (license license:lgpl3+)))
>> There are also some (ISC?) bits on
>> <https://inqlab.net/git/guile-srfi-146.git/tree/srfi/srfi-146.scm>.
> Yes, the sample SRFI implementation is licensed under ISC. Afaiu,
> there's no problem in relicensing this as LGPL-3.0-or-later. I think a
> lot of the guile-srfi-* libraries do this.
>
I have looked at license text, and it states that it allows 
'sublicensing', but it doesn't say anything about relicensing (except 
maybe for the "deal in the Software without restriction"?).

As such, I think it would be safer to just include license:isc in the list.

Greetings,
Maxime.
M Aug. 8, 2022, 7:04 p.m. UTC | #6
On 08-08-2022 14:43, pukkamustard wrote:
> ```
> no code for module (srfi srfi-128)
> ```
>
> guile-srfi-128 is built using the guile-build-system. Maybe something
> not working properly with guile-build-system and cross-compilation?

I don't know about guile-build-system, but for some Guile packages that 
use gnu-build-system, the package itself has to be added to 
native-inputs when cross-compiling (this-package may be useful). I think 
it has something to do with macros and the module system.

Greetings,
Maxime.
pukkamustard Aug. 9, 2022, 9:24 a.m. UTC | #7
Maxime Devos <maximedevos@telenet.be> writes:

> I don't know about guile-build-system, but for some Guile packages
> that use gnu-build-system, the package itself has to be added to
> native-inputs when cross-compiling (this-package may be useful). I
> think it has something to do with macros and the module system.

That seems to do the trick. Adding the Guile libraries to the
native-inputs makes cross-compilation work.

I will send in a V2 of patches that fixes this.

Thanks,
pukkamustard
pukkamustard Aug. 19, 2022, 1:41 p.m. UTC | #8
Sorry for the delayed response. I seem to have missed this mail.

Maxime Devos <maximedevos@telenet.be> writes:

> [[PGP Signed Part:Undecided]]
> On 08-08-2022 14:43, pukkamustard wrote:
>
>  +    (license license:lgpl3+)))
>
> There are also some (ISC?) bits on
> <https://inqlab.net/git/guile-srfi-146.git/tree/srfi/srfi-146.scm>.
>
> Yes, the sample SRFI implementation is licensed under ISC. Afaiu,
> there's no problem in relicensing this as LGPL-3.0-or-later. I think a
> lot of the guile-srfi-* libraries do this.
>
> I have looked at license text, and it states that it allows 'sublicensing', but it doesn't say anything about relicensing (except maybe for
> the "deal in the Software without restriction"?).
>
> As such, I think it would be safer to just include license:isc in the list.

I'm no legal expert, but I think I am free to distribute it only
under LGPL-3.0-or-later (and not also ISC). And I prefer to do so.

For prior cases see modules/srfi/srfi-71.scm as distributed with
Guile. The file contains a SRFI sample implementation with the same ISC
license header. It seems to be fine to relicense modules distributed
with Guile as LGPL-3.0-or-later. In the Guix package definition for
Guile only license:lgpl3+ is listed (and not license:isc).

Cheers,
pukkamustard
M Aug. 19, 2022, 8:34 p.m. UTC | #9
On 19-08-2022 15:41, pukkamustard wrote:

> I'm no legal expert, but I think I am free to distribute it only
> under LGPL-3.0-or-later (and not also ISC). And I prefer to do so.
Sure, go ahead and distribute it as LGPL-3.0-or-later, but I don't see 
how it follows that license:isc should be removed from the license list.

However, to me it seems inaccurate that you do not have to follow the 
ISC by following the LGPL-3.0-or-later instead. The ISC has a line:
> ;; [...] The above copyright notice and this permission notice shall 
> be included
> ;; in all copies or substantial portions of the Software. [...]
Even if ISC permits relicensing, I would assume you will still have to 
follow that. Otherwise, you could circumvent 'preserve this copyright 
notice / preserve authorship information / ...’ requirements by 
relicensing it as something very permissive, which seems a loophole to me.
> For prior cases see modules/srfi/srfi-71.scm as distributed with
> Guile. The file contains a SRFI sample implementation with the same ISC
> license header. It seems to be fine to relicense modules distributed
> with Guile as LGPL-3.0-or-later.

I am not following, how is this relicensing?

> In the Guix package definition for Guile only license:lgpl3+ is listed (and not license:isc).

Right, I would add license:isc with an appropriate comment to the list 
in the Guile package definition, looks like the license information for 
that package is incomplete.

[...]

More generally, I don't see a need for computing an 'effective license' 
(*) of the licenses of the individual files, given the lack of legal 
experts here and as 'licenses' accepts a list, not only a single item.

(*) things like 'isc or expat + lgplN-or-later -> lgplN-or-later'.

Greetings,
Maxime.
pukkamustard Aug. 29, 2022, 8:48 a.m. UTC | #10
Hi,

I think I finally understand your reasoning (also thanks to the thread
on guix-devel -
https://lists.gnu.org/archive/html/guix-devel/2022-08/msg00167.html) and
agree.

Will send in V3 shortly with license:isc added to the list of licenses
with a comment.

Thank you for your elaborations and patience.

- pukkamustard

Maxime Devos <maximedevos@telenet.be> writes:

> [[PGP Signed Part:Undecided]]
> On 19-08-2022 15:41, pukkamustard wrote:
>
>> I'm no legal expert, but I think I am free to distribute it only
>> under LGPL-3.0-or-later (and not also ISC). And I prefer to do so.
> Sure, go ahead and distribute it as LGPL-3.0-or-later, but I don't see
> how it follows that license:isc should be removed from the license
> list.
>
> However, to me it seems inaccurate that you do not have to follow the
> ISC by following the LGPL-3.0-or-later instead. The ISC has a line:
>> ;; [...] The above copyright notice and this permission notice shall
>> be included
>> ;; in all copies or substantial portions of the Software. [...]
> Even if ISC permits relicensing, I would assume you will still have to
> follow that. Otherwise, you could circumvent 'preserve this copyright
> notice / preserve authorship information / ...’ requirements by
> relicensing it as something very permissive, which seems a loophole to
> me.
>> For prior cases see modules/srfi/srfi-71.scm as distributed with
>> Guile. The file contains a SRFI sample implementation with the same ISC
>> license header. It seems to be fine to relicense modules distributed
>> with Guile as LGPL-3.0-or-later.
>
> I am not following, how is this relicensing?
>
>> In the Guix package definition for Guile only license:lgpl3+ is listed (and not license:isc).
>
> Right, I would add license:isc with an appropriate comment to the list
> in the Guile package definition, looks like the license information
> for that package is incomplete.
>
> [...]
>
> More generally, I don't see a need for computing an 'effective
> license' (*) of the licenses of the individual files, given the lack
> of legal experts here and as 'licenses' accepts a list, not only a
> single item.
>
> (*) things like 'isc or expat + lgplN-or-later -> lgplN-or-later'.
>
> Greetings,
> Maxime.
>
> [2. OpenPGP public key --- application/pgp-keys; OpenPGP_0x49E3EE22191725EE.asc]...
>
> [[End of PGP Signed Part]]
diff mbox series

Patch

diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm
index 2763fb73d0..3eb1e90213 100644
--- a/gnu/packages/guile-xyz.scm
+++ b/gnu/packages/guile-xyz.scm
@@ -3142,6 +3142,39 @@  (define-public guile-srfi-145
 denote the invalidity of certain code paths in a Scheme program.")
     (license license:gpl3+)))
 
+(define-public guile-srfi-146
+  (package
+    (name "guile-srfi-146")
+    (version "0.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://inqlab.net/git/guile-srfi-146.git")
+             (commit (string-append "v" version))))
+       (sha256
+        (base32
+         "13dbzlav4fql8lcfr021z5368lwri6i15x0ykv8llzyghlbbx2w6"))
+       (file-name (git-file-name name version))))
+    (build-system gnu-build-system)
+    (native-inputs
+     (list autoconf automake pkg-config))
+    (inputs (list guile-3.0))
+    (propagated-inputs
+     (list guile-srfi-128 guile-srfi-145 guile-srfi-158))
+    (synopsis "SRFI 146 (Mappings) for Guile")
+    (description
+     "This package provides an implementation of SRFI 146 for Guile.
+SRFI 146 defines datastructures that implement mappings (finite sets
+of associations consiting of a key and a value).  Two types of
+mappings are defined: One using a comparator to define an order on the
+keys and another using a hash function on the keys.  The
+datastructures and procedures are by default purely-functional.  This
+package re-uses the SRFI sample implementation that is based on
+red-black trees and Hash Array Mapped Trie (HAMT).")
+    (home-page "https://inqlab.net/git/guile-srfi-146.git")
+    (license license:lgpl3+)))
+
 (define-public guile-srfi-158
   (let ((commit "13126d1ed37892c864337a600a43d6876625fb99")
         (revision "0"))