Re: [gentoo-dev] [PATCH] qmake-utils.eclass: add qt{4,5}_get_bindir helper functions

2015-02-25 Thread Ben de Groot
On 20 February 2015 at 04:06, Jeroen Roovers  wrote:
> On Wed, 18 Feb 2015 19:58:29 +0800
> Ben de Groot  wrote:
>
>> The attached patch proposes two helper functions to be added to
>> qmake-utils.eclass. These functions echo the correct directory where
>> qt binaries such as moc and lrelease are located. They can be used in
>> ebuilds when such binaries need to be called directly. (Ebuilds should
>> not rely on qtchooser for this.)
>>
>> Please review before I commit.
>
> Looks good (barring what Davide noted).
>
> Do you have a list of ebuilds that might benefit?
>
> I know net-analyzer/wireshark might, but it doesn't even use
> qmake-utils.eclass right now simply because it doesn't use qmake (but it
> does use moc and uic, so I wouldn't expect to find those functions in an
> eclass seemingly about qmake).
>

Committed, with improvements by Davide.

Based on a quick qgrep for lrelease/moc/uic, packages that would benefit are:

app-cdr/qpxtool
app-crypt/pinentry
app-editors/znotes
app-text/diffpdf
app-text/qpdfview
dev-util/universalindentgui
games-board/qgo
games-emulation/higan
games-kids/cubetest
games-util/higan-purify
media-sound/lastfmplayer
media-sound/musescore
media-video/smplayer
media-video/videocut
media-video/vlc
media-video/xvideoservicethief
net-analyzer/wireshark
net-im/psi
net-im/skype
net-p2p/transmission
sci-calculators/speedcrunch
sci-geosciences/gpsbabel
sci-geosciences/merkaartor
sci-visualization/qtiplot/
sys-boot/unetbootin

-- 
Cheers,

Ben | yngwin
Gentoo developer



Re: [gentoo-dev] [PATCH] qmake-utils.eclass: add qt{4,5}_get_bindir helper functions

2015-02-19 Thread Jeroen Roovers
On Wed, 18 Feb 2015 19:58:29 +0800
Ben de Groot  wrote:

> The attached patch proposes two helper functions to be added to
> qmake-utils.eclass. These functions echo the correct directory where
> qt binaries such as moc and lrelease are located. They can be used in
> ebuilds when such binaries need to be called directly. (Ebuilds should
> not rely on qtchooser for this.)
> 
> Please review before I commit.

Looks good (barring what Davide noted).

Do you have a list of ebuilds that might benefit?

I know net-analyzer/wireshark might, but it doesn't even use
qmake-utils.eclass right now simply because it doesn't use qmake (but it
does use moc and uic, so I wouldn't expect to find those functions in an
eclass seemingly about qmake).


 jer



[gentoo-dev] [PATCH] qmake-utils.eclass: add qt{4,5}_get_bindir helper functions

2015-02-18 Thread Ben de Groot
The attached patch proposes two helper functions to be added to
qmake-utils.eclass. These functions echo the correct directory where
qt binaries such as moc and lrelease are located. They can be used in
ebuilds when such binaries need to be called directly. (Ebuilds should
not rely on qtchooser for this.)

Please review before I commit.

-- 
Cheers,

Ben | yngwin
Gentoo developer
--- gentoo-x86/eclass/qmake-utils.eclass	2014-11-22 11:04:23.765870730 +0800
+++ overlay/qt/eclass/qmake-utils.eclass	2015-02-11 23:10:51.067484243 +0800
@@ -51,6 +51,25 @@
 	esac
 }

+# @FUNCTION qt4_get_bindir
+# @DESCRIPTION:
+# Get the correct location of Qt4's installed binaries.
+qt4_get_bindir() {
+	local qtbindir=${EPREFIX}/usr/$(get_libdir)/qt4/bin
+	if [[ -x ${qtbindir} ]]; then
+		echo ${qtbindir}
+	else
+		echo ${EPREFIX}/usr/bin
+	fi
+}
+
+# @FUNCTION qt5_get_bindir
+# @DESCRIPTION:
+# Get the correct location of Qt5's installed binaries.
+qt5_get_bindir() {
+	echo ${EPREFIX}/usr/$(get_libdir)/qt5/bin
+}
+
 # @VARIABLE: EQMAKE4_EXCLUDE
 # @DEFAULT_UNSET
 # @DESCRIPTION:
@@ -158,11 +177,7 @@

 	[[ -n ${EQMAKE4_EXCLUDE} ]] && eshopts_pop

-	# determine qmake binary location
-	local qmake_path=${EPREFIX}/usr/$(get_libdir)/qt4/bin/qmake
-	[[ ! -x ${qmake_path} ]] && qmake_path=${EPREFIX}/usr/bin/qmake
-
-	"${qmake_path}" \
+	"$(qt4_get_bindir)"/qmake \
 		-makefile \
 		QMAKE_AR="$(tc-getAR) cqs" \
 		QMAKE_CC="$(tc-getCC)" \
@@ -213,7 +228,7 @@

 	ebegin "Running qmake"

-	"${EPREFIX}"/usr/$(get_libdir)/qt5/bin/qmake \
+	"$(qt5_get_bindir)"/qmake \
 		-makefile \
 		QMAKE_AR="$(tc-getAR) cqs" \
 		QMAKE_CC="$(tc-getCC)" \