2020-04-07 04:53:23 +02:00
|
|
|
#!/bin/sh -ex
|
|
|
|
|
2023-04-11 21:30:21 +02:00
|
|
|
brew install -f --overwrite nasm ninja git p7zip create-dmg ccache pipenv
|
2018-07-16 03:12:43 +02:00
|
|
|
|
2023-01-21 21:21:41 +01:00
|
|
|
#/usr/sbin/softwareupdate --install-rosetta --agree-to-license
|
|
|
|
arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
|
2023-04-11 21:30:21 +02:00
|
|
|
arch -x86_64 /usr/local/homebrew/bin/brew update
|
2023-03-11 20:08:27 +01:00
|
|
|
arch -x86_64 /usr/local/homebrew/bin/brew install -f --overwrite llvm@16 sdl2 glew cmake
|
2023-04-11 21:30:21 +02:00
|
|
|
arch -x86_64 /usr/local/homebrew/bin/brew link -f llvm@16
|
2023-01-21 21:21:41 +01:00
|
|
|
|
|
|
|
#export MACOSX_DEPLOYMENT_TARGET=12.0
|
2022-01-04 20:55:42 +01:00
|
|
|
export CXX=clang++
|
|
|
|
export CC=clang
|
2023-01-21 21:21:41 +01:00
|
|
|
|
|
|
|
export BREW_PATH;
|
|
|
|
BREW_PATH="$(brew --prefix)"
|
|
|
|
export BREW_X64_PATH;
|
|
|
|
BREW_X64_PATH="$("/usr/local/homebrew/bin/brew" --prefix)"
|
|
|
|
export BREW_BIN="/usr/local/bin"
|
|
|
|
export BREW_SBIN="/usr/local/sbin"
|
|
|
|
export CMAKE_EXTRA_OPTS='-DLLVM_TARGETS_TO_BUILD=X86'
|
|
|
|
|
|
|
|
export WORKDIR;
|
|
|
|
WORKDIR="$(pwd)"
|
|
|
|
|
2023-04-11 21:30:21 +02:00
|
|
|
# Get Qt
|
2023-01-21 21:21:41 +01:00
|
|
|
git clone https://github.com/engnr/qt-downloader.git
|
|
|
|
cd qt-downloader
|
|
|
|
git checkout f52efee0f18668c6d6de2dec0234b8c4bc54c597
|
2023-04-11 21:30:21 +02:00
|
|
|
"/opt/homebrew/bin/pipenv" run pip3 install py7zr requests semantic_version lxml
|
|
|
|
"/opt/homebrew/bin/pipenv" run ./qt-downloader macos desktop 5.15.2 clang_64 --opensource
|
2023-01-21 21:21:41 +01:00
|
|
|
cd ..
|
|
|
|
|
|
|
|
export Qt5_DIR="$WORKDIR/qt-downloader/5.15.2/clang_64/lib/cmake/Qt5"
|
|
|
|
export SDL2_DIR="$BREW_X64_PATH/opt/sdl2/lib/cmake/SDL2"
|
|
|
|
|
2023-04-11 21:30:21 +02:00
|
|
|
export PATH="$BREW_X64_PATH/opt/llvm@16/bin:$WORKDIR/qt-downloader/5.15.2/clang_64/bin:$BREW_BIN:$BREW_SBIN:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Library/Apple/usr/bin:$PATH"
|
2023-01-21 21:21:41 +01:00
|
|
|
export LDFLAGS="-L$BREW_X64_PATH/lib -Wl,-rpath,$BREW_X64_PATH/lib"
|
|
|
|
export CPPFLAGS="-I$BREW_X64_PATH/include -msse -msse2 -mcx16 -no-pie"
|
|
|
|
export LIBRARY_PATH="$BREW_X64_PATH/lib"
|
|
|
|
export LD_LIBRARY_PATH="$BREW_X64_PATH/lib"
|
2022-01-04 20:55:42 +01:00
|
|
|
|
|
|
|
git submodule update --init --recursive --depth 1
|
|
|
|
|
|
|
|
# 3rdparty fixes
|
|
|
|
sed -i '' "s/extern const double NSAppKitVersionNumber;/const double NSAppKitVersionNumber = 1343;/g" 3rdparty/hidapi/hidapi/mac/hid.c
|
|
|
|
|
2020-04-07 04:53:23 +02:00
|
|
|
mkdir build && cd build || exit 1
|
2022-01-04 20:55:42 +01:00
|
|
|
|
2023-01-21 21:21:41 +01:00
|
|
|
"$BREW_X64_PATH/bin/cmake" .. \
|
2022-10-15 21:01:38 +02:00
|
|
|
-DUSE_SDL=ON -DUSE_DISCORD_RPC=OFF -DUSE_VULKAN=ON -DUSE_ALSA=OFF -DUSE_PULSE=OFF -DUSE_AUDIOUNIT=ON \
|
2023-01-21 21:21:41 +01:00
|
|
|
-DLLVM_CCACHE_BUILD=OFF -DLLVM_BUILD_RUNTIME=OFF -DLLVM_BUILD_TOOLS=OFF \
|
2022-01-05 09:32:13 +01:00
|
|
|
-DLLVM_INCLUDE_DOCS=OFF -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_INCLUDE_TESTS=OFF -DLLVM_INCLUDE_TOOLS=OFF \
|
|
|
|
-DLLVM_INCLUDE_UTILS=OFF -DLLVM_USE_PERF=OFF -DLLVM_ENABLE_Z3_SOLVER=OFF \
|
|
|
|
-DUSE_NATIVE_INSTRUCTIONS=OFF \
|
2022-04-19 04:13:02 +02:00
|
|
|
-DUSE_SYSTEM_MVK=OFF \
|
2023-01-21 21:21:41 +01:00
|
|
|
$CMAKE_EXTRA_OPTS \
|
|
|
|
-DLLVM_TARGET_ARCH=X86_64 -DCMAKE_OSX_ARCHITECTURES=x86_64 -DCMAKE_IGNORE_PATH="$BREW_PATH/lib" \
|
2022-01-05 09:32:13 +01:00
|
|
|
-G Ninja
|
2022-01-04 20:55:42 +01:00
|
|
|
|
2023-01-21 21:21:41 +01:00
|
|
|
"$BREW_PATH/bin/ninja"; build_status=$?;
|
2022-01-04 20:55:42 +01:00
|
|
|
|
2022-01-05 09:32:13 +01:00
|
|
|
cd ..
|
2022-01-04 20:55:42 +01:00
|
|
|
|
2022-01-05 09:32:13 +01:00
|
|
|
{ [ "$CI_HAS_ARTIFACTS" = "true" ];
|
|
|
|
} && SHOULD_DEPLOY="true" || SHOULD_DEPLOY="false"
|
2022-01-04 20:55:42 +01:00
|
|
|
|
2022-01-05 09:32:13 +01:00
|
|
|
if [ "$build_status" -eq 0 ] && [ "$SHOULD_DEPLOY" = "true" ]; then
|
|
|
|
.ci/deploy-mac.sh
|
2023-01-21 21:21:41 +01:00
|
|
|
fi
|