Skip to content

Commit

Permalink
Update scripts
Browse files Browse the repository at this point in the history
Mostly minor changes.
  • Loading branch information
rodlie committed Apr 5, 2024
1 parent 3cc5781 commit 89b4987
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 20 deletions.
2 changes: 1 addition & 1 deletion src/scripts/build_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ else
-DGIT_BRANCH=${BRANCH} \
${CMAKE_EXTRA} ..
VERSION=`cat version.txt`
VERSION="${VERSION}-${BRANCH}-${COMMIT}"
VERSION="${VERSION}-${COMMIT}"
fi
cmake --build .

Expand Down
4 changes: 2 additions & 2 deletions src/scripts/build_source_tarball.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ cd ${BUILD_DIR}/friction-${VERSION}
# no symlinks please
rm -f src/engine/skia/third_party/externals/harfbuzz/README

# remote git anything
find . \( -name ".git" -o -name ".gitignore" -o -name ".gitmodules" -o -name ".gitattributes" \) -exec rm -rf -- {} +
# remove git anything
find . \( -name ".git" -o -name ".github" -o -name ".gitignore" -o -name ".gitmodules" -o -name ".gitattributes" \) -exec rm -rf -- {} +

cd ${BUILD_DIR}
tar cvvf friction-${VERSION}.tar friction-${VERSION}
Expand Down
20 changes: 11 additions & 9 deletions src/scripts/build_vfxplatform.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ MKJOBS=${MKJOBS:-4}
SDK_VERSION=${SDK_VERSION:-""}
ONLY_SDK=${ONLY_SDK:-0}
SDK_TAR="${DISTFILES}/friction-vfxplatform-sdk-${SDK_VERSION}.tar"
BUILD_RPM=${BUILD_RPM:-1}
DOWNLOAD_SDK=${DOWNLOAD_SDK:-0}
TAR_VERSION=${TAR_VERSION:-""}

# Download SDK
if [ "${DOWNLOAD_SDK}" = 1 ] && [ ! -f "${SDK_TAR}.xz" ]; then
if [ "${DOWNLOAD_SDK}" = 1 ] && [ ! -f "${SDK_TAR}.bz2" ]; then
(cd ${DISTFILES} ;
wget https://download.friction.graphics/distfiles/vfxplatform/friction-vfxplatform-sdk-${SDK_VERSION}.tar.xz
wget https://download.friction.graphics/distfiles/vfxplatform/friction-vfxplatform-sdk-${SDK_VERSION}.tar.bz2
)
fi

Expand All @@ -48,16 +48,16 @@ if [ ! -d "${SDK}" ]; then
mkdir -p "${SDK}/bin"
(cd "${SDK}"; ln -sf lib lib64)
fi
if [ -f "${SDK_TAR}.xz" ]; then
(cd ${SDK}/.. ; tar xf ${SDK_TAR}.xz )
if [ -f "${SDK_TAR}.bz2" ]; then
(cd ${SDK}/.. ; tar xf ${SDK_TAR}.bz2 )
else
SDK=${SDK} DISTFILES=${DISTFILES} MKJOBS=${MKJOBS} ${BUILD}/build_vfxplatform_sdk01.sh
SDK=${SDK} DISTFILES=${DISTFILES} MKJOBS=${MKJOBS} ${BUILD}/build_vfxplatform_sdk02.sh
SDK=${SDK} DISTFILES=${DISTFILES} MKJOBS=${MKJOBS} ${BUILD}/build_vfxplatform_sdk03.sh
(cd ${SDK}/.. ;
rm -rf friction/src
tar cvvf ${SDK_TAR} friction
xz -9 ${SDK_TAR}
bzip2 -9 ${SDK_TAR}
)
fi

Expand All @@ -73,20 +73,22 @@ REL=${REL} \
BRANCH=${BRANCH} \
COMMIT=${COMMIT} \
TAG=${TAG} \
TAR_VERSION=${TAR_VERSION} \
${BUILD}/build_vfxplatform_friction.sh

# Get Friction version
VERSION=`cat ${BUILD}/friction/build-vfxplatform/version.txt`
if [ "${REL}" != 1 ]; then
GIT_COMMIT=`(cd ${BUILD}/friction ; git rev-parse --short=8 HEAD)`
GIT_BRANCH=`(cd ${BUILD}/friction ; git rev-parse --abbrev-ref HEAD)`
VERSION="${VERSION}-${GIT_BRANCH}-${GIT_COMMIT}"
VERSION="${VERSION}-${GIT_COMMIT}"
fi
if [ "${TAR_VERSION}" != "" ]; then
VERSION=${TAR_VERSION}
fi

# Package Friction
SDK=${SDK} \
DISTFILES=${DISTFILES} \
BUILD=${BUILD} \
VERSION=${VERSION} \
PKG_RPM=${BUILD_RPM} \
${BUILD}/build_vfxplatform_package.sh
3 changes: 2 additions & 1 deletion src/scripts/build_vfxplatform_friction.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ REL=${REL:-1}
BRANCH=${BRANCH:-""}
COMMIT=${COMMIT:-""}
TAG=${TAG:-""}
TAR_VERSION=${TAR_VERSION:-""}

export PATH="${SDK}/bin:${PATH}"
export PKG_CONFIG_PATH="${SDK}/lib/pkgconfig"
Expand Down Expand Up @@ -99,7 +100,7 @@ cmake -GNinja \

VERSION=`cat version.txt`
if [ "${REL}" != 1 ]; then
VERSION="${VERSION}-${GIT_BRANCH}-${GIT_COMMIT}"
VERSION="${VERSION}-${GIT_COMMIT}"
fi

cmake --build .
Expand Down
10 changes: 5 additions & 5 deletions src/scripts/build_vfxplatform_package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,8 @@ ln -sf bin/friction .

cd ${BUILD}
tar cvf ${FRICTION_PORTABLE}.tar ${FRICTION_PORTABLE}
xz -9 ${FRICTION_PORTABLE}.tar
cp -a ${FRICTION_PORTABLE}.tar.xz ${DISTFILES}/builds/${VERSION}/
bzip2 -9 ${FRICTION_PORTABLE}.tar
cp -a ${FRICTION_PORTABLE}.tar.bz2 ${DISTFILES}/builds/${VERSION}/

# AppImage
if [ "${PKG_APP}" = 1 ]; then
Expand All @@ -203,12 +203,12 @@ ln -sf usr/share/applications/${APPID}.desktop .
ln -sf usr/share/icons/hicolor/256x256/apps/${APPID}.png .
ln -sf usr/share/icons/hicolor/256x256/apps/${APPID}.png .DirIcon
)
if [ ! -f "${DISTFILES}/appimagetool.tar.xz" ]; then
if [ ! -f "${DISTFILES}/appimagetool.tar.bz2" ]; then
(cd ${DISTFILES} ;
wget https://download.friction.graphics/distfiles/misc/appimagetool.tar.xz
wget https://download.friction.graphics/distfiles/misc/appimagetool.tar.bz2
)
fi
tar xf ${DISTFILES}/appimagetool.tar.xz
tar xf ${DISTFILES}/appimagetool.tar.bz2
ARCH=x86_64 ./appimagetool/AppRun ${FRICTION_PORTABLE}
cp -a *.AppImage ${DISTFILES}/builds/${VERSION}/
fi
Expand Down
3 changes: 2 additions & 1 deletion src/scripts/git-backup.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set -e -x

CWD=`pwd`
DIR=${CWD}/backup
DATE=`date +%s`
DATE=`date +%Y%m%d%H%M`
URL=https://github.com/friction2d
BACKUP_DIR=${DIR}/friction-git-backup-${DATE}
REPOS="
Expand All @@ -14,6 +14,7 @@ gperftools
sfntly
friction-shader-plugins
mxe
friction-examples
"

mkdir -p ${BACKUP_DIR}
Expand Down
22 changes: 21 additions & 1 deletion src/scripts/run_vfxplatform.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,23 @@
#!/bin/bash
#
# Friction - https://friction.graphics
#
# Copyright (c) Friction contributors
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#

set -e -x

CWD=`pwd`
Expand All @@ -10,9 +29,10 @@ MKJOBS=${JOBS:-4}
ONLY_SDK=${ONLY_SDK:-0}
DOWNLOAD_SDK=${DOWNLOAD_SDK:-0}
SDK_VERSION="20240123"
TAR_VERSION=${TAR_VERSION:-""}

DOCKER="docker run"
DOCKER="${DOCKER} -e REL=${REL} -e MKJOBS=${JOBS} -e SDK_VERSION=${SDK_VERSION} -e ONLY_SDK=${ONLY_SDK} -e DOWNLOAD_SDK=${DOWNLOAD_SDK} -e BRANCH=${BRANCH} -e COMMIT=${COMMIT} -e TAG=${TAG}"
DOCKER="${DOCKER} -e REL=${REL} -e MKJOBS=${JOBS} -e TAR_VERSION=${TAR_VERSION} -e SDK_VERSION=${SDK_VERSION} -e ONLY_SDK=${ONLY_SDK} -e DOWNLOAD_SDK=${DOWNLOAD_SDK} -e BRANCH=${BRANCH} -e COMMIT=${COMMIT} -e TAG=${TAG}"
DOCKER="${DOCKER} -t --mount type=bind,source=${CWD}/distfiles,target=/mnt"

if [ ! -d "${CWD}/distfiles" ]; then
Expand Down

0 comments on commit 89b4987

Please sign in to comment.