Skip to content

Commit 5875a20

Browse files
author
GitHub Actions Fix
committed
build: enforce static library build for PortAudio and update error messages
1 parent 7a395d9 commit 5875a20

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

.github/workflows/build-and-release.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,13 @@ jobs:
101101
cd build
102102
103103
if [ "${{ runner.os }}" = "Windows" ]; then
104-
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../install
104+
# Force static library build to preserve libportaudio*.a install outputs
105+
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../install -DPA_BUILD_SHARED_LIBS=OFF
105106
cmake --build . --config Release
106107
cmake --install . --config Release
107108
else
108-
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../install
109+
# Force static library build to preserve libportaudio*.a install outputs
110+
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../install -DPA_BUILD_SHARED_LIBS=OFF
109111
make -j$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 4)
110112
make install
111113
fi

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# PlayBuffer
22

3-
A simple cross-platform audio player that reads raw float audio samples from stdin and plays them through the default audio output device using PortAudio.
3+
A simple cross-platform audio player that reads raw float audio samples from stdin and plays them through the default audio output device using [PortAudio](https://github.com/PortAudio/portaudio).
44

55
## Purpose
66

scripts/build-macos.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ fi
2727
# Find PortAudio static library under ${PA_PREFIX}/lib
2828
PA_LIB=$(find "$PA_PREFIX/lib" -name "libportaudio*.a" | head -n 1)
2929
if [ -z "$PA_LIB" ]; then
30-
echo "Error: Could not find PortAudio static library in portaudio/install/lib"
30+
echo "Error: Could not find PortAudio static library in $PA_PREFIX/lib"
3131
exit 1
3232
fi
3333

@@ -38,7 +38,7 @@ echo "Compiling play_buffer..."
3838
gcc -o play_buffer play_buffer.c \
3939
-DPLAYBUFFER_VERSION="\"$VERSION\"" \
4040
-DPORTAUDIO_COMMIT="\"$PORTAUDIO_COMMIT\"" \
41-
-I portaudio/install/include \
41+
-I "$PA_PREFIX/include" \
4242
"$PA_LIB" \
4343
-framework CoreAudio \
4444
-framework CoreFoundation \

scripts/build-ubuntu.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ fi
2727
# Find PortAudio static library under ${PA_PREFIX}/lib
2828
PA_LIB=$(find "$PA_PREFIX/lib" -name "libportaudio*.a" | head -n 1)
2929
if [ -z "$PA_LIB" ]; then
30-
echo "Error: Could not find PortAudio static library in portaudio/install/lib"
30+
echo "Error: Could not find PortAudio static library in $PA_PREFIX/lib"
3131
exit 1
3232
fi
3333

@@ -42,7 +42,7 @@ echo "Compiling play_buffer..."
4242
gcc -o play_buffer play_buffer.c \
4343
-DPLAYBUFFER_VERSION="\"$VERSION\"" \
4444
-DPORTAUDIO_COMMIT="\"$PORTAUDIO_COMMIT\"" \
45-
-I portaudio/install/include \
45+
-I "$PA_PREFIX/include" \
4646
"$PA_LIB" \
4747
-lm -lpthread -lasound
4848

0 commit comments

Comments
 (0)