x11-misc/gtkdialog: Make gnome-base/libglade and x11-libs/vte dependencies optional...
authorJeroen Roovers <jer@gentoo.org>
Sat, 17 Oct 2015 07:39:56 +0000 (09:39 +0200)
committerJeroen Roovers <jer@gentoo.org>
Sat, 17 Oct 2015 07:40:22 +0000 (09:40 +0200)
Package-Manager: portage-2.2.23

x11-misc/gtkdialog/files/gtkdialog-0.8.3-optdeps.patch [new file with mode: 0644]
x11-misc/gtkdialog/gtkdialog-0.8.3-r1.ebuild [moved from x11-misc/gtkdialog/gtkdialog-0.8.3.ebuild with 60% similarity]
x11-misc/gtkdialog/metadata.xml

diff --git a/x11-misc/gtkdialog/files/gtkdialog-0.8.3-optdeps.patch b/x11-misc/gtkdialog/files/gtkdialog-0.8.3-optdeps.patch
new file mode 100644 (file)
index 0000000..e032c12
--- /dev/null
@@ -0,0 +1,62 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -25,32 +25,40 @@
+ AC_PROG_YACC
+ AC_SUBST(YACC)
+ 
++PKG_PROG_PKG_CONFIG([0.24])
++
+ # Checks for libraries.
+-pkg_modules="gtk+-2.0 >= 2.0.0"
+-PKG_CHECK_MODULES(GTK, [$pkg_modules])
++PKG_CHECK_MODULES(GTK, [gtk+-2.0 >= 2.0.0])
+ AC_SUBST(GTK_CFLAGS)
+ AC_SUBST(GTK_LIBS)
+ 
+-pkg_modules="gthread-2.0"
+-PKG_CHECK_MODULES(GTHREAD, [$pkg_modules])
++PKG_CHECK_MODULES(GTHREAD, [gthread-2.0])
+ AC_SUBST(GTHREAD_CFLAGS)
+ AC_SUBST(GTHREAD_LIBS)
+ 
+-glade_lib="libglade-2.0"
+-PKG_CHECK_MODULES([GLADE_LIB], \
+-      [$glade_lib], \
+-      AC_SUBST(HAVE_GLADE_LIB, 1),\
+-      AC_SUBST(HAVE_GLADE_LIB, 0))
+-AC_SUBST(GLADE_LIB_CFLAGS)
+-AC_SUBST(GLADE_LIB_LIBS)
+-
+-vte_lib="vte >= 0.23.5"
+-PKG_CHECK_MODULES([VTE], \
+-      [$vte_lib], \
+-      AC_SUBST(HAVE_VTE, 1),\
+-      AC_SUBST(HAVE_VTE, 0))
+-AC_SUBST(VTE_CFLAGS)
+-AC_SUBST(VTE_LIBS)
++AC_ARG_WITH([glade],
++  AS_HELP_STRING([--with-glade], [enable support for libglade])
++)
++
++AC_ARG_WITH([vte],
++  AS_HELP_STRING([--with-vte], [enable support for vte])
++)
++
++AS_IF(
++  [test "x$with_glade" = "xyes"],
++  [PKG_CHECK_MODULES([GLADE_LIB], [libglade-2.0], [have_glade_lib=1], AC_MSG_ERROR([glade requested but not found]))],
++  [test "x$with_glade" = "xno"],
++  [have_glade_lib=0]
++)
++AC_SUBST([HAVE_GLADE_LIB], [$have_glade_lib])
++
++AS_IF(
++  [test "x$with_vte" = "xyes"],
++  [PKG_CHECK_MODULES([VTE], [vte >= 0.23.5], [have_vte=1], AC_MSG_ERROR([vte requested but not found]))],
++  [test "x$with_vte" = "xno"],
++  [have_vte=0]
++)
++AC_SUBST([HAVE_VTE], [$have_vte])
+ 
+ # Checks for header files.
+ AC_CHECK_HEADERS([locale.h])
similarity index 60%
rename from x11-misc/gtkdialog/gtkdialog-0.8.3.ebuild
rename to x11-misc/gtkdialog/gtkdialog-0.8.3-r1.ebuild
index 97bea1365ea64950b963d6bd64dbb39462ce21b9..36198e49472156e8f8936c722812fd8046668fea 100644 (file)
@@ -2,7 +2,8 @@
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 
-EAPI=4
+EAPI=5
+inherit autotools eutils
 
 DESCRIPTION="A small utility for fast and easy GUI building"
 HOMEPAGE="https://code.google.com/p/gtkdialog/"
@@ -11,17 +12,32 @@ SRC_URI="https://${PN}.googlecode.com/files/${P}.tar.gz"
 LICENSE="GPL-2"
 SLOT="0"
 KEYWORDS="~amd64 ~ppc ~x86"
-IUSE=""
+IUSE="glade vte"
 
-RDEPEND="x11-libs/gtk+:2
-       gnome-base/libglade"
-DEPEND="${RDEPEND}
+RDEPEND="
+       x11-libs/gtk+:2
+       glade? ( gnome-base/libglade )
+       vte? ( x11-libs/vte:= )
+"
+DEPEND="
+       ${RDEPEND}
        virtual/pkgconfig
        sys-devel/flex
-       virtual/yacc"
+       virtual/yacc
+"
 
 DOCS=( AUTHORS ChangeLog TODO )
 
+src_prepare() {
+       mv configure.{in,ac} || die
+       epatch "${FILESDIR}"/${PN}-0.8.3-optdeps.patch
+       eautoreconf
+}
+
+src_configure() {
+       econf $(use_with glade) $(use_with vte)
+}
+
 src_install() {
        # Stop make install from running gtk-update-icon-cache
        emake DESTDIR="${D}" UPDATE_ICON_CACHE=true install
index f66a06401dd05fd0a9c3f6d542df6aad043c940b..03bfd68ad51598cce38112db75d285df2e35f776 100644 (file)
@@ -1,15 +1,21 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
 <pkgmetadata>
-       <herd>desktop-misc</herd>
-       <longdescription>gtkdialog is a GUI-creation utility that can be used with an arbitrary
-       interpreter. It enables the programmer to describe a graphical user 
-       interface in a simple XML-like language, and use it with any 
-       interpreter that supports either files, standard I/O, or environment 
-       variables. It can be called as an external program from the 
-       interpreter, but can be used as a stand-alone framework for the 
-       application as well. Stand-alone, bash, and awk examples are provided.</longdescription>
-       <upstream>
-               <remote-id type="google-code">gtkdialog</remote-id>
-       </upstream>
+<herd>desktop-misc</herd>
+<longdescription>
+gtkdialog is a GUI-creation utility that can be used with an arbitrary
+interpreter. It enables the programmer to describe a graphical user interface
+in a simple XML-like language, and use it with any interpreter that supports
+either files, standard I/O, or environment variables. It can be called as an
+external program from the interpreter, but can be used as a stand-alone
+framework for the application as well. Stand-alone, bash, and awk examples are
+provided.
+</longdescription>
+<upstream>
+<remote-id type="google-code">gtkdialog</remote-id>
+</upstream>
+<use>
+<flag name='glade'>Enable support for <pkg>gnome-base/libglade</pkg></flag>
+<flag name='vte'>Enable support for <pkg>x11-libs/vte</pkg></flag>
+</use>
 </pkgmetadata>