Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ci] Simplify the macOS build #1766

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 23 additions & 38 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: MacOS
name: macOS

on:
push:
Expand All @@ -25,60 +25,45 @@ jobs:
- uses: actions/checkout@v4

- name: Install build tools
run: brew install automake autoconf libtool pkg-config

- name: Install gperf, bison and flex
# Mac OS 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
brew update
brew install \
autoconf \
automake \
libtool

- 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 sqlite
# 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
run: |
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'
autoreconf -fi
./configure
make
sudo make install
cd ..

- 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
# libxml2 is included with Mac OS
run: |
brew install libunistring confuse libplist libwebsockets libevent libgcrypt json-c protobuf-c libsodium gnutls pulseaudio openssl
brew install \
bison \
confuse \
ffmpeg \
flex \
libplist \
libwebsockets \
json-c \
protobuf-c \
pulseaudio

- 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)
# 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"
export LDFLAGS="-L$(brew --prefix)/lib"
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
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

Expand Down