diff mbox series

[bug#43182,3/3] gnu: nomad: Update to 0.2.0-alpha-100-g6a565d3.

Message ID 20200904144053.1981499-3-mike.rosset@gmail.com
State Accepted
Headers show
Series [bug#43182,1/3] gnu: emacsy-minimal: Update to v0.4.1-31-g415d96f. | expand

Checks

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

Commit Message

Mike Rosset Sept. 4, 2020, 2:40 p.m. UTC
* gnu/packages/guile-xyz.scm (nomad): Update to 0.2.0-alpha-100-g6a565d3.

  This also removes all propagated inputs and instead uses wrapping for search
paths.

  Wrapping has been simplified and now adds NOMAD_WEB_EXTENSION_DIR,
GI_TYPELIB_PATH and GST_PLUGIN_SYSTEM_PATH environment variables.
---
 gnu/packages/guile-xyz.scm | 92 ++++++++++++++++----------------------
 1 file changed, 39 insertions(+), 53 deletions(-)

Comments

Mathieu Othacehe Sept. 7, 2020, 6:10 a.m. UTC | #1
Hello Mike,

I pushed the two first ones, thanks.

> * gnu/packages/guile-xyz.scm (nomad): Update to 0.2.0-alpha-100-g6a565d3.

For this one, you need to describe every change exhaustively, according
to the commit message convention. For instance:

[native-inputs]: Add "gettext".
[propagated-inputs]: Move "glib-networking" to ....
[inputs]: ... here.

and so on.

> +                 `("GI_TYPELIB_PATH" ":" prefix (,gi-path ,(getenv "GI_TYPELIB_PATH")))
> +                 `("GIO_EXTRA_MODULES" ":" prefix (,(getenv "GIO_EXTRA_MODULES")))

You can wrap a few lines here to stay under the 78 columns limit.

> +                 `("GST_PLUGIN_SYSTEM_PATH" ":" prefix ,gst-plugins)
> +                 `("NOMAD_WEB_EXTENSION_DIR" ":" prefix (,ext-path)))

If NOMAD_WEB_EXTENSION_DIR is wrapped, it is up to the user to set
it. Don't we want to keep it as a native-search-paths so that any
extension package to nomad is automatically added to this variable?

Thanks,

Mathieu
Mike Rosset Sept. 7, 2020, 6:55 a.m. UTC | #2
Mathieu Othacehe <othacehe@gnu.org> writes:

> Hello Mike,
>
> I pushed the two first ones, thanks.
>
>> * gnu/packages/guile-xyz.scm (nomad): Update to 0.2.0-alpha-100-g6a565d3.
>
> For this one, you need to describe every change exhaustively, according
> to the commit message convention. For instance:
>
> [native-inputs]: Add "gettext".
> [propagated-inputs]: Move "glib-networking" to ....
> [inputs]: ... here.
>
> and so on.

I'll reword this commit message.

>> +                 `("GI_TYPELIB_PATH" ":" prefix (,gi-path ,(getenv "GI_TYPELIB_PATH")))
>> +                 `("GIO_EXTRA_MODULES" ":" prefix (,(getenv "GIO_EXTRA_MODULES")))
>
> You can wrap a few lines here to stay under the 78 columns limit.
>
>> +                 `("GST_PLUGIN_SYSTEM_PATH" ":" prefix ,gst-plugins)
>> +                 `("NOMAD_WEB_EXTENSION_DIR" ":" prefix (,ext-path)))
>
> If NOMAD_WEB_EXTENSION_DIR is wrapped, it is up to the user to set
> it. Don't we want to keep it as a native-search-paths so that any
> extension package to nomad is automatically added to this variable?
>

No, web extension is a GTK term for extending the WebKit process
which runs outside of the GTK/Glib process.

The extensions are dynamic libraries and you need to tell the
WebKitWebContext where to look for them. Normally I'd just substitute
in the $(libexecdir).  But we need to use the libs in the build directory for
testing.  And I can't use libtool --mode=execute -dlopen. Because the
WebKit process does the dlopen.

We don't actually do much with the WebProcess right now.  But later it's
a pathway to DOM introspection using scheme... at least in theory.

So it's easier to just set NOMAD_WEB_EXTENSION_DIR in pre-inst-env.  For
end users setting NOMAD_WEB_EXTENSION_DIR explicitly in a wrap will have
no impact. Since nomad extensions are done in scheme and use the normal
search path mechanisms for guile.

Mike
Mike Rosset Sept. 7, 2020, 7:58 a.m. UTC | #3
Mathieu Othacehe <othacehe@gnu.org> writes:

> Hello Mike,
>
> I pushed the two first ones, thanks.
>
>> * gnu/packages/guile-xyz.scm (nomad): Update to 0.2.0-alpha-100-g6a565d3.
>
> For this one, you need to describe every change exhaustively, according
> to the commit message convention. For instance:
>
> [native-inputs]: Add "gettext".
> [propagated-inputs]: Move "glib-networking" to ....
> [inputs]: ... here.
>
> and so on.

Reworded commit following this format.

>> +                 `("GI_TYPELIB_PATH" ":" prefix (,gi-path ,(getenv "GI_TYPELIB_PATH")))
>> +                 `("GIO_EXTRA_MODULES" ":" prefix (,(getenv "GIO_EXTRA_MODULES")))
>
> You can wrap a few lines here to stay under the 78 columns limit.
>
>> +                 `("GST_PLUGIN_SYSTEM_PATH" ":" prefix ,gst-plugins)
>> +                 `("NOMAD_WEB_EXTENSION_DIR" ":" prefix (,ext-path)))

Wrapped these lines and emailed a new 001 patch for Nomad.
Ricardo Wurmus Sept. 7, 2020, 11:02 a.m. UTC | #4
Mike Rosset <mike.rosset@gmail.com> writes:

>>> +                 `("GI_TYPELIB_PATH" ":" prefix (,gi-path ,(getenv "GI_TYPELIB_PATH")))
>>> +                 `("GIO_EXTRA_MODULES" ":" prefix (,(getenv "GIO_EXTRA_MODULES")))
>>
>> You can wrap a few lines here to stay under the 78 columns limit.
>>
>>> +                 `("GST_PLUGIN_SYSTEM_PATH" ":" prefix ,gst-plugins)
>>> +                 `("NOMAD_WEB_EXTENSION_DIR" ":" prefix (,ext-path)))
>>
>> If NOMAD_WEB_EXTENSION_DIR is wrapped, it is up to the user to set
>> it. Don't we want to keep it as a native-search-paths so that any
>> extension package to nomad is automatically added to this variable?
>>
>
> No, web extension is a GTK term for extending the WebKit process
> which runs outside of the GTK/Glib process.
>
> The extensions are dynamic libraries and you need to tell the
> WebKitWebContext where to look for them. Normally I'd just substitute
> in the $(libexecdir).  But we need to use the libs in the build directory for
> testing.  And I can't use libtool --mode=execute -dlopen. Because the
> WebKit process does the dlopen.

During the build you could use LD_LIBRARY_PATH, no?
Mike Rosset Sept. 7, 2020, 4:24 p.m. UTC | #5
Ricardo Wurmus <rekado@elephly.net> writes:

> Mike Rosset <mike.rosset@gmail.com> writes:
>
>>
>> No, web extension is a GTK term for extending the WebKit process
>> which runs outside of the GTK/Glib process.
>>
>> The extensions are dynamic libraries and you need to tell the
>> WebKitWebContext where to look for them. Normally I'd just substitute
>> in the $(libexecdir).  But we need to use the libs in the build directory for
>> testing.  And I can't use libtool --mode=execute -dlopen. Because the
>> WebKit process does the dlopen.
>
> During the build you could use LD_LIBRARY_PATH, no?

No, The WebKitWebContext only uses the directory that is set by
webkit_web_context_set_web_extensions_directory. See
https://webkitgtk.org/reference/webkit2gtk/stable/WebKitWebContext.html#webkit-web-context-set-web-extensions-directory.
diff mbox series

Patch

diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm
index 5164dc91c5..afe6b9a07c 100644
--- a/gnu/packages/guile-xyz.scm
+++ b/gnu/packages/guile-xyz.scm
@@ -3074,7 +3074,7 @@  perform geometrical transforms on JPEG images.")
 (define-public nomad
   (package
     (name "nomad")
-    (version "0.2.0-alpha")
+    (version "0.2.0-alpha-100-g6a565d3")
     (source (origin
               (method git-fetch)
               (uri (git-reference
@@ -3083,7 +3083,7 @@  perform geometrical transforms on JPEG images.")
               (file-name (git-file-name name version))
               (sha256
                (base32
-                "1z2z5x37v1qrk2vb8qlz2yj030iirzzd0maa9fjxzlqkrg6krbaj"))))
+                "0anmprm63a88kii251rl296v1g4iq62r6n4nssx5jbc0hzkknanz"))))
     (build-system gnu-build-system)
     (native-inputs
      `(("autoconf" ,autoconf)
@@ -3094,36 +3094,35 @@  perform geometrical transforms on JPEG images.")
        ("guile" ,guile-2.2)
        ("glib:bin" ,glib "bin")
        ("texinfo" ,texinfo)
+       ("gettext" ,gnu-gettext)
        ("perl" ,perl)))
     (inputs
-     `(("guile" ,guile-2.2)
+     `(;; Guile
+       ("guile" ,guile-2.2)
        ("guile-lib" ,guile2.2-lib)
        ("guile-readline" ,guile2.2-readline)
        ("guile-gcrypt" ,guile2.2-gcrypt)
        ("gnutls" ,gnutls)
+       ("g-golf" ,g-golf)
        ("shroud" ,shroud)
        ("emacsy" ,emacsy-minimal)
+       ;; Gtk
        ("glib" ,glib)
        ("dbus-glib" ,dbus-glib)
+       ("glib-networking" ,glib-networking)
        ("gtk+" ,gtk+)
        ("gtk+:bin" ,gtk+ "bin")
-       ("gtksourceview" ,gtksourceview)
        ("webkitgtk" ,webkitgtk)
-       ("g-golf" ,g-golf)
-       ("xorg-server" ,xorg-server)))
-    (propagated-inputs
-     `(("glib" ,glib)
-       ("glib-networking" ,glib-networking)
+       ("gtksourceview" ,gtksourceview)
+       ("vte" ,vte)
+       ;; Gstreamer
        ("gstreamer" ,gstreamer)
        ("gst-plugins-base" ,gst-plugins-base)
        ("gst-plugins-good" ,gst-plugins-good)
        ("gst-plugins-bad" ,gst-plugins-bad)
        ("gst-plugins-ugly" ,gst-plugins-ugly)
-       ("gtk+" ,gtk+)
-       ("gtksourceview" ,gtksourceview)
-       ("vte" ,vte)
-       ("webkitgtk" ,webkitgtk)
-       ("gsettings-desktop-schemas" ,gsettings-desktop-schemas)))
+       ;; Util
+       ("xorg-server" ,xorg-server)))
     (arguments
      `(#:modules ((guix build gnu-build-system)
                   (guix build utils)
@@ -3141,49 +3140,36 @@  perform geometrical transforms on JPEG images.")
              #t))
          (add-after 'install 'wrap-binaries
            (lambda* (#:key inputs outputs #:allow-other-keys)
-             (let* ((out (assoc-ref outputs "out"))
-                    (gio-deps (map (cut assoc-ref inputs <>)
-                                   '("glib-networking"
-                                     "glib"
-                                     "gstreamer"
-                                     "gst-plugins-base"
-                                     "gst-plugins-good"
-                                     "gst-plugins-bad"
-                                     "gst-plugins-ugly")))
-                    (gio-mod-path (map (cut string-append <>
-                                            "/lib/gio/modules")
-                                       gio-deps))
-                    (effective (read-line (open-pipe*
+             (let* ((out        (assoc-ref outputs "out"))
+                    (effective  (read-line (open-pipe*
                                            OPEN_READ
                                            "guile" "-c"
                                            "(display (effective-version))")))
-                    (deps (map (cut assoc-ref inputs <>)
-                               '("emacsy" "guile-lib" "guile-readline"
-                                 "g-golf" "shroud")))
-                    (scm-path (map (cut string-append <>
-                                        "/share/guile/site/" effective)
-                                   `(,out ,@deps)))
-                    (go-path (map (cut string-append <>
-                                       "/lib/guile/" effective "/site-ccache")
-                                  `(,out ,@deps)))
-                    (progs (map (cut string-append out "/bin/" <>)
-                                '("nomad"))))
-               (map (cut wrap-program <>
-                         `("GIO_EXTRA_MODULES" ":" prefix ,gio-mod-path)
-                         `("GUILE_LOAD_PATH" ":" prefix ,scm-path)
-                         `("GUILE_LOAD_COMPILED_PATH" ":"
-                           prefix ,go-path))
-                    progs)
+                    (gst-plugins (map (lambda (i)
+                                        (string-append (assoc-ref inputs i)
+                                                       "/lib/gstreamer-1.0"))
+                                      `("gstreamer"
+                                        "gst-plugins-base"
+                                        "gst-plugins-good"
+                                        "gst-plugins-bad"
+                                        "gst-plugins-ugly")))
+                    (out-append (lambda (. args)
+                                     (apply string-append out args)))
+                    (gi-path    (out-append "/lib/girepository-1.0"))
+                    (load-path  (out-append "/share/guile/site/" effective))
+                    (comp-path  (out-append "/lib/guile/" effective "/site-ccache"))
+                    (ext-path   (out-append "/libexec/nomad")))
+               (wrap-program (string-append out "/bin/nomad")
+                 `("GUILE_LOAD_PATH" ":" prefix  (,load-path
+                                                  ,(getenv "GUILE_LOAD_PATH")))
+                 `("GUILE_LOAD_COMPILED_PATH" ":" prefix
+                   (,comp-path
+                    ,(getenv "GUILE_LOAD_COMPILED_PATH")))
+                 `("GI_TYPELIB_PATH" ":" prefix (,gi-path ,(getenv "GI_TYPELIB_PATH")))
+                 `("GIO_EXTRA_MODULES" ":" prefix (,(getenv "GIO_EXTRA_MODULES")))
+                 `("GST_PLUGIN_SYSTEM_PATH" ":" prefix ,gst-plugins)
+                 `("NOMAD_WEB_EXTENSION_DIR" ":" prefix (,ext-path)))
                #t))))))
-    (native-search-paths
-     (list (search-path-specification
-            (variable "GI_TYPELIB_PATH")
-            (separator ":")
-            (files '("lib/girepository-1.0")))
-           (search-path-specification
-            (variable "NOMAD_WEB_EXTENSION_DIR")
-            (separator ":")
-            (files '("libexec/nomad")))))
     (home-page "https://savannah.nongnu.org/projects/nomad/")
     (synopsis "Extensible Web Browser in Guile Scheme")
     (description "Nomad is a Emacs-like web browser that consists of a modular