Skip to content

Commit

Permalink
macOS static build
Browse files Browse the repository at this point in the history
  • Loading branch information
complexlogic committed Dec 23, 2023
1 parent ec7b328 commit 880bb0f
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 9 deletions.
60 changes: 52 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,15 @@ jobs:
packages: write
strategy:
fail-fast: false
matrix:
config:
- name: Intel
OSX_ARCH: x86_64
VCPKG_TRIPLET: x64-osx

- name: Apple Silicon
OSX_ARCH: arm64
VCPKG_TRIPLET: arm64-osx

env:
CMAKE_BUILD_TYPE: Release
Expand All @@ -237,19 +246,54 @@ jobs:
with:
fetch-depth: 0

- name: "Install dependencies"
run: |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install libebur128 taglib ffmpeg fmt inih cmake pkg-config || true
- name: Install Dependencies
run: brew install nasm automake autoconf-archive ninja

- name: Setup vcpkg
uses: friendlyanon/setup-vcpkg@v1
with:
committish: ${{env.VCPKG_COMMITTISH}}
cache-key: vcpkg-${{matrix.config.name}}-${{env.VCPKG_COMMITISH}}
cache-restore-keys: vcpkg-${{matrix.config.name}}-${{env.VCPKG_COMMITISH}}

- name: Setup Overlays
uses: actions/checkout@v3
with:
repository: complexlogic/vcpkg
ref: refs/heads/rsgain
path: build/overlays

- name: Configure
run: cmake -S . -B build
-DCMAKE_BUILD_TYPE=${{env.CMAKE_BUILD_TYPE}}
-DCMAKE_INSTALL_PREFIX=/usr
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_OSX_ARCHITECTURES=${{matrix.config.OSX_ARCH}}
-DCMAKE_TOOLCHAIN_FILE="$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake"
-DVCPKG_OVERLAY_PORTS=build/overlays/ports
-DVCPKG_TARGET_TRIPLET=${{matrix.config.VCPKG_TRIPLET}}
-DVCPKG_MANIFEST_FEATURES="fmt;ffmpeg;libebur128;inih;"
-DSTRIP_BINARY=ON
-DPACKAGE=ZIP
-DCPACK_SYSTEM_NAME="macOS-${{matrix.config.OSX_ARCH}}"

- name: Build
run: |
cmake \
--build build \
--config ${{env.CMAKE_BUILD_TYPE}}
build/rsgain -v
--target package
- name: Test
if: ${{matrix.config.OSX_ARCH == 'x86_64'}}
run: build/rsgain -v

- name: Upload Package
uses: actions/upload-artifact@v3
with:
name: macOS ${{matrix.config.name}} build
path: build/*.zip

- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: build/*.zip
token: ${{secrets.ACTIONS_SECRET}}
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ elseif (UNIX)
install(FILES "${PROJECT_SOURCE_DIR}/docs/${EXECUTABLE_TITLE}.1" DESTINATION "${CMAKE_INSTALL_PREFIX}/share/man/man1")
endif ()
install(DIRECTORY "${PROJECT_SOURCE_DIR}/config/presets" DESTINATION "${CMAKE_INSTALL_PREFIX}/share/${EXECUTABLE_TITLE}")
if (PACKAGE STREQUAL "TXZ")
if (PACKAGE STREQUAL "TXZ" OR PACKAGE STREQUAL "ZIP")
set(BINARY_PREFIX ".")
set(PRESETS_PREFIX ".")
else ()
Expand Down

0 comments on commit 880bb0f

Please sign in to comment.