You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

212 lines
4.5 KiB

4 years ago
#!/bin/bash
4 years ago
# upstreamURL="https://github.com/DEAKSoftware/Synergy-Binaries.git"
# queriedURL="$( git config --get remote.origin.url )"
# toplevelPath="$( git rev-parse --show-toplevel )"
4 years ago
4 years ago
# if [ "${upstreamURL}" != "${queriedURL}" ] || [ "${toplevelPath}" == "" ]; then
4 years ago
4 years ago
# echo "error: Unrecognised Git upstream URL, or top-level directory. This script must run within the top-level directory of the Synergy-Binaries repository."
# exit 1
4 years ago
4 years ago
# fi
4 years ago
4 years ago
# productRepoPath="${toplevelPath}/Synergy-Core"
# buildPath="${productRepoPath}/build"
# binariesPath="${toplevelPath}/Binaries"
# toolsPath="${toplevelPath}/Tools"
4 years ago
4 years ago
# configureSubmodules() {
4 years ago
4 years ago
# git submodule update --init --remote --recursive
4 years ago
4 years ago
# }
4 years ago
4 years ago
# configureCMake() {
4 years ago
4 years ago
# cmake -S "${productRepoPath}" -B "${buildPath}" -D CMAKE_BUILD_TYPE=MINSIZEREL -D SYNERGY_ENTERPRISE=ON || exit 1
4 years ago
4 years ago
# }
4 years ago
4 years ago
# configureVersion() {
4 years ago
4 years ago
# source /etc/os-release || exit 1
# linuxVersion="${ID}${VERSION_ID}"
4 years ago
4 years ago
# source "${buildPath}/version"
# synergyVersion="${SYNERGY_VERSION_MAJOR}.${SYNERGY_VERSION_MINOR}.${SYNERGY_VERSION_PATCH}"
# synergyVersionStage="${SYNERGY_VERSION_STAGE}"
4 years ago
4 years ago
# }
4 years ago
4 years ago
# configure() {
4 years ago
4 years ago
# configureSubmodules
# configureCMake
# configureVersion
# }
4 years ago
4 years ago
# buildBinaries() {
4 years ago
4 years ago
# cmake --build "${buildPath}" --parallel 8 || exit 1
4 years ago
4 years ago
# }
4 years ago
4 years ago
# buildAppImage() {
4 years ago
4 years ago
# pushd "${toolsPath}" || exit 1
4 years ago
4 years ago
# wget -O linuxdeploy -c https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage || exit 1
# chmod a+x linuxdeploy || exit 1
4 years ago
4 years ago
# # Needed by linuxdeploy
# export VERSION="${synergyVersion}-${linuxVersion}"
4 years ago
4 years ago
# appImagePath="${buildPath}/Synergy-${VERSION}.AppDir"
4 years ago
4 years ago
# ./linuxdeploy \
# --appdir "${appImagePath}" \
# --executable "${buildPath}/bin/synergy" \
# --executable "${buildPath}/bin/synergyc" \
# --executable "${buildPath}/bin/synergyd" \
# --executable "${buildPath}/bin/synergys" \
# --executable "${buildPath}/bin/syntool" \
# --create-desktop-file \
# --icon-file "${productRepoPath}/res/synergy.svg" \
# --output appimage || exit 1
4 years ago
4 years ago
# mv "${toolsPath}/"*.AppImage "${binariesPath}"
4 years ago
4 years ago
# popd
4 years ago
4 years ago
# }
4 years ago
4 years ago
# buildDeb() {
4 years ago
4 years ago
# pushd "${productRepoPath}" || exit 1
4 years ago
4 years ago
# printf "synergy (${synergyVersion}) ${synergyVersionStage}; urgency=medium\n" > "debian/changelog" || exit 1
# debuild --set-envvar CMAKE_BUILD_TYPE=MINSIZEREL --set-envvar SYNERGY_ENTERPRISE=ON -us -uc || exit 1
# git clean -fd
4 years ago
4 years ago
# popd
4 years ago
4 years ago
# mv "${productRepoPath}/../"*.deb "${binariesPath}"
4 years ago
4 years ago
# rename "s/(\\d+\\.\\d+.\\d+)/\$1-${linuxVersion}/g" "${binariesPath}"/*.deb
4 years ago
4 years ago
# mv "${productRepoPath}/../synergy_${synergyVersion}"* "${buildPath}"
# mv "${productRepoPath}/../synergy-dbgsym_${synergyVersion}"* "${buildPath}"
4 years ago
4 years ago
# }
4 years ago
4 years ago
# buildClean() {
4 years ago
4 years ago
# pushd "${productRepoPath}" || exit 1
4 years ago
4 years ago
# git clean -fdx
4 years ago
4 years ago
# popd
4 years ago
4 years ago
# pushd "${toplevelPath}" || exit 1
4 years ago
4 years ago
# git clean -fdx
4 years ago
4 years ago
# popd
4 years ago
4 years ago
# }
# if [ "${1}" = "--help" ] || [ "${1}" = "-h" ]; then
# cat "${toplevelPath}/Documentation/HelpLinux.txt"
# elif [ "${1}" = "--bin" ]; then
# configure
# buildBinaries
# elif [ "${1}" = "--appimage" ]; then
4 years ago
4 years ago
# configure
# buildBinaries
# buildAppImage
4 years ago
4 years ago
# elif [ "${1}" = "--deb" ]; then
4 years ago
4 years ago
# configure
# buildDeb
4 years ago
4 years ago
# elif [ "${1}" = "--all" ]; then
4 years ago
4 years ago
# configure
# buildBinaries
# buildAppImage
# buildDeb
4 years ago
4 years ago
# elif [ "${1}" = "--clean" ]; then
4 years ago
4 years ago
# buildClean
4 years ago
4 years ago
# else
4 years ago
4 years ago
# echo "error: Bad or unknown option. Run with '--help' option for details."
# exit 1
4 years ago
4 years ago
# fi
4 years ago
4 years ago
# exit 0
4 years ago
4 years ago
configureCMake() {
cmake -S "${productRepoPath}" -B "${productBuildPath}" \
-D CMAKE_BUILD_TYPE=Release \
-D SYNERGY_ENTERPRISE=ON \
|| exit 1
}
buildBinaries() {
cmake --build "${productBuildPath}" --parallel || exit 1
4 years ago
4 years ago
}
buildAppImage() {
pushd "${toolsPath}" || exit 1
wget -O linuxdeploy -c "${linuxdeployURL}" || exit 1
chmod a+x linuxdeploy || exit 1
# Needed by linuxdeploy
export VERSION="${productVersion}-${productStage}"
appImagePath="${productBuildPath}/${productPackageName}.AppDir"
./linuxdeploy \
--appdir "${appImagePath}" \
--executable "${productBuildPath}/bin/synergy" \
--executable "${productBuildPath}/bin/synergyc" \
--executable "${productBuildPath}/bin/synergyd" \
--executable "${productBuildPath}/bin/synergys" \
--executable "${productBuildPath}/bin/syntool" \
--create-desktop-file \
--icon-file "${productRepoPath}/res/synergy.svg" \
--output appimage || exit 1
rsync -a --delete "${toolsPath}/"*.AppImage "${binariesPath}/${productPackageName}.AppImage"
popd
}
4 years ago
4 years ago
set -o nounset
4 years ago
4 years ago
configureCMake
buildBinaries
buildAppImage
exit 0