fluidsynth/.azure/azure-pipelines-mac.yml

200 lines
6.9 KiB
YAML
Raw Normal View History

trigger:
paths:
include:
- '*'
exclude:
- '.azure/azure-pipelines-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'
2019-10-21 10:44:49 +00:00
parameters:
- name: UseCache
displayName: Use Dependency Cache
type: boolean
default: true
2019-10-21 10:44:49 +00:00
jobs:
- job: macOS_brew
2021-09-07 20:10:29 +00:00
strategy:
matrix:
2022-01-14 16:30:54 +00:00
UnixLibs:
imageName: 'macos-11'
CMakeFlags: '-Denable-framework=0'
2021-09-07 20:10:29 +00:00
10_15:
imageName: 'macOS-10.15'
2022-01-14 16:30:54 +00:00
CMakeFlags: ''
2021-09-07 20:10:29 +00:00
11_0:
imageName: 'macos-11'
2022-01-14 16:30:54 +00:00
CMakeFlags: ''
12_0:
imageName: 'macos-12'
CMakeFlags: ''
2021-09-07 20:10:29 +00:00
2019-10-21 10:44:49 +00:00
pool:
2021-09-07 20:10:29 +00:00
vmImage: $(imageName)
# recommended by https://github.com/Homebrew/brew/issues/2491#issuecomment-294207661
2021-02-07 12:46:02 +00:00
# brew update || brew update
# brew upgrade $PACKAGES
2019-10-21 10:44:49 +00:00
steps:
- script: |
2021-09-07 20:10:29 +00:00
set -ex
PACKAGES="glib gobject-introspection libsndfile pkg-config jack dbus-glib pulseaudio portaudio sdl2 libomp"
2021-02-07 12:46:02 +00:00
brew install $PACKAGES
2019-10-21 10:44:49 +00:00
displayName: 'Prerequisites'
- script: |
2021-09-07 20:10:29 +00:00
set -ex
2019-10-21 10:44:49 +00:00
mkdir build && cd build
export PKG_CONFIG_PATH="/usr/local/opt/libffi/lib/pkgconfig"
2022-01-14 16:31:13 +00:00
cmake -Werror=dev $(CMakeFlags) -DCMAKE_BUILD_TYPE=Release -DCMAKE_VERBOSE_MAKEFILE=1 -DNO_GUI=1 ..
2021-09-07 20:10:29 +00:00
make -j3
2019-10-21 10:44:49 +00:00
displayName: 'Compile fluidsynth'
- script: |
2021-09-07 20:10:29 +00:00
set -ex
2022-01-23 14:33:33 +00:00
cd build
make -j3 check
2019-10-21 10:44:49 +00:00
displayName: 'Execute Unittests'
2022-01-23 14:33:33 +00:00
- script: |
set -ex
cd build
make -j3 demo
displayName: 'Compile demos'
2022-01-14 16:31:13 +00:00
- script: |
set -ex
cd build
sudo make install
rm -f install_manifest.txt
displayName: 'Install fluidsynth to default location'
- script: |
set -ex
cd build
cmake -DCMAKE_INSTALL_PREFIX=$(Build.ArtifactStagingDirectory) ..
make install
displayName: 'Install fluidsynth to artifact dir'
- job: macOS_ports
timeoutInMinutes: 300
strategy:
matrix:
# SDL2/SDL_cpuinfo.h includes some x86 specific headers, which ofc doesn't work when cross compiling for arm64
# And this universal build thingy doesn't work on Mac10.15 for some reason...
# Furthermore, there is a problem when restoring the cache on Mac11, so disable this job as well
#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=""'
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=""'
pool:
vmImage: $(imageName)
steps:
- script: |
set -ex
brew install wget pkg-config
wget $(macPortsUrl)
sudo installer -pkg *.pkg -target /
rm -f *.pkg
sudo chown -R $(id -u):$(id -g) /opt/local
sudo chflags nouchg /opt/local
displayName: 'Prerequisites'
workingDirectory: $(Agent.TempDirectory)
- task: Cache@2
continueOnError: true
displayName: "Cache macPort packages"
condition: and(not(in(variables['Build.Reason'], 'Schedule')), ${{ parameters.useCache }})
inputs:
key: '"$(Agent.OS)" | "$(imageName)" | "$(macPortsUrl)" | "versionalways"'
path: '/opt/local'
cacheHitVar: CACHE_RESTORED
- script: |
set -ex
export PATH=$PATH:/opt/local/bin
echo $PATH
which codesign
which port
cmake --version || true
echo "+universal" | sudo tee -a /opt/local/etc/macports/variants.conf
sudo sh -c 'cat << EOF >> /opt/local/etc/macports/macports.conf
buildfromsource always
universal_archs arm64 x86_64
ui_interactive no
EOF'
sudo port install glib2-devel libsndfile dbus-glib readline
# fixup permissions to allow non-priv pipeline user access every directory, to make the caching step succeed at the end
sudo chown -R $(id -u):$(id -g) /opt/local
# remove all extended attributes, as they cannot be restored when restoring the pipeline cache
#sudo xattr -rcv /opt/local
displayName: 'Port install universal'
condition: and(succeeded(), ne(variables.CACHE_RESTORED, 'true'))
- script: |
set -ex
export PATH=$PATH:/opt/local/bin
export PKG_CONFIG_PATH="/opt/local/lib/pkgconfig"
mkdir build && cd build
cmake -Werror=dev $(CMakeFlags) -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_VERBOSE_MAKEFILE=1 -DNO_GUI=1 ..
make -j3
displayName: 'Compile fluidsynth'
- script: |
export PATH=$PATH:/opt/local/bin
sudo port -v install fluidsynth +universal
displayName: 'port install fluidsynth +universal'
condition: failed()
enabled: false
- script: |
set -x
cat /opt/local/var/macports/logs/*cmake-bootstrap/cmake-bootstrap/main.log
cat /opt/local/var/macports/build/*cmake-bootstrap/cmake-bootstrap/work/cmake-3.9.4-arm64/Bootstrap.cmk/*.log
cat /opt/local/var/macports/logs/*_fluidsynth/fluidsynth/main.log
condition: failed()
displayName: 'Print fluidsynth error log'
- script: |
set -ex
cd build
make -j3 check
displayName: 'Execute Unittests'
- script: |
set -ex
cd build
make -j3 demo
displayName: 'Compile demos'
- script: |
set -ex
cd build
sudo make install
rm -f install_manifest.txt
displayName: 'Install fluidsynth to default location'
- script: |
set -ex
cd build
cmake -DCMAKE_INSTALL_PREFIX=$(Build.ArtifactStagingDirectory) ..
make install
cd /opt/local/lib/
cp -a libgthread*.dylib libglib*.dylib libintl*.dylib libsndfile*.dylib libdbus-*.dylib libreadline*.dylib $(Build.ArtifactStagingDirectory)/lib
file /opt/local/lib/libglib-2.0.dylib $(Build.ArtifactStagingDirectory)/bin/fluidsynth $(Build.ArtifactStagingDirectory)/lib/libfluidsynth*.dylib
displayName: 'Install fluidsynth to artifact dir'
- task: PublishBuildArtifacts@1
displayName: 'Publish fluidsynth artifacts'
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'fluidsynth-$(imageName)'
publishLocation: 'Container'
- task: PublishBuildArtifacts@1
displayName: 'Publish macPorts deps'
enabled: false
condition: and(succeeded(), ne(variables.CACHE_RESTORED, 'true'))
inputs:
PathtoPublish: '/opt/local/lib'
ArtifactName: 'macports-$(imageName)'
publishLocation: 'Container'