From 4c562481ac81db16d4f8b1dbf8baa71b6565a320 Mon Sep 17 00:00:00 2001 From: Twaik Yont Date: Thu, 17 Oct 2024 12:19:40 +0300 Subject: [PATCH 1/3] bump(main/libsoundtouch): 2.3.3 --- packages/libsoundtouch/build.sh | 4 ++-- .../source-SoundTouchDLL-Makefile.am.patch | 11 ----------- 2 files changed, 2 insertions(+), 13 deletions(-) delete mode 100644 packages/libsoundtouch/source-SoundTouchDLL-Makefile.am.patch diff --git a/packages/libsoundtouch/build.sh b/packages/libsoundtouch/build.sh index 69de9f0aed2912d..cc6f73a27996048 100644 --- a/packages/libsoundtouch/build.sh +++ b/packages/libsoundtouch/build.sh @@ -2,9 +2,9 @@ TERMUX_PKG_HOMEPAGE=https://www.surina.net/soundtouch/ TERMUX_PKG_DESCRIPTION="An open-source audio processing library for changing the Tempo, Pitch and Playback Rates of audio streams or files" TERMUX_PKG_LICENSE="LGPL-2.1" TERMUX_PKG_MAINTAINER="@termux" -TERMUX_PKG_VERSION=2.3.2 +TERMUX_PKG_VERSION=2.3.3 TERMUX_PKG_SRCURL=https://www.surina.net/soundtouch/soundtouch-${TERMUX_PKG_VERSION}.tar.gz -TERMUX_PKG_SHA256=3bde8ddbbc3661f04e151f72cf21ca9d8f8c88e265833b65935b8962d12d6b08 +TERMUX_PKG_SHA256=43b23dfac2f64a3aff55d64be096ffc7b73842c3f5665caff44975633a975a99 TERMUX_PKG_DEPENDS="libc++" termux_step_pre_configure() { diff --git a/packages/libsoundtouch/source-SoundTouchDLL-Makefile.am.patch b/packages/libsoundtouch/source-SoundTouchDLL-Makefile.am.patch deleted file mode 100644 index c762e480a798a89..000000000000000 --- a/packages/libsoundtouch/source-SoundTouchDLL-Makefile.am.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/source/SoundTouchDLL/Makefile.am -+++ b/source/SoundTouchDLL/Makefile.am -@@ -34,7 +34,7 @@ - # Compiler flags - - # Modify the default 0.0.0 to LIB_SONAME.0.0 --LDFLAGS=-version-info @LIB_SONAME@ -+LDFLAGS+=-version-info @LIB_SONAME@ - - if X86 - CXXFLAGS1=-mstackrealign -msse From 9940d3b1b9df1b65379a539913ed8f365ca2760c Mon Sep 17 00:00:00 2001 From: Twaik Yont Date: Thu, 17 Oct 2024 12:19:48 +0300 Subject: [PATCH 2/3] enhance(main/portaudio): bump to latest commit and add SLES support --- packages/portaudio/build.sh | 21 +++++++++++++---- packages/portaudio/fix-threading.patch | 27 ++++++++++++++++++++++ packages/portaudio/sles.patch | 31 ++++++++++++++++++++++++++ 3 files changed, 75 insertions(+), 4 deletions(-) create mode 100644 packages/portaudio/fix-threading.patch create mode 100644 packages/portaudio/sles.patch diff --git a/packages/portaudio/build.sh b/packages/portaudio/build.sh index 77d92484ccbfc77..3432f5321ab0d2f 100644 --- a/packages/portaudio/build.sh +++ b/packages/portaudio/build.sh @@ -4,19 +4,32 @@ TERMUX_PKG_LICENSE="MIT" TERMUX_PKG_LICENSE_FILE="LICENSE.txt" TERMUX_PKG_MAINTAINER="@termux" TERMUX_PKG_VERSION=19.07.00 -TERMUX_PKG_REVISION=1 -_DATE=20210406 -TERMUX_PKG_SRCURL=https://files.portaudio.com/archives/pa_stable_v${TERMUX_PKG_VERSION//./}_${_DATE}.tgz -TERMUX_PKG_SHA256=47efbf42c77c19a05d22e627d42873e991ec0c1357219c0d74ce6a2948cb2def +TERMUX_PKG_REVISION=2 +# There are no tags or releases in the last few years, but there are a lot of new commits +TERMUX_PKG_SRCURL=https://github.com/PortAudio/portaudio/archive/57aa393109ec996799d3a5846c9ecb0a65b64644.tar.gz +TERMUX_PKG_SHA256=935d3e8b93baa057bb4bf114520687c21e57129a1c1df014c41dd51fb35be3c2 TERMUX_PKG_AUTO_UPDATE=false TERMUX_PKG_DEPENDS="libc++" +# Pulseaudio backend does not work, audacity hangs. TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" --enable-cxx --without-alsa --without-jack --without-oss --without-asihpi +--without-pulseaudio ac_cv_lib_pthread_pthread_create=yes ac_cv_lib_rt_clock_gettime=yes " TERMUX_PKG_MAKE_PROCESSES=1 + +termux_step_post_get_source() { + local _URL0="https://github.com/croissanne/portaudio_opensles/raw/3cab75108027588430c613d12eeef37d820c98d1/src/hostapi/opensles/pa_opensles.c" + local _URL1="https://github.com/croissanne/portaudio_opensles/raw/3cab75108027588430c613d12eeef37d820c98d1/include/pa_opensles.h" + termux_download $_URL0 $TERMUX_PKG_CACHEDIR/${_URL0##*/} 64cf987beceba200fdbc0e217eb07d8ad87c91766ba41bf68f696de2b191214f + termux_download $_URL1 $TERMUX_PKG_CACHEDIR/${_URL1##*/} 3cc8feefdd0e76d52425a48244c73dac73343c3b89b7c5827c8226a42aef4d32 + cp $TERMUX_PKG_CACHEDIR/pa_opensles.c $TERMUX_PKG_CACHEDIR/pa_opensles.h $TERMUX_PKG_SRCDIR/ + touch $TERMUX_PKG_SRCDIR/pa_opensles.h + rm -rf $TERMUX_PKG_MASSAGEDIR + mkdir -p $TERMUX_PKG_MASSAGEDIR +} diff --git a/packages/portaudio/fix-threading.patch b/packages/portaudio/fix-threading.patch new file mode 100644 index 000000000000000..5474788a4a88678 --- /dev/null +++ b/packages/portaudio/fix-threading.patch @@ -0,0 +1,27 @@ ++++ ./src/os/unix/pa_unix_util.h +@@ -153,6 +153,7 @@ + pthread_cond_t cond; + PaUtilClockId condClockId; + volatile sig_atomic_t stopRequest; ++ int stopped; + } PaUnixThread; + + /** Initialize global threading state. ++++ ./src/os/unix/pa_unix_util.c +@@ -424,6 +424,8 @@ + { + *exitResult = paNoError; + } ++ if (self->stopped) ++ return paNoError; + #if 0 + if( watchdogExitResult ) + *watchdogExitResult = paNoError; +@@ -473,6 +475,7 @@ + error: + PA_ASSERT_CALL( PaUnixMutex_Terminate( &self->mtx ), paNoError ); + PA_ASSERT_CALL( pthread_cond_destroy( &self->cond ), 0 ); ++ self->stopped = 1; + + return result; + } diff --git a/packages/portaudio/sles.patch b/packages/portaudio/sles.patch new file mode 100644 index 000000000000000..dc56168c59703cc --- /dev/null +++ b/packages/portaudio/sles.patch @@ -0,0 +1,31 @@ ++++ ./configure +@@ -16173,6 +16173,12 @@ + as_fn_error $? "libpthread not found!" "$LINENO" 5 + fi + ++ DLL_LIBS="$DLL_LIBS -lOpenSLES" ++ LIBS="$LIBS -lOpenSLES" ++ OTHER_OBJS="$OTHER_OBJS pa_opensles.o" ++ $as_echo "#define PA_USE_OPENSLES 1" >>confdefs.h ++ $as_echo "#define PaUtil_AllocateMemory PaUtil_AllocateZeroInitializedMemory" >>confdefs.h ++ $as_echo "#define PaUtil_GroupAllocateMemory PaUtil_GroupAllocateZeroInitializedMemory" >>confdefs.h + + if [ "$have_alsa" = "yes" ] && [ "$with_alsa" != "no" ] ; then + DLL_LIBS="$DLL_LIBS -lasound" ++++ ./src/os/unix/pa_unix_hostapis.c +@@ -51,6 +51,7 @@ + PaError PaAsiHpi_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index ); + PaError PaMacCore_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index ); + PaError PaSkeleton_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index ); ++PaError PaOpenSLES_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index ); + + /** Note that on Linux, ALSA is placed before OSS so that the former is preferred over the latter. + */ +@@ -58,6 +59,7 @@ + PaUtilHostApiInitializer *paHostApiInitializers[] = + { + #ifdef __linux__ ++ PaOpenSLES_Initialize, + + #if PA_USE_ALSA + PaAlsa_Initialize, From d4ca853f1fd0a476175f49b94aaa140c0962eb60 Mon Sep 17 00:00:00 2001 From: Twaik Yont Date: Thu, 17 Oct 2024 20:18:21 +0300 Subject: [PATCH 3/3] bump(x11/audacity): 3.6.4 --- x11-packages/audacity/AudacityFunctions.patch | 10 + x11-packages/audacity/CMakeLists.txt.patch | 3 +- x11-packages/audacity/build.sh | 112 ++++++-- ...proxies-portaudio-v19-CMakeLists.txt.patch | 29 --- ...make-proxies-portmidi-CMakeLists.txt.patch | 29 --- ...ake-proxies-wxWidgets-CMakeLists.txt.patch | 11 - x11-packages/audacity/cmake-proxies.patch | 10 + x11-packages/audacity/ffmpeg-configure.patch | 39 ++- ...rc-libnyquist-nyquist-cmt-midifile.c.patch | 18 -- ...src-libnyquist-nyquist-cmt-midifns.c.patch | 12 +- ...libnyquist-nyquist-nyqsrc-handlers.c.patch | 11 - ...-libnyquist-nyquist-xlisp-security.c.patch | 7 +- .../libraries-lib-files-PathList.cpp.patch | 59 +++++ ...aries-lib-wx-wrappers-CMakeLists.txt.patch | 17 ++ ...dules-mod-script-pipe-CMakeLists.txt.patch | 11 - ...dules-mod-script-pipe-PipeServer.cpp.patch | 3 +- x11-packages/audacity/no-sem.patch | 239 ++++++++++++++++++ .../audacity/src-AudacityApp.cpp.patch | 17 +- .../audacity/src-AudioIOBase.cpp.patch | 10 - .../audacity/src-CMakeLists.txt.patch | 11 +- x11-packages/audacity/src-FFmpeg.h.patch | 11 - .../audacity/src-ListNavigaionPanel.h.patch | 11 + .../audacity/src-MixerBoard.cpp.patch | 11 - x11-packages/audacity/static-sqlite.patch | 8 + 24 files changed, 506 insertions(+), 193 deletions(-) create mode 100644 x11-packages/audacity/AudacityFunctions.patch delete mode 100644 x11-packages/audacity/cmake-proxies-portaudio-v19-CMakeLists.txt.patch delete mode 100644 x11-packages/audacity/cmake-proxies-portmidi-CMakeLists.txt.patch delete mode 100644 x11-packages/audacity/cmake-proxies-wxWidgets-CMakeLists.txt.patch create mode 100644 x11-packages/audacity/cmake-proxies.patch delete mode 100644 x11-packages/audacity/lib-src-libnyquist-nyquist-cmt-midifile.c.patch delete mode 100644 x11-packages/audacity/lib-src-libnyquist-nyquist-nyqsrc-handlers.c.patch create mode 100644 x11-packages/audacity/libraries-lib-files-PathList.cpp.patch create mode 100644 x11-packages/audacity/libraries-lib-wx-wrappers-CMakeLists.txt.patch delete mode 100644 x11-packages/audacity/modules-mod-script-pipe-CMakeLists.txt.patch create mode 100644 x11-packages/audacity/no-sem.patch delete mode 100644 x11-packages/audacity/src-AudioIOBase.cpp.patch delete mode 100644 x11-packages/audacity/src-FFmpeg.h.patch create mode 100644 x11-packages/audacity/src-ListNavigaionPanel.h.patch delete mode 100644 x11-packages/audacity/src-MixerBoard.cpp.patch create mode 100644 x11-packages/audacity/static-sqlite.patch diff --git a/x11-packages/audacity/AudacityFunctions.patch b/x11-packages/audacity/AudacityFunctions.patch new file mode 100644 index 000000000000000..768b6dafbc5b335 --- /dev/null +++ b/x11-packages/audacity/AudacityFunctions.patch @@ -0,0 +1,10 @@ ++++ ./cmake-proxies/cmake-modules/AudacityFunctions.cmake +@@ -586,7 +586,7 @@ + add_custom_command( + TARGET "${TARGET}" + POST_BUILD +- COMMAND "$,$,${nostrip}>,echo,strip>" -x $ ++ COMMAND "$,$,${nostrip}>,echo,llvm-strip>" -x $ + ) + endif() + diff --git a/x11-packages/audacity/CMakeLists.txt.patch b/x11-packages/audacity/CMakeLists.txt.patch index 6b1755b194836cf..b0f1d96e3a1866d 100644 --- a/x11-packages/audacity/CMakeLists.txt.patch +++ b/x11-packages/audacity/CMakeLists.txt.patch @@ -1,5 +1,4 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt ++++ ./CMakeLists.txt @@ -226,6 +226,7 @@ message( STATUS "Building for 32-bit target" ) endif() diff --git a/x11-packages/audacity/build.sh b/x11-packages/audacity/build.sh index 53325f7dc0672d4..89ae56d8d1db941 100644 --- a/x11-packages/audacity/build.sh +++ b/x11-packages/audacity/build.sh @@ -2,40 +2,42 @@ TERMUX_PKG_HOMEPAGE=https://www.audacityteam.org/ TERMUX_PKG_DESCRIPTION="An easy-to-use, multi-track audio editor and recorder" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_MAINTAINER="@termux" -# Version 3.0.0 or higher does not work with vanilla wxWidgets. -TERMUX_PKG_VERSION=2.4.2 -TERMUX_PKG_REVISION=9 -_FFMPEG_VERSION=4.4.3 +TERMUX_PKG_VERSION=3.6.4 +_FFMPEG_VERSION=6.1.1 TERMUX_PKG_SRCURL=(https://github.com/audacity/audacity/archive/Audacity-${TERMUX_PKG_VERSION}.tar.gz https://www.ffmpeg.org/releases/ffmpeg-${_FFMPEG_VERSION}.tar.xz) -TERMUX_PKG_SHA256=(cdb4800c8e9d1d4ca19964caf8d24000f80286ebd8a4db566c2622449744c099 - 6c5b6c195e61534766a0b5fe16acc919170c883362612816d0a1c7f4f947006e) -TERMUX_PKG_DEPENDS="gdk-pixbuf, glib, gtk3, libc++, libexpat, libflac, libmp3lame, libogg, libsndfile, libsoundtouch, libsoxr, libvorbis, wxwidgets" +TERMUX_PKG_SHA256=(e7d82eaae65081a1118a899751ff50ddf76a1cc0f056882eeaffcedb86c12aec + 8684f4b00f94b85461884c3719382f1261f0d9eb3d59640a1f4ac0873616f968) +TERMUX_PKG_DEPENDS="zlib, libpng, libjpeg-turbo, libjpeg-turbo-static, libexpat, wxwidgets, libmp3lame, mpg123, libid3tag, libwavpack, libogg, libflac, libopus, opusfile, libvorbis, libsndfile, portmidi, portaudio, rapidjson, libuuid" # Support for FFmpeg 5.0 is not backported: # https://github.com/audacity/audacity/issues/2445 TERMUX_PKG_SUGGESTS="audacity-ffmpeg" +TERMUX_PKG_HOSTBUILD=true TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" +-DCMAKE_STRIP=llvm-strip +-Daudacity_conan_enabled=off +-Daudacity_has_vst3=no +-Daudacity_has_tests=no +-Daudacity_has_networking=no +-Daudacity_has_crashreports=no +-Daudacity_has_sentry_reporting=no +-Daudacity_has_updates_check=no -Daudacity_use_wxwidgets=system -Daudacity_use_expat=system -Daudacity_use_lame=system --Daudacity_use_sndfile=system -Daudacity_use_soxr=system --Daudacity_use_portaudio=local +-Daudacity_use_portaudio=system -Daudacity_use_ffmpeg=loaded --Daudacity_use_id3tag=off --Daudacity_use_mad=off -Daudacity_use_nyquist=local -Daudacity_use_vamp=off --Daudacity_use_ogg=system --Daudacity_use_vorbis=system --Daudacity_use_flac=system -Daudacity_use_lv2=off --Daudacity_use_midi=off +-Daudacity_use_midi=system -Daudacity_use_portmixer=local --Daudacity_use_portsmf=off +-Daudacity_use_portsmf=local -Daudacity_use_sbsms=off -Daudacity_use_soundtouch=system -Daudacity_use_twolame=off +-DUSE_MIDI=OFF " TERMUX_PKG_RM_AFTER_INSTALL=" opt/audacity/include @@ -43,6 +45,74 @@ opt/audacity/lib/pkgconfig opt/audacity/share " +# Function to obtain the .deb URL +obtain_deb_url() { + local url="https://packages.ubuntu.com/noble/amd64/$1/download" + local retries=5 + local wait=5 + local attempt + local deb_url + + for ((attempt=1; attempt<=retries; attempt++)); do + local PAGE="$(curl -s "$url")" + >&2 echo page + >&2 echo "$PAGE" + if deb_url=$(echo "$PAGE" | grep -Eo 'http://.*\.deb' | head -n 1); then + if [[ -n "$deb_url" ]]; then + echo "$deb_url" + return 0 + else + # deb_url is empty or server answered with `internal server error`, retry + >&2 echo "Attempt $attempt: Received empty URL or server answered with `Internal server error` page. Retrying in $wait seconds..." + fi + else + # The command failed, retry + >&2 echo "Attempt $attempt: Command failed. Retrying in $wait seconds..." + fi + sleep "$wait" + done + + # Failed after retries, output error to stderr and exit with code 1 + >&2 echo "Failed to obtain URL after $retries attempts." + exit 1 +} + +termux_step_host_build() { + termux_setup_cmake + termux_setup_ninja + + ( # Running build in a subshell to avoid variable mess + # We must build the `image-compiler` for building. + # See https://github.com/audacity/audacity/blob/Audacity-3.6.4/BUILDING.md#selecting-target-architecture-on-macos + _PREFIX="$TERMUX_PKG_HOSTBUILD_DIR/prefix" + + # Building both gtk2.0 and alsa only for building host-side tool seems to be excessive. + # Let's download them from ubuntu repos. + # To avoid messing with `apt update` and `apt download` we will get download links directly from ubuntu servers. + mkdir "$_PREFIX" + for i in libgtk2.0-0t64 libgtk2.0-dev libasound2-dev; do + wget "$(obtain_deb_url $i)" -O "$TERMUX_PKG_HOSTBUILD_DIR/tmp.deb" + dpkg-deb -R "$TERMUX_PKG_HOSTBUILD_DIR/tmp.deb" "$TERMUX_PKG_HOSTBUILD_DIR/tmp" + cp -rf "$TERMUX_PKG_HOSTBUILD_DIR"/tmp/* "$_PREFIX" + rm -rf "$TERMUX_PKG_HOSTBUILD_DIR/tmp.deb" "$TERMUX_PKG_HOSTBUILD_DIR/tmp" + unset _URL + done + + for i in "$_PREFIX"/usr/lib/x86_64-linux-gnu/pkgconfig/*.pc; do + # patch pkg-config files to match new prefix + sed -i '/^prefix=/c\prefix='"$_PREFIX/usr" "$i" + done + + # Also we should import pkg-config configuration files from the packages we imported from ubuntu repos + export PKG_CONFIG_LIBDIR="/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/share/pkgconfig" + PKG_CONFIG_LIBDIR+=":$_PREFIX/usr/lib/x86_64-linux-gnu/pkgconfig" + export CFLAGS="-I$_PREFIX/usr/include" + export LDFLAGS="-Wl,-rpath,$_PREFIX/usr/lib/x86_64-linux-gnu" + cmake -GNinja -B "$TERMUX_PKG_HOSTBUILD_DIR" -S "$TERMUX_PKG_SRCDIR" -DCMAKE_BUILD_TYPE=Release + ninja -C "$TERMUX_PKG_HOSTBUILD_DIR" image-compiler + ) +} + termux_step_pre_configure() { local _FFMPEG_PREFIX=${TERMUX_PREFIX}/opt/${TERMUX_PKG_NAME} LDFLAGS="-Wl,-rpath=${_FFMPEG_PREFIX}/lib ${LDFLAGS}" @@ -88,6 +158,12 @@ termux_step_pre_configure() { CPPFLAGS="-I${_FFMPEG_PREFIX}/include ${CPPFLAGS}" CPPFLAGS+=" -Dushort=u_short -Dulong=u_long" + CXXFLAGS+=" -std=c++17" + # Adding `image-compiler` we built in host_build step + export PATH="$TERMUX_PKG_HOSTBUILD_DIR/Release/bin:$PATH" + LDFLAGS+=" -Wl,-rpath=$TERMUX_PREFIX/lib/audacity" + # For some reason `image-compiler` fails to find it's libraries in our custom prefix, let's help it. + export LD_LIBRARY_PATH="$TERMUX_PKG_HOSTBUILD_DIR/prefix/usr/lib/x86_64-linux-gnu" } termux_step_post_make_install() { @@ -115,9 +191,7 @@ termux_step_create_debscripts() { #!$TERMUX_PREFIX/bin/sh echo echo "********" - echo "Audacity in this particular package does not (yet) support audio devices." - echo - echo "https://github.com/termux/termux-packages/issues/10412" + echo "Audacity can not use microphone until you grant microphone access to Termux:API." echo "********" echo EOF diff --git a/x11-packages/audacity/cmake-proxies-portaudio-v19-CMakeLists.txt.patch b/x11-packages/audacity/cmake-proxies-portaudio-v19-CMakeLists.txt.patch deleted file mode 100644 index 1f45a66af50ceca..000000000000000 --- a/x11-packages/audacity/cmake-proxies-portaudio-v19-CMakeLists.txt.patch +++ /dev/null @@ -1,29 +0,0 @@ ---- a/cmake-proxies/portaudio-v19/CMakeLists.txt -+++ b/cmake-proxies/portaudio-v19/CMakeLists.txt -@@ -56,7 +56,7 @@ - "Use the portaudio CoreAudio interface if available" - YES - ) -- elseif( CMAKE_SYSTEM_NAME MATCHES "Linux|FreeBSD" ) -+ elseif( CMAKE_SYSTEM_NAME MATCHES "Android|Linux|FreeBSD" ) - cmd_option( - ${_OPT}use_pa_alsa - "Use the portaudio ALSA interface if available" -@@ -118,7 +118,7 @@ - ${TARGET_ROOT}/src/hostapi/coreaudio/pa_mac_core_utilities.c - > - -- $<$: -+ $<$: - ${TARGET_ROOT}/src/os/unix/pa_unix_hostapis.c - ${TARGET_ROOT}/src/os/unix/pa_unix_util.c - > -@@ -158,7 +158,7 @@ - ${TARGET_ROOT}/src/os/win - > - -- $<$: -+ $<$: - ${TARGET_ROOT}/src/os/unix - > - diff --git a/x11-packages/audacity/cmake-proxies-portmidi-CMakeLists.txt.patch b/x11-packages/audacity/cmake-proxies-portmidi-CMakeLists.txt.patch deleted file mode 100644 index 7a7824997e47c0b..000000000000000 --- a/x11-packages/audacity/cmake-proxies-portmidi-CMakeLists.txt.patch +++ /dev/null @@ -1,29 +0,0 @@ ---- a/cmake-proxies/portmidi/CMakeLists.txt -+++ b/cmake-proxies/portmidi/CMakeLists.txt -@@ -3,7 +3,7 @@ - - def_vars() - --if( CMAKE_SYSTEM_NAME MATCHES "Linux|FreeBSD" ) -+if( CMAKE_SYSTEM_NAME MATCHES "Android|Linux|FreeBSD" ) - if( ${_OPT}use_pa_alsa ) - find_package( ALSA ) - endif() -@@ -29,7 +29,7 @@ - ${TARGET_ROOT}/porttime/ptmacosx_mach.c - > - -- $<$: -+ $<$: - ${TARGET_ROOT}/pm_linux/finddefault.c - ${TARGET_ROOT}/pm_linux/pmlinux.c - ${TARGET_ROOT}/porttime/ptlinux.c -@@ -53,7 +53,7 @@ - ${TARGET_ROOT}/pm_mac - > - -- $<$: -+ $<$: - ${TARGET_ROOT}/pm_linux - > - ) diff --git a/x11-packages/audacity/cmake-proxies-wxWidgets-CMakeLists.txt.patch b/x11-packages/audacity/cmake-proxies-wxWidgets-CMakeLists.txt.patch deleted file mode 100644 index b97311a6ca71ac5..000000000000000 --- a/x11-packages/audacity/cmake-proxies-wxWidgets-CMakeLists.txt.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/cmake-proxies/wxWidgets/CMakeLists.txt -+++ b/cmake-proxies/wxWidgets/CMakeLists.txt -@@ -99,7 +99,7 @@ - - # Causes problems on OSX, so turn it off - set( wxBUILD_PRECOMP NO ) -- elseif( CMAKE_SYSTEM_NAME MATCHES "Linux|FreeBSD" ) -+ elseif( CMAKE_SYSTEM_NAME MATCHES "Android|Linux|FreeBSD" ) - # Doesn't yet have accessbility - set( wxUSE_ACCESSIBILITY NO ) - diff --git a/x11-packages/audacity/cmake-proxies.patch b/x11-packages/audacity/cmake-proxies.patch new file mode 100644 index 000000000000000..54220c695fcde36 --- /dev/null +++ b/x11-packages/audacity/cmake-proxies.patch @@ -0,0 +1,10 @@ ++++ ./cmake-proxies/CMakeLists.txt +@@ -8,7 +8,7 @@ + addlib( libvamp vamp VAMP NO YES "vamp >= 2.5" "vamp-hostsdk >= 2.5" ) + addlib( lv2 lv2 LV2 NO YES "lilv-0 >= 0.24.6" "lv2 >= 1.16.0" "serd-0 >= 0.30.2" "sord-0 >= 0.16.4" "sratom-0 >= 0.6.4" "suil-0 >= 0.10.6" ) + +-#addlib( portmidi midi MIDI NO YES "PortMidi" ) ++addlib( portmidi midi MIDI YES YES "PortMidi" ) + + if (NOT USE_MIDI AND + "EXPERIMENTAL_MIDI_OUT" IN_LIST EXPERIMENTAL_OPTIONS_LIST ) diff --git a/x11-packages/audacity/ffmpeg-configure.patch b/x11-packages/audacity/ffmpeg-configure.patch index ee326ef939b6139..8c01b8a9bf167e0 100644 --- a/x11-packages/audacity/ffmpeg-configure.patch +++ b/x11-packages/audacity/ffmpeg-configure.patch @@ -1,5 +1,4 @@ ---- a/ffmpeg-4.4.3/configure -+++ b/ffmpeg-4.4.3/configure ++++ ./ffmpeg-6.1.1/configure @@ -5336,13 +5336,9 @@ striptype="" ;; @@ -14,3 +13,39 @@ ;; haiku) prefix_default="/boot/common" ++++ ./ffmpeg-6.1.1/libavcodec/allcodecs.c +@@ -154,7 +154,6 @@ + extern const FFCodec ff_h264_crystalhd_decoder; + extern const FFCodec ff_h264_v4l2m2m_decoder; + extern const FFCodec ff_h264_mediacodec_decoder; +-extern const FFCodec ff_h264_mediacodec_encoder; + extern const FFCodec ff_h264_mmal_decoder; + extern const FFCodec ff_h264_qsv_decoder; + extern const FFCodec ff_h264_rkmpp_decoder; +@@ -850,6 +849,7 @@ + extern const FFCodec ff_libopenh264_decoder; + extern const FFCodec ff_h264_amf_encoder; + extern const FFCodec ff_h264_cuvid_decoder; ++extern const FFCodec ff_h264_mediacodec_encoder; + extern const FFCodec ff_h264_mf_encoder; + extern const FFCodec ff_h264_nvenc_encoder; + extern const FFCodec ff_h264_omx_encoder; ++++ ./ffmpeg-6.1.1/libavutil/file_open.c +@@ -119,7 +119,7 @@ + #undef free + free(ptr); + #else +- size_t len = strlen(prefix) + 12; /* room for "/tmp/" and "XXXXXX\0" */ ++ size_t len = strlen(prefix) + strlen("@TERMUX_PREFIX@/tmp/") + 7; /* room for "@TERMUX_PREFIX@/tmp/" and "XXXXXX\0" */ + *filename = av_malloc(len); + #endif + /* -----common section-----*/ +@@ -136,7 +136,7 @@ + # endif + fd = open(*filename, O_RDWR | O_BINARY | O_CREAT | O_EXCL, 0600); + #else +- snprintf(*filename, len, "/tmp/%sXXXXXX", prefix); ++ snprintf(*filename, len, "@TERMUX_PREFIX@/tmp/%sXXXXXX", prefix); + fd = mkstemp(*filename); + #if defined(_WIN32) || defined (__ANDROID__) + if (fd < 0) { diff --git a/x11-packages/audacity/lib-src-libnyquist-nyquist-cmt-midifile.c.patch b/x11-packages/audacity/lib-src-libnyquist-nyquist-cmt-midifile.c.patch deleted file mode 100644 index 6b2a49550d78d0d..000000000000000 --- a/x11-packages/audacity/lib-src-libnyquist-nyquist-cmt-midifile.c.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- a/lib-src/libnyquist/nyquist/cmt/midifile.c -+++ b/lib-src/libnyquist/nyquist/cmt/midifile.c -@@ -380,6 +380,7 @@ - - static void - metaevent(type) -+int type; - { - int leng = msgleng(); - char *m = msg(); -@@ -510,6 +511,7 @@ - - static long - to32bit(c1,c2,c3,c4) -+int c1, c2, c3, c4; - { - long value = 0L; - diff --git a/x11-packages/audacity/lib-src-libnyquist-nyquist-cmt-midifns.c.patch b/x11-packages/audacity/lib-src-libnyquist-nyquist-cmt-midifns.c.patch index e90459b4333b10f..24feefdff83b539 100644 --- a/x11-packages/audacity/lib-src-libnyquist-nyquist-cmt-midifns.c.patch +++ b/x11-packages/audacity/lib-src-libnyquist-nyquist-cmt-midifns.c.patch @@ -1,12 +1,10 @@ ---- a/lib-src/libnyquist/nyquist/cmt/midifns.c -+++ b/lib-src/libnyquist/nyquist/cmt/midifns.c -@@ -118,7 +118,9 @@ ++++ ./lib-src/libnyquist/nyquist/cmt/midifns.c +@@ -118,7 +118,7 @@ #ifdef UNIX #ifndef UNIX_IRIX #include "sys/time.h" -+#ifndef __ANDROID__ +-#ifndef __OpenBSD__ ++#if !defined(__OpenBSD__) && !defined(__ANDROID__) #include "sys/timeb.h" -+#endif + #endif #include "cmtio.h" - #else - #include diff --git a/x11-packages/audacity/lib-src-libnyquist-nyquist-nyqsrc-handlers.c.patch b/x11-packages/audacity/lib-src-libnyquist-nyquist-nyqsrc-handlers.c.patch deleted file mode 100644 index 3df43ce9a652436..000000000000000 --- a/x11-packages/audacity/lib-src-libnyquist-nyquist-nyqsrc-handlers.c.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/lib-src/libnyquist/nyquist/nyqsrc/handlers.c -+++ b/lib-src/libnyquist/nyquist/nyqsrc/handlers.c -@@ -6,7 +6,7 @@ - - /* note -- a simple way to make a midi note on channel 1 */ - /**/ --void note(pitch, dur) -+void note(int pitch, int dur) - { - } - diff --git a/x11-packages/audacity/lib-src-libnyquist-nyquist-xlisp-security.c.patch b/x11-packages/audacity/lib-src-libnyquist-nyquist-xlisp-security.c.patch index 742f42067afd3be..615b53e40e8b620 100644 --- a/x11-packages/audacity/lib-src-libnyquist-nyquist-xlisp-security.c.patch +++ b/x11-packages/audacity/lib-src-libnyquist-nyquist-xlisp-security.c.patch @@ -1,11 +1,10 @@ https://github.com/termux/termux-packages/issues/15852 ---- a/lib-src/libnyquist/nyquist/xlisp/security.c -+++ b/lib-src/libnyquist/nyquist/xlisp/security.c -@@ -4,7 +4,7 @@ - */ ++++ ./lib-src/libnyquist/nyquist/xlisp/security.c +@@ -5,7 +5,7 @@ #include + #include "switches.h" -#if defined(UNIX) || defined(__APPLE__) || defined(__CYGWIN__) +#if defined(UNIX) || defined(__APPLE__) || defined(__CYGWIN__) || defined(__ANDROID__) #include diff --git a/x11-packages/audacity/libraries-lib-files-PathList.cpp.patch b/x11-packages/audacity/libraries-lib-files-PathList.cpp.patch new file mode 100644 index 000000000000000..e0d7e3fca958f6f --- /dev/null +++ b/x11-packages/audacity/libraries-lib-files-PathList.cpp.patch @@ -0,0 +1,59 @@ ++++ ./libraries/lib-files/PathList.cpp 2024-10-16 18:02:46.211602270 +0300 +@@ -48,7 +48,7 @@ + const auto portablePrefix = wxPathOnly(wxPathOnly(programPath)); + + // Make sure install prefix is set so wxStandardPath resolves paths properly +- if (wxDirExists(portablePrefix + L"/share/audacity")) { ++ if (wxDirExists(portablePrefix + L"@TERMUX_PREFIX@/share/audacity")) { + // use prefix relative to executable location to make Audacity portable + standardPaths.SetInstallPrefix(portablePrefix); + } else { +@@ -87,7 +87,7 @@ + + FileNames::AddUniquePathToPathList(progPath, audacityPathList); + // Add the path to modules: +- FileNames::AddUniquePathToPathList(progPath + L"/lib/audacity", audacityPathList); ++ FileNames::AddUniquePathToPathList(progPath + L"@TERMUX_PREFIX@/lib/audacity", audacityPathList); + + #if !defined(__WXMSW__) + // On Unix systems, the common directory structure is +@@ -97,8 +97,8 @@ + + if (!progParentPath.IsEmpty()) + { +- FileNames::AddUniquePathToPathList(progParentPath + L"/lib/audacity", audacityPathList); +- FileNames::AddUniquePathToPathList(progParentPath + L"/lib", audacityPathList); ++ FileNames::AddUniquePathToPathList(progParentPath + L"@TERMUX_PREFIX@/lib/audacity", audacityPathList); ++ FileNames::AddUniquePathToPathList(progParentPath + L"@TERMUX_PREFIX@/lib", audacityPathList); + } + + #if HAVE_GET_LIBRARY_PATH +@@ -116,9 +116,9 @@ + audacityPathList); + FileNames::AddUniquePathToPathList(FileNames::ModulesDir(), + audacityPathList); +- FileNames::AddUniquePathToPathList(wxString::Format(installPrefix + L"/share/%s", wxT(AUDACITY_NAME)), ++ FileNames::AddUniquePathToPathList(wxString::Format(installPrefix + L"@TERMUX_PREFIX@/share/%s", wxT(AUDACITY_NAME)), + audacityPathList); +- FileNames::AddUniquePathToPathList(wxString::Format(installPrefix + L"/share/doc/%s", wxT(AUDACITY_NAME)), ++ FileNames::AddUniquePathToPathList(wxString::Format(installPrefix + L"@TERMUX_PREFIX@/share/doc/%s", wxT(AUDACITY_NAME)), + audacityPathList); + #else //AUDACITY_NAME + FileNames::AddUniquePathToPathList(wxString::Format(wxT("%s/.audacity-files"), +@@ -126,13 +126,13 @@ + audacityPathList); + FileNames::AddUniquePathToPathList(FileNames::ModulesDir(), + audacityPathList); +- FileNames::AddUniquePathToPathList(installPrefix + L"/share/audacity", ++ FileNames::AddUniquePathToPathList(installPrefix + L"@TERMUX_PREFIX@/share/audacity", + audacityPathList); +- FileNames::AddUniquePathToPathList(installPrefix + L"/share/doc/audacity", ++ FileNames::AddUniquePathToPathList(installPrefix + L"@TERMUX_PREFIX@/share/doc/audacity", + audacityPathList); + #endif //AUDACITY_NAME + +- FileNames::AddUniquePathToPathList(installPrefix + L"/share/locale", ++ FileNames::AddUniquePathToPathList(installPrefix + L"@TERMUX_PREFIX@/share/locale", + audacityPathList); + + FileNames::AddUniquePathToPathList(wxString::Format(wxT("./locale")), diff --git a/x11-packages/audacity/libraries-lib-wx-wrappers-CMakeLists.txt.patch b/x11-packages/audacity/libraries-lib-wx-wrappers-CMakeLists.txt.patch new file mode 100644 index 000000000000000..fc40df37b61cde0 --- /dev/null +++ b/x11-packages/audacity/libraries-lib-wx-wrappers-CMakeLists.txt.patch @@ -0,0 +1,17 @@ ++++ ./libraries/lib-wx-wrappers/CMakeLists.txt +@@ -25,7 +25,7 @@ + FileDialog/mac/FileDialogPrivate.mm + FileDialog/mac/FileDialogPrivate.h + > +- $<$: ++ $<$: + FileDialog/gtk/FileDialogPrivate.cpp + FileDialog/gtk/FileDialogPrivate.h + > +@@ -42,5 +42,5 @@ + + audacity_library( lib-wx-wrappers "${SOURCES}" "${LIBRARIES}" + "" +- "$<$:PkgConfig::GTK>" ++ "$<$:PkgConfig::GTK>" + ) diff --git a/x11-packages/audacity/modules-mod-script-pipe-CMakeLists.txt.patch b/x11-packages/audacity/modules-mod-script-pipe-CMakeLists.txt.patch deleted file mode 100644 index 363eb84e6be8a56..000000000000000 --- a/x11-packages/audacity/modules-mod-script-pipe-CMakeLists.txt.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/modules/mod-script-pipe/CMakeLists.txt -+++ b/modules/mod-script-pipe/CMakeLists.txt -@@ -41,7 +41,7 @@ - list( APPEND LIBRARIES - PRIVATE - Audacity -- $<$:wxWidgets> -+ $<$:wxWidgets> - ) - - set_target_property_all( ${TARGET} LIBRARY_OUTPUT_DIRECTORY "${_DEST}/modules" ) diff --git a/x11-packages/audacity/modules-mod-script-pipe-PipeServer.cpp.patch b/x11-packages/audacity/modules-mod-script-pipe-PipeServer.cpp.patch index bd810a024151a2f..783b92bc1b5199d 100644 --- a/x11-packages/audacity/modules-mod-script-pipe-PipeServer.cpp.patch +++ b/x11-packages/audacity/modules-mod-script-pipe-PipeServer.cpp.patch @@ -1,5 +1,4 @@ ---- a/modules/mod-script-pipe/PipeServer.cpp -+++ b/modules/mod-script-pipe/PipeServer.cpp ++++ ./modules/scripting/mod-script-pipe/PipeServer.cpp @@ -114,7 +114,7 @@ #include #include diff --git a/x11-packages/audacity/no-sem.patch b/x11-packages/audacity/no-sem.patch new file mode 100644 index 000000000000000..84d91d55e864aed --- /dev/null +++ b/x11-packages/audacity/no-sem.patch @@ -0,0 +1,239 @@ +The whole sense of using semaphores here is to make sure there is only one instance running +Can be implemented using lock file ++++ ./src/AudacityApp.cpp +@@ -2094,10 +2094,7 @@ + #endif + + #if defined(__UNIX__) +- +-#include +-#include +-#include ++#include + + // Return true if there are no other instances of Audacity running, + // false otherwise. +@@ -2110,127 +2107,51 @@ + wxIPV4address addr; + addr.LocalHost(); + +- struct sembuf op = {}; +- +- // Generate the IPC key we'll use for both shared memory and semaphores. +- wxString datadir = FileNames::DataDir(); +- key_t memkey = ftok(datadir.c_str(), 0); +- key_t servkey = ftok(datadir.c_str(), 1); +- key_t lockkey = ftok(datadir.c_str(), 2); ++ wxString lockPath = "@TERMUX_PREFIX@/tmp/audacity.lock"; + +- // Create and map the shared memory segment where the port number ++ int lockFd = -1; ++ uint16_t portnum; ++ ++ // Create the file with 0666 permissions where the port number + // will be stored. +- int memid = shmget(memkey, sizeof(int), IPC_CREAT | S_IRUSR | S_IWUSR); +- if (memid == -1) +- { +- AudacityMessageBox( +- XO("Unable to create shared memory segment.\n\n" +- "error code=%d : \"%s\".").Format(errno, strerror(errno)), +- XO("Audacity Startup Failure"), +- wxOK | wxICON_ERROR); +- ++ lockFd = open(lockPath, O_RDWR | O_CREAT, 0666); ++ if (lockFd == -1) { ++ dprintf(2, "Unable to create shared memory segment. Error code=%d : \"%s\".", errno, strerror(errno)); + return false; + } + +- int *portnum = (int *) shmat(memid, nullptr, 0); +- +- // Create (or return) the SERVER semaphore ID +- int servid = semget(servkey, 1, IPC_CREAT | S_IRUSR | S_IWUSR); +- +- // Create the LOCK semaphore only if it doesn't already exist. +- int lockid = semget(lockkey, 1, IPC_CREAT | IPC_EXCL | S_IRUSR | S_IWUSR); +- +- // If the LOCK semaphore was successfully created, then this is the first +- // time Audacity has been run during this boot of the system. In this +- // case we know we'll become the "server" application, so set up the +- // semaphores to prepare for it. +- if (lockid != -1) +- { +- // Initialize value of each semaphore, 1 indicates released and 0 +- // indicates acquired. +- // +- // Note that this action is NOT recorded in the semaphore's +- // UNDO buffer. +- semctl(servid, 0, SETVAL, 1); +- semctl(lockid, 0, SETVAL, 1); +- +- // Now acquire them so the semaphores will be set to the +- // released state when the process terminates. +- op.sem_num = 0; +- op.sem_op = -1; +- op.sem_flg = SEM_UNDO; +- if (semop(lockid, &op, 1) == -1 || semop(servid, &op, 1) == -1) +- { +- AudacityMessageBox( +- XO("Unable to acquire semaphores.\n\n" +- "This is likely due to a resource shortage\n" +- "and a reboot may be required."), +- XO("Audacity Startup Failure"), +- wxOK | wxICON_ERROR); +- +- return false; +- } +- +- // We will be the server... +- isServer = true; +- } +- // Something catastrophic must have happened, so bail. +- else if (errno != EEXIST) +- { +- AudacityMessageBox( +- XO("Unable to create semaphores.\n\n" +- "This is likely due to a resource shortage\n" +- "and a reboot may be required."), +- XO("Audacity Startup Failure"), +- wxOK | wxICON_ERROR); +- ++ // Resize the file to 2 bytes ++ if (ftruncate(lockFd, 2) == -1) { ++ dprintf(2, "Unable to truncate shared memory segment. Error code=%d : \"%s\".", errno, strerror(errno)); ++ close(lockFd); + return false; + } +- // Otherwise it's a normal startup and we need to determine whether +- // we'll be the server or the client. +- else ++ ++ // Let's assume first byte holds SERVER lock and the second one holds CLIENT lock. + { +- // Retrieve the LOCK semaphore since we wouldn't have gotten it above. +- lockid = semget(lockkey, 1, 0); +- +- // Acquire the LOCK semaphore. We may block here if another +- // process is currently setting up the server. +- op.sem_num = 0; +- op.sem_op = -1; +- op.sem_flg = SEM_UNDO; +- if (semop(lockid, &op, 1) == -1) +- { +- AudacityMessageBox( +- XO("Unable to acquire lock semaphore.\n\n" +- "This is likely due to a resource shortage\n" +- "and a reboot may be required."), +- XO("Audacity Startup Failure"), +- wxOK | wxICON_ERROR); +- ++ struct flock client = { .l_type = F_WRLCK, .l_whence = SEEK_SET, .l_start = 1, .l_len = 1 }; ++ // CLIENT lock so we should wait until it unlocks. ++ if (fcntl(lockFd, F_SETLKW, &client) == -1) { ++ dprintf(2, "Failed to obtain CLIENT lock. Error code=%d : \"%s\".", errno, strerror(errno)); ++ close(lockFd); + return false; + } ++ } + +- // Try to acquire the SERVER semaphore. If it's not currently active, then +- // we will become the server. Otherwise, this will fail and we'll know that +- // the server is already active and we will become the client. +- op.sem_num = 0; +- op.sem_op = -1; +- op.sem_flg = IPC_NOWAIT | SEM_UNDO; +- if (semop(servid, &op, 1) == 0) +- { ++ { ++ struct flock server = { .l_type = F_WRLCK, .l_whence = SEEK_SET, .l_start = 0, .l_len = 1 }; ++ // SERVER lock, we only check if there is other server available. ++ if (fcntl(lockFd, F_SETLK, &server) == -1) { ++ if (errno == EAGAIN || errno == EACCES) ++ // Other process alredy set the lock. ++ isServer = false; ++ else { ++ dprintf(2, "Failed to obtain SERVER lock. Error code=%d : \"%s\".", errno, strerror(errno)); ++ close(lockFd); ++ return false; ++ } ++ } else + isServer = true; +- } +- else if (errno != EAGAIN) +- { +- AudacityMessageBox( +- XO("Unable to acquire server semaphore.\n\n" +- "This is likely due to a resource shortage\n" +- "and a reboot may be required."), +- XO("Audacity Startup Failure"), +- wxOK | wxICON_ERROR); +- +- return false; +- } + } + + // Initialize the socket server if we're to be the server. +@@ -2251,16 +2172,25 @@ + // Save the port number in shared memory so that clients + // know where to connect. + mIPCServ->GetLocal(addr); +- *portnum = addr.Service(); ++ portnum = addr.Service(); ++ lseek(lockFd, 0, SEEK_SET); ++ if (write(lockFd, &portnum, 2) != 2) { ++ dprintf(2, "Failed to write portnum. Error code=%d : \"%s\".", errno, strerror(errno)); ++ close(lockFd); ++ return false; ++ } + } + +- // Now that the server is active, we release the LOCK semaphore +- // to allow any waiters to continue. The SERVER semaphore will ++ // Now that the server is active, we release the CLIENT lock ++ // to allow any waiters to continue. The SERVER lock will + // remain locked for the duration of this processes execution + // and will be cleaned up by the system. +- op.sem_num = 0; +- op.sem_op = 1; +- semop(lockid, &op, 1); ++ struct flock client = { .l_type = F_UNLCK, .l_whence = SEEK_SET, .l_start = 1, .l_len = 1 }; ++ if (fcntl(lockFd, F_SETLK, &client) == -1) { ++ dprintf(2, "Failed to release CLIENT lock. Error code=%d : \"%s\".", errno, strerror(errno)); ++ close(lockFd); ++ return false; ++ } + + // Bail if the server creation failed. + if (mIPCServ == nullptr) +@@ -2281,12 +2211,25 @@ + } + + // Retrieve the port number that the server is listening on. +- addr.Service(*portnum); ++ lseek(lockFd, 0, SEEK_SET); ++ if (read(lockFd, &portnum, 2) != 2) { ++ AudacityMessageBox( ++ XO("Failed to read portnum.\n\n" ++ "error code=%d : \"%s\".").Format(errno, strerror(errno)), ++ XO("Audacity Startup Failure"), ++ wxOK | wxICON_ERROR); ++ close(lockFd); ++ return 1; ++ } ++ addr.Service(portnum); + +- // Now release the LOCK semaphore. +- op.sem_num = 0; +- op.sem_op = 1; +- semop(lockid, &op, 1); ++ // Now release the CLIENT lock. ++ struct flock client = { .l_type = F_UNLCK, .l_whence = SEEK_SET, .l_start = 1, .l_len = 1 }; ++ if (fcntl(lockFd, F_SETLK, &client) == -1) { ++ dprintf(2, "Failed to release CLIENT lock. Error code=%d : \"%s\".", errno, strerror(errno)); ++ close(lockFd); ++ return false; ++ } + + // If we get here, then Audacity is currently active. So, we connect + // to it and we forward all filenames listed on the command line to diff --git a/x11-packages/audacity/src-AudacityApp.cpp.patch b/x11-packages/audacity/src-AudacityApp.cpp.patch index f74213630307008..9e2fea5a90b7aad 100644 --- a/x11-packages/audacity/src-AudacityApp.cpp.patch +++ b/x11-packages/audacity/src-AudacityApp.cpp.patch @@ -1,20 +1,19 @@ ---- a/src/AudacityApp.cpp -+++ b/src/AudacityApp.cpp -@@ -964,7 +964,7 @@ ++++ ./src/AudacityApp.cpp +@@ -1148,7 +1148,7 @@ #define WL(lang,sublang) #endif --#if wxCHECK_VERSION(3, 0, 1) -+#if wxCHECK_VERSION(3, 0, 1) && !defined __ANDROID__ +-#if wxCHECK_VERSION(3, 0, 1) && !wxCHECK_VERSION(3, 1, 6) ++#if wxCHECK_VERSION(3, 0, 1) && !wxCHECK_VERSION(3, 1, 6) && !defined __ANDROID__ wxLanguageInfo userLangs[] = { - // Bosnian is defined in wxWidgets already -@@ -1270,7 +1270,7 @@ + // Included upstream in version 3.1.6 +@@ -1361,7 +1361,7 @@ // // TODO: The whole Language initialization really need to be reworked. // It's all over the place. --#if wxCHECK_VERSION(3, 0, 1) -+#if wxCHECK_VERSION(3, 0, 1) && !defined __ANDROID__ +-#if wxCHECK_VERSION(3, 0, 1) && !wxCHECK_VERSION(3, 1, 6) ++#if wxCHECK_VERSION(3, 0, 1) && !wxCHECK_VERSION(3, 1, 6) && !defined __ANDROID__ for (size_t i = 0, cnt = WXSIZEOF(userLangs); i < cnt; i++) { wxLocale::AddLanguage(userLangs[i]); diff --git a/x11-packages/audacity/src-AudioIOBase.cpp.patch b/x11-packages/audacity/src-AudioIOBase.cpp.patch deleted file mode 100644 index e906655c654f7b7..000000000000000 --- a/x11-packages/audacity/src-AudioIOBase.cpp.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/src/AudioIOBase.cpp -+++ b/src/AudioIOBase.cpp -@@ -21,6 +21,7 @@ - #include "prefs/RecordingPrefs.h" - #include "widgets/MeterPanelBase.h" - -+#include "portaudio.h" - #if USE_PORTMIXER - #include "portmixer.h" - #endif diff --git a/x11-packages/audacity/src-CMakeLists.txt.patch b/x11-packages/audacity/src-CMakeLists.txt.patch index f2757f2ba438335..eaf4f540947bb25 100644 --- a/x11-packages/audacity/src-CMakeLists.txt.patch +++ b/x11-packages/audacity/src-CMakeLists.txt.patch @@ -1,15 +1,12 @@ ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -1090,9 +1090,9 @@ - $<$:sbsms> ++++ ./src/CMakeLists.txt +@@ -1019,8 +1019,8 @@ + $<$:libsbsms> $<$:soundtouch> $<$:libvamp> - $<$:PkgConfig::GLIB> - $<$:PkgConfig::GTK> -- $<$:z> + $<$:PkgConfig::GLIB> + $<$:PkgConfig::GTK> -+ $<$:z> - $<$:pthread> + $<$:Threads::Threads> ) diff --git a/x11-packages/audacity/src-FFmpeg.h.patch b/x11-packages/audacity/src-FFmpeg.h.patch deleted file mode 100644 index 4d075582f211a31..000000000000000 --- a/x11-packages/audacity/src-FFmpeg.h.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/src/FFmpeg.h -+++ b/src/FFmpeg.h -@@ -328,7 +328,7 @@ - - wxString GetLibAVFormatPath() - { -- return wxT(""); -+ return wxT("@TERMUX_PREFIX@/opt/audacity/lib"); - } - - wxString GetLibAVFormatName() diff --git a/x11-packages/audacity/src-ListNavigaionPanel.h.patch b/x11-packages/audacity/src-ListNavigaionPanel.h.patch new file mode 100644 index 000000000000000..7e25ee5b946ab54 --- /dev/null +++ b/x11-packages/audacity/src-ListNavigaionPanel.h.patch @@ -0,0 +1,11 @@ +https://bugs.gentoo.org/915041 ++++ ./src/ListNavigationPanel.h +@@ -13,7 +13,7 @@ + #include + #include + +-#if !defined(__FreeBSD__) && !defined(__OpenBSD__) ++#if !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__ANDROID__) + extern template class WXDLLIMPEXP_CORE wxNavigationEnabled; + #endif + diff --git a/x11-packages/audacity/src-MixerBoard.cpp.patch b/x11-packages/audacity/src-MixerBoard.cpp.patch deleted file mode 100644 index 3403646c7e88339..000000000000000 --- a/x11-packages/audacity/src-MixerBoard.cpp.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/src/MixerBoard.cpp -+++ b/src/MixerBoard.cpp -@@ -1304,7 +1304,7 @@ - wxMemoryDC dc; - - for (const auto &data : table) { -- auto bmp = std::make_unique(data.bitmap,24); -+ auto bmp = std::make_unique(data.bitmap); - dc.SelectObject(*bmp); - AColor::Bevel(dc, false, bev); - mMusicalInstruments.push_back(std::make_unique( diff --git a/x11-packages/audacity/static-sqlite.patch b/x11-packages/audacity/static-sqlite.patch new file mode 100644 index 000000000000000..4f3e4d29369696c --- /dev/null +++ b/x11-packages/audacity/static-sqlite.patch @@ -0,0 +1,8 @@ ++++ ./cmake-proxies/sqlite/CMakeLists.txt +@@ -1,5 +1,5 @@ + +-add_library( ${TARGET} SHARED ) ++add_library( ${TARGET} STATIC ) + + def_vars() +