mumble-voip / mumble

Mumble is an open-source, low-latency, high quality voice chat software.
https://www.mumble.info
Other
6.28k stars 1.11k forks source link

Don't install bundled libcelt system-wide #3519

Closed haasn closed 5 years ago

haasn commented 6 years ago

When building mumble (via the gentoo-9999 ebuild), it refuses to merge because of file collisions against libcelt0.so:

 * package media-sound/mumble-9999 NOT merged
 * 
 * Detected file collision(s):
 * 
 *  /usr/lib64/libcelt0.so
 * 
 * Searching all installed packages for file collisions...
 * 
 * Press Ctrl-C to Stop
 * 
 * media-libs/celt-0.11.3:0::gentoo
 *  /usr/lib64/libcelt0.so

Configuration:

/usr/lib64/qt5/bin/qmake -o Makefile /var/tmp/portage/media-sound/mumble-9999/work/mumble-9999/src/mumble_proto/mumble_proto.pro \
        'QMAKE_AR=x86_64-pc-linux-gnu-ar cqs' \
        QMAKE_CC=x86_64-pc-linux-gnu-gcc \
        QMAKE_LINK_C=x86_64-pc-linux-gnu-gcc \
        QMAKE_LINK_C_SHLIB=x86_64-pc-linux-gnu-gcc \
        QMAKE_CXX=x86_64-pc-linux-gnu-g++ \
        QMAKE_LINK=x86_64-pc-linux-gnu-g++ \
        QMAKE_LINK_SHLIB=x86_64-pc-linux-gnu-g++ \
        QMAKE_OBJCOPY=x86_64-pc-linux-gnu-objcopy \
        QMAKE_RANLIB= \
        QMAKE_STRIP= \
        'QMAKE_CFLAGS=-march=native -O2 -g -pipe' \
        QMAKE_CFLAGS_RELEASE= \
        QMAKE_CFLAGS_DEBUG= \
        'QMAKE_CXXFLAGS=-march=native -O2 -g -pipe' \
        QMAKE_CXXFLAGS_RELEASE= \
        QMAKE_CXXFLAGS_DEBUG= \
        'QMAKE_LFLAGS=-Wl,-O1 -Wl,--as-needed' \
        QMAKE_LFLAGS_RELEASE= \
        QMAKE_LFLAGS_DEBUG= \
        'CONFIG+=bundled-celt no-bundled-opus no-bundled-speex no-embed-qt-translations no-server no-update no-alsa no-dbus release no-g15 no-oss no-portaudio no-pulseaudio no-speechd no-bonjour no-pch' \
        DEFINES+=PLUGIN_PATH=/usr/lib64/mumble

The bundled CELT should probably be linked statically and/or installed to a special subdirectory to avoid conflicting system-wide libraries.

Note: This might affect other files as well, a few seem fishy:

# ll image/usr/lib64
total 151k
lrwxrwxrwx 1 root root  18 Sep 11 04:21 libcelt0.so -> libcelt0.so.0.11.0
lrwxrwxrwx 1 root root  18 Sep 11 04:21 libcelt0.so.0 -> libcelt0.so.0.11.0
lrwxrwxrwx 1 root root  18 Sep 11 04:21 libcelt0.so.0.11 -> libcelt0.so.0.11.0
-rwxr-xr-x 1 root root 92k Sep 11 04:21 libcelt0.so.0.11.0
lrwxrwxrwx 1 root root  17 Sep 11 04:21 libcelt0.so.0.7 -> libcelt0.so.0.7.0
-rwxr-xr-x 1 root root 76k Sep 11 04:21 libcelt0.so.0.7.0
-rwxr-xr-x 1 root root 35k Sep 11 04:21 libl4d2.so
-rwxr-xr-x 1 root root 15k Sep 11 04:21 liblink.so
lrwxrwxrwx 1 root root  18 Sep 11 04:21 libmumble.so -> libmumble.so.1.3.0
lrwxrwxrwx 1 root root  18 Sep 11 04:21 libmumble.so.1 -> libmumble.so.1.3.0
lrwxrwxrwx 1 root root  18 Sep 11 04:21 libmumble.so.1.3 -> libmumble.so.1.3.0
-rwxr-xr-x 1 root root 24k Sep 11 04:21 libmumble.so.1.3.0
-rwxr-xr-x 1 root root 27k Sep 11 04:21 librl.so

libl4d2, liblink and librl in particular seem out of place.

haasn commented 6 years ago

Alternatively, mumble could be made to work with the system-wide libcelt. (Current version: 0.11.3)

kakra commented 6 years ago

@haasn I've made a patch which essentially allows to remove bundled celt from the ebuild and add it as a system-wide dependency. Here's the changes to the ebuild:

diff --git a/media-sound/mumble/mumble-9999.ebuild b/media-sound/mumble/mumble-9999.ebuild
index e75beaeaaec..39bd2a461c0 100644
--- a/media-sound/mumble/mumble-9999.ebuild
+++ b/media-sound/mumble/mumble-9999.ebuild
@@ -10,7 +10,7 @@ HOMEPAGE="https://wiki.mumble.info"
 if [[ "${PV}" = 9999 ]] ; then
        inherit git-r3
        EGIT_REPO_URI="https://github.com/mumble-voip/mumble.git"
-       EGIT_SUBMODULES=( '-*' celt-0.7.0-src celt-0.11.0-src themes/Mumble 3rdparty/rnnoise-src )
+       EGIT_SUBMODULES=( '-*' themes/Mumble 3rdparty/rnnoise-src )
 else
        MY_P="${PN}-${PV/_/~}"
        SRC_URI="https://mumble.info/snapshot/${MY_P}.tar.gz"
@@ -31,6 +31,7 @@ RDEPEND="
        dev-qt/qtwidgets:5
        dev-qt/qtxml:5
        >=dev-libs/protobuf-2.2.0:=
+       >=media-libs/celt-0.7.0
        >=media-libs/libsndfile-1.0.20[-minimal]
        >=media-libs/speex-1.2.0
        media-libs/speexdsp
@@ -63,7 +64,7 @@ src_configure() {
        }

        local conf_add=(
-               bundled-celt
+               no-bundled-celt
                no-bundled-opus
                no-bundled-speex
                no-embed-qt-translations
@@ -112,7 +113,7 @@ src_install() {
        doman man/mumble-overlay.1
        doman man/mumble.1

-       dolib.so "${dir}"/libmumble.so* "${dir}"/libcelt0.so* "${dir}"/plugins/lib*.so*
+       dolib.so "${dir}"/libmumble.so* "${dir}"/plugins/lib*.so*
 }

 pkg_postinst() {

Additionally, you need the following patch from my mumble branch: https://github.com/kakra/mumble/commit/0ab097b31e66bcd65cf9419ba7732503a558d04c

kakra commented 6 years ago

In #3521 you can read that this may break compatibility with some peers, so please do your tests before using this version. If you're only using private mumble servers, everything should be fine, I guess.

gautrr commented 5 years ago

Workaround by @kakra not needed anymore since Gentoo has removed the systemwide libcelt. #3521 Issue can be closed.

davidebeatrici commented 5 years ago

Excellent, thank you for the info!