mirror of
https://github.com/Yonokid/PyTaiko.git
synced 2026-02-04 11:40:13 +01:00
Update python-app.yml
This commit is contained in:
142
.github/workflows/python-app.yml
vendored
142
.github/workflows/python-app.yml
vendored
@@ -47,53 +47,82 @@ jobs:
|
|||||||
mingw-w64-x86_64-cmake
|
mingw-w64-x86_64-cmake
|
||||||
mingw-w64-x86_64-pkg-config
|
mingw-w64-x86_64-pkg-config
|
||||||
|
|
||||||
# Download pre-built PortAudio with ASIO support (Windows only)
|
# Download individual PortAudio files (Windows only)
|
||||||
- name: Download pre-built PortAudio with ASIO (Windows)
|
- name: Download PortAudio individual files (Windows)
|
||||||
if: runner.os == 'Windows'
|
if: runner.os == 'Windows'
|
||||||
shell: msys2 {0}
|
shell: msys2 {0}
|
||||||
run: |
|
run: |
|
||||||
# Create directory for pre-built libraries
|
# Create directory structure for PortAudio
|
||||||
mkdir -p /mingw64/prebuilt
|
mkdir -p /mingw64/portaudio-custom/{include,lib,bin}
|
||||||
cd /mingw64/prebuilt
|
cd /mingw64/portaudio-custom
|
||||||
|
|
||||||
# Try multiple sources for pre-built PortAudio with ASIO
|
# Download header files
|
||||||
echo "=== Attempting to download pre-built PortAudio with ASIO ==="
|
echo "Downloading PortAudio headers..."
|
||||||
|
curl -L -o include/portaudio.h https://raw.githubusercontent.com/PortAudio/portaudio/master/include/portaudio.h
|
||||||
|
|
||||||
# Option 1: Try PortAudio Windows binaries
|
# Download Windows-specific DLL and import library
|
||||||
curl -L https://github.com/PortAudio/portaudio/releases/download/v19.7.0/pa_stable_v190700_20210406_msvc.zip -o portaudio_msvc.zip 2>/dev/null || echo "MSVC binaries not available"
|
# Note: You'll need to find actual URLs for these files
|
||||||
|
echo "Downloading PortAudio binaries..."
|
||||||
|
|
||||||
# Option 2: Try community builds
|
# Option 1: From a release that provides individual files
|
||||||
curl -L https://github.com/spatialaudio/portaudio-binaries/raw/master/libportaudio64bit-asio.dll -o libportaudio64bit-asio.dll 2>/dev/null || echo "Community binaries not available"
|
curl -L -o lib/libportaudio.dll.a https://example.com/path/to/libportaudio.dll.a
|
||||||
|
curl -L -o lib/portaudio.lib https://example.com/path/to/portaudio.lib # MSVC-style
|
||||||
|
curl -L -o bin/portaudio_x64.dll https://example.com/path/to/portaudio_x64.dll
|
||||||
|
|
||||||
# Option 3: Try a known working ASIO-enabled build
|
# Option 2: Alternative sources (adjust URLs as needed)
|
||||||
curl -L https://www.un4seen.com/files/z/1/bass24-win32.zip -o bass_example.zip 2>/dev/null || echo "Alternative audio library not available"
|
# curl -L -o lib/libportaudio.a https://github.com/some-repo/portaudio-static/releases/download/v19.7.0/libportaudio.a
|
||||||
|
# curl -L -o bin/portaudio.dll https://github.com/some-repo/portaudio-binaries/releases/download/v19.7.0/portaudio.dll
|
||||||
|
|
||||||
# Check what we downloaded
|
# Verify downloads
|
||||||
ls -la *.zip 2>/dev/null || echo "No zip files downloaded"
|
echo "=== Downloaded files ==="
|
||||||
|
find . -type f -ls
|
||||||
|
|
||||||
# Extract what we have
|
- name: Set up PortAudio build environment (Windows)
|
||||||
for zip_file in *.zip; do
|
|
||||||
if [ -f "$zip_file" ]; then
|
|
||||||
echo "Extracting $zip_file"
|
|
||||||
unzip -q "$zip_file" 2>/dev/null || echo "Failed to extract $zip_file"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
# Look for PortAudio files
|
|
||||||
find . -name "*portaudio*" -o -name "*asio*" 2>/dev/null || echo "No PortAudio/ASIO files found in downloads"
|
|
||||||
|
|
||||||
- name: Verify ASIO support (Windows)
|
|
||||||
if: runner.os == 'Windows'
|
if: runner.os == 'Windows'
|
||||||
shell: msys2 {0}
|
shell: msys2 {0}
|
||||||
run: |
|
run: |
|
||||||
# Check if ASIO symbols are present in PortAudio
|
# Create pkg-config file for custom PortAudio
|
||||||
echo "=== Checking for ASIO support in PortAudio ==="
|
mkdir -p /mingw64/lib/pkgconfig
|
||||||
|
cat > /mingw64/lib/pkgconfig/portaudio-custom.pc << EOF
|
||||||
|
prefix=/mingw64/portaudio-custom
|
||||||
|
exec_prefix=\${prefix}
|
||||||
|
libdir=\${prefix}/lib
|
||||||
|
includedir=\${prefix}/include
|
||||||
|
|
||||||
# Look for ASIO in the installed library
|
Name: PortAudio
|
||||||
find /mingw64 -name "*portaudio*" -exec nm {} \; 2>/dev/null | grep -i asio && echo "ASIO symbols found!" || echo "No ASIO symbols found - will use DirectSound/WASAPI fallback"
|
Description: Portable cross-platform Audio API
|
||||||
|
Version: 19.7.0
|
||||||
|
Libs: -L\${libdir} -lportaudio -lole32 -luuid -lwinmm -ldsound -lwsock32 -lsetupapi
|
||||||
|
Cflags: -I\${includedir}
|
||||||
|
EOF
|
||||||
|
|
||||||
# Check what audio APIs are available
|
# Or set environment variables directly
|
||||||
pkg-config --cflags --libs portaudio 2>/dev/null || echo "Using manual linking flags"
|
export PORTAUDIO_INCLUDE_DIR="/mingw64/portaudio-custom/include"
|
||||||
|
export PORTAUDIO_LIB_DIR="/mingw64/portaudio-custom/lib"
|
||||||
|
export PORTAUDIO_BIN_DIR="/mingw64/portaudio-custom/bin"
|
||||||
|
|
||||||
|
- name: Verify PortAudio setup (Windows)
|
||||||
|
if: runner.os == 'Windows'
|
||||||
|
shell: msys2 {0}
|
||||||
|
run: |
|
||||||
|
echo "=== Verifying PortAudio setup ==="
|
||||||
|
|
||||||
|
# Check header file
|
||||||
|
if [ -f "/mingw64/portaudio-custom/include/portaudio.h" ]; then
|
||||||
|
echo "✓ Header file found"
|
||||||
|
grep -i "asio\|version" /mingw64/portaudio-custom/include/portaudio.h | head -5
|
||||||
|
else
|
||||||
|
echo "✗ Header file missing"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check library files
|
||||||
|
ls -la /mingw64/portaudio-custom/lib/ || echo "Library directory not found"
|
||||||
|
|
||||||
|
# Check DLL
|
||||||
|
ls -la /mingw64/portaudio-custom/bin/ || echo "Binary directory not found"
|
||||||
|
|
||||||
|
# Test if we can find ASIO symbols (if available)
|
||||||
|
find /mingw64/portaudio-custom -name "*.dll" -o -name "*.a" -exec nm {} \; 2>/dev/null | grep -i asio && echo "ASIO symbols found!" || echo "No ASIO symbols found"
|
||||||
|
|
||||||
- name: Build static audio library (Windows)
|
- name: Build static audio library (Windows)
|
||||||
if: runner.os == 'Windows'
|
if: runner.os == 'Windows'
|
||||||
@@ -103,31 +132,54 @@ jobs:
|
|||||||
# Clean previous builds
|
# Clean previous builds
|
||||||
make clean 2>/dev/null || echo "No previous build to clean"
|
make clean 2>/dev/null || echo "No previous build to clean"
|
||||||
|
|
||||||
# Build with PortAudio support
|
# Build with custom PortAudio
|
||||||
# Add ASIO flag but don't fail if not available
|
|
||||||
export CFLAGS="$CFLAGS -DPA_USE_ASIO=1"
|
export CFLAGS="$CFLAGS -DPA_USE_ASIO=1"
|
||||||
export PKG_CONFIG_PATH="/mingw64/lib/pkgconfig:$PKG_CONFIG_PATH"
|
|
||||||
|
|
||||||
# Try building with pkg-config first, then fallback to manual flags
|
# Method 1: Use pkg-config with custom .pc file
|
||||||
if pkg-config --exists portaudio; then
|
if pkg-config --exists portaudio-custom; then
|
||||||
echo "Building with pkg-config PortAudio support"
|
echo "Building with custom pkg-config PortAudio"
|
||||||
make all PORTAUDIO_CFLAGS="$(pkg-config --cflags portaudio)" PORTAUDIO_LIBS="$(pkg-config --libs portaudio)"
|
make all PORTAUDIO_CFLAGS="$(pkg-config --cflags portaudio-custom)" PORTAUDIO_LIBS="$(pkg-config --libs portaudio-custom)"
|
||||||
|
|
||||||
|
# Method 2: Use environment variables
|
||||||
|
elif [ -d "/mingw64/portaudio-custom" ]; then
|
||||||
|
echo "Building with custom PortAudio paths"
|
||||||
|
make all \
|
||||||
|
PORTAUDIO_CFLAGS="-I/mingw64/portaudio-custom/include" \
|
||||||
|
PORTAUDIO_LIBS="-L/mingw64/portaudio-custom/lib -lportaudio -lole32 -luuid -lwinmm -ldsound -lwsock32 -lsetupapi"
|
||||||
|
|
||||||
|
# Method 3: Fallback to system PortAudio
|
||||||
else
|
else
|
||||||
echo "Building with manual PortAudio linking"
|
echo "Falling back to system PortAudio"
|
||||||
make all PORTAUDIO_LIBS="-lportaudio -lole32 -luuid -lwinmm -ldsound -lwsock32 -lsetupapi"
|
if pkg-config --exists portaudio; then
|
||||||
|
make all PORTAUDIO_CFLAGS="$(pkg-config --cflags portaudio)" PORTAUDIO_LIBS="$(pkg-config --libs portaudio)"
|
||||||
|
else
|
||||||
|
make all PORTAUDIO_LIBS="-lportaudio -lole32 -luuid -lwinmm -ldsound -lwsock32 -lsetupapi"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Verify the build
|
# Verify the build
|
||||||
make verify 2>/dev/null || echo "Verification step not available"
|
make verify 2>/dev/null || echo "Verification step not available"
|
||||||
|
|
||||||
- name: Copy static DLL (Windows)
|
- name: Copy libraries and DLLs (Windows)
|
||||||
if: runner.os == 'Windows'
|
if: runner.os == 'Windows'
|
||||||
run: |
|
run: |
|
||||||
mkdir -p build/lib
|
mkdir -p build/lib
|
||||||
|
|
||||||
|
# Copy your built library
|
||||||
cp libs/audio/libaudio.dll build/lib/
|
cp libs/audio/libaudio.dll build/lib/
|
||||||
|
|
||||||
# No need to copy other DLLs since everything is statically linked!
|
# Copy the custom PortAudio DLL if it exists
|
||||||
echo "Static build complete - single DLL created"
|
if [ -f "/mingw64/portaudio-custom/bin/portaudio.dll" ]; then
|
||||||
|
cp /mingw64/portaudio-custom/bin/portaudio.dll build/lib/
|
||||||
|
echo "✓ Custom PortAudio DLL copied"
|
||||||
|
elif [ -f "/mingw64/portaudio-custom/bin/portaudio_x64.dll" ]; then
|
||||||
|
cp /mingw64/portaudio-custom/bin/portaudio_x64.dll build/lib/
|
||||||
|
echo "✓ Custom PortAudio x64 DLL copied"
|
||||||
|
else
|
||||||
|
echo "⚠ No custom PortAudio DLL found - runtime may need system PortAudio"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Build output:"
|
||||||
ls -la build/lib/
|
ls -la build/lib/
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user