aboutsummaryrefslogtreecommitdiff
path: root/games
diff options
context:
space:
mode:
authorEdward W. Koenig <kingbeowulf@linuxgalaxy.org>2025-01-28 20:23:11 -0800
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2025-02-01 10:17:29 +0700
commit6d0eb878c1afebe23e46e462ae2b599f4951ebc6 (patch)
tree903025d4a3ee3585d3915408807175c6ff170d41 /games
parentf8da9a0e4217c138b56319b4e49e5a518a60930a (diff)
games/wesnoth: Allow optional multicore CPU builds
Signed-off-by: Edward W. Koenig <kingbeowulf@linuxgalaxy.org> Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'games')
-rw-r--r--games/wesnoth/README16
-rw-r--r--games/wesnoth/wesnoth.SlackBuild16
2 files changed, 25 insertions, 7 deletions
diff --git a/games/wesnoth/README b/games/wesnoth/README
index 8cb70abd22..307426cd2a 100644
--- a/games/wesnoth/README
+++ b/games/wesnoth/README
@@ -7,12 +7,22 @@ campaigns and different kinds of multi-player matches.
If you want to compile the wesnothd server and campaign server you can
run the script as follows:
-# SERVER=yes ./wesnoth.SlackBuild
+ SERVER=yes ./wesnoth.SlackBuild
Please note that the server UID and GID are not required at compile
time but will be required at runtime under the UID/GID specified in
the buildscript. You can create the user and group for the wesnoth
server as follows:
-# groupadd -g 229 wesnoth
-# useradd -u 229 -d /dev/null -s /bin/false -g wesnoth wesnoth
+ groupadd -g 229 wesnoth
+ useradd -u 229 -d /dev/null -s /bin/false -g wesnoth wesnoth
+
+The script will now check if MAKEFLAGS environment variable is set
+and pass that value to the wesnoth scons build system. To change the
+defaults, do something like
+
+ # Set how many cores to use for the build
+ export MAKEFLAGS="-j6" ; ./wesnoth.SlackBuild
+
+ # Force use of the wesnoth defaults ( -j1 )
+ unset MAKEFLAGS ; ./wesnoth.SlackBuild
diff --git a/games/wesnoth/wesnoth.SlackBuild b/games/wesnoth/wesnoth.SlackBuild
index 59a31cde83..dc6adcd935 100644
--- a/games/wesnoth/wesnoth.SlackBuild
+++ b/games/wesnoth/wesnoth.SlackBuild
@@ -26,6 +26,8 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+set -e
+
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=wesnoth
@@ -51,8 +53,6 @@ TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
-SERVER=${SERVER:-"no"}
-
if [ "$ARCH" = "i586" ]; then
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
LIBDIRSUFFIX=""
@@ -67,11 +67,19 @@ else
LIBDIRSUFFIX=""
fi
+SERVER=${SERVER:-"no"}
+
if [ "$SERVER" = "yes" ]; then
OPT_SERVER="server-uid=229 server-gid=229 wesnothd"
fi
-set -e
+# scons does not pull in environment variables, check if MAKEFLAGS is set
+# and use if it is.
+if [ -n "$MAKEFLAGS" ]; then
+ CORES=$MAKEFLAGS
+else
+ CORES=""
+fi
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
@@ -87,7 +95,7 @@ find -L . \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \+
-scons $MAKEFLAGS \
+scons $CORES \
CXXFLAGS="$SLKCFLAGS" \
CFLAGS="$SLKCFLAGS" \
prefix=/usr \