commit:     f523cdc975e9726f259f5f661332e57e9e499b26
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Jun 19 14:50:49 2019 +0000
Commit:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Wed Jun 19 15:03:42 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f523cdc9

media-sound/mumble: Build multilib libmumble.so*

Closes: https://bugs.gentoo.org/267441
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>

 media-sound/mumble/mumble-9999.ebuild | 40 ++++++++++++++++++++++++++---------
 1 file changed, 30 insertions(+), 10 deletions(-)

diff --git a/media-sound/mumble/mumble-9999.ebuild 
b/media-sound/mumble/mumble-9999.ebuild
index d15c4124e79..30b2055c37f 100644
--- a/media-sound/mumble/mumble-9999.ebuild
+++ b/media-sound/mumble/mumble-9999.ebuild
@@ -3,7 +3,7 @@
 
 EAPI=7
 
-inherit desktop qmake-utils xdg
+inherit desktop multilib-build qmake-utils xdg
 
 DESCRIPTION="Mumble is an open source, low-latency, high quality voice chat 
software"
 HOMEPAGE="https://wiki.mumble.info";
@@ -63,6 +63,8 @@ BDEPEND="
        virtual/pkgconfig
 "
 
+# NB: qmake does not support multilib but it's fine to configure
+# for the native ABI here
 src_configure() {
        myuse() {
                [[ -n "${1}" ]] || die "myuse: No use option given"
@@ -97,16 +99,36 @@ src_configure() {
                DEFINES+="PLUGIN_PATH=/usr/$(get_libdir)/mumble"
 }
 
-src_install() {
-       newdoc README.Linux README
-       dodoc CHANGES
+multilib_src_compile() {
+       local emake_args=(
+               # place libmumble* in a subdirectory
+               DESTDIR_ADD="/${MULTILIB_ABI_FLAG}"
+               {C,L}FLAGS_ADD="$(get_abi_CFLAGS)"
+       )
+       # build only overlay library for other ABIs
+       multilib_is_native_abi || emake_args+=( -C overlay_gl )
+       emake "${emake_args[@]}"
+       emake clean
+}
+
+src_compile() {
+       multilib_foreach_abi multilib_src_compile
+}
 
-       local dir=release
-       if use debug; then
-               dir=debug
+multilib_src_install() {
+       local dir=$(usex debug debug release)
+       dolib.so "${dir}/${MULTILIB_ABI_FLAG}"/libmumble.so*
+       if multilib_is_native_abi; then
+               dobin "${dir}"/mumble
+               dolib.so "${dir}"/libcelt0.so* "${dir}"/plugins/lib*.so*
        fi
+}
+
+src_install() {
+       multilib_foreach_abi multilib_src_install
 
-       dobin "${dir}"/mumble
+       newdoc README.Linux README
+       dodoc CHANGES
        dobin scripts/mumble-overlay
 
        insinto /usr/share/services
@@ -118,8 +140,6 @@ src_install() {
 
        doman man/mumble-overlay.1
        doman man/mumble.1
-
-       dolib.so "${dir}"/libmumble.so* "${dir}"/libcelt0.so* 
"${dir}"/plugins/lib*.so*
 }
 
 pkg_preinst() {

Reply via email to