Skip to content

Instantly share code, notes, and snippets.

@MateuszKubuszok
Created November 5, 2025 14:39
Show Gist options
  • Select an option

  • Save MateuszKubuszok/8159dd732bbba6f850372cc05791d10b to your computer and use it in GitHub Desktop.

Select an option

Save MateuszKubuszok/8159dd732bbba6f850372cc05791d10b to your computer and use it in GitHub Desktop.
Strawberry MacOS build script
# Run each recipe in a single bash shell
set shell := ["bash", "-euo", "pipefail", "-c"]
# Set environment variables
set export
BUILD_DIR := `pwd`
ARCH := `uname -m`
STRAWBERRY_OPT_DIR := BUILD_DIR + "/opt/strawberry_macos_" + ARCH + "_release"
PKG_CONFIG_PATH := STRAWBERRY_OPT_DIR + "/lib/pkgconfig"
LDFLAGS := "-L" + STRAWBERRY_OPT_DIR + "/lib -Wl,-rpath," + STRAWBERRY_OPT_DIR + "/lib"
test:
echo "{{BUILD_DIR}}"
echo "{{ARCH}}"
echo "{{STRAWBERRY_OPT_DIR}}"
echo "{{PKG_CONFIG_PATH}}"
echo "{{LDFLAGS}}"
setup:
@if [ ! -d "{{STRAWBERRY_OPT_DIR}}" ]; then \
tarball="strawberry-macos-{{ARCH}}-release.tar.xz"; \
echo "Downloading ${tarball}..."; \
curl -f -O -L "https://github.com/strawberrymusicplayer/strawberry-macos-dependencies/releases/latest/download/${tarball}" && \
echo "Extracting ${tarball} to {{BUILD_DIR}}..." && \
tar -C "{{BUILD_DIR}}" -xf "${tarball}" && \
echo "Removing ${tarball}..." && \
rm "${tarball}" && \
echo "Done."; \
fi
@if [ ! -L "/opt/strawberry_macos_{{ARCH}}_release" ]; then \
echo "Linking {{STRAWBERRY_OPT_DIR}} to /opt/strawberry_macos_{{ARCH}}_release..." && \
sudo ln -s "{{STRAWBERRY_OPT_DIR}}" "/opt/strawberry_macos_{{ARCH}}_release" && \
echo "Done."; \
fi
@if [ ! -d "{{BUILD_DIR}}/strawberry" ]; then \
echo "Cloning strawberry repository..." && \
git clone --recursive https://github.com/strawberrymusicplayer/strawberry "{{BUILD_DIR}}/strawberry" && \
echo "Done."; \
else \
echo "Pulling strawberry repository..." && \
git -C "{{BUILD_DIR}}/strawberry" pull --ff-only && \
echo "Updating strawberry submodules..." && \
git -C "{{BUILD_DIR}}/strawberry" submodule update --init --recursive && \
echo "Done."; \
fi
configure:
@echo "Creating build directory..." && \
mkdir -p "{{BUILD_DIR}}/strawberry/build" && \
echo "Done."; \
echo "Configuring strawberry..." && \
cd "{{BUILD_DIR}}/strawberry/build" && \
"{{STRAWBERRY_OPT_DIR}}/bin/cmake" \
-DCMAKE_BUILD_TYPE="Release" \
--log-level="DEBUG" -S .. -B . \
-DUSE_BUNDLE=ON \
-DCMAKE_PREFIX_PATH="{{STRAWBERRY_OPT_DIR}}/lib/cmake" \
-DPKG_CONFIG_EXECUTABLE="{{STRAWBERRY_OPT_DIR}}/bin/pkg-config" \
-DICU_ROOT="{{STRAWBERRY_OPT_DIR}}" \
-DMACDEPLOYQT_EXECUTABLE="{{STRAWBERRY_OPT_DIR}}/bin/macdeployqt" \
-DARCH="{{ARCH}}" \
-DENABLE_SPARKLE=ON \
-DENABLE_QTSPARKLE=OFF && \
echo "Done.";
build:
@echo "Building strawberry..." && \
cd "{{BUILD_DIR}}/strawberry/build" && \
make -j "${JOBS:-4}" && \
echo "Removing strawberry.dmg..." && \
rm -rf "{{BUILD_DIR}}/strawberry/build/*.dmg" && \
echo "Making DMG..." && \
make dmg && \
echo "Done.";
cleanup:
@echo "Cleaning up..." && \
rm -rf "{{STRAWBERRY_OPT_DIR}}" && \
echo "Removing build directory..." && \
rm -rf "{{BUILD_DIR}}/strawberry/build" && \
echo "Done.";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment