Skip to content

Commit

Permalink
Update for cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
kovzol committed Oct 28, 2024
1 parent 6ed0620 commit 4b3b22f
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 11 deletions.
26 changes: 24 additions & 2 deletions tools/create-deb
Original file line number Diff line number Diff line change
@@ -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)
Expand Down Expand Up @@ -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"
Expand Down
38 changes: 29 additions & 9 deletions tools/deploy-mac
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 4b3b22f

Please sign in to comment.