2020-05-22 14:10:57 -04:00
|
|
|
name: MacOS
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2023-10-21 17:27:47 -04:00
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
paths-ignore:
|
|
|
|
- 'docs/**'
|
|
|
|
- 'htdocs/**'
|
|
|
|
- 'web-src/**'
|
2020-05-22 14:10:57 -04:00
|
|
|
pull_request:
|
2023-10-21 17:27:47 -04:00
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
paths-ignore:
|
|
|
|
- 'docs/**'
|
|
|
|
- 'htdocs/**'
|
|
|
|
- 'web-src/**'
|
2023-09-02 17:30:42 -04:00
|
|
|
workflow_dispatch:
|
2020-05-22 14:10:57 -04:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: macos-latest
|
|
|
|
|
|
|
|
steps:
|
2023-10-21 16:32:35 -04:00
|
|
|
- uses: actions/checkout@v4
|
2020-05-22 14:10:57 -04:00
|
|
|
|
|
|
|
- name: Install build tools
|
|
|
|
run: brew install automake autoconf libtool pkg-config
|
|
|
|
|
2022-01-11 17:06:39 -05:00
|
|
|
- name: Install gperf, bison and flex
|
|
|
|
# MacOS comes with an ancient bison, we need a newer version. Homebrew's
|
|
|
|
# bison and flex are keg-only, which means they are not symlinked into
|
2022-01-12 11:16:06 -05:00
|
|
|
# /usr/local because macOS already provides this software. Homebrew tells
|
|
|
|
# you to adjust the $PATH, but I couldn't make that work, and I think
|
|
|
|
# symlinking is a better solution for simple binaries.
|
2022-01-11 17:06:39 -05:00
|
|
|
run: |
|
|
|
|
brew install gperf bison flex
|
2022-01-12 03:20:25 -05:00
|
|
|
sudo ln -s /usr/local/opt/bison/bin/bison /usr/local/bin/bison
|
|
|
|
sudo ln -s /usr/local/opt/flex/bin/flex /usr/local/bin/flex
|
2022-01-11 17:06:39 -05:00
|
|
|
|
2020-05-22 14:10:57 -04:00
|
|
|
- name: Install libinotify-kqueue
|
2020-05-23 11:55:55 -04:00
|
|
|
# brew does not have libinotify package
|
2020-05-22 14:10:57 -04:00
|
|
|
run: |
|
|
|
|
git clone https://github.com/libinotify-kqueue/libinotify-kqueue
|
|
|
|
cd libinotify-kqueue
|
|
|
|
autoreconf -fvi
|
|
|
|
./configure
|
|
|
|
make
|
|
|
|
sudo make install
|
|
|
|
cd ..
|
|
|
|
|
2023-08-24 16:04:21 -04:00
|
|
|
- name: Install sqlite
|
2023-09-03 15:16:44 -04:00
|
|
|
# When GH actions has 3.43.0_1+, which has unlock-notify, then this can be
|
|
|
|
# removed and we can just install brew's sqlite
|
2023-08-24 16:04:21 -04:00
|
|
|
run: |
|
2023-08-24 17:30:51 -04:00
|
|
|
wget https://www.sqlite.org/2020/sqlite-autoconf-3310100.tar.gz
|
|
|
|
tar xzf sqlite-autoconf-3310100.tar.gz
|
|
|
|
cd sqlite-autoconf-3310100
|
|
|
|
export CFLAGS='-DSQLITE_ENABLE_UNLOCK_NOTIFY=1'
|
|
|
|
./configure
|
|
|
|
make
|
|
|
|
sudo make install
|
|
|
|
cd ..
|
2023-08-24 16:04:21 -04:00
|
|
|
|
2020-05-22 14:10:57 -04:00
|
|
|
- name: Install ffmpeg
|
|
|
|
# The libbluray ffmpeg dependency fails without the chown (source: stackoverflow)
|
|
|
|
run: |
|
|
|
|
sudo chown -R $(whoami) $(brew --prefix)/*
|
|
|
|
brew install ffmpeg
|
|
|
|
|
|
|
|
- name: Install other dependencies
|
2024-04-06 16:13:35 -04:00
|
|
|
# Homebrew has libmxml but it isn't compatible with mxml 3
|
2024-04-06 17:18:24 -04:00
|
|
|
run: |
|
|
|
|
brew search libmxml
|
|
|
|
brew install libunistring libmxml@3 confuse libplist libwebsockets libevent libgcrypt json-c protobuf-c libsodium gnutls pulseaudio openssl
|
2020-05-22 14:10:57 -04:00
|
|
|
|
2021-10-01 13:03:55 -04:00
|
|
|
- name: Configure
|
2023-09-03 15:16:44 -04:00
|
|
|
# We configure a non-privileged setup, since how to add a "owntone" system
|
|
|
|
# user in MacOS isn't clear to me (useradd etc. isn't available)
|
2020-05-22 14:10:57 -04:00
|
|
|
run: |
|
|
|
|
autoreconf -fi
|
2023-09-03 15:16:44 -04:00
|
|
|
./configure --prefix=$HOME/owntone_data/usr --sysconfdir=$HOME/owntone_data/etc --localstatedir=$HOME/owntone_data/var --enable-chromecast --with-pulseaudio
|
2020-05-22 14:10:57 -04:00
|
|
|
|
2021-10-01 13:03:55 -04:00
|
|
|
- name: Build
|
2020-05-23 02:30:27 -04:00
|
|
|
run: |
|
2023-09-03 15:16:44 -04:00
|
|
|
# Without setting these env vars the build fails with e.g. "fatal error: 'openssl/ssl.h' file not found"
|
2020-05-23 02:30:27 -04:00
|
|
|
# (Solution taken from https://github.com/libimobiledevice/libimobiledevice/issues/389#issuecomment-289284190)
|
|
|
|
export LD_LIBRARY_PATH=$(brew --prefix openssl)/lib
|
|
|
|
export CPATH=$(brew --prefix openssl)/include
|
|
|
|
export PKG_CONFIG_PATH=$(brew --prefix openssl)/lib/pkgconfig
|
|
|
|
make
|
2020-05-22 14:10:57 -04:00
|
|
|
|
2021-10-01 13:03:55 -04:00
|
|
|
- name: Install
|
2023-09-03 15:16:44 -04:00
|
|
|
run: |
|
|
|
|
make install
|
|
|
|
|
|
|
|
- name: Prepare test run
|
|
|
|
run: |
|
|
|
|
mkdir -p $HOME/owntone_data/media
|
|
|
|
sed -i '' 's/uid = "owntone"/uid = ${USER}/g' $HOME/owntone_data/etc/owntone.conf
|
|
|
|
sed -i '' 's/loglevel = log/loglevel = debug/g' $HOME/owntone_data/etc/owntone.conf
|
|
|
|
sed -i '' 's/directories = { "\/srv\/music" }/directories = { "${HOME}\/owntone_data\/media" }/g' $HOME/owntone_data/etc/owntone.conf
|
|
|
|
|
|
|
|
- name: Test run
|
|
|
|
run: |
|
|
|
|
$HOME/owntone_data/usr/sbin/owntone -f -t
|