From 4b3b22f248405eb67eae98cd406a846181cf038c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Kov=C3=A1cs?= Date: Mon, 28 Oct 2024 10:30:08 +0100 Subject: [PATCH] Update for cmake --- tools/create-deb | 26 ++++++++++++++++++++++++-- tools/deploy-mac | 38 +++++++++++++++++++++++++++++--------- 2 files changed, 53 insertions(+), 11 deletions(-) diff --git a/tools/create-deb b/tools/create-deb index 98115ce5..dbdf9030 100755 --- a/tools/create-deb +++ b/tools/create-deb @@ -1,13 +1,35 @@ #!/usr/bin/env bash +# Usage: ./create-deb [build-dir] +# where build-dir points to the build folder (on qmake builds, ../bin, this is the default). + # This script creates a .deb package of XaoS 4.3 and above. -# Make sure you build the program first ("qmake6 PREFIX=/usr && make -j4"). +# Make sure you build the program first ("qmake6 PREFIX=/usr && make -j`nproc`" +# or "mkdir build && cd build && cmake .. -DCMAKE_INSTALL_PREFIX=/usr && make -j`nproc`"). # Required packages before running this script: # lynx pandoc git-extras lintian set -x set -e + +BUILD_DIR="$1" + +if [ "$BUILD_DIR" = "" ]; then + BUILD_DIR="../bin/" + fi + +test -x "$BUILD_DIR/XaoS" || { + echo "Missing $BUILD_DIR/XaoS. Build XaoS first." + exit 1 + } + +test -d ../bin || { + mkdir ../bin + cp -R $BUILD_DIR/XaoS ../bin/xaos + } + test -x ../bin/xaos +strip ../bin/xaos ARCH=$(dpkg --print-architecture) LINUX_VARIANT=$(lsb_release -s -i) @@ -55,7 +77,7 @@ Upstream-Name: xaos Source: https://github.com/xaos-project/XaoS Files: * -Copyright: 2023 The XaoS Project +Copyright: 1996-2024 XaoS Contributors License: GPL-1" > "$DOCDIR/copyright" git-changelog -x > "$DOCDIR/changelog" diff --git a/tools/deploy-mac b/tools/deploy-mac index 3cf4b3cd..91794ea4 100755 --- a/tools/deploy-mac +++ b/tools/deploy-mac @@ -1,19 +1,39 @@ #!/bin/sh +# Usage: ./deploy-mac [build-dir] [codesign] +# where build-dir is the folder where the executable has already been built (by default, "../bin/") +# and codesign is the input for performing an optional code signing. +# The qmake process already creates the bin folder ("../bin/"), but the cmake process +# usually uses another directory. + +BUILD_DIR="$1" + +if [ "$BUILD_DIR" = "" ]; then + BUILD_DIR="../bin/" + fi + MACDEPLOYQT=$(command -v macdeployqt) if [ ! -x "$MACDEPLOYQT" ]; then echo "macdeployqt is not in path." - exit + exit 1 fi -cd "$(dirname "$0")/.." +test -d "$BUILD_DIR/XaoS.app/" || { + echo "Missing $BUILD_DIR/XaoS.app/. Build XaoS first." + exit 2 + } + +test -d ../bin || { + mkdir ../bin + cp -R $BUILD_DIR/XaoS.app ../bin + } -mkdir bin/XaoS.app/Contents/Resources/examples/ -cp examples/*/* bin/XaoS.app/Contents/Resources/examples/ -cp -R catalogs bin/XaoS.app/Contents/Resources/ -cp -R tutorial bin/XaoS.app/Contents/Resources/ -if [ -z "$1" ]; then - $MACDEPLOYQT bin/XaoS.app -dmg +mkdir -p "../bin/XaoS.app/Contents/Resources/examples/" +cp ../examples/*/* ../bin/XaoS.app/Contents/Resources/examples/ +cp -R ../catalogs ../bin/XaoS.app/Contents/Resources/ +cp -R ../tutorial ../bin/XaoS.app/Contents/Resources/ +if [ -z "$2" ]; then + $MACDEPLOYQT ../bin/XaoS.app -dmg else - $MACDEPLOYQT bin/XaoS.app -dmg -codesign="$1" + $MACDEPLOYQT ../bin/XaoS.app -dmg -codesign="$2" fi