Skip to contentSkip to conversation

yad: new package

PATCH Superseded James Knight 4 participants 5 messages Jul 2, 2015 – Jul 3, 2015

v1 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 yad: new package

---
 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
package/Config.in +1 -0
index 13a7e74..351bb9a 100644
@@ -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"
package/yad/Config.in new file +23 -0
new file mode 100644
index 0000000..ead2c44
@@ -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
package/yad/yad.hash new file +2 -0
new file mode 100644
index 0000000..b86b815
@@ -0,0 +1,2 @@
+# Locally computed
+sha256 c7b79ff8189222a642e90052590e3ceb6c3d70623346096c1987f695ebf694b1 yad-0.28.1.tar.xz
package/yad/yad.mk new file +24 -0
new file mode 100644
index 0000000..630d3b3
@@ -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))
Signature · 1 line
1.9.5.msysgit.1
#1 lore raw

PATCH 1/1 yad: new package

Hi James,

Quoted 35 lines · James Knight
---
 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
package/Config.in +1 -0
index 13a7e74..351bb9a 100644
@@ -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"
package/yad/Config.in new file +6 -0
new file mode 100644
index 0000000..ead2c44
@@ -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

package/yad/Config.in line 16

Quoted 10 lines
package/yad/Config.in new file +10 -0
+	  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?

package/yad/Config.in line 18

Quoted 2 lines
package/yad/Config.in new file +2 -0
+	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.

package/yad/Config.in line 23

Quoted 4 lines
package/yad/Config.in new file +4 -0
+endif
+
+comment "yad needs libgtk2 or libgtk3"
+	depends on !BR2_PACKAGE_LIBGTK2 && !BR2_PACKAGE_LIBGTK3

This comment then becomes redundant.

Quoted 20 lines
package/yad/yad.hash new file +2 -0
new file mode 100644
index 0000000..b86b815
@@ -0,0 +1,2 @@
+# Locally computed
+sha256 c7b79ff8189222a642e90052590e3ceb6c3d70623346096c1987f695ebf694b1 yad-0.28.1.tar.xz
package/yad/yad.mk new file +6 -0
new file mode 100644
index 0000000..630d3b3
@@ -0,0 +1,24 @@
+################################################################################
+#
+# yad
+#
+################################################################################
+

package/yad/yad.mk line 16

Quoted 10 lines
package/yad/yad.mk new file +10 -0
+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...

package/yad/yad.mk line 18

Quoted 2 lines
package/yad/yad.mk new file +2 -0
+YAD_DEPENDENCIES += libgtk3
+YAD_CONF_OPTS += --with-gtk=gtk3

but here you assume that gtk3 is enabled.

package/yad/yad.mk line 24

Quoted 6 lines
package/yad/yad.mk new file +6 -0
+else
+YAD_DEPENDENCIES += libgtk2
+YAD_CONF_OPTS += --with-gtk=gtk2
+endif
+
+$(eval $(autotools-package))

baruch

Signature · 3 lines
     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 -
#2 lore raw

PATCH 1/1 yad: new package

Dear Baruch Siach,

Quoted 8 lines · Baruch Siach

package/yad/Config.in line 16

Quoted 6 lines
package/yad/Config.in new file +6 -0
+
+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).

Quoted 24 lines
Quoted 24 lines
package/yad/yad.hash new file +2 -0
new file mode 100644
index 0000000..b86b815
@@ -0,0 +1,2 @@
+# Locally computed
+sha256 c7b79ff8189222a642e90052590e3ceb6c3d70623346096c1987f695ebf694b1 yad-0.28.1.tar.xz
package/yad/yad.mk new file +10 -0
new file mode 100644
index 0000000..630d3b3
@@ -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
Quoted 8 lines

package/yad/yad.mk line 16

Quoted 6 lines
package/yad/yad.mk new file +6 -0
+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

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#3 lore raw

PATCH 1/1 yad: new package

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

Hi,

Quoted 9 lines
Quoted 8 lines

package/yad/Config.in line 16

Quoted 6 lines
package/yad/Config.in new file +6 -0
+
+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?

Quoted 7 lines

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

Quoted 8 lines
Quoted 3 lines
Quoted 1 line

+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:

Quoted 5 lines

* 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.

Quoted 8 lines

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.

Signature · 1 line
Bye, Peter Korsgaard
#4 lore raw

PATCH 1/1 yad: new package

Gentlemen,

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

Quoted 5 lines · Peter Korsgaard

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).

Quoted 6 lines

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.