summaryrefslogtreecommitdiff
path: root/packages/voip/mumble/mumble-scm.exheres-0
blob: effa47ce325d7c3f71f8cb5715ac051a1401c643 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
# Copyright 2010-2011 Johannes Nixdorf <mixi@user-helfen-usern.de>
# Copyright 2012-2013 Lasse Brun <bruners@gmail.com>
# Copyright 2013-2018 Timo Gurr <tgurr@exherbo.org>
# Distributed under the terms of the GNU General Public License v2
# Based in part upon 'mumble-1.2.2.ebuild' from Gentoo, which is:
#     Copyright 1999-2010 Gentoo Foundation


SCM_REPOSITORY="https://github.com/mumble-voip/mumble.git"

SCM_EXTERNAL_REFS="
	3rdparty/speex-src:speex
	3rdparty/celt-0.11.0-src:celt011
	3rdparty/opus-src:opus
	3rdparty/sbcelt-src:sbcelt
	3rdparty/minhook-src:minhook
	3rdparty/mach-override-src:machoverride
	3rdparty/speexdsp-src:speexdsp
    3rdparty/rnnoise-src:rnnoise
	themes/Mumble:mumblethemes
	3rdparty/celt-0.7.0-src:celt07
"

SCM_sbcelt_EXTERNAL_REFS="
	celt-0.7.0:celt07sbcelt
"

SCM_SECONDARY_REPOSITORIES="
	speex
	celt07
	celt011
	opus
	sbcelt
	minhook
	machoverride
	speexdsp
	mumblethemes
    rnnoise
	celt07sbcelt
"

SCM_speex_REPOSITORY="https://github.com/mumble-voip/speex.git"
SCM_celt07_REPOSITORY="https://github.com/mumble-voip/celt-0.7.0.git"
SCM_celt011_REPOSITORY="https://github.com/mumble-voip/celt-0.11.0.git"
SCM_opus_REPOSITORY="https://github.com/mumble-voip/opus.git"
SCM_sbcelt_REPOSITORY="https://github.com/mumble-voip/sbcelt.git"
SCM_minhook_REPOSITORY="https://github.com/mumble-voip/minhook.git"
SCM_machoverride_REPOSITORY="https://github.com/mumble-voip/mach_override.git"
SCM_speexdsp_REPOSITORY="https://github.com/mumble-voip/speexdsp.git"
SCM_mumblethemes_REPOSITORY="https://github.com/mumble-voip/mumble-theme.git"
SCM_rnnoise_REPOSITORY="https://github.com/mumble-voip/rnnoise.git"
SCM_celt07sbcelt_REPOSITORY="https://git.xiph.org/celt.git/"

require scm-git \
	qmake [ slot=5 ] \
    freedesktop-desktop \
    gtk-icon-cache \
    option-renames [ renames=[ 'speechd tts' ] ]

SUMMARY="Mumble is an open source, low-latency, high quality voice chat software"
DESCRIPTION="
Mumble is a voice chat application for groups. While it can be used for any kind of
activity, it is primarily intended for gaming. It can be compared to programs like Ventrilo or
TeamSpeak. People tend to simplify things, so when they talk about Mumble they either talk about
\"Mumble\" the client application or about \"Mumble & Murmur\" the whole voice chat application suite.
"
HOMEPAGE+=" https://wiki.${PN}.info/wiki/Main_Page"
DOWNLOADS=""

LICENCES="BSD-3 MIT"
SLOT="0"
PLATFORMS="~amd64 ~x86"
MYOPTIONS="
    alsa
    avahi
    dbus
    oss
    pulseaudio
    tts [[ description = [ Support for text to speech ] ]]
    ( providers: libressl openssl ) [[ number-selected = exactly-one ]]
"

DEPENDENCIES="
    build:
        virtual/pkg-config
        x11-libs/qttools:5 [[ note = [ Qt5LinguistTools ] ]]
        x11-proto/xorgproto
    build+run:
        dev-libs/boost
        dev-libs/protobuf:=
        media-libs/libsndfile
        media-libs/opus[>=1.0.0]
        media-libs/speex[>=1.2_rc1]
        media-libs/speexdsp[>=1.2_rc1]
        x11-libs/libX11
        x11-libs/libXi
        x11-libs/qtbase:5[gui][sql][sqlite]
        x11-libs/qtsvg:5
        alsa? ( sys-sound/alsa-lib )
        avahi? ( net-dns/avahi[dns_sd] )
        pulseaudio? ( media-sound/pulseaudio )
        tts? ( app-speech/speechd )
        providers:libressl? ( dev-libs/libressl:= )
        providers:openssl? ( dev-libs/openssl )
        !media-sound/mumble [[
            description = [ media-sound/mumble was moved to ::desktop voip/mumble ]
            resolution = uninstall-blocked-before
        ]]
"

DEFAULT_SRC_PREPARE_PATCHES=(
	"${FILES}"/gcc.patch
	"${FILES}"/tls12_strong_ciphers.patch
	"${FILES}"/higher_opus_complexity.patch
	"${FILES}"/allow_higher_bitrate_and_frame_size.patch
)



src_prepare() {
    default

    # TODO: report upstream
    edo sed \
        -e "s:pkg-config:${PKG_CONFIG}:g" \
        -i main.pro \
        -i qmake/pkgconfig.pri \
        -i src/${PN}.pri \
        -i src/${PN}/${PN}.pro

    # set version
#    edo sed \
#        -e "s:Compiled by User:${PV}:g" \
#        -i src/Version.h

#    edo rmdir ${WORK}/3rdparty/celt-0.{7,11}.0-src
#    edo ln -s ${WORKBASE}/celt-0.7.0-${CELT7_REV} ${WORK}/3rdparty/celt-0.7.0-src
#    edo ln -s ${WORKBASE}/celt-0.11.0-${CELT11_REV} ${WORK}/3rdparty/celt-0.11.0-src

#    edo rmdir ${WORK}/themes/Mumble
#    edo ln -s ${WORKBASE}/mumble-theme-${MUMBLETHEME_REV} ${WORK}/themes/Mumble
}

src_configure() {
    config=(
        release                  # release build
        bundled-celt             # bundled celt
        no-bundled-opus          # bundled opus
        no-bundled-speex         # bundled speex
        no-embed-qt-translations # Qt translations embedding
        no-g15                   # Logitech g15 keyboard support
        no-server                # server part (voip/murmur)
        no-update                # new versions check
    )
    option alsa ||  config+=( no-alsa )
    option avahi || config+=( no-bonjour )
    option dbus || config+=( no-dbus )
    option oss || config+=( no-oss )
    option pulseaudio || config+=( no-pulseaudio )
    option tts || config+=( no-speechd )

    eqmake main.pro -recursive \
        CONFIG+="${config[*]}" \
        DEFINES+="PLUGIN_PATH=/usr/$(exhost --target)/lib/mumble"
}

src_install() {
    local host=$(exhost --target)

    dobin release/${PN}
    dobin scripts/${PN}-overlay

    exeinto /usr/${host}/lib/${PN}
    doexe release/libmumble.so.*
#    dosym libmumble.so.$(ever range 1-3) /usr/${host}/lib/${PN}/libmumble.so
#    dosym libmumble.so.$(ever range 1-3) /usr/${host}/lib/${PN}/libmumble.so.$(ever range 1)
#    dosym libmumble.so.$(ever range 1-3) /usr/${host}/lib/${PN}/libmumble.so.$(ever range 1-2)
    doexe release/plugins/lib*.so*
    doexe release/libcelt0.so.0.{7,11}.0

    insinto /usr/share/applications
    doins scripts/${PN}.desktop

    insinto /usr/share/icons/hicolor/scalable/apps
    doins icons/${PN}.svg

    insinto /usr/share/kde4/services
    doins scripts/${PN}.protocol

    doman man/${PN}.1
    doman man/${PN}-overlay.1

    emagicdocs
}

pkg_postinst() {
    freedesktop-desktop_pkg_postinst
    gtk-icon-cache_pkg_postinst

    elog "Mumble supports reading the kernel input devices, but may fall back to using the less optimal xinput2"
    elog "This can be solved with a simple udev rule: SUBSYSTEM==\"input\", GROUP=\"input\" MODE=\"660\""
}

pkg_postrm() {
    freedesktop-desktop_pkg_postrm
    gtk-icon-cache_pkg_postrm
}