gnu: Add guile-gnome

Message ID 87y46fk2k7.fsf@auf.org
State New
Headers

Commit Message

Patrick Hetu June 8, 2016, 5:34 p.m. UTC
  Ludovic Courtès @ 2016-06-08 09:19 EDT:

> Patr
ick Hetu <patrick.hetu@auf.org> skribis:
>
>> Ludovic Courtès @ 2016-05-28 12:06 EDT:
>>
>>> Pushed as 9b381643f009025d97dfc0b82d2c00800c204380 with a few minor
>>> changes:
>> [...]
>> Still, the current g-wrap package needs a new patch to fix his Makefile.in
>> because the native-search-paths hooks won't find it for Guile 2.0.
>
> But it works well to build guile-gnome AFAICS.  When is it a problem?

I'm getting this error in a simple test script:

In ice-9/boot-9.scm:
2951: 3 [define-module* (gnome gw gtk) #:filename ...]
2926: 2 [resolve-imports ((#) (#) (#) (#) ...)]
2867: 1 [resolve-interface (g-wrap gw standard) #:select ...]
In unknown file:
   ?: 0 [scm-error misc-error #f ...]

ERROR: In procedure scm-error:
ERROR: no code for module (g-wrap gw standard)

because the g-wrap code is under:

/gnu/store/...-g-wrap-1.9.15/share/guile/site
/gnu/store/...-g-wrap-1.9.15/share/guile/site/g-wrap.scm
/gnu/store/...-g-wrap-1.9.15/share/guile/site/g-wrap
/gnu/store/...-g-wrap-1.9.15/share/guile/site/g-wrap/compat.scm
/gnu/store/...-g-wrap-1.9.15/share/guile/site/g-wrap/config.scm

and not /gnu/..../share/guile/2.0/g-wrap/...

> But yeah, patching it to match the native-search-paths is a good idea.

ok, I've attached the patch.

>> Also, should I rename it to guile-g-wrap at the same time?
>
> I don’t think so, because it’s both a program and a library, not just a
> library (I see that this rule mine and is not spelled out in “Packaging
> Guidelines”; it probably should, if there’s consensus.)

ok.

Patrick
  

Comments

David Pirotte June 8, 2016, 8:37 p.m. UTC | #1
Hello Patrick,

> ...
> +        (modify-phases %standard-phases
> +          (add-before 'configure 'pre-configure
> +               (lambda* (#:key outputs #:allow-other-keys)
> +                 (let ((out (assoc-ref outputs "out")))
> +                   (substitute* (find-files "." "^Makefile.in$")
> +                     (("guilemoduledir =.*guile/site" all)
> +                     (string-append all "/2.0")))
> +                  #t))))))
> ...

Just curious: why do you (string-append all "/2.0")? Is this a guix guideline maybe?

	IMO, G-wrap, Guile-Cairo and Guile-Gnome should all be installed in the
	directory returned by (%global-site-dir)

Cheers,
David
  
Efraim Flashner June 9, 2016, 6:37 a.m. UTC | #2
On Wed, Jun 08, 2016 at 05:37:26PM -0300, David Pirotte wrote:
> Hello Patrick,
> 
> > ...
> > +        (modify-phases %standard-phases
> > +          (add-before 'configure 'pre-configure
> > +               (lambda* (#:key outputs #:allow-other-keys)
> > +                 (let ((out (assoc-ref outputs "out")))
> > +                   (substitute* (find-files "." "^Makefile.in$")
> > +                     (("guilemoduledir =.*guile/site" all)
> > +                     (string-append all "/2.0")))
> > +                  #t))))))
> > ...
> 
> Just curious: why do you (string-append all "/2.0")? Is this a guix guideline maybe?
> 
> 	IMO, G-wrap, Guile-Cairo and Guile-Gnome should all be installed in the
> 	directory returned by (%global-site-dir)
> 
> Cheers,
> David

`guilemoduledir =.*guile/site' is saved in the variable `all' and then
used in the second half of the substitute*.  I have a similar one I
wrote for aria2 in bittorrent.scm
  
David Pirotte June 9, 2016, 7:45 p.m. UTC | #3
> > > ...
> > > +        (modify-phases %standard-phases
> > > +          (add-before 'configure 'pre-configure
> > > +               (lambda* (#:key outputs #:allow-other-keys)
> > > +                 (let ((out (assoc-ref outputs "out")))
> > > +                   (substitute* (find-files "." "^Makefile.in$")
> > > +                     (("guilemoduledir =.*guile/site" all)
> > > +                     (string-append all "/2.0")))
> > > +                  #t))))))
> > > ...  

> > Just curious: why do you (string-append all "/2.0")? Is this a guix guideline
> > maybe?

> > 	IMO, G-wrap, Guile-Cairo and Guile-Gnome should all be installed in the
> > 	directory returned by (%global-site-dir)

> `guilemoduledir =.*guile/site' is saved in the variable `all' and then
> used in the second half of the substitute*.  I have a similar one I
> wrote for aria2 in bittorrent.scm

ok, but why "/2.0" is appended to it?
  
Alex Kost June 10, 2016, 8:44 a.m. UTC | #4
David Pirotte (2016-06-09 22:45 +0300) wrote:

>> > > ...
>> > > +        (modify-phases %standard-phases
>> > > +          (add-before 'configure 'pre-configure
>> > > +               (lambda* (#:key outputs #:allow-other-keys)
>> > > +                 (let ((out (assoc-ref outputs "out")))
>> > > +                   (substitute* (find-files "." "^Makefile.in$")
>> > > +                     (("guilemoduledir =.*guile/site" all)
>> > > +                     (string-append all "/2.0")))
>> > > +                  #t))))))
>> > > ...  
>
>> > Just curious: why do you (string-append all "/2.0")? Is this a guix guideline
>> > maybe?
>
>> > 	IMO, G-wrap, Guile-Cairo and Guile-Gnome should all be installed in the
>> > 	directory returned by (%global-site-dir)
>
>> `guilemoduledir =.*guile/site' is saved in the variable `all' and then
>> used in the second half of the substitute*.  I have a similar one I
>> wrote for aria2 in bittorrent.scm
>
> ok, but why "/2.0" is appended to it?

I think the version is not needed, but Ludovic had another opinion.  I
don't remember details but there was some discussion about it:
<http://lists.gnu.org/archive/html/guix-devel/2014-10/msg00408.html>
  
Ludovic Courtès June 10, 2016, 12:52 p.m. UTC | #5
Patrick Hetu <patrick.hetu@auf.org> skribis:

> From 66baa02e5683a309588ae0a68a7d1b918ad72d8e Mon Sep 17 00:00:00 2001
> From: Patrick Hetu <patrick.hetu@auf.org>
> Date: Wed, 8 Jun 2016 13:18:07 -0400
> Subject: [PATCH] gnu: g-wrap: Fix installation path
>
> * gnu/packages/guile.scm (g-wrap): Add 2.0/ to the installation path

Applied, thanks!

I think guile-gnome built successfully even without this patch because
it uses ‘g-wrap-config --guile-module-directory’ to determine what to
add to its load path.

Ludo’.
  
David Pirotte June 11, 2016, 9:54 p.m. UTC | #6
Hi Alex,

> >> > > ...
> >> > > +        (modify-phases %standard-phases
> >> > > +          (add-before 'configure 'pre-configure
> >> > > +               (lambda* (#:key outputs #:allow-other-keys)
> >> > > +                 (let ((out (assoc-ref outputs "out")))
> >> > > +                   (substitute* (find-files "." "^Makefile.in$")
> >> > > +                     (("guilemoduledir =.*guile/site" all)
> >> > > +                     (string-append all "/2.0")))
> >> > > +                  #t))))))
> >> > > ...    

> >> > Just curious: why do you (string-append all "/2.0")? Is this a guix guideline
> >> > maybe?  

> >> > 	IMO, G-wrap, Guile-Cairo and Guile-Gnome should all be installed in
> >> > the directory returned by (%global-site-dir)  

> >> `guilemoduledir =.*guile/site' is saved in the variable `all' and then
> >> used in the second half of the substitute*.  I have a similar one I
> >> wrote for aria2 in bittorrent.scm  

> > ok, but why "/2.0" is appended to it?  

> I think the version is not needed, but Ludovic had another opinion.  I
> don't remember details but there was some discussion about it:
> <http://lists.gnu.org/archive/html/guix-devel/2014-10/msg00408.html>

Thanks for the pointer.  FWIW, I agree with Mark

	(a) (%global-site-dir) as always been part of gule's search paths for
	modules, and that should not be 'altered' for guix, imo;

	(b) it seems to me there has been a confuson, in this thread, in between
	those of you talking about packages that also need to install things in
	$prefix/bin and 'natively' do not distingish themselve from other version(s)
	[1] and those of you talking packages that are compatible with several
	version of guile [the one listed in their configure.ac file] and these
	should be installed in (%global-site-dir), imo.

But then maybe I'm missing something.

Cheers,
David

[1]	the thread sites qt 4 and 5, but guile does that too by the way, even if
	you specify --program-suffix, it installs itself and its scripts, in
	$prefix/bin, without the suffix
  

Patch

From 66baa02e5683a309588ae0a68a7d1b918ad72d8e Mon Sep 17 00:00:00 2001
From: Patrick Hetu <patrick.hetu@auf.org>
Date: Wed, 8 Jun 2016 13:18:07 -0400
Subject: [PATCH] gnu: g-wrap: Fix installation path

* gnu/packages/guile.scm (g-wrap): Add 2.0/ to the installation path
---
 gnu/packages/guile.scm | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/gnu/packages/guile.scm b/gnu/packages/guile.scm
index 74e58c4..04c3f03 100644
--- a/gnu/packages/guile.scm
+++ b/gnu/packages/guile.scm
@@ -939,6 +939,16 @@  capabilities.")
        ("guile-lib" ,guile-lib)))
     (inputs
      `(("libffi" ,libffi)))
+    (arguments
+      `(#:phases
+        (modify-phases %standard-phases
+          (add-before 'configure 'pre-configure
+               (lambda* (#:key outputs #:allow-other-keys)
+                 (let ((out (assoc-ref outputs "out")))
+                   (substitute* (find-files "." "^Makefile.in$")
+                     (("guilemoduledir =.*guile/site" all)
+                     (string-append all "/2.0")))
+                  #t))))))
     (synopsis "Generate C bindings for Guile")
     (description "G-Wrap is a tool and Guile library for generating function
 wrappers for inter-language calls.  It currently only supports generating Guile
-- 
2.7.4