Skip to content

Commit

Permalink
desubmodulize portaudio - PLEASE READ
Browse files Browse the repository at this point in the history
this is necessary in order to get Furnace to build using CMake 4.0.

you should do:

git submodule deinit extern/portaudio
  • Loading branch information
tildearrow committed Feb 22, 2025
1 parent c58a7cb commit 165b814
Show file tree
Hide file tree
Showing 328 changed files with 190,256 additions and 6 deletions.
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,3 @@
[submodule "extern/adpcm"]
path = extern/adpcm
url = https://github.com/superctr/adpcm
[submodule "extern/portaudio"]
path = extern/portaudio
url = https://github.com/PortAudio/portaudio.git
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.0)
cmake_minimum_required(VERSION 3.0...3.16)

if (APPLE)
set(MACOSX_DEPLOYMENT_TARGET 10.9)
Expand Down Expand Up @@ -310,7 +310,7 @@ if (WITH_PORTAUDIO)
set(PA_BUILD_SHARED_LIBS OFF CACHE BOOL "Build dynamic library" FORCE)
# don't - Furnace has its own implementation
set(PA_USE_JACK OFF CACHE BOOL "Enable support for JACK Audio Connection Kit" FORCE)
add_subdirectory(extern/portaudio EXCLUDE_FROM_ALL)
add_subdirectory(extern/portaudio-modified EXCLUDE_FROM_ALL)
list(APPEND DEPENDENCIES_LIBRARIES PortAudio)
message(STATUS "Using vendored PortAudio")
endif()
Expand Down
1 change: 0 additions & 1 deletion extern/portaudio
Submodule portaudio deleted from 6ee983
13 changes: 13 additions & 0 deletions extern/portaudio-modified/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# EditorConfig info: https://editorconfig.org/
root = true

[Makefile*]
indent_style = tab

[*.{c,cpp,h,cxx,hxx}]
indent_style = space
indent_size = 4
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
max_line_length = 120
43 changes: 43 additions & 0 deletions extern/portaudio-modified/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Set the default behavior, in case people don't have core.autocrlf set.
* text=auto

# Explicitly declare text files you want to always be normalized and converted
# to native line endings on checkout.
*.c text
*.h text
*.cpp text
*.hpp text
*.fth text
*.java text
*.f text
*.txt text
*.dox text
*.m text

# Declare files that will always have CRLF line endings on checkout.
*.sln text eol=crlf
*.def text eol=crlf
*.dsp text eol=crlf
*.dsw text eol=crlf
*.vcproj text eol=crlf
*.sln text eol=crlf
*.doc text eol=crlf
*.bat text eol=crlf

# Denote all files that are truly binary and should not be modified.
*.dic binary
*.odt binary
*.pdf binary
*.png binary
*.jpg binary
*.wav binary
*.la binary
config.guess binary
config.status binary
config.sub binary
configure binary
depcomp binary
install-sh binary
libtool binary
missing binary

36 changes: 36 additions & 0 deletions extern/portaudio-modified/.github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

(Please use the mailing list for support requests and general discussion. This is only for actual bugs.)

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior. Include code if applicable.
1.

**Expected behavior**
A clear and concise description of what you expected to happen.

**Actual behavior**
What actually happened.
Include a recording if helpful.
Error messages or logs longer than a page should be attached as a .txt file.

**Desktop (please complete the following information):**
- OS: [e.g. Mac OS]
- OS Version [e.g. 22]
- PortAudio version: stable, nightly snapshot (which?), current (please give date and/or Git hash):
- If Windows or Linux, which Host API (e.g. WASAPI):

**Additional context**
Add any other context about the problem here.

Note: PortAudio is a community supported project. If you have a solution, please create a Pull Request for us to consider.
5 changes: 5 additions & 0 deletions extern/portaudio-modified/.github/asiosdk-version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
GitHub Actions uses the hash of this file as the cache key for the ASIO SDK.
Update this file when a new version of the ASIO SDK is released to trigger
a new download on GitHub Actions instead of using the old cache.

asiosdk_2.3.3_2019-06-14.zip
96 changes: 96 additions & 0 deletions extern/portaudio-modified/.github/workflows/MSBuild.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
name: MSBuild MSVC Project File CI

on: [push, pull_request]

env:
# Path to the solution file relative to the root of the project.
SOLUTION_FILE_PATH: ./msvc/portaudio.sln
VCPROJ_FILE_PATH: ./msvc/portaudio.vcproj
VCXPROJ_FILE_PATH: ./msvc/portaudio.vcxproj
VCXPROJ_FILTERS_FILE_PATH: ./msvc/portaudio.vcxproj.filters
VCXPROJ_USER_FILE_PATH: ./msvc/portaudio.vcxproj.user
DEF_FILE_PATH: ./msvc/portaudio.def

jobs:
build:
runs-on: windows-latest
strategy:
matrix:
BUILD_CONFIGURATION: [Release]
BUILD_PLATFORM: [Win32, x64]

steps:
- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v1

- uses: actions/checkout@v2

- name: Upgrade VC Project File
# We maintain our vcproj file in an old format to maintain backwards compatibility
# This step upgrades the project to the latest version of MSVC
# see https://docs.microsoft.com/en-us/visualstudio/ide/reference/upgrade-devenv-exe?view=vs-2019
# pipe to file to ensure that it terminates https://stackoverflow.com/questions/48896010/occasionally-occurring-msbuild-error-msb3428/48918105#48918105
# discussion of using vswhere.exe here: https://stackoverflow.com/questions/65287456/how-to-upgrade-a-visual-studio-project-from-within-a-github-action/65311868#65311868
run: |
$devenv = & vswhere.exe '-property' productPath
Write-Output "$devenv"
& $devenv "${{env.VCPROJ_FILE_PATH}}" /Upgrade /NoSplash | Out-Null
Write-Output "devenv launched"
while (!(Test-Path "${{env.VCXPROJ_FILE_PATH}}")) { Start-Sleep -Seconds 10 }
Write-Output "vcxproj found"
while (!(Test-Path "${{env.VCXPROJ_FILTERS_FILE_PATH}}")) { Start-Sleep -Seconds 10 }
Write-Output "vcxproj.filters found"
Start-Sleep -Seconds 10
Write-Output "done."
- name: Remove ASIO Files and Enable PA_USE_DS=1
# Process the project files to remove ASIO-related sources and includes (since we can not access the ASIO SDK in a public build)
run: |
# Process .vcxproj file: remove source files
$xdoc = new-object System.Xml.XmlDocument
$vcxprojFile = resolve-path("${{env.VCXPROJ_FILE_PATH}}")
$xdoc.load($vcxprojFile)
$namespace = New-Object -TypeName "Xml.XmlNamespaceManager" -ArgumentList $xdoc.NameTable
$namespace.AddNamespace("vs", $xdoc.DocumentElement.NamespaceURI)
$nodes = $xdoc.SelectNodes("//vs:ClCompile[contains(@Include, '..\src\hostapi\asio')]", $namespace)
Write-Output "deleting ASIO related compilation nodes from .vcxproj:"
Write-Output $nodes
ForEach($node in $nodes) {
$parent = $node.ParentNode
$parent.RemoveChild($node)
}
# Enable DirectSound host API
$nodes = $xdoc.SelectNodes("//vs:PreprocessorDefinitions[contains(., 'PA_USE_DS=0')]", $namespace)
ForEach($node in $nodes) {
$text = $node.InnerText
$node.InnerText = $text -replace 'PA_USE_DS=0', 'PA_USE_DS=1'
}
$xdoc.save($vcxprojFile)
# Process .vcxproj.filters file: remove source files and includes
$vcxprojFiltersFile = resolve-path("${{env.VCXPROJ_FILTERS_FILE_PATH}}")
$xdoc.load($vcxprojFiltersFile)
$namespace = New-Object -TypeName "Xml.XmlNamespaceManager" -ArgumentList $xdoc.NameTable
$namespace.AddNamespace("vs", $xdoc.DocumentElement.NamespaceURI)
$nodes = $xdoc.SelectNodes("//vs:ClCompile[contains(@Include, '..\src\hostapi\asio')]", $namespace)
Write-Output "deleting ASIO related compilation nodes from .vcxproj.filters:"
Write-Output $nodes
ForEach($node in $nodes) {
$parent = $node.ParentNode
$parent.RemoveChild($node)
}
$nodes = $xdoc.SelectNodes("//vs:ClInclude[contains(@Include, 'pa_asio.h')]", $namespace)
Write-Output "deleting ASIO related include nodes from .vcxproj.filters:"
Write-Output $nodes
ForEach($node in $nodes) {
$parent = $node.ParentNode
$parent.RemoveChild($node)
}
$xdoc.save($vcxprojFiltersFile)
# Process .def file: remove PaAsio_ symbols
Set-Content -Path "${{env.DEF_FILE_PATH}}" -Value (Get-Content -Path "${{env.DEF_FILE_PATH}}" | Select-String -Pattern 'PaAsio_' -NotMatch)
- name: Build
working-directory: ${{env.GITHUB_WORKSPACE}}
# Add additional options to the MSBuild command line here (like platform or verbosity level).
# See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference
run: msbuild /m /p:Configuration=${{matrix.BUILD_CONFIGURATION}} /p:Platform=${{matrix.BUILD_PLATFORM}} ${{env.VCXPROJ_FILE_PATH}}
20 changes: 20 additions & 0 deletions extern/portaudio-modified/.github/workflows/autotools.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: autotools build

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build-autotools:

runs-on: ubuntu-latest
name: Ubuntu

steps:
- uses: actions/checkout@v2
- name: configure
run: ./configure
- name: make
run: make
128 changes: 128 additions & 0 deletions extern/portaudio-modified/.github/workflows/cmake.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
name: CMake build

on: [push, pull_request]

jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- name: Ubuntu GCC
os: ubuntu-latest
install_dir: ~/portaudio
vcpkg_triplet: x64-linux
cmake_generator: "Unix Makefiles"
cmake_options:
-DPA_USE_OSS=ON
-DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake
- name: Ubuntu MinGW
os: ubuntu-latest
install_dir: ~/portaudio
asio_sdk_cache_path: asiosdk.zip
dependencies_extras: mingw-w64
# FIXME: linking JACK fails with vcpkg. Switch the CMake toolchain file to use vcpkg. The
# toolchain file in this repository is not needed when using a MinGW triplet with vcpkg.
vcpkg_triplet: x64-mingw-static
cmake_generator: "Unix Makefiles"
cmake_options:
-DPA_USE_ASIO=ON
-DASIO_SDK_ZIP_PATH=asiosdk.zip
-DCMAKE_TOOLCHAIN_FILE=cmake/toolchains/i686-w64-mingw32.cmake
- name: Windows MSVC
os: windows-latest
install_dir: C:\portaudio
vcpkg_triplet: x64-windows
cmake_generator: "Visual Studio 17 2022"
# ASIO_SDK_ZIP_PATH needs to be quoted or CMake will save the download to
# asiosdk instead of asiosdk.zip.
asio_sdk_cache_path: "asiosdk.zip"
# Somehow CMake fails to find the toolchain file if a relative path is used on Windows.
cmake_options:
-DPA_USE_ASIO=ON
-DASIO_SDK_ZIP_PATH="asiosdk.zip"
-DCMAKE_TOOLCHAIN_FILE=D:\a\portaudio\portaudio\vcpkg\scripts\buildsystems\vcpkg.cmake
- name: Windows MinGW
os: windows-latest
install_dir: C:\portaudio
vcpkg_triplet: x64-mingw-static
cmake_generator: "MinGW Makefiles"
# ASIO_SDK_ZIP_PATH needs to be quoted or CMake will save the download to
# asiosdk instead of asiosdk.zip.
asio_sdk_cache_path: "asiosdk.zip"
# Somehow CMake fails to find the toolchain file if a relative path is used on Windows.
cmake_options:
-DPA_USE_ASIO=ON
-DASIO_SDK_ZIP_PATH="asiosdk.zip"
-DCMAKE_TOOLCHAIN_FILE=D:\a\portaudio\portaudio\vcpkg\scripts\buildsystems\vcpkg.cmake
- name: macOS Clang
os: macOS-latest
install_dir: ~/portaudio
vcpkg_triplet: x64-osx
cmake_generator: "Unix Makefiles"
cmake_options:
-DCMAKE_FRAMEWORK=OFF
-DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake
- name: macOS Clang framework
os: macOS-latest
install_dir: ~/portaudio
vcpkg_triplet: x64-osx
cmake_generator: "Unix Makefiles"
cmake_options:
-DCMAKE_FRAMEWORK=ON
-DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake

runs-on: ${{ matrix.os }}
name: ${{ matrix.name }}
env:
cmake_build_type: RelWithDebInfo
steps:
- name: checkout Git repository
uses: actions/checkout@v2
- name: "[Ubuntu] install dependencies"
run: |
sudo apt-get update
sudo apt-get install libasound2-dev ${{ matrix.dependencies_extras }}
if: matrix.os == 'ubuntu-latest'
- name: "[macOS] install dependencies"
# https://github.com/PortAudio/portaudio/issues/767
run: brew install pkg-config
if: matrix.os == 'macOS-latest'
- name: "[Windows/MinGW] set up ASIO SDK cache"
uses: actions/cache@v2
if: matrix.asio_sdk_cache_path != null
with:
path: ${{ matrix.asio_sdk_cache_path }}
key: ${{ hashFiles('.github/asiosdk-version.txt') }}
- name: Setup vcpkg
uses: lukka/run-vcpkg@v7
if: ${{ matrix.vcpkg_triplet }} != null
with:
vcpkgTriplet: ${{ matrix.vcpkg_triplet }}
appendedCacheKey: ${{ hashFiles( '**/vcpkg.json' ) }}
additionalCachedPaths: build/vcpkg_installed
vcpkgGitCommitId: f30786c9c4c901f21a13e2d524349e39cc359a90
# Required when using vcpkg.json manifest in repository
setupOnly: true
- name: configure
run: cmake
-G "${{ matrix.cmake_generator }}"
${{ matrix.cmake_options }}
-DCMAKE_INSTALL_PREFIX=${{ matrix.install_dir }}
-DCMAKE_BUILD_TYPE=${{ env.cmake_build_type }}
-DVCPKG_TARGET_TRIPLET=${{ matrix.vcpkg_triplet }}
-DPA_USE_SKELETON=ON
-DPA_BUILD_TESTS=ON
-DPA_BUILD_EXAMPLES=ON
-DPA_WARNINGS_ARE_ERRORS=ON
-S .
-B build
- name: build
run: cmake --build build --config ${{ env.cmake_build_type }} --parallel 2
- name: install
run: cmake --install build --config ${{ env.cmake_build_type }}
- name: "Upload GitHub Actions artifacts"
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.name }} PortAudio build
path: ${{ matrix.install_dir }}
17 changes: 17 additions & 0 deletions extern/portaudio-modified/.github/workflows/compare_def_files.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Check that PortAudio .def files are in sync

on: [push, pull_request]

jobs:
run-pa-compare-def-files-py:

runs-on: ubuntu-latest
name: Ubuntu

steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Run the pa_compare_def_files.py script
run: python ./pa_compare_def_files.py
Loading

0 comments on commit 165b814

Please sign in to comment.