-
Notifications
You must be signed in to change notification settings - Fork 238
83 lines (71 loc) · 2.65 KB
/
macos.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: macOS
on:
push:
branches:
- master
paths-ignore:
- 'docs/**'
- 'htdocs/**'
- 'web-src/**'
pull_request:
branches:
- master
paths-ignore:
- 'docs/**'
- 'htdocs/**'
- 'web-src/**'
workflow_dispatch:
jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Install build tools
run: brew install automake autoconf libtool pkg-config
- name: Install gperf, bison and flex
# macOS has ancient versions of bison and flex, so we need a newer from
# Homebrew. The new versions are installed keg-only, so we must tell
# configure/make where to look. Adjusting $PATH doesn't work (maybe
# because make invokes the two via ylwrap), so instead symlink the two
# into /usr/local/bin.
run: |
brew install gperf bison flex
sudo ln -s "$(brew --prefix)/opt/bison/bin/bison" /usr/local/bin/bison
sudo ln -s "$(brew --prefix)/opt/flex/bin/flex" /usr/local/bin/flex
- name: Install libinotify-kqueue
# brew does not have libinotify package
run: |
git clone https://github.com/libinotify-kqueue/libinotify-kqueue
cd libinotify-kqueue
autoreconf -fvi
./configure
make
sudo make install
cd ..
- name: Install other dependencies
# libxml2 is included with macOS
run: |
brew install libunistring confuse libplist libwebsockets libevent libgcrypt json-c protobuf-c libsodium gnutls pulseaudio openssl ffmpeg sqlite
- name: Configure
# 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)
run: |
export CFLAGS="-I$(brew --prefix)/include -I$(brew --prefix sqlite)/include"
export LDFLAGS="-L$(brew --prefix)/lib -L$(brew --prefix sqlite)/lib"
autoreconf -fi
./configure --prefix=$HOME/owntone_data/usr --sysconfdir=$HOME/owntone_data/etc --localstatedir=$HOME/owntone_data/var --enable-chromecast --with-pulseaudio
- name: Build
run: |
make
- name: Install
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