diff --git a/net-voip/mumble/additional-files/mumble.rdef.in b/net-voip/mumble/additional-files/mumble.rdef.in new file mode 100644 index 000000000..c19845892 --- /dev/null +++ b/net-voip/mumble/additional-files/mumble.rdef.in @@ -0,0 +1,24 @@ +resource app_flags B_SINGLE_LAUNCH; + +resource app_version { + major = @MAJOR@, + middle = @MIDDLE@, + minor = @MINOR@, + + variety = B_APPV_FINAL, + internal = 0, + + short_info = "@SHORT_INFO@", + long_info = "@LONG_INFO@" +}; + +resource app_signature "@APP_SIGNATURE@"; + +resource vector_icon array { + $"6E63696602050005EA0102044030C34530BC3A30304030BC3A30C3454050BC3A" + $"50C34550504050C34550BC3A060A00010002420000000000000000420000CA00" + $"00CA00000A01010002418000000000000000418000C90000C900000A00010002" + $"412000000000000000413000C84000C870000A0101000240E000000000000000" + $"411000C78000C7A0000A000100023DC000000000000000400000BE0000430000" + $"0A000100023DC0000000000000004000004A2800430000" +}; diff --git a/net-voip/mumble/mumble-1.5.517.recipe b/net-voip/mumble/mumble-1.5.517.recipe new file mode 100644 index 000000000..8ce27a52a --- /dev/null +++ b/net-voip/mumble/mumble-1.5.517.recipe @@ -0,0 +1,116 @@ +SUMMARY="Low latency encrypted VoIP client" +DESCRIPTION="Mumble is a low-latency, high quality voice chat program primarily \ +intended for gaming. \ +Features include a encrypted connection with Public/private-key authentication and \ +noise suppression. \ +To use Mumble, you need a mumble server. You can either join a public existing server \ +or host your own." +HOMEPAGE="https://www.mumble.info/" +COPYRIGHT="2005-2022 The Mumble Developers" +LICENSE="BSD (3-clause)" +REVISION="1" +SOURCE_URI="https://github.com/mumble-voip/mumble/releases/download/v1.5.517/mumble-1.5.517.tar.gz" +CHECKSUM_SHA256="8efd06a0f47ebfe27735f7575ba0becfb21d0f400a5082202dbbd998ab8351de" +PATCHES="mumble-1.5.517.patchset" +ADDITIONAL_FILES="mumble.rdef.in" + +ARCHITECTURES="all !x86_gcc2" +SECONDARY_ARCHITECTURES="x86" + +PROVIDES=" + mumble$secondaryArchSuffix + app:Mumble + " +REQUIRES=" + haiku$secondaryArchSuffix + lib:libboost_system$secondaryArchSuffix + lib:libexpat$secondaryArchSuffix + lib:libogg$secondaryArchSuffix + lib:libopus$secondaryArchSuffix + lib:libpcre2_posix$secondaryArchSuffix + lib:libPocoFoundation$secondaryArchSuffix + lib:libPocoXML$secondaryArchSuffix + lib:libPocoZip$secondaryArchSuffix + lib:libportaudio$secondaryArchSuffix + lib:libprotobuf$secondaryArchSuffix + lib:libprotoc$secondaryArchSuffix + lib:libsndfile$secondaryArchSuffix + lib:libssl$secondaryArchSuffix + lib:libspeexdsp$secondaryArchSuffix + lib:libQt5Core$secondaryArchSuffix + lib:librnnoise$secondaryArchSuffix + lib:libX11$secondaryArchSuffix + lib:libz$secondaryArchSuffix + " +BUILD_REQUIRES=" + haiku${secondaryArchSuffix}_devel + devel:libboost_system$secondaryArchSuffix + devel:libexpat$secondaryArchSuffix + devel:libogg$secondaryArchSuffix + devel:libopus$secondaryArchSuffix + devel:libpcre2_posix$secondaryArchSuffix + devel:libPocoFoundation$secondaryArchSuffix + devel:libPocoXML$secondaryArchSuffix + devel:libPocoZip$secondaryArchSuffix + devel:libprotobuf$secondaryArchSuffix + devel:libprotoc$secondaryArchSuffix + devel:libsndfile$secondaryArchSuffix + devel:libssl$secondaryArchSuffix + devel:libspeexdsp$secondaryArchSuffix + devel:libQt5Core$secondaryArchSuffix + devel:librnnoise$secondaryArchSuffix + devel:libX11$secondaryArchSuffix + devel:libz$secondaryArchSuffix + " +BUILD_PREREQUIRES=" + cmd:cc + cmd:cmake + cmd:gcc$secondaryArchSuffix + cmd:linguist$secondaryArchSuffix + cmd:make + cmd:pkg_config$secondaryArchSuffix + cmd:python3 + " + +BUILD() { + cmake -Bbuild \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -Dbundled-opus=OFF \ + -Dbundled-rnnoise=OFF \ + -Dbundled-speex=OFF \ + -Dclient=ON \ + -Ddbus=OFF \ + -Doverlay=OFF \ + -Dplugins=OFF \ + -Dserver=OFF \ + -Dsymbols=ON \ + -Dtracy=OFF \ + -DTRACY_ENABLE=OFF \ + -Dtests=OFF \ + -Dwarnings-as-errors=OFF \ + -Dzeroconf=OFF + make -C build $jobArgs +} + +INSTALL() { + mkdir $appsDir + cp build/mumble $appsDir/Mumble + + local APP_SIGNATURE="application/x-vnd.mumble" + local MAJOR="`echo "$portVersion" | cut -d. -f1`" + local MIDDLE="`echo "$portVersion" | cut -d. -f2`" + local MINOR="`echo "$portVersion" | cut -d. -f3`" + local SHORT_INFO="$SUMMARY" + local LONG_INFO="$DESCRIPTION" + sed \ + -e "s|@APP_SIGNATURE@|$APP_SIGNATURE|" \ + -e "s|@MAJOR@|$MAJOR|" \ + -e "s|@MIDDLE@|$MIDDLE|" \ + -e "s|@MINOR@|$MINOR|" \ + -e "s|@SHORT_INFO@|$SHORT_INFO|" \ + -e "s|@LONG_INFO@|$LONG_INFO|" \ + $portDir/additional-files/mumble.rdef.in > $sourceDir/mumble.rdef + + addResourcesToBinaries $sourceDir/mumble.rdef $appsDir/Mumble + addAppDeskbarSymlink $appsDir/Mumble +} diff --git a/net-voip/mumble/patches/mumble-1.5.517.patchset b/net-voip/mumble/patches/mumble-1.5.517.patchset new file mode 100644 index 000000000..edb612b61 --- /dev/null +++ b/net-voip/mumble/patches/mumble-1.5.517.patchset @@ -0,0 +1,340 @@ +From 94568066cec59959aa9027f8c683cde999c71e7b Mon Sep 17 00:00:00 2001 +From: zeldakatze +Date: Thu, 8 Feb 2024 02:02:40 +0100 +Subject: mumble: some quick and horrible hacks to make it compile and somehow + work with portaudio + + +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 13b3d30..b0d67da 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -196,20 +196,24 @@ endif() + + # Note: We always include and link against Tracy but it is only enabled, if we set the TRACY_ENABLE cmake option + # to ON, before including the respective subdirectory +-set(TRACY_ENABLE ${tracy} CACHE BOOL "" FORCE) ++#set(TRACY_ENABLE ${tracy} CACHE BOOL "" FORCE) + set(TRACY_ON_DEMAND ON CACHE BOOL "" FORCE) + # We force to build Tracy as a static library in order to not create a dependency on the respective .so file + # (can cause issues for packagers as that dependency is retained even though Tracy is disabled) + set(PREV_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS}) + set(BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE) +-add_subdirectory("${3RDPARTY_DIR}/tracy" "tracy" EXCLUDE_FROM_ALL) +-disable_warnings_for_all_targets_in("${3RDPARTY_DIR}/tracy") ++if(NOT HAIKU) ++ add_subdirectory("${3RDPARTY_DIR}/tracy" "tracy" EXCLUDE_FROM_ALL) ++ disable_warnings_for_all_targets_in("${3RDPARTY_DIR}/tracy") ++endif() + message(STATUS "Tracy: ${TRACY_ENABLE}") + + # Restore whatever BUILD_SHARED_LIBS was set to before + set(BUILD_SHARED_LIBS ${PREV_BUILD_SHARED_LIBS} CACHE BOOL "" FORCE) + +-target_link_libraries(shared PUBLIC Tracy::TracyClient) ++if(NOT HAIKU) ++ target_link_libraries(shared PUBLIC Tracy::TracyClient) ++endif() + + # Add the GSL + if(bundled-gsl) +diff --git a/src/ProcessResolver.cpp b/src/ProcessResolver.cpp +index 9355980..b7db3ce 100644 +--- a/src/ProcessResolver.cpp ++++ b/src/ProcessResolver.cpp +@@ -276,6 +276,10 @@ void ProcessResolver::doResolve() { + + kvm_cleanup(kd); + } ++#elif __HAIKU__ ++void ProcessResolver::doResolve() { ++ #warning "Stub" ++} + #else + # error "No implementation of ProcessResolver::resolve() available for this operating system" + #endif +diff --git a/src/mumble/CMakeLists.txt b/src/mumble/CMakeLists.txt +index 56d6c04..865ac4a 100644 +--- a/src/mumble/CMakeLists.txt ++++ b/src/mumble/CMakeLists.txt +@@ -633,11 +633,15 @@ else() + target_sources(mumble_client_object_lib PRIVATE "SharedMemory_unix.cpp") + + if(NOT APPLE) +- find_pkg(X11 COMPONENTS Xext REQUIRED) +- +- if(xinput2) +- find_pkg(X11 COMPONENTS Xi REQUIRED) +- target_link_libraries(mumble_client_object_lib PUBLIC X11::Xi) ++ if(NOT HAIKU) ++ find_pkg(X11 COMPONENTS Xext REQUIRED) ++ ++ if(xinput2) ++ find_pkg(X11 COMPONENTS Xi REQUIRED) ++ target_link_libraries(mumble_client_object_lib PUBLIC X11::Xi) ++ else() ++ target_compile_definitions(mumble_client_object_lib PUBLIC "NO_XINPUT2") ++ endif() + else() + target_compile_definitions(mumble_client_object_lib PUBLIC "NO_XINPUT2") + endif() +@@ -647,20 +651,36 @@ else() + target_link_libraries(mumble_client_object_lib PUBLIC Qt5::QXcbIntegrationPlugin) + endif() + +- target_sources(mumble_client_object_lib +- PRIVATE +- "GlobalShortcut_unix.cpp" +- "GlobalShortcut_unix.h" +- "Log_unix.cpp" +- "os_unix.cpp" +- ) ++ ++ if(HAIKU) ++ target_sources(mumble_client_object_lib ++ PRIVATE ++ "GlobalShortcut_haiku.cpp" ++ "GlobalShortcut_haiku.h" ++ "Log_unix.cpp" ++ "os_unix.cpp" ++ ) ++ ++ else() ++ target_sources(mumble_client_object_lib ++ PRIVATE ++ "GlobalShortcut_unix.cpp" ++ "GlobalShortcut_unix.h" ++ "Log_unix.cpp" ++ "os_unix.cpp" ++ ) ++ endif() + + if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") + find_library(LIB_RT rt) + target_link_libraries(mumble_client_object_lib PUBLIC ${LIB_RT}) + endif() +- +- target_link_libraries(mumble_client_object_lib PUBLIC X11::Xext) ++ ++ if(HAIKU) ++ target_link_libraries(mumble_client_object_lib PUBLIC X11) ++ else() ++ target_link_libraries(mumble_client_object_lib PUBLIC X11::Xext) ++ endif() + else() + find_library(LIB_APPKIT "AppKit") + find_library(LIB_APPLICATIONSERVICES "ApplicationServices") +@@ -1101,7 +1121,7 @@ if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.16.0") + PROPERTIES + SKIP_UNITY_BUILD_INCLUSION TRUE + ) +- elseif(UNIX) ++ elseif(UNIX AND NOT HAIKU) + # Exclude source files that include the X11 headers as these define + # an awful lot of macros that can conflict with other code + set_source_files_properties( +diff --git a/src/mumble/GlobalShortcut_haiku.cpp b/src/mumble/GlobalShortcut_haiku.cpp +new file mode 100644 +index 0000000..fae01f5 +--- /dev/null ++++ b/src/mumble/GlobalShortcut_haiku.cpp +@@ -0,0 +1,47 @@ ++// Copyright 2007-2023 The Mumble Developers. All rights reserved. ++// Use of this source code is governed by a BSD-style license ++// that can be found in the LICENSE file at the root of the ++// Mumble source tree or at . ++ ++#include "GlobalShortcut_haiku.h" ++ ++#include "Settings.h" ++#include "Global.h" ++ ++/** ++ * Returns a platform specific GlobalShortcutEngine object. ++ * ++ * @see GlobalShortcutX ++ * @see GlobalShortcutMac ++ * @see GlobalShortcutWin ++ */ ++GlobalShortcutEngine *GlobalShortcutEngine::platformInit() { ++ return new GlobalShortcutHaiku(); ++} ++ ++GlobalShortcutHaiku::GlobalShortcutHaiku() { ++ ++} ++ ++GlobalShortcutHaiku::~GlobalShortcutHaiku() { ++ ++} ++void GlobalShortcutHaiku::run() { ++ ++} ++ ++bool GlobalShortcutHaiku::canDisable() { ++ return true; ++} ++ ++bool GlobalShortcutHaiku::enabled() { ++ return false; ++} ++ ++void GlobalShortcutHaiku::setEnabled(bool enabled) { ++ ++} ++ ++GlobalShortcutHaiku::ButtonInfo GlobalShortcutHaiku::buttonInfo(const QVariant &v) { ++ return ButtonInfo(); ++} +diff --git a/src/mumble/GlobalShortcut_haiku.h b/src/mumble/GlobalShortcut_haiku.h +new file mode 100644 +index 0000000..916cf8c +--- /dev/null ++++ b/src/mumble/GlobalShortcut_haiku.h +@@ -0,0 +1,27 @@ ++// Copyright 2007-2023 The Mumble Developers. All rights reserved. ++// Use of this source code is governed by a BSD-style license ++// that can be found in the LICENSE file at the root of the ++// Mumble source tree or at . ++ ++#ifndef MUMBLE_MUMBLE_GLOBALSHORTCUT_HAIKU_H_ ++#define MUMBLE_MUMBLE_GLOBALSHORTCUT_HAIKU_H_ ++ ++#include "Global.h" ++#include "GlobalShortcut.h" ++ ++class GlobalShortcutHaiku : public GlobalShortcutEngine { ++private: ++ Q_OBJECT ++ Q_DISABLE_COPY(GlobalShortcutHaiku) ++public: ++ GlobalShortcutHaiku(); ++ ~GlobalShortcutHaiku() Q_DECL_OVERRIDE; ++ void run() Q_DECL_OVERRIDE; ++ ButtonInfo buttonInfo(const QVariant &) Q_DECL_OVERRIDE; ++ ++ bool canDisable() override; ++ bool enabled() override; ++ void setEnabled(bool enabled) override; ++}; ++ ++#endif +diff --git a/src/mumble/PAAudio.cpp b/src/mumble/PAAudio.cpp +index 7849157..a89eb25 100644 +--- a/src/mumble/PAAudio.cpp ++++ b/src/mumble/PAAudio.cpp +@@ -262,6 +262,11 @@ int PortAudioSystem::openStream(PaStream **stream, PaDeviceIndex device, const u + // TODO: add support for more than 2 channels + streamPar.channelCount = 2; + } ++ deviceSampleRate = SAMPLE_RATE; ++ #ifdef __HAIKU__ ++ streamPar.channelCount = 2; ++ deviceSampleRate = devInfo->defaultSampleRate; ++ #endif + + streamPar.device = device; + streamPar.sampleFormat = paFloat32; +@@ -269,7 +274,7 @@ int PortAudioSystem::openStream(PaStream **stream, PaDeviceIndex device, const u + streamPar.hostApiSpecificStreamInfo = nullptr; + + const auto ret = +- Pa_OpenStream(stream, isInput ? &streamPar : nullptr, isInput ? nullptr : &streamPar, SAMPLE_RATE, frameSize, ++ Pa_OpenStream(stream, isInput ? &streamPar : nullptr, isInput ? nullptr : &streamPar, deviceSampleRate, frameSize, + paClipOff | paDitherOff, &streamCallback, reinterpret_cast< void * >(isInput)); + if (ret != paNoError) { + qWarning("PortAudioSystem: failed to open stream - Pa_OpenStream() returned: %s", Pa_GetErrorText(ret)); +@@ -360,7 +365,7 @@ PortAudioInput::PortAudioInput() : stream(nullptr) { + return; + } + +- iMicFreq = SAMPLE_RATE; ++ iMicFreq = pas->deviceSampleRate; + eMicFormat = SampleFloat; + initializeMixer(); + +diff --git a/src/mumble/PAAudio.h b/src/mumble/PAAudio.h +index 9a20fb4..55b7698 100644 +--- a/src/mumble/PAAudio.h ++++ b/src/mumble/PAAudio.h +@@ -14,6 +14,10 @@ + + #include + ++#ifdef __HAIKU__ ++#define PA_MAX_RESAMPLE_FRAME_COUNT 1000 ++#endif ++ + class PortAudioInit; + + class PortAudioSystem : public QObject { +@@ -59,6 +63,8 @@ public: + + bool startStream(PaStream *stream); + bool stopStream(PaStream *stream); ++ ++ double deviceSampleRate; + + PortAudioSystem(); + ~PortAudioSystem(); +@@ -73,6 +79,9 @@ protected: + QMutex qmWait; + QWaitCondition qwcSleep; + PaStream *stream; ++#ifdef __HAIKU__ ++ char *resamplingBuffer; ++#endif + + public: + void process(const uint32_t frames, const void *buffer); +-- +2.42.1 + + +From dc384d1a9f588e6107ff2984a2a576f72d5064da Mon Sep 17 00:00:00 2001 +From: zeldakatze +Date: Mon, 19 Feb 2024 00:46:23 +0100 +Subject: mumble: somewhat fix the flickering on minimize and maximize + + +diff --git a/src/mumble/MainWindow.cpp b/src/mumble/MainWindow.cpp +index b8f5cbc..2797a9e 100644 +--- a/src/mumble/MainWindow.cpp ++++ b/src/mumble/MainWindow.cpp +@@ -626,7 +626,7 @@ void MainWindow::hideEvent(QHideEvent *e) { + } + + void MainWindow::showEvent(QShowEvent *e) { +-#ifndef Q_OS_MAC ++#if !(defined(Q_OS_MAC) || defined(__HAIKU__)) + # ifdef Q_OS_UNIX + if (!qApp->activeModalWidget() && !qApp->activePopupWidget()) + # endif +-- +2.42.1 + + +From 20d0a34a8db56ba298f65c8f6a4d158eeec369e5 Mon Sep 17 00:00:00 2001 +From: zeldakatze +Date: Tue, 20 Feb 2024 10:28:29 +0100 +Subject: mumble: make the add server dialog be on top + + +diff --git a/src/mumble/ConnectDialog.cpp b/src/mumble/ConnectDialog.cpp +index eb93c9e..854b44e 100644 +--- a/src/mumble/ConnectDialog.cpp ++++ b/src/mumble/ConnectDialog.cpp +@@ -806,6 +806,10 @@ void ConnectDialogEdit::init() { + + qwInlineNotice->hide(); + ++#ifdef __HAIKU__ ++ setWindowFlag(Qt::WindowStaysOnTopHint); ++#endif ++ + qlePort->setValidator(new QIntValidator(1, 65535, qlePort)); + qlePort->setText(QString::number(DEFAULT_MUMBLE_PORT)); + qlePassword->setEchoMode(QLineEdit::Password); +-- +2.42.1 +