diff mbox

gnu: Add libunique.

Message ID 20160816194503.GA19955@jasmine
State New
Headers show

Commit Message

Leo Famulari Aug. 16, 2016, 7:45 p.m. UTC
On Mon, Aug 15, 2016 at 11:33:26PM +0000, ng0 wrote:
> Leo Famulari <leo@famulari.name> writes:
> > Is this package required by something else that we are working on? What
> > is the use case?
> 
> (gnunet-gtk):
> 
>     (arguments
>          `(#:configure-flags
>                 (list "--without-libunique"

Okay, then I think we should add the package with a comment that says
it's unmaintained. What do you think of the attached patch?

Comments

non such Aug. 17, 2016, 9:52 a.m. UTC | #1
Leo Famulari <leo@famulari.name> writes:

> On Mon, Aug 15, 2016 at 11:33:26PM +0000, ng0 wrote:
>> Leo Famulari <leo@famulari.name> writes:
>> > Is this package required by something else that we are working on? What
>> > is the use case?
>> 
>> (gnunet-gtk):
>> 
>>     (arguments
>>          `(#:configure-flags
>>                 (list "--without-libunique"
>
> Okay, then I think we should add the package with a comment that says
> it's unmaintained. What do you think of the attached patch?

Looks good to me. This way if some old application should require
libunique, we have it. I'll also ask about libunique at gnunet-devel
list with some other applications I need to question. As far as I
understand Christian, they want to avoid external dependencies where
possible. A ifcase for gnunet-gtk is in the HEAD of gnunet-gtk.

Thanks

> From fa8fbd899756cf948da23e9a29d92a5f48d4eb1c Mon Sep 17 00:00:00 2001
> From: ng0 <ng0@we.make.ritual.n0.is>
> Date: Wed, 3 Aug 2016 08:18:14 +0000
> Subject: [PATCH] gnu: Add libunique.
>
> * gnu/packages/gnome.scm (libunique): New variable.
>
> Signed-off-by: Leo Famulari <leo@famulari.name>
> ---
>  gnu/packages/gnome.scm | 40 ++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 40 insertions(+)
>
> diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm
> index 4a0be01..b094c30 100644
> --- a/gnu/packages/gnome.scm
> +++ b/gnu/packages/gnome.scm
> @@ -5420,3 +5420,43 @@ GLib/GObject code.")
>       "Libgnomekbd is a keyboard configuration library for the GNOME desktop
>  environment, which can notably display keyboard layouts.")
>      (license license:lgpl2.0+)))
> +
> +;;; This package is no longer maintained:
> +;;; https://wiki.gnome.org/Attic/LibUnique
> +;;; "Unique is now in maintenance mode, and its usage is strongly discouraged.
> +;;; Applications should use the GtkApplication class provided by GTK+ 3.0."
> +(define-public libunique
> +  (package
> +    (name "libunique")
> +    (version "3.0.2")
> +    (source (origin
> +              (method url-fetch)
> +              (uri (string-append "mirror://gnome/sources/" name "/"
> +                                  (version-major+minor version)  "/"
> +                                  name "-" version ".tar.xz"))
> +              (sha256
> +               (base32
> +                "0f70lkw66v9cj72q0iw1s2546r6bwwcd8idcm3621fg2fgh2rw58"))))
> +    (build-system glib-or-gtk-build-system)
> +    (arguments
> +     `(#:configure-flags '("--disable-static"
> +                           "--disable-dbus" ; use gdbus
> +                           "--enable-introspection")))
> +    (native-inputs
> +     `(("pkg-config" ,pkg-config)
> +       ("gobject-introspection" ,gobject-introspection)
> +       ("glib:bin" ,glib "bin")
> +       ("gtk-doc" ,gtk-doc)))
> +    (propagated-inputs
> +     ;; Referred to in .h files and .pc.
> +     `(("gtk+" ,gtk+)))
> +    (home-page "https://wiki.gnome.org/Attic/LibUnique")
> +    (synopsis "Library for writing single instance applications")
> +    (description
> +     "Libunique is a library for writing single instance applications.  If you
> +launch a single instance application twice, the second instance will either just
> +quit or will send a message to the running instance.  Libunique makes it easy to
> +write this kind of application, by providing a base class, taking care of all
> +the IPC machinery needed to send messages to a running instance, and also
> +handling the startup notification side.")
> +    (license license:lgpl2.1+)))
> -- 
> 2.9.3
>
Leo Famulari Aug. 19, 2016, 10:51 p.m. UTC | #2
On Wed, Aug 17, 2016 at 09:52:40AM +0000, ng0 wrote:
> Leo Famulari <leo@famulari.name> writes:
> > Okay, then I think we should add the package with a comment that says
> > it's unmaintained. What do you think of the attached patch?
> 
> Looks good to me. This way if some old application should require
> libunique, we have it. I'll also ask about libunique at gnunet-devel
> list with some other applications I need to question. As far as I
> understand Christian, they want to avoid external dependencies where
> possible. A ifcase for gnunet-gtk is in the HEAD of gnunet-gtk.

What does your last sentence mean?
non such Aug. 20, 2016, 9:36 a.m. UTC | #3
Leo Famulari <leo@famulari.name> writes:

> On Wed, Aug 17, 2016 at 09:52:40AM +0000, ng0 wrote:
>> Leo Famulari <leo@famulari.name> writes:
>> > Okay, then I think we should add the package with a comment that says
>> > it's unmaintained. What do you think of the attached patch?
>> 
>> Looks good to me. This way if some old application should require
>> libunique, we have it. I'll also ask about libunique at gnunet-devel
>> list with some other applications I need to question. As far as I
>> understand Christian, they want to avoid external dependencies where
>> possible. A ifcase for gnunet-gtk is in the HEAD of gnunet-gtk.
>
> What does your last sentence mean?

I should be more precise and provide context to statements. I am
sorry. I meant this:
https://gnunet.org/svn/gnunet-gtk/src/fs/gnunet-fs-gtk.c

/**
 * @file src/fs/gnunet-fs-gtk.c
 * @brief Main function of gnunet-fs-gtk
 * @author Christian Grothoff
 */
#include "gnunet-fs-gtk.h"
#include "gnunet-fs-gtk_common.h"
#include "gnunet-fs-gtk_event-handler.h"
#include "gnunet-fs-gtk_open-uri.h"

#if HAVE_LIBUNIQUE
#include <unique/unique.h>
#endif

and similar inclusions.

By the way, I've asked about specific dependencies here
(https://gnunet.org/bugs/view.php?id=4618 ), including libunique.
non such Aug. 22, 2016, 2:16 p.m. UTC | #4
So we need libunique definitely:

libunique is used so that if you start gnunet-gtk applications twice,
you still only get one window. This makes sense in combination with
'gnunet-uri', which may launch a possibly already running GUI to process
a particular URI. In this case, libunique is used to detect that the GUI
is already up, and pass the URI to the running process.

There _may_ be a more modern alternative in Gtk3 these days, but for now
we need libunique for this functionality.

see: https://gnunet.org/bugs/view.php?id=4618#c11050

Is this patch good for merging?
Leo Famulari Aug. 22, 2016, 7:47 p.m. UTC | #5
On Mon, Aug 22, 2016 at 02:16:49PM +0000, ng0 wrote:
> So we need libunique definitely:
> 
> libunique is used so that if you start gnunet-gtk applications twice,
> you still only get one window. This makes sense in combination with
> 'gnunet-uri', which may launch a possibly already running GUI to process
> a particular URI. In this case, libunique is used to detect that the GUI
> is already up, and pass the URI to the running process.
> 
> There _may_ be a more modern alternative in Gtk3 these days, but for now
> we need libunique for this functionality.
> 
> see: https://gnunet.org/bugs/view.php?id=4618#c11050
> 
> Is this patch good for merging?

Okay, pushed as 85327d0d4. Thank you for your work on this!
diff mbox

Patch

From fa8fbd899756cf948da23e9a29d92a5f48d4eb1c Mon Sep 17 00:00:00 2001
From: ng0 <ng0@we.make.ritual.n0.is>
Date: Wed, 3 Aug 2016 08:18:14 +0000
Subject: [PATCH] gnu: Add libunique.

* gnu/packages/gnome.scm (libunique): New variable.

Signed-off-by: Leo Famulari <leo@famulari.name>
---
 gnu/packages/gnome.scm | 40 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)

diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm
index 4a0be01..b094c30 100644
--- a/gnu/packages/gnome.scm
+++ b/gnu/packages/gnome.scm
@@ -5420,3 +5420,43 @@  GLib/GObject code.")
      "Libgnomekbd is a keyboard configuration library for the GNOME desktop
 environment, which can notably display keyboard layouts.")
     (license license:lgpl2.0+)))
+
+;;; This package is no longer maintained:
+;;; https://wiki.gnome.org/Attic/LibUnique
+;;; "Unique is now in maintenance mode, and its usage is strongly discouraged.
+;;; Applications should use the GtkApplication class provided by GTK+ 3.0."
+(define-public libunique
+  (package
+    (name "libunique")
+    (version "3.0.2")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "mirror://gnome/sources/" name "/"
+                                  (version-major+minor version)  "/"
+                                  name "-" version ".tar.xz"))
+              (sha256
+               (base32
+                "0f70lkw66v9cj72q0iw1s2546r6bwwcd8idcm3621fg2fgh2rw58"))))
+    (build-system glib-or-gtk-build-system)
+    (arguments
+     `(#:configure-flags '("--disable-static"
+                           "--disable-dbus" ; use gdbus
+                           "--enable-introspection")))
+    (native-inputs
+     `(("pkg-config" ,pkg-config)
+       ("gobject-introspection" ,gobject-introspection)
+       ("glib:bin" ,glib "bin")
+       ("gtk-doc" ,gtk-doc)))
+    (propagated-inputs
+     ;; Referred to in .h files and .pc.
+     `(("gtk+" ,gtk+)))
+    (home-page "https://wiki.gnome.org/Attic/LibUnique")
+    (synopsis "Library for writing single instance applications")
+    (description
+     "Libunique is a library for writing single instance applications.  If you
+launch a single instance application twice, the second instance will either just
+quit or will send a message to the running instance.  Libunique makes it easy to
+write this kind of application, by providing a base class, taking care of all
+the IPC machinery needed to send messages to a running instance, and also
+handling the startup notification side.")
+    (license license:lgpl2.1+)))
-- 
2.9.3