Skip to content

Commit

Permalink
Add macos build script.
Browse files Browse the repository at this point in the history
  • Loading branch information
egorpugin committed Feb 28, 2024
1 parent 46c815b commit 593cd0b
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions utils/build/macos.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#!/bin/bash

set -e
set -x

git pull

PROG=sw
EXE=sw.client.sw-1.0.0
GUI=sw.client.sw.gui-0.4.0
COMPILER=

function run {
ARCH=$1
shift
PLATFORM=$1
shift

DIR=~/Nextcloud/sw/$PLATFORM/$ARCH
BUILD_TYPE=r #rwdi is too big for github
CFG=${ARCH}_${BUILD_TYPE}
OUT=.sw/out/$CFG

REMOTE_DIR=sw/client_sync/$PLATFORM/$ARCH
ssh sw "mkdir -p $REMOTE_DIR"

$PROG build -sd -static -config ${BUILD_TYPE} $COMPILER -platform $ARCH -config-name $CFG $* -Dwith-gui=true -sfc
mkdir -p $DIR

chmod 755 $OUT/$EXE
7zz a sw.7z $OUT/$EXE
cp sw.7z $DIR/
scp sw.7z sw:$REMOTE_DIR
rm sw.7z

if [ "$ARCH" = "${BASE_PLATFORM}" ]; then
sudo rm /usr/local/bin/sw
sudo cp $OUT/$EXE /usr/local/bin/sw
fi

#return

chmod 755 $OUT/$GUI
7zz a swgui.7z $OUT/$GUI
cp swgui.7z $DIR/
scp swgui.7z sw:$REMOTE_DIR
rm swgui.7z
}

BASE_PLATFORM=arm64
run x86_64 macos -os macos-11 $* # goes first because we might update abi and will not able to build next version until deps are uploaded
run arm64 macos -os macos-12.0 $*

0 comments on commit 593cd0b

Please sign in to comment.