From d2da1860018df7fbab714c015463fd6620841e53 Mon Sep 17 00:00:00 2001 From: filux Date: Fri, 20 Jan 2017 23:57:35 +0100 Subject: [PATCH] new script, helpful for 'steam' releases --- README.md | 33 ++++++++++++ mk/linux/make-binary-archive.sh | 7 ++- mk/linux/make-data-archive.sh | 2 +- mk/linux/setupBuildDeps.sh | 4 +- .../tools/ContentBuilder/content/.gitignore | 3 ++ .../content/base_content/.gitignore | 4 -- .../content/linux_x64/.gitignore | 4 -- .../ContentBuilder/content/linux_x64/bin | 2 +- .../content/linux_x64/lib/.gitignore | 4 -- .../ContentBuilder/prepare_files_for_linux.sh | 50 +++++++++++++++++++ 10 files changed, 95 insertions(+), 18 deletions(-) create mode 100644 README.md create mode 100644 mk/steamworks_sdk/sdk/tools/ContentBuilder/content/.gitignore delete mode 100644 mk/steamworks_sdk/sdk/tools/ContentBuilder/content/base_content/.gitignore delete mode 100644 mk/steamworks_sdk/sdk/tools/ContentBuilder/content/linux_x64/.gitignore delete mode 100644 mk/steamworks_sdk/sdk/tools/ContentBuilder/content/linux_x64/lib/.gitignore create mode 100755 mk/steamworks_sdk/sdk/tools/ContentBuilder/prepare_files_for_linux.sh diff --git a/README.md b/README.md new file mode 100644 index 000000000..655c86864 --- /dev/null +++ b/README.md @@ -0,0 +1,33 @@ +**This is the game engine source code repository.** + +MegaGlest (http://megaglest.org) is a libre software cross +platform real-time strategy game. + +[![logo](http://megaglest.org/uploads/megaglest2011/logo/logo.png)] +(http://megaglest.org/) + +MegaGlest is an entertaining free (freeware and free software) +and open source cross-platform 3D real-time strategy (RTS) game, +where you control the armies of one of seven different factions: +Tech, Magic, Egypt, Indians, Norsemen, Persian or Romans. The +game is played in one of 17 naturally looking settings, which, +like the unit models, are crafted with great attention to +detail. A lot of additional game data can be downloaded from +within the game at no cost. + +[**MegaGlest Downloads**](http://megaglest.org/download.html) + +[![gif](http://megaglest.org/uploads/images/screenshots/game_screens.gif)] +(http://megaglest.org/screenshots.html) +[![intro](http://megaglest.org/uploads/images/trailer3.png)] +(http://downloads.megaglest.org/videos/megaglest_game_trailer_lq.webm) + +If you want to compile MegaGlest yourself, you should read the following: + +[Development Tutorial](https://docs.megaglest.org/MG/Development) + +[Git Workflow](https://github.com/MegaGlest/megaglest-source/wiki/Git-How-To) + + + +Return to the main (upstream) repository [**here**](https://github.com/MegaGlest/megaglest-source) diff --git a/mk/linux/make-binary-archive.sh b/mk/linux/make-binary-archive.sh index 13ec4ac00..983408ad6 100755 --- a/mk/linux/make-binary-archive.sh +++ b/mk/linux/make-binary-archive.sh @@ -5,9 +5,13 @@ # Copyright (c) 2011 Mark Vejvoda under GNU GPL v3.0+ LANG=C +CURRENTDIR="$(dirname "$(readlink -f "$0")")" # set this to non 0 to skip building the binary skipbinarybuild=0 -if [ "$1" = "-CI" ] || [ "$1" = "--installer" ]; then skipbinarybuild=1; fi +if [ "$1" = "-CI" ] || ( [ "$1" = "--installer" ] && \ + [ "$(find "$CURRENTDIR" -name 'megaglest' -mmin -60)" ] ); then + skipbinarybuild=1 +fi # Consider setting this for small packages if there's plenty of RAM and CPU available: #export XZ_OPT="$XZ_OPT -9e" @@ -16,7 +20,6 @@ if [ "$1" = "-CI" ] || [ "$1" = "--installer" ] || [ "$(echo "$1" | grep '\--sho if [ "$2" != "" ]; then SOURCE_BRANCH="$2"; fi fi -CURRENTDIR="$(dirname "$(readlink -f "$0")")" cd "$CURRENTDIR" VERSION=`./mg-version.sh --version` kernel=`uname -s | tr '[A-Z]' '[a-z]'` diff --git a/mk/linux/make-data-archive.sh b/mk/linux/make-data-archive.sh index a24949057..8035fe544 100755 --- a/mk/linux/make-data-archive.sh +++ b/mk/linux/make-data-archive.sh @@ -75,7 +75,7 @@ if [ "$DATA_HASH" != "" ]; then if [ "$DATA_COMMIT_NR" -gt "$DATA_COMMIT_PREV_NR" ]; then DATA_COMMIT_LATEST_NR="$DATA_COMMIT_NR"; fi # ^ first sync commit -gt than the wrong one = warning seen for last time, so situation still may be not fixed, but is most likely improved and we avoid endless warnings fi - if [ "$(echo "$CAT_DATA_HASH_FILE" | grep "$DATA_HASH")" != "" ]; then + if [ "$1" != "--installer" ] && [ "$(echo "$CAT_DATA_HASH_FILE" | grep "$DATA_HASH")" != "" ]; then echo; echo " NOTE: The archive wasn't created because for almost sure it would be exactly the same like last time (the same commit) and new creation date would convince many users to download it again."; echo exit 0 fi diff --git a/mk/linux/setupBuildDeps.sh b/mk/linux/setupBuildDeps.sh index 41b8201aa..9bff45f85 100755 --- a/mk/linux/setupBuildDeps.sh +++ b/mk/linux/setupBuildDeps.sh @@ -129,7 +129,7 @@ case $distribution in ;; 14.04*) #LTS, name > trusty - installcommand="apt-get install $APT_OPTIONS build-essential cmake libsdl2-dev libalut-dev libgl1-mesa-dev libglu1-mesa-dev libvorbis-dev libwxbase2.8-dev libwxgtk2.8-dev libx11-dev liblua5.1-0-dev libjpeg-dev libpng12-dev libcurl4-gnutls-dev libxml2-dev libircclient-dev libglew-dev libftgl-dev libfribidi-dev libvlc-dev libvlccore-dev libcppunit-dev" + installcommand="apt-get install $APT_OPTIONS build-essential cmake libsdl2-dev libalut-dev libgl1-mesa-dev libglu1-mesa-dev libvorbis-dev libwxgtk3.0-dev libx11-dev liblua5.1-0-dev libjpeg-dev libpng12-dev libcurl4-gnutls-dev libxml2-dev libircclient-dev libglew-dev libftgl-dev libfribidi-dev libvlc-dev libvlccore-dev libcppunit-dev" $installcommand if [ "$?" -ne "0" ]; then error_during_installation; exit 1; fi ;; @@ -163,7 +163,7 @@ case $distribution in ;; 17|17.*) #LTS, based on Ubuntu 14.04 - installcommand="apt-get install $APT_OPTIONS build-essential cmake libsdl2-dev libalut-dev libgl1-mesa-dev libglu1-mesa-dev libvorbis-dev libwxbase2.8-dev libwxgtk2.8-dev libx11-dev liblua5.1-0-dev libjpeg-dev libpng12-dev libcurl4-gnutls-dev libxml2-dev libircclient-dev libglew-dev libftgl-dev libfribidi-dev libvlc-dev libvlccore-dev libcppunit-dev" + installcommand="apt-get install $APT_OPTIONS build-essential cmake libsdl2-dev libalut-dev libgl1-mesa-dev libglu1-mesa-dev libvorbis-dev libwxgtk3.0-dev libx11-dev liblua5.1-0-dev libjpeg-dev libpng12-dev libcurl4-gnutls-dev libxml2-dev libircclient-dev libglew-dev libftgl-dev libfribidi-dev libvlc-dev libvlccore-dev libcppunit-dev" $installcommand if [ "$?" -ne "0" ]; then error_during_installation; exit 1; fi ;; diff --git a/mk/steamworks_sdk/sdk/tools/ContentBuilder/content/.gitignore b/mk/steamworks_sdk/sdk/tools/ContentBuilder/content/.gitignore new file mode 100644 index 000000000..948ed0944 --- /dev/null +++ b/mk/steamworks_sdk/sdk/tools/ContentBuilder/content/.gitignore @@ -0,0 +1,3 @@ +/base_content/ +/linux_x64/ +/linux_x86/ diff --git a/mk/steamworks_sdk/sdk/tools/ContentBuilder/content/base_content/.gitignore b/mk/steamworks_sdk/sdk/tools/ContentBuilder/content/base_content/.gitignore deleted file mode 100644 index 5e7d2734c..000000000 --- a/mk/steamworks_sdk/sdk/tools/ContentBuilder/content/base_content/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -# Ignore everything in this directory -* -# Except this file -!.gitignore diff --git a/mk/steamworks_sdk/sdk/tools/ContentBuilder/content/linux_x64/.gitignore b/mk/steamworks_sdk/sdk/tools/ContentBuilder/content/linux_x64/.gitignore deleted file mode 100644 index 5e7d2734c..000000000 --- a/mk/steamworks_sdk/sdk/tools/ContentBuilder/content/linux_x64/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -# Ignore everything in this directory -* -# Except this file -!.gitignore diff --git a/mk/steamworks_sdk/sdk/tools/ContentBuilder/content/linux_x64/bin b/mk/steamworks_sdk/sdk/tools/ContentBuilder/content/linux_x64/bin index f1ff06d60..7951405f8 120000 --- a/mk/steamworks_sdk/sdk/tools/ContentBuilder/content/linux_x64/bin +++ b/mk/steamworks_sdk/sdk/tools/ContentBuilder/content/linux_x64/bin @@ -1 +1 @@ -lib/ \ No newline at end of file +lib \ No newline at end of file diff --git a/mk/steamworks_sdk/sdk/tools/ContentBuilder/content/linux_x64/lib/.gitignore b/mk/steamworks_sdk/sdk/tools/ContentBuilder/content/linux_x64/lib/.gitignore deleted file mode 100644 index 5e7d2734c..000000000 --- a/mk/steamworks_sdk/sdk/tools/ContentBuilder/content/linux_x64/lib/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -# Ignore everything in this directory -* -# Except this file -!.gitignore diff --git a/mk/steamworks_sdk/sdk/tools/ContentBuilder/prepare_files_for_linux.sh b/mk/steamworks_sdk/sdk/tools/ContentBuilder/prepare_files_for_linux.sh new file mode 100755 index 000000000..f2724df2a --- /dev/null +++ b/mk/steamworks_sdk/sdk/tools/ContentBuilder/prepare_files_for_linux.sh @@ -0,0 +1,50 @@ +#!/bin/bash +# Use this script to prepare MegaGlest files for linux on steam +# ---------------------------------------------------------------------------- +# Written by filux +# Copyright (c) 2017 under GNU GPL v3.0+ + +CURRENTDIR="$(dirname "$(readlink -f "$0")")" +cd "$CURRENTDIR" + +megaglest_linux_path="$CURRENTDIR/../../../../linux" +BINARY_DIR="$("$megaglest_linux_path/make-binary-archive.sh" --show-result-path2)" +DATA_DIR="$("$megaglest_linux_path/make-data-archive.sh" --show-result-path2)" + +VERSION="$("$megaglest_linux_path/mg-version.sh" --version)" +kernel="$(uname -s | tr '[A-Z]' '[a-z]')" +architecture="$(uname -m | tr '[A-Z]' '[a-z]')" + +# Grab the version +echo "Linux project root path [$megaglest_linux_path]" +echo "About to prepare files for steam and for $VERSION" +# Stop if anything produces an error. +set -ex + +cd "$CURRENTDIR" +INSTALLDATADIR="content/base_content" +rm -rf "$INSTALLDATADIR"; sleep 0.1s; mkdir "$INSTALLDATADIR" +if [ "$architecture" = "x86_64" ]; then INSTALLBINDIR="content/linux_x64/" + else INSTALLBINDIR="content/linux_x86/"; fi +rm -rf "$INSTALLBINDIR"; sleep 0.1s; mkdir "$INSTALLBINDIR" + +echo "Copying MegaGlest binary files..." +"$megaglest_linux_path/make-binary-archive.sh" --installer +cd "$BINARY_DIR" +cp -r * "$CURRENTDIR/$INSTALLBINDIR" +# create symlink from "lib" to "bin" where steam is able to find libs on the very end of its searching +cd "$CURRENTDIR/$INSTALLBINDIR" +ln -s "lib" "bin" + +if [ "$1" != "--binary-only" ]; then + echo "Copying MegaGlest data files..." + "$megaglest_linux_path/make-data-archive.sh" --installer + cd "$DATA_DIR" + cp -r * "$CURRENTDIR/$INSTALLDATADIR" +fi + +cd "$CURRENTDIR" +set +ex +echo "Successfully prepared files!" + +exit 0