这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/libsoundtouch/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
11 changes: 0 additions & 11 deletions packages/libsoundtouch/source-SoundTouchDLL-Makefile.am.patch

This file was deleted.

21 changes: 17 additions & 4 deletions packages/portaudio/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
27 changes: 27 additions & 0 deletions packages/portaudio/fix-threading.patch
Original file line number Diff line number Diff line change
@@ -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;
}
31 changes: 31 additions & 0 deletions packages/portaudio/sles.patch
Original file line number Diff line number Diff line change
@@ -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,
10 changes: 10 additions & 0 deletions x11-packages/audacity/AudacityFunctions.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
+++ ./cmake-proxies/cmake-modules/AudacityFunctions.cmake
@@ -586,7 +586,7 @@
add_custom_command(
TARGET "${TARGET}"
POST_BUILD
- COMMAND "$<IF:$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>,${nostrip}>,echo,strip>" -x $<TARGET_FILE:${TARGET}>
+ COMMAND "$<IF:$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>,${nostrip}>,echo,llvm-strip>" -x $<TARGET_FILE:${TARGET}>
)
endif()

3 changes: 1 addition & 2 deletions x11-packages/audacity/CMakeLists.txt.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
+++ ./CMakeLists.txt
@@ -226,6 +226,7 @@
message( STATUS "Building for 32-bit target" )
endif()
Expand Down
112 changes: 93 additions & 19 deletions x11-packages/audacity/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,47 +2,117 @@ 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
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}"
Expand Down Expand Up @@ -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() {
Expand Down Expand Up @@ -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
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

10 changes: 10 additions & 0 deletions x11-packages/audacity/cmake-proxies.patch
Original file line number Diff line number Diff line change
@@ -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 )
Loading