public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCH] qmake-utils.eclass: add qt{4,5}_get_bindir helper functions
@ 2015-02-18 11:58 Ben de Groot
  2015-02-18 14:08 ` [gentoo-dev] " Davide Pesavento
  2015-02-19 20:06 ` [gentoo-dev] " Jeroen Roovers
  0 siblings, 2 replies; 4+ messages in thread
From: Ben de Groot @ 2015-02-18 11:58 UTC (permalink / raw
  To: gentoo-dev; +Cc: Gentoo Qt herd

[-- Attachment #1: Type: text/plain, Size: 383 bytes --]

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

[-- Attachment #2: qmake-utils.eclass.patch --]
[-- Type: text/x-patch, Size: 1252 bytes --]

--- 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)" \

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

* [gentoo-dev] Re: [PATCH] qmake-utils.eclass: add qt{4,5}_get_bindir helper functions
  2015-02-18 11:58 [gentoo-dev] [PATCH] qmake-utils.eclass: add qt{4,5}_get_bindir helper functions Ben de Groot
@ 2015-02-18 14:08 ` Davide Pesavento
  2015-02-19 20:06 ` [gentoo-dev] " Jeroen Roovers
  1 sibling, 0 replies; 4+ messages in thread
From: Davide Pesavento @ 2015-02-18 14:08 UTC (permalink / raw
  To: Ben de Groot; +Cc: gentoo-dev, Gentoo Qt herd

On Wed, Feb 18, 2015 at 12:58 PM, Ben de Groot <yngwin@gentoo.org> 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.
>

Thanks Ben.

The -x test on line 59 should be a -d.

Also, I'd rephrase the description as follows:
"Echoes the directory where Qt{4,5} binaries are installed."

And you're missing a colon after @FUNCTION.

Thanks,
Davide


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

* Re: [gentoo-dev] [PATCH] qmake-utils.eclass: add qt{4,5}_get_bindir helper functions
  2015-02-18 11:58 [gentoo-dev] [PATCH] qmake-utils.eclass: add qt{4,5}_get_bindir helper functions Ben de Groot
  2015-02-18 14:08 ` [gentoo-dev] " Davide Pesavento
@ 2015-02-19 20:06 ` Jeroen Roovers
  2015-02-26  2:01   ` Ben de Groot
  1 sibling, 1 reply; 4+ messages in thread
From: Jeroen Roovers @ 2015-02-19 20:06 UTC (permalink / raw
  To: gentoo-dev

On Wed, 18 Feb 2015 19:58:29 +0800
Ben de Groot <yngwin@gentoo.org> 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


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

* Re: [gentoo-dev] [PATCH] qmake-utils.eclass: add qt{4,5}_get_bindir helper functions
  2015-02-19 20:06 ` [gentoo-dev] " Jeroen Roovers
@ 2015-02-26  2:01   ` Ben de Groot
  0 siblings, 0 replies; 4+ messages in thread
From: Ben de Groot @ 2015-02-26  2:01 UTC (permalink / raw
  To: gentoo-dev

On 20 February 2015 at 04:06, Jeroen Roovers <jer@gentoo.org> wrote:
> On Wed, 18 Feb 2015 19:58:29 +0800
> Ben de Groot <yngwin@gentoo.org> 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


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

end of thread, other threads:[~2015-02-26  2:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-18 11:58 [gentoo-dev] [PATCH] qmake-utils.eclass: add qt{4,5}_get_bindir helper functions Ben de Groot
2015-02-18 14:08 ` [gentoo-dev] " Davide Pesavento
2015-02-19 20:06 ` [gentoo-dev] " Jeroen Roovers
2015-02-26  2:01   ` Ben de Groot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox