Skip to content

Commit

Permalink
Add linux build script.
Browse files Browse the repository at this point in the history
  • Loading branch information
egorpugin committed Feb 28, 2024
1 parent 593cd0b commit 5db36d2
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions utils/build/linux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#!/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="-compiler gcc"

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

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

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

chmod 755 $OUT/$EXE
7z 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
sudo chmod 755 /usr/local/bin/sw
sw setup
fi

#return

#$PROG build -sd -static -config ${BUILD_TYPE} $COMPILER -platform $ARCH -config-name $CFG $* -Dwith-gui=true
chmod 755 $OUT/$GUI
7z a swgui.7z $OUT/$GUI
cp swgui.7z $DIR/
scp swgui.7z sw:$REMOTE_DIR
rm swgui.7z
}

BASE_PLATFORM=x86_64
run x86_64 linux $*

0 comments on commit 5db36d2

Please sign in to comment.