macOS support (#72)

* Fix build assumptions for librt and opus

meson.build:
Only require librt when building zalsa. The library is also not
available on macOS, which makes it even more so important to not search
for it and require it by default.
Require the existence of `opus/opus_custom.h` to be able to build with
opus support. The existence of the header file depends on whether opus
has been built using the `--enable-custom-modes` configure option.

* Force the creation of symlinks

scripts/meson_create_symlink:
Force the creation of symlinks so that existing files are overwritten.

* Add build workflow for latest macOS

.github/workflows/build.yml:
Extend build workflow by job for building on latest macOS.
This commit is contained in:
David Runge 2022-04-22 15:06:45 +02:00 committed by GitHub
parent 0a23b230a6
commit 7efb2eb65e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 5 deletions

View File

@ -54,3 +54,13 @@ jobs:
run: meson build && ninja -C build
- name: Install jack-example-tools
run: ninja -C build install
build_macos_latest:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: brew install jack meson opus pkg-config readline
- name: Build jack-example-tools
run: meson build && ninja -C build
- name: Install jack-example-tools
run: ninja -C build install

View File

@ -8,14 +8,17 @@ project(
os = build_machine.system()
cc = meson.get_compiler('c')
lib_m = cc.find_library('m')
lib_rt = cc.find_library('rt')
alsa_required = false
if get_option('alsa_in_out').enabled() or get_option('zalsa').enabled()
alsa_required = true
endif
lib_rt_required = false
if get_option('zalsa').enabled()
lib_rt_required = true
endif
libsamplerate_required = false
if get_option('alsa_in_out').enabled() or get_option('jack_netsource').enabled()
libsamplerate_required = true
@ -75,10 +78,13 @@ lib_jacknet = cc.find_library('jacknet', required: get_option('jack_net'))
dep_alsa = dependency('alsa', version: '>=1.0.18', required: alsa_required)
dep_opus = dependency('opus', version: '>=0.9.0', required: get_option('opus_support'))
header_opus_custom = cc.check_header('opus/opus_custom.h')
dep_readline = dependency('readline', required: get_option('readline_support'))
dep_samplerate = dependency('samplerate', required: libsamplerate_required)
dep_sndfile = dependency('sndfile', required: get_option('jack_rec'))
dep_threads = dependency('threads')
lib_m = cc.find_library('m')
lib_rt = cc.find_library('rt', required: lib_rt_required)
lib_zita_alsa_pcmi = cc.find_library('zita-alsa-pcmi', required: get_option('zalsa'))
lib_zita_resampler = cc.find_library('zita-resampler', required: get_option('zalsa'))
has_ppoll = cc.has_function('ppoll', prefix: '#define _GNU_SOURCE\n#include <sys/poll.h>')
@ -101,7 +107,7 @@ if get_option('jack_netsource').enabled() or (get_option('jack_netsource').auto(
endif
opus_support = false
if get_option('opus_support').enabled() or (get_option('opus_support').auto() and dep_opus.found())
if get_option('opus_support').enabled() or (get_option('opus_support').auto() and dep_opus.found() and header_opus_custom)
opus_support = true
endif
@ -117,7 +123,7 @@ endif
build_zalsa = false
if get_option('zalsa').enabled() or (
get_option('zalsa').auto() and dep_alsa.found() and lib_zita_alsa_pcmi.found() and lib_zita_resampler.found()
get_option('zalsa').auto() and dep_alsa.found() and lib_rt.found() and lib_zita_alsa_pcmi.found() and lib_zita_resampler.found()
)
build_zalsa = true
endif

View File

@ -8,4 +8,4 @@
set -eu
ln -sv "$2" "$MESON_INSTALL_DESTDIR_PREFIX/$1/$3"
ln -fsv "$2" "$MESON_INSTALL_DESTDIR_PREFIX/$1/$3"