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

fix macos build #273

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
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
42 changes: 28 additions & 14 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
with:
path: c:/vcpkg/installed
key: vcpkg-deps

- name: Install Windows Deps
run: |
cd mk\windoze
Expand Down Expand Up @@ -97,7 +97,7 @@ jobs:
with:
path: c:/vcpkg/installed
key: vcpkg-deps

- name: Build MegaGlest
run: |
cd mk/windoze
Expand All @@ -106,7 +106,7 @@ jobs:
- name: Git Hash
if: ${{ github.ref == 'refs/heads/develop' }}
run: echo "VERSION=$(git rev-parse --short HEAD)" >> $env:GITHUB_ENV

- name: Prepare Snapshot
if: ${{ github.ref == 'refs/heads/develop' }}
run: |
Expand All @@ -126,7 +126,7 @@ jobs:
name: megaglest-x64-windows
retention-days: 1
path: mk/windoze/*.zip

on-dockerbuild-failure:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
Expand All @@ -139,32 +139,46 @@ jobs:
if: ${{ github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success' }}
strategy:
fail-fast: false
runs-on: macos-latest
runs-on: macos-13
env:
HOMEBREW_FORCE_BREWED_CURL: 1
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Get dependencies
run: |
# temp hack fix to make brew work
brew untap homebrew/cask
brew untap homebrew/core
# temp hack fix to make brew update/upgrade work
brew unlink [email protected] && brew link --overwrite [email protected]
brew unlink node@18
mk/macos/setupBuildDeps.sh
# more stupid hacks - these will need removing or changing at some point.
cd /usr/local/Cellar/libnghttp2/
ln -s 1.58.0 1.57.0
cd -

- name: Build MegaGlest With Clang Compiler
run: |
export HOMEBREW_FORCE_BREWED_CURL=1
# Make github happy.
# TODO: is there a better way than this?
if ! typeset -p HOMEBREW_CELLAR 2> /dev/null | grep -q '^'
then
export HOMEBREW_CELLAR="/usr/local/Cellar"
fi
PKG_CONFIG_PATH="/usr/local/opt/curl/lib/pkgconfig":${PKG_CONFIG_PATH}
PATH="/usr/local/opt/curl/bin:$PATH"
for f in $HOMEBREW_CELLAR/{openldap,zstd,brotli}/*
do
export PATH="$f/bin:$PATH"
export LDFLAGS="-L$f/lib $LDFLAGS"
export CPPFLAGS="-I$f/include $CPPFLAGS"
export PKG_CONFIG_PATH="$f/lib/pkgconfig:$PKG_CONFIG_PATH"
done
mk/macos/build-mg.sh -m
make -C mk/macos/build -j$(sysctl -n hw.ncpu) VERBOSE=1

- name: Git Hash
if: ${{ github.ref == 'refs/heads/develop' }}
run: |
echo "VERSION=$(git rev-parse --short HEAD)" >> $GITHUB_ENV

- name: Prepare Snapshot
if: ${{ github.ref == 'refs/heads/develop' }}
run: |
Expand Down
19 changes: 2 additions & 17 deletions mk/macos/build-mg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,7 @@ then
echo "Found brew. Adding links. (Note, this assumes system-wide brew install.)"
if [ -d "$HOMEBREW_PREFIX/opt/curl" ]
then
for f in $HOMEBREW_PREFIX/opt/{curl,zstd,brotli}
do
export PATH="$f/bin:$PATH"
export LDFLAGS="-L$f/lib $LDFLAGS"
export CPPFLAGS="-I$f/include $CPPFLAGS"
export PKG_CONFIG_PATH="$f/lib/pkgconfig:$PKG_CONFIG_PATH"
done
else
# Make github happy.
# TODO: is there a better way than this?
if ! typeset -p HOMEBREW_CELLAR 2> /dev/null | grep -q '^'
then
export HOMEBREW_CELLAR="/usr/local/Cellar"
fi

for f in $HOMEBREW_CELLAR/{curl,zstd,brotli}/*
for f in $HOMEBREW_PREFIX/opt/{openldap,curl,zstd,brotli}
do
export PATH="$f/bin:$PATH"
export LDFLAGS="-L$f/lib $LDFLAGS"
Expand Down Expand Up @@ -129,7 +114,7 @@ $list_of_libs2" | sed '/:$/d' | sed '/^$/d' | sort -u )"
for dyn_lib in $list_of_libs; do
cp "$dyn_lib" "lib/"
done

if [ "$(find lib -type f -name "libvlc.*")" != "" ]; then
LIBVLC_DIR_CHECK="$( echo "$list_of_checked_libs" | tr ' ' '\n' | grep "libvlc\." | sort -u | head -1 )"
if [ "$LIBVLC_DIR_CHECK" != "" ]; then
Expand Down
Loading