All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] yad: new package
@ 2015-07-02 22:09 James Knight
  2015-07-03  5:31 ` Baruch Siach
  0 siblings, 1 reply; 5+ messages in thread
From: James Knight @ 2015-07-02 22:09 UTC (permalink / raw
  To: buildroot

Signed-off-by: James Knight <james.knight@rockwellcollins.com>
---
 package/Config.in     |  1 +
 package/yad/Config.in | 23 +++++++++++++++++++++++
 package/yad/yad.hash  |  2 ++
 package/yad/yad.mk    | 24 ++++++++++++++++++++++++
 4 files changed, 50 insertions(+)
 create mode 100644 package/yad/Config.in
 create mode 100644 package/yad/yad.hash
 create mode 100644 package/yad/yad.mk

diff --git a/package/Config.in b/package/Config.in
index 13a7e74..351bb9a 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -289,6 +289,7 @@ comment "X applications"
 	source "package/xscreensaver/Config.in"
 	source "package/xterm/Config.in"
 	source "package/xvkbd/Config.in"
+	source "package/yad/Config.in"
 
 comment "X libraries and helper libraries"
 	source "package/libsexy/Config.in"
diff --git a/package/yad/Config.in b/package/yad/Config.in
new file mode 100644
index 0000000..ead2c44
--- /dev/null
+++ b/package/yad/Config.in
@@ -0,0 +1,23 @@
+config BR2_PACKAGE_YAD
+	bool "yad"
+	depends on BR2_PACKAGE_XORG7
+	depends on BR2_PACKAGE_LIBGTK2 || BR2_PACKAGE_LIBGTK3
+	select BR2_PACKAGE_LIBGLIB2
+	help
+	  YAD (yet another dialog) is a tool for create graphical dialogs
+	  from shell scripts.
+
+	  http://sourceforge.net/projects/yad-dialog/
+
+if BR2_PACKAGE_YAD
+
+config BR2_PACKAGE_YAD_FORCE_LIBGTK2
+	bool "Force libgtk2"
+	depends on BR2_PACKAGE_LIBGTK2 && BR2_PACKAGE_LIBGTK3
+	help
+	  Force YAD to be built with libgtk2.
+
+endif
+
+comment "yad needs libgtk2 or libgtk3"
+	depends on !BR2_PACKAGE_LIBGTK2 && !BR2_PACKAGE_LIBGTK3
diff --git a/package/yad/yad.hash b/package/yad/yad.hash
new file mode 100644
index 0000000..b86b815
--- /dev/null
+++ b/package/yad/yad.hash
@@ -0,0 +1,2 @@
+# Locally computed
+sha256 c7b79ff8189222a642e90052590e3ceb6c3d70623346096c1987f695ebf694b1 yad-0.28.1.tar.xz
diff --git a/package/yad/yad.mk b/package/yad/yad.mk
new file mode 100644
index 0000000..630d3b3
--- /dev/null
+++ b/package/yad/yad.mk
@@ -0,0 +1,24 @@
+################################################################################
+#
+# yad
+#
+################################################################################
+
+YAD_VERSION = 0.28.1
+YAD_SOURCE = yad-$(YAD_VERSION).tar.xz
+YAD_SITE = http://sourceforge.net/projects/yad-dialog/files
+YAD_LICENSE = GPLv3
+YAD_LICENSE_FILES = COPYING
+YAD_DEPENDENCIES = host-intltool host-pkgconf libglib2
+
+YAD_CONF_OPTS = --enable-html=no
+
+ifeq ($(BR2_PACKAGE_LIBGTK3)$(BR2_PACKAGE_YAD_FORCE_LIBGTK2),y)
+YAD_DEPENDENCIES += libgtk3
+YAD_CONF_OPTS += --with-gtk=gtk3
+else
+YAD_DEPENDENCIES += libgtk2
+YAD_CONF_OPTS += --with-gtk=gtk2
+endif
+
+$(eval $(autotools-package))
-- 
1.9.5.msysgit.1

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

* [Buildroot] [PATCH 1/1] yad: new package
  2015-07-02 22:09 [Buildroot] [PATCH 1/1] yad: new package James Knight
@ 2015-07-03  5:31 ` Baruch Siach
  2015-07-03  7:49   ` Thomas Petazzoni
  0 siblings, 1 reply; 5+ messages in thread
From: Baruch Siach @ 2015-07-03  5:31 UTC (permalink / raw
  To: buildroot

Hi James,

On Thu, Jul 02, 2015 at 06:09:27PM -0400, James Knight wrote:
> Signed-off-by: James Knight <james.knight@rockwellcollins.com>
> ---
>  package/Config.in     |  1 +
>  package/yad/Config.in | 23 +++++++++++++++++++++++
>  package/yad/yad.hash  |  2 ++
>  package/yad/yad.mk    | 24 ++++++++++++++++++++++++
>  4 files changed, 50 insertions(+)
>  create mode 100644 package/yad/Config.in
>  create mode 100644 package/yad/yad.hash
>  create mode 100644 package/yad/yad.mk
> 
> diff --git a/package/Config.in b/package/Config.in
> index 13a7e74..351bb9a 100644
> --- a/package/Config.in
> +++ b/package/Config.in
> @@ -289,6 +289,7 @@ comment "X applications"
>  	source "package/xscreensaver/Config.in"
>  	source "package/xterm/Config.in"
>  	source "package/xvkbd/Config.in"
> +	source "package/yad/Config.in"
>  
>  comment "X libraries and helper libraries"
>  	source "package/libsexy/Config.in"
> diff --git a/package/yad/Config.in b/package/yad/Config.in
> new file mode 100644
> index 0000000..ead2c44
> --- /dev/null
> +++ b/package/yad/Config.in
> @@ -0,0 +1,23 @@
> +config BR2_PACKAGE_YAD
> +	bool "yad"
> +	depends on BR2_PACKAGE_XORG7
> +	depends on BR2_PACKAGE_LIBGTK2 || BR2_PACKAGE_LIBGTK3
> +	select BR2_PACKAGE_LIBGLIB2
> +	help
> +	  YAD (yet another dialog) is a tool for create graphical dialogs
> +	  from shell scripts.
> +
> +	  http://sourceforge.net/projects/yad-dialog/
> +
> +if BR2_PACKAGE_YAD
> +
> +config BR2_PACKAGE_YAD_FORCE_LIBGTK2
> +	bool "Force libgtk2"
> +	depends on BR2_PACKAGE_LIBGTK2 && BR2_PACKAGE_LIBGTK3

You need both gtk2 and gtk3?

> +	help
> +	  Force YAD to be built with libgtk2.

This doesn't match the dependency.

Generally though we prefer using 'select' for not so obvious dependencies as 
is this case. Since yad seems to optionally depend on either gtk3 or gtk2 (I 
took a peek below) something like the following should do

	select BR2_PACKAGE_LIBGTK3 if !BR2_PACKAGE_LIBGTK2

Don't forget to propagate your selected default gtk dependencies here.

> +endif
> +
> +comment "yad needs libgtk2 or libgtk3"
> +	depends on !BR2_PACKAGE_LIBGTK2 && !BR2_PACKAGE_LIBGTK3

This comment then becomes redundant.

> diff --git a/package/yad/yad.hash b/package/yad/yad.hash
> new file mode 100644
> index 0000000..b86b815
> --- /dev/null
> +++ b/package/yad/yad.hash
> @@ -0,0 +1,2 @@
> +# Locally computed
> +sha256 c7b79ff8189222a642e90052590e3ceb6c3d70623346096c1987f695ebf694b1 yad-0.28.1.tar.xz
> diff --git a/package/yad/yad.mk b/package/yad/yad.mk
> new file mode 100644
> index 0000000..630d3b3
> --- /dev/null
> +++ b/package/yad/yad.mk
> @@ -0,0 +1,24 @@
> +################################################################################
> +#
> +# yad
> +#
> +################################################################################
> +
> +YAD_VERSION = 0.28.1
> +YAD_SOURCE = yad-$(YAD_VERSION).tar.xz
> +YAD_SITE = http://sourceforge.net/projects/yad-dialog/files
> +YAD_LICENSE = GPLv3
> +YAD_LICENSE_FILES = COPYING
> +YAD_DEPENDENCIES = host-intltool host-pkgconf libglib2
> +
> +YAD_CONF_OPTS = --enable-html=no
> +
> +ifeq ($(BR2_PACKAGE_LIBGTK3)$(BR2_PACKAGE_YAD_FORCE_LIBGTK2),y)

This condition is true if either gtk3 or gtk2 are selected...

> +YAD_DEPENDENCIES += libgtk3
> +YAD_CONF_OPTS += --with-gtk=gtk3

but here you assume that gtk3 is enabled.

> +else
> +YAD_DEPENDENCIES += libgtk2
> +YAD_CONF_OPTS += --with-gtk=gtk2
> +endif
> +
> +$(eval $(autotools-package))

baruch

-- 
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -

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

* [Buildroot] [PATCH 1/1] yad: new package
  2015-07-03  5:31 ` Baruch Siach
@ 2015-07-03  7:49   ` Thomas Petazzoni
  2015-07-03 13:45     ` Peter Korsgaard
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas Petazzoni @ 2015-07-03  7:49 UTC (permalink / raw
  To: buildroot

Dear Baruch Siach,

On Fri, 3 Jul 2015 08:31:05 +0300, Baruch Siach wrote:

> > +
> > +if BR2_PACKAGE_YAD
> > +
> > +config BR2_PACKAGE_YAD_FORCE_LIBGTK2
> > +	bool "Force libgtk2"
> > +	depends on BR2_PACKAGE_LIBGTK2 && BR2_PACKAGE_LIBGTK3
> 
> You need both gtk2 and gtk3?

No, I think James idea here is that if the user has gtk2 *or* gtk3
enabled, then we don't need anything special: we'll use either of them.

However, if the user has enabled *both* gtk2 and gtk3, then we need to
know which one the user wants to use. This option therefore appears in
such a situation, and allows the user to either opt for gtk3 (option
disabled) or gtk2 (option enabled).

> > diff --git a/package/yad/yad.hash b/package/yad/yad.hash
> > new file mode 100644
> > index 0000000..b86b815
> > --- /dev/null
> > +++ b/package/yad/yad.hash
> > @@ -0,0 +1,2 @@
> > +# Locally computed
> > +sha256 c7b79ff8189222a642e90052590e3ceb6c3d70623346096c1987f695ebf694b1 yad-0.28.1.tar.xz
> > diff --git a/package/yad/yad.mk b/package/yad/yad.mk
> > new file mode 100644
> > index 0000000..630d3b3
> > --- /dev/null
> > +++ b/package/yad/yad.mk
> > @@ -0,0 +1,24 @@
> > +################################################################################
> > +#
> > +# yad
> > +#
> > +################################################################################
> > +
> > +YAD_VERSION = 0.28.1
> > +YAD_SOURCE = yad-$(YAD_VERSION).tar.xz
> > +YAD_SITE = http://sourceforge.net/projects/yad-dialog/files
> > +YAD_LICENSE = GPLv3
> > +YAD_LICENSE_FILES = COPYING
> > +YAD_DEPENDENCIES = host-intltool host-pkgconf libglib2
> > +
> > +YAD_CONF_OPTS = --enable-html=no
> > +
> > +ifeq ($(BR2_PACKAGE_LIBGTK3)$(BR2_PACKAGE_YAD_FORCE_LIBGTK2),y)
> 
> This condition is true if either gtk3 or gtk2 are selected...

No, this condition is true if gtk3 is there *and*
BR2_PACKAGE_YAD_FORCE_LIBGTK2 is disabled, which means that we want to
use gtk3, because we are in one of the two possible situations:

 * only gtk3 is enabled -> we want to use it

 * both gtk3 and gtk2 are enabled, but since
   BR2_PACKAGE_YAD_FORCE_LIBGTK2 is enabled, it means the user wants to
   use gtk3

Since there is no way for BR2_PACKAGE_YAD_FORCE_LIBGTK2 to be true
without BR2_PACKAGE_LIBGTK3 being true, it works fine.

But I agree it's a bit tricky. James, what do you think instead to have
a simpler (though admittedly somewhat less flexible) solution, as
proposed by Baruch:

	select BR2_PACKAGE_LIBGTK3 if !BR2_PACKAGE_LIBGTK2

and then use gtk3 if available, otherwise gtk2 if available. Thanks to
the select, you're sure at least one of the two will be available. The
only thing you give up is that the user cannot select to use gtk2 if he
has both gtk2 and gtk3 in the same system. But:

	1/ situations with both gtk2 and gtk3 are pretty unlikely

	2/ if you have both, why would you *not* want to use gtk3 ?

Thanks,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* [Buildroot] [PATCH 1/1] yad: new package
  2015-07-03  7:49   ` Thomas Petazzoni
@ 2015-07-03 13:45     ` Peter Korsgaard
  2015-07-03 15:44       ` James Knight
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Korsgaard @ 2015-07-03 13:45 UTC (permalink / raw
  To: buildroot

>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@free-electrons.com> writes:

Hi,

 >> > +
 >> > +if BR2_PACKAGE_YAD
 >> > +
 >> > +config BR2_PACKAGE_YAD_FORCE_LIBGTK2
 >> > +	bool "Force libgtk2"
 >> > +	depends on BR2_PACKAGE_LIBGTK2 && BR2_PACKAGE_LIBGTK3
 >> 
 >> You need both gtk2 and gtk3?

 > No, I think James idea here is that if the user has gtk2 *or* gtk3
 > enabled, then we don't need anything special: we'll use either of them.

 > However, if the user has enabled *both* gtk2 and gtk3, then we need to
 > know which one the user wants to use. This option therefore appears in
 > such a situation, and allows the user to either opt for gtk3 (option
 > disabled) or gtk2 (option enabled).

Ok, but that really a common enough situation to add such an option?
E.G. how often do people have a config where:

- They have enabled BOTH gtk2 and gtk3
- They are not happy with yad using gtk3

E.G. the Debian package simply uses the gtk3 backend.

If we really want to do it then I think it would be clearer to have
a choice option, E.G.:

choice
        prompt "backend to use" if BR2_PACKAGE_LIBGTK2 && BR2_PACKAGE_LIBGTK3

config BR2_PACKAGE_YAD_GTK3
       depends on BR2_PACKAGE_LIBGTK3
       prompt "gtk3"

config BR2_PACKAGE_YAD_GTK2
       depends on BR2_PACKAGE_LIBGTK2
       prompt "gtk2"

endchoice

 >> > +ifeq ($(BR2_PACKAGE_LIBGTK3)$(BR2_PACKAGE_YAD_FORCE_LIBGTK2),y)
 >> 
 >> This condition is true if either gtk3 or gtk2 are selected...

 > No, this condition is true if gtk3 is there *and*
 > BR2_PACKAGE_YAD_FORCE_LIBGTK2 is disabled, which means that we want to
 > use gtk3, because we are in one of the two possible situations:

 >  * only gtk3 is enabled -> we want to use it

 >  * both gtk3 and gtk2 are enabled, but since
 >    BR2_PACKAGE_YAD_FORCE_LIBGTK2 is enabled, it means the user wants to
 >    use gtk3

For those situations where we want to check for A and !B we often stick
a dummy character like 'x' in between to make it clearer - E.G.

ifeq ($(BR2_PACKAGE_LIBGTK3)x$(BR2_PACKAGE_YAD_FORCE_LIBGTK2),yx)

git grep ,yx
package/cairo/cairo.mk:ifeq ($(BR2_PACKAGE_DIRECTFB)x$(BR2_PACKAGE_DIRECTFB_SVG),yx)
package/ffmpeg/ffmpeg.mk:ifeq ($(BR2_PACKAGE_FFMPEG_GPL)x$(BR2_PACKAGE_FFMPEG_NONFREE),yx)
package/ipmiutil/ipmiutil.mk:ifeq ($(BR2_PACKAGE_OPENSSL)x$(BR2_STATIC_LIBS),yx)
package/iproute2/iproute2.mk:ifeq ($(BR2_PACKAGE_IPTABLES)x$(BR2_STATIC_LIBS),yx)
package/libsrtp/libsrtp.mk:ifeq ($(BR2_PACKAGE_OPENSSL)x$(BR2_STATIC_LIBS),yx)

A comment explaining this would also be good.


 > and then use gtk3 if available, otherwise gtk2 if available. Thanks to
 > the select, you're sure at least one of the two will be available. The
 > only thing you give up is that the user cannot select to use gtk2 if he
 > has both gtk2 and gtk3 in the same system. But:

 > 	1/ situations with both gtk2 and gtk3 are pretty unlikely

 > 	2/ if you have both, why would you *not* want to use gtk3 ?

Indeed.

-- 
Bye, Peter Korsgaard

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

* [Buildroot] [PATCH 1/1] yad: new package
  2015-07-03 13:45     ` Peter Korsgaard
@ 2015-07-03 15:44       ` James Knight
  0 siblings, 0 replies; 5+ messages in thread
From: James Knight @ 2015-07-03 15:44 UTC (permalink / raw
  To: buildroot

Gentlemen,

I'll just go straight to the two (2) issues I believe we are down to.

On Fri, Jul 3, 2015 at 9:45 AM, Peter Korsgaard <peter@korsgaard.com> wrote:
> Ok, but that really a common enough situation to add such an option?
> E.G. how often do people have a config where:
>
> - They have enabled BOTH gtk2 and gtk3
> - They are not happy with yad using gtk3

Maybe I have an odd setup but I actually have both gtk2 and gtk3 for
my configuration. The intent of enabling both was to maintain support
for some legacy software on my target as well as provide the means for
new updates/capabilities.

For myself, I'm in a situation where I do not want yad to use gtk3;
however my reasons might not be worthy enough. Truthfully, the issue I
am experiencing is that I have not had time to create a gtk3 theme
that matches my target's gtk2 theme. So, using yad with gtk3 yields
some very plain dialogs. To get it working (quickly) in my situation,
I just wanted the capability to force the package to use gtk2 and
worry about other stuff for now (until I can go back and look at gtk3
theming).

> For those situations where we want to check for A and !B we often stick
> a dummy character like 'x' in between to make it clearer - E.G.
>
> ifeq ($(BR2_PACKAGE_LIBGTK3)x$(BR2_PACKAGE_YAD_FORCE_LIBGTK2),yx)
>...
> A comment explaining this would also be good.

This is a more clear approach I was looking for (frustrated that I
cannot think of them or find them until after I submit a patch).

--

I don't mind adjusting the patch and dropping the ability to change
the gtk backend to make things simpler. I'll just modify my own
repository to restrict to gtk2. In the end, this might be the better
approach: a simple make file and if a package supports gtk3 it should
most likely be using it.

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

end of thread, other threads:[~2015-07-03 15:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-02 22:09 [Buildroot] [PATCH 1/1] yad: new package James Knight
2015-07-03  5:31 ` Baruch Siach
2015-07-03  7:49   ` Thomas Petazzoni
2015-07-03 13:45     ` Peter Korsgaard
2015-07-03 15:44       ` James Knight

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.