Skip to content

Commit

Permalink
Import fluidsynth v2.3.4
Browse files Browse the repository at this point in the history
  • Loading branch information
komh committed Sep 26, 2023
1 parent af3b5c4 commit 4c8d4ef
Show file tree
Hide file tree
Showing 101 changed files with 3,443 additions and 733 deletions.
20 changes: 20 additions & 0 deletions .azure/Dockerfile.azure-alpine
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
ARG BASE_IMAGE=alpine:3.18
FROM ${BASE_IMAGE}

RUN apk add --no-cache --virtual .pipeline-deps readline linux-pam \
&& apk add bash sudo shadow \
&& apk add \
cmake make \
glib-dev \
dbus-dev \
ladspa-dev \
libsndfile-dev \
sdl2-dev \
nodejs-current \
gcc g++ \
pkgconf \
&& apk del .pipeline-deps

LABEL "com.azure.dev.pipelines.agent.handler.node.path"="/usr/bin/node"

CMD [ "node" ]
100 changes: 100 additions & 0 deletions .azure/azure-pipelines-alpine.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@

trigger:
paths:
include:
- '*'
exclude:
- '.azure/azure-pipelines-android.yml'
- '.azure/azure-pipelines-mac.yml'
- '.azure/cmake-android.yml'
- '.azure/azure-pipelines-vcpkg.yml'
- '.azure/azure-pipelines-win.yml'
- '.circleci/config.yml'
- '.github/workflows/linux.yml'
- '.github/workflows/sonarcloud.yml'
- '.cirrus.yml'
- 'README.md'

resources:
containers:
- container: alpine-linux
endpoint: 'myDockerHub'
image: tommoebert332/alpine-cmake:latest

variables:
AlpineImageName: 'tommoebert332/alpine-cmake:latest'

stages:
- stage: DockerBuild
displayName: 'Docker Build'
jobs:
- job: DockerBuild
pool:
vmImage: 'ubuntu-20.04'
steps:
- checkout: self

- task: Docker@2
continueOnError: true
displayName: 'Docker login'
inputs:
containerRegistry: 'myDockerHub'
command: 'login'

- bash: |
docker build -f .azure/Dockerfile.azure-alpine \
-t $(AlpineImageName) \
.azure
displayName: 'docker build'
- bash: |
docker push $(AlpineImageName)
displayName: 'docker push'
- task: Docker@2
displayName: 'docker logout'
condition: always()
inputs:
command: logout
containerRegistry: 'myDockerHub'

- stage: FluidAlpineBuild
displayName: 'Build on alpine'
jobs:
- job: Alpine
pool:
vmImage: 'ubuntu-20.04'
strategy:
matrix:
no-cflags:
CFLAGS: ''
CMFLAGS: ''
posix-cflags:
CFLAGS: '-D_POSIX_C_SOURCE=199506L'
CMFLAGS: ''
gentoo-flags:
CFLAGS: '-pipe -frecord-gcc-switches -fno-diagnostics-color -fmessage-length=0 -D_POSIX_C_SOURCE=199506L'
CXXFLAGS: '-pipe -frecord-gcc-switches -fno-diagnostics-color -fmessage-length=0'
CMFLAGS: '-Denable-profiling=yes -Denable-readline=yes -Denable-systemd=no -Denable-threads=no -Denable-trap-on-fpe=yes -Denable-ubsan=OFF'
strncasecmp-flags:
CFLAGS: '-D_POSIX_C_SOURCE=199506L -DNCURSES_WIDECHAR'
CMFLAGS: '-Denable-floats=1 -Denable-benchmark=1'

container: alpine-linux
steps:
- checkout: self
- task: CMake@1
displayName: 'CMake configure'
inputs:
cmakeArgs: $(CMFLAGS) -DCMAKE_VERBOSE_MAKEFILE=1 ..
workingDirectory: 'build'
- task: CMake@1
displayName: 'CMake Build'
inputs:
cmakeArgs: --build . --parallel
workingDirectory: 'build'
- task: CMake@1
displayName: 'CMake Check'
inputs:
cmakeArgs: --build . --target check --parallel
workingDirectory: 'build'
34 changes: 15 additions & 19 deletions .azure/azure-pipelines-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ trigger:
include:
- '*'
exclude:
- '.azure/azure-pipelines-alpine.yml'
- '.azure/azure-pipelines-mac.yml'
- '.azure/azure-pipelines-vcpkg.yml'
- '.azure/azure-pipelines-win.yml'
- '.azure/Dockerfile.azure-alpine'
- '.circleci/config.yml'
- '.github/workflows/linux.yml'
- '.github/workflows/sonarcloud.yml'
Expand All @@ -32,18 +34,18 @@ schedules:

variables:
ICONV_VERSION: '1.17'
# Use recent master libffi, because 3.3 is broken: checking host system type... Invalid configuration `arm-none-linux-eabi': machine `arm-none-linux' not recognized
FFI_VERSION: '3.4.2'
# libffi 3.4.4 fails due to https://github.com/libffi/libffi/issues/760
FFI_VERSION: 'ce077e5565366171aa1b4438749b0922fce887a4'
GETTEXT_VERSION: '0.21'
GLIB_VERSION: '2.72'
GLIB_EXTRAVERSION: '3'
OBOE_VERSION: '1.6.1'
SNDFILE_VERSION: '1.1.0'
GLIB_EXTRAVERSION: '4'
OBOE_VERSION: '1.7.0'
SNDFILE_VERSION: '1.2.0'
INSTPATCH_VERSION: '1.1.6'
VORBIS_VERSION: '1.3.7'
OGG_VERSION: '1.3.5'
OPUS_VERSION: '1.3.1'
FLAC_VERSION: '1.3.4'
FLAC_VERSION: '1.4.2'
PCRE_VERSION: '8.45'

# Android NDK sources and standalone toolchain is put here
Expand All @@ -53,7 +55,7 @@ variables:
# Must be the same as $ANDROID_NDK_HOME see:
# https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-README.md
# We cannot use $ANDROID_NDK_HOME because this is an environment variable, but here, we need a compile-time constant.
NDK: '/usr/local/lib/android/sdk/ndk/25.1.8937393'
NDK: '/usr/local/lib/android/sdk/ndk/25.2.9519653'

# All the built binaries, libs and their headers will be installed here
PREFIX: '$(DEV)/opt/android'
Expand Down Expand Up @@ -145,7 +147,7 @@ jobs:
wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-${ICONV_VERSION}.tar.gz
tar zxf libiconv-${ICONV_VERSION}.tar.gz
wget -O libffi-${FFI_VERSION}.tar.gz https://github.com/libffi/libffi/releases/download/v${FFI_VERSION}/libffi-${FFI_VERSION}.tar.gz
wget -O libffi-${FFI_VERSION}.tar.gz https://github.com/libffi/libffi/archive/${FFI_VERSION}.tar.gz # https://github.com/libffi/libffi/releases/download/v${FFI_VERSION}/libffi-${FFI_VERSION}.tar.gz
tar zxf libffi-${FFI_VERSION}.tar.gz
wget http://ftp.gnu.org/pub/gnu/gettext/gettext-${GETTEXT_VERSION}.tar.gz
Expand Down Expand Up @@ -187,7 +189,7 @@ jobs:
- task: Cache@2
inputs:
key: '$(ARCH) | $(DEV)/*.tar.*'
key: '$(ARCH) | "$(NDK)" | $(DEV)/*.tar.*'
path: '$(PREFIX)'
cacheHitVar: 'CACHE_RESTORED'
displayName: 'Cache fluidsynth dependency libraries'
Expand All @@ -209,12 +211,6 @@ jobs:
displayName: 'apt-get install build-tools'
condition: and(succeeded(), ne(variables.CACHE_RESTORED, 'true'))
- script: |
set -ex
ln -sfn $ANDROID_SDK_ROOT/ndk/25.0.8775105 $ANDROID_NDK_ROOT
displayName: 'Use NDK r25'
enabled: false
- script: |
set -e
Expand Down Expand Up @@ -275,7 +271,7 @@ jobs:
make install
popd
displayName: 'Compile libiconv'
displayName: 'Compile libiconv-$(ICONV_VERSION)'
workingDirectory: $(DEV)
condition: and(succeeded(), ne(variables.CACHE_RESTORED, 'true'))
Expand All @@ -299,7 +295,7 @@ jobs:
make -j$((`nproc`+1))
make install
popd
displayName: 'Compile libffi'
displayName: 'Compile libffi-$(FFI_VERSION)'
workingDirectory: $(DEV)
condition: and(succeeded(), ne(variables.CACHE_RESTORED, 'true'))
Expand Down Expand Up @@ -327,7 +323,7 @@ jobs:
make -j$((`nproc`+1))
make install
popd
displayName: 'Compile gettext'
displayName: 'Compile gettext-$(GETTEXT_VERSION)'
workingDirectory: $(DEV)
condition: and(succeeded(), ne(variables.CACHE_RESTORED, 'true'))
Expand Down Expand Up @@ -386,7 +382,7 @@ jobs:
ninja -C build
ninja -C build install
popd
displayName: 'Compile glib (meson)'
displayName: 'Compile glib-$(GLIB_VERSION).$(GLIB_EXTRAVERSION) (meson)'
workingDirectory: $(DEV)
condition: and(succeeded(), ne(variables.CACHE_RESTORED, 'true'))
Expand Down
66 changes: 58 additions & 8 deletions .azure/azure-pipelines-mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@ trigger:
- '*'
exclude:
- '.azure/azure-pipelines-android.yml'
- '.azure/azure-pipelines-alpine.yml'
- '.azure/cmake-android.yml'
- '.azure/azure-pipelines-vcpkg.yml'
- '.azure/azure-pipelines-win.yml'
- '.azure/Dockerfile.azure-alpine'
- '.circleci/config.yml'
- '.github/workflows/linux.yml'
- '.github/workflows/sonarcloud.yml'
Expand All @@ -23,15 +26,38 @@ jobs:
- job: macOS_brew
strategy:
matrix:
UnixLibs:
UnixLibs11:
imageName: 'macos-11'
CMakeFlags: '-Denable-framework=0'
11_0:
ReadlinePkgConf: ''
UnixLibs11_static:
imageName: 'macos-11'
CMakeFlags: '-Denable-framework=0 -DBUILD_SHARED_LIBS=0'
ReadlinePkgConf: ''
UnixLibs11_static_pkgconf_readline:
imageName: 'macos-11'
CMakeFlags: '-Denable-framework=0 -DBUILD_SHARED_LIBS=0'
ReadlinePkgConf: '$(brew --prefix readline)/lib/pkgconfig'
UnixLibs12:
imageName: 'macos-12'
CMakeFlags: '-Denable-framework=0'
ReadlinePkgConf: ''
UnixLibs12_static:
imageName: 'macos-12'
CMakeFlags: '-Denable-framework=0 -DBUILD_SHARED_LIBS=0'
ReadlinePkgConf: ''
UnixLibs12_static_pkgconf_readline:
imageName: 'macos-12'
CMakeFlags: '-Denable-framework=0 -DBUILD_SHARED_LIBS=0'
ReadlinePkgConf: '$(brew --prefix readline)/lib/pkgconfig'
FrameWork11:
imageName: 'macos-11'
CMakeFlags: ''
12_0:
ReadlinePkgConf: ''
FrameWork12:
imageName: 'macos-12'
CMakeFlags: ''
ReadlinePkgConf: ''

pool:
vmImage: $(imageName)
Expand All @@ -41,14 +67,15 @@ jobs:
steps:
- script: |
set -ex
PACKAGES="glib gobject-introspection libsndfile pkg-config jack dbus-glib pulseaudio portaudio sdl2 libomp"
PACKAGES="glib gobject-introspection libsndfile pkg-config jack dbus-glib pulseaudio portaudio sdl2 libomp readline"
brew install $PACKAGES
displayName: 'Prerequisites'
- script: |
set -ex
mkdir build && cd build
export PKG_CONFIG_PATH="/usr/local/opt/libffi/lib/pkgconfig"
cmake -Werror=dev $(CMakeFlags) -DCMAKE_BUILD_TYPE=Release -DCMAKE_VERBOSE_MAKEFILE=1 -DNO_GUI=1 ..
export PKG_CONFIG_PATH="$(brew --prefix libffi)/lib/pkgconfig:$(ReadlinePkgConf)"
# assist cmake in finding openmp installed via homebrew
cmake -Werror=dev $(CMakeFlags) -DCMAKE_BUILD_TYPE=Release -DCMAKE_VERBOSE_MAKEFILE=1 -DNO_GUI=1 -DCMAKE_PREFIX_PATH=$(brew --prefix libomp) ..
make -j3
displayName: 'Compile fluidsynth'
- script: |
Expand All @@ -73,6 +100,29 @@ jobs:
cmake -DCMAKE_INSTALL_PREFIX=$(Build.ArtifactStagingDirectory) ..
make install
displayName: 'Install fluidsynth to artifact dir'
- script: |
set -e
cat << EOF > static-link-test.c
#include <fluidsynth.h>
int main() { fluid_synth_process(0,0,0,0,0,0); return 0; }
EOF
export PKG_CONFIG_PATH=$(Build.ArtifactStagingDirectory)/lib/pkgconfig:$(ReadlinePkgConf)
set -x
cc -o static-link-test static-link-test.c $(pkg-config --cflags --static fluidsynth) $(pkg-config --libs --static fluidsynth)
./static-link-test
echo $?
displayName: 'Consume from pkg-config'
condition: and(succeeded(), contains(variables.CMakeFlags, 'Denable-framework=0'))
# regression test for #1266
- script: |
set -e
rm -rf build
mkdir build && cd build
export PKG_CONFIG_PATH="$(brew --prefix libffi)/lib/pkgconfig"
cmake -G Xcode -Denable-sdl2=0 -Denable-readline=0 -Denable-dbus=0 ..
xcodebuild
displayName: 'Test CMake XCode Generator'
condition: and(succeeded(), not(contains(variables.CMakeFlags, 'Denable-framework=0')))
- job: macOS_ports
Expand All @@ -85,11 +135,11 @@ jobs:
#11_0_universal_unixlibs:
# macPortsUrl: 'https://github.com/macports/macports-base/releases/download/v2.7.2/MacPorts-2.7.2-11-BigSur.pkg'
# imageName: 'macos-11'
# CMakeFlags: '-Denable-sdl2=0 -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -Denable-framework=0 -DLIB_SUFFIX=""'
# CMakeFlags: '-Denable-sdl2=0 -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -Denable-framework=0
12_0_universal_unixlibs:
macPortsUrl: 'https://github.com/macports/macports-base/releases/download/v2.7.2/MacPorts-2.7.2-12-Monterey.pkg'
imageName: 'macos-12'
CMakeFlags: '-Denable-sdl2=0 -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -Denable-framework=0 -DLIB_SUFFIX=""'
CMakeFlags: '-Denable-sdl2=0 -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -Denable-framework=0'
pool:
vmImage: $(imageName)
steps:
Expand Down
5 changes: 4 additions & 1 deletion .azure/azure-pipelines-vcpkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@ trigger:
- '*'
exclude:
- '.azure/azure-pipelines-android.yml'
- '.azure/azure-pipelines-alpine.yml'
- '.azure/cmake-android.yml'
- '.azure/azure-pipelines-mac.yml'
- '.azure/azure-pipelines-win.yml'
- '.azure/Dockerfile.azure-alpine'
- '.circleci/config.yml'
- '.github/workflows/linux.yml'
- '.github/workflows/sonarcloud.yml'
Expand All @@ -31,7 +34,7 @@ variables:
toolset: 'v142'
generator: 'Visual Studio 16 2019'
configuration: 'RelWithDebInfo'
VCPKG_REVISION: 'e809a42f87565e803b2178a0c11263f462d1800a'
VCPKG_REVISION: 'fc59c2a30a99536e8fb6e085c228e9f724dd87d0'

jobs:
- job: vcpkg
Expand Down
3 changes: 3 additions & 0 deletions .azure/azure-pipelines-win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@ trigger:
- '*'
exclude:
- '.azure/azure-pipelines-android.yml'
- '.azure/azure-pipelines-alpine.yml'
- '.azure/cmake-android.yml'
- '.azure/azure-pipelines-mac.yml'
- '.azure/azure-pipelines-vcpkg.yml'
- '.azure/Dockerfile.azure-alpine'
- '.circleci/config.yml'
- '.github/workflows/linux.yml'
- '.github/workflows/sonarcloud.yml'
Expand Down
2 changes: 1 addition & 1 deletion .azure/cmake-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ steps:
-DCMAKE_STAGING_PREFIX=${PREFIX} \
-DCMAKE_VERBOSE_MAKEFILE=1 \
-DBUILD_SHARED_LIBS=1 \
-DLIB_SUFFIX="" \
-DLIB_SUFFIX= \
${{ parameters.cmakeArgs }} ..
make -j$((`nproc`+1))
${{ parameters.installCommand }}
Expand Down
Loading

0 comments on commit 4c8d4ef

Please sign in to comment.