Skip to content

Commit

Permalink
Update build scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
rodlie committed Mar 9, 2024
1 parent ee4747a commit 1810143
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/scripts/build_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ fi

CWD=`pwd`
MKJOBS=${MKJOBS:-4}
COMMIT=`git rev-parse --short HEAD`
COMMIT=`git rev-parse --short=8 HEAD`
BRANCH=`git rev-parse --abbrev-ref HEAD`

if [ "${BRANCH}" = "main" ]; then
Expand Down
12 changes: 6 additions & 6 deletions src/scripts/build_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ if [ "${DISTRO_ID}" != "ubuntu" ]; then
exit 1
fi

DISTRO_VERSION_ID=`cat /etc/os-release | sed '/^VERSION_ID=/!d;s/VERSION_ID=//;s/"//g'`
DID="${DISTRO_ID}${DISTRO_VERSION_ID}"
DISTRO_VERSION_ID=`cat /etc/os-release | sed '/^VERSION_CODENAME=/!d;s/VERSION_CODENAME=//;s/"//g;'`
DID="${DISTRO_ID}-${DISTRO_VERSION_ID}"

FRICTION_ROOT="/friction.graphics"
FRICTION_DIR="${FRICTION_ROOT}/friction"
FRICTION_SRC_DIR="${FRICTION_DIR}/src"
FRICTION_OUT_DIR="/snapshots"
FRICTION_OUT_DIR="/distfiles/builds"

FRICTION_BRANCH=${FRICTION_BRANCH:-""}
FRICTION_COMMIT=${FRICTION_COMMIT:-""}
Expand Down Expand Up @@ -79,12 +79,12 @@ if [ ! -d "${FRICTION_SRC_DIR}" ]; then
if [ "${FRICTION_TAG}" != "" ]; then
(cd friction; git checkout tags/${FRICTION_TAG})
fi
#(cd friction; git submodule update -i docs)
(cd friction; git submodule update -i --recursive)
fi

cd ${FRICTION_DIR}

COMMIT=`git rev-parse --short HEAD`
COMMIT=`git rev-parse --short=8 HEAD`
BRANCH=`git rev-parse --abbrev-ref HEAD`
VERSION="dev"

Expand All @@ -109,7 +109,7 @@ else
-DGIT_BRANCH=${BRANCH} \
${CMAKE_EXTRA} ..
VERSION=`cat version.txt`
VERSION="${VERSION}-dev-${COMMIT}"
VERSION="${VERSION}-${BRANCH}-${COMMIT}"
fi
cmake --build .

Expand Down
2 changes: 1 addition & 1 deletion src/scripts/build_vfxplatform.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ ${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 HEAD)`
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}"
fi
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/build_vfxplatform_friction.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ cp -a ${SDK}/lib/libunw* /usr/lib64/

CMAKE_EXTRA=""

GIT_COMMIT=`git rev-parse --short HEAD`
GIT_COMMIT=`git rev-parse --short=8 HEAD`
GIT_BRANCH=`git rev-parse --abbrev-ref HEAD`

if [ "${REL}" != 1 ]; then
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 @@ -40,8 +40,8 @@ if [ ! -d "${BUILD}/${FRICTION_PKG}" ]; then
exit 1
fi

if [ ! -d "${DISTFILES}/builds" ]; then
mkdir -p ${DISTFILES}/builds
if [ ! -d "${DISTFILES}/builds/${VERSION}" ]; then
mkdir -p ${DISTFILES}/builds/${VERSION}
fi

export PATH="${SDK}/bin:${PATH}"
Expand Down Expand Up @@ -147,7 +147,7 @@ mv ${FRICTION_PKG}.tar ${HOME}/rpmbuild/SOURCES/
cat ${BUILD}/friction/src/scripts/vfxplatform.spec | sed 's/__FRICTION_PKG_VERSION__/'${PKG_VERSION}'/g;s/__FRICTION_VERSION__/'${VERSION}'/g;s/__APPID__/'${APPID}'/g' > rpm.spec

rpmbuild -bb rpm.spec
cp -a ${HOME}/rpmbuild/RPMS/*/*.rpm ${DISTFILES}/builds/
cp -a ${HOME}/rpmbuild/RPMS/*/*.rpm ${DISTFILES}/builds/${VERSION}/
fi

# Portable
Expand Down Expand Up @@ -188,7 +188,7 @@ done
cd ${BUILD}
tar cvf ${FRICTION_PORTABLE}.tar ${FRICTION_PORTABLE}
xz -9 ${FRICTION_PORTABLE}.tar
cp -a ${FRICTION_PORTABLE}.tar.xz ${DISTFILES}/builds/
cp -a ${FRICTION_PORTABLE}.tar.xz ${DISTFILES}/builds/${VERSION}/

# AppImage
if [ "${PKG_APP}" = 1 ]; then
Expand All @@ -208,7 +208,7 @@ if [ ! -f "${DISTFILES}/appimagetool.tar.xz" ]; then
fi
tar xf ${DISTFILES}/appimagetool.tar.xz
ARCH=x86_64 ./appimagetool/AppRun ${FRICTION_PORTABLE}
cp -a *.AppImage ${DISTFILES}/builds/
cp -a *.AppImage ${DISTFILES}/builds/${VERSION}/
fi

echo "FRICTION PACKAGE DONE"
6 changes: 3 additions & 3 deletions src/scripts/run_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ REL=${REL:-0}
BRANCH=${BRANCH:-""}
COMMIT=${COMMIT:-""}
TAG=${TAG:-""}
MKJOBS=${JOBS:-4}
MKJOBS=${MKJOBS:-4}

JAMMY=${JAMMY:-1}
MANTIC=${MANTIC:-1}
NOBLE=${NOBLE:-1}

MOUNT_DIR="snapshots"
MOUNT_DIR="distfiles"
DOCKER_MOUNT="-t --mount type=bind,source=${CWD}/${MOUNT_DIR},target=/${MOUNT_DIR}"
DOCKER="docker run -e REL=${REL} -e MKJOBS=${JOBS}"
DOCKER="docker run -e REL=${REL} -e MKJOBS=${MKJOBS}"

if [ "${BRANCH}" != "" ]; then
DOCKER="${DOCKER} -e FRICTION_BRANCH=${BRANCH}"
Expand Down

0 comments on commit 1810143

Please sign in to comment.