Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 482816 - net-misc/putty add USE flag for building CLI tools only
Summary: net-misc/putty add USE flag for building CLI tools only
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Jeroen Roovers (RETIRED)
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2013-08-28 15:00 UTC by Tiziano Müller (RETIRED)
Modified: 2013-09-04 17:23 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tiziano Müller (RETIRED) gentoo-dev 2013-08-28 15:00:16 UTC
It is possible to build only the command line utilities in the putty package when passing --without-gtk. You then end up with puttygen, psftp, pscp and plink. Since I need only puttygen on a server I patched an ebuild locally according to:

--- putty-0.63.ebuild	2013-08-08 14:33:45.000000000 +0200
+++ putty-0.63-r1.ebuild	2013-08-28 16:45:33.000000000 +0200
@@ -14,17 +14,17 @@
 LICENSE="MIT"
 
 SLOT="0"
-KEYWORDS="alpha amd64 ~hppa ppc sparc x86"
-IUSE="doc ipv6 kerberos"
+KEYWORDS="~alpha ~amd64 ~hppa ~ppc ~sparc ~x86"
+IUSE="doc +gtk ipv6 kerberos"
 
 RDEPEND="
 	!net-misc/pssh
-	dev-libs/glib
 	kerberos? ( virtual/krb5 )
-	x11-libs/gdk-pixbuf
+	gtk? ( x11-libs/gdk-pixbuf
 	x11-libs/gtk+:2
 	x11-libs/libX11
 	x11-libs/pango
+		dev-libs/glib )
 "
 DEPEND="
 	${RDEPEND}
@@ -44,7 +44,9 @@
 
 src_configure() {
 	cd "${S}"/unix || die
-	econf $(use_with kerberos gssapi)
+	econf \
+		$(use_with kerberos gssapi) \
+		$(use_with gtk)
 }
 
 src_compile() {
@@ -62,22 +64,24 @@
 	cd "${S}"/unix || die
 	default
 
+	if use gtk ; then
 	for i in 16 22 24 32 48 64 128 256; do
 		newicon -s ${i} "${WORKDIR}"/${PN}-icons/${PN}-${i}.png ${PN}.png
 	done
 
 	# install desktop file provided by Gustav Schaffter in #49577
 	make_desktop_entry ${PN} PuTTY ${PN} Network
+	fi
 }
 
 pkg_preinst() {
-	gnome2_icon_savelist
+	use gtk && gnome2_icon_savelist
 }
 
 pkg_postinst() {
-	gnome2_icon_cache_update
+	use gtk && gnome2_icon_cache_update
 }
 
 pkg_postrm() {
-	gnome2_icon_cache_update
+	use gtk && gnome2_icon_cache_update
 }

and added the following description to metadata.xml:

Index: metadata.xml
===================================================================
RCS file: /var/cvsroot/gentoo-x86/net-misc/putty/metadata.xml,v
retrieving revision 1.4
diff -r1.4 metadata.xml
14a15,17
> 	<use>
> 		<flag name='gtk'>Build the GUI tools which use <pkg>x11-libs/gtk+:2</pkg></flag>
> 	</use>



Any objections if I commit that to the tree?
Would you prefer a different USE flag?
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2013-08-28 16:17:43 UTC
I trust the ebuild patch is OK, but the description should clearly state that USE=gtk means building putty itself, which is what most people would be looking for, rather than the CLI tools.
Comment 2 Tiziano Müller (RETIRED) gentoo-dev 2013-08-29 10:05:06 UTC
How about the following?

Build the Putty client which requires <pkg>x11-libs/gtk+:2</pkg>. Otherwise only the CLI tools puttygen, plink, pscp and psftp will be built.
Comment 3 Jeroen Roovers (RETIRED) gentoo-dev 2013-09-04 16:07:30 UTC
(In reply to Tiziano Müller from comment #2)
> How about the following?
> 
> Build the Putty client which requires <pkg>x11-libs/gtk+:2</pkg>. Otherwise
> only the CLI tools puttygen, plink, pscp and psftp will be built.

It's PuTTY, actually. Otherwise that looks fine.
Comment 4 Tiziano Müller (RETIRED) gentoo-dev 2013-09-04 17:23:35 UTC
committed with the correction, thanks.