From ab3b70f36ae443170b652882d35888a863fb9766 Mon Sep 17 00:00:00 2001 From: SoftCoder Date: Mon, 9 Oct 2017 23:53:43 -0700 Subject: [PATCH] - fix windows build and better automation for building steam shim --- mk/linux/mg_cppcheck.sh | 2 +- .../include/platform/sdl/platform_util.h | 2 +- source/steamshim_parent/build.sh | 35 ++++++++++++++++--- 3 files changed, 33 insertions(+), 6 deletions(-) diff --git a/mk/linux/mg_cppcheck.sh b/mk/linux/mg_cppcheck.sh index 7856e4f9..2a65846b 100755 --- a/mk/linux/mg_cppcheck.sh +++ b/mk/linux/mg_cppcheck.sh @@ -5,7 +5,7 @@ # Copyright (c) 2011 Mark Vejvoda under GNU GPL v3.0+ if ! cppcheck_loc="$(type -p "cppcheck")" || [ -z "$cppcheck_loc" ]; then - # install foobar here + # install cppcheck echo "CPPCHECK is not installed, installing now..." sudo apt install cppcheck fi diff --git a/source/shared_lib/include/platform/sdl/platform_util.h b/source/shared_lib/include/platform/sdl/platform_util.h index 106c2ba2..653e3e52 100644 --- a/source/shared_lib/include/platform/sdl/platform_util.h +++ b/source/shared_lib/include/platform/sdl/platform_util.h @@ -102,7 +102,7 @@ std::string utf8_encode(const std::wstring &wstr); std::wstring utf8_decode(const std::string &str); std::string getRegKey(const std::string& location, const std::string& name); -void message(string message, bool isNonGraphicalModeEnabled,string writepath); +void message(string message, bool isNonGraphicalModeEnabled,const string &writepath); void exceptionMessage(const exception &excp); string getCommandLine(); void init_win32(); diff --git a/source/steamshim_parent/build.sh b/source/steamshim_parent/build.sh index 3ee34973..83d70d97 100755 --- a/source/steamshim_parent/build.sh +++ b/source/steamshim_parent/build.sh @@ -2,10 +2,37 @@ # Use this script to build MegaGlest Steam Shim using make # ---------------------------------------------------------------------------- # Written by Mark Vejvoda -# Copyright (c) 2011-2013 Mark Vejvoda under GNU GPL v3.0+ +# Copyright (c) 2011-2017 Mark Vejvoda under GNU GPL v3.0+ # ---------------------------------------------------------------------------- -rm -f megaglest_shim -rm -f megaglest -#make STEAMWORKS?=/home/softcoder/Code/steamworks_sdk/sdk +CURRENTDIR="$(dirname $(readlink -f $0))" +rm -f ${CURRENTDIR}/megaglest_shim +rm -f ${CURRENTDIR}/megaglest +# Pass the path to your steam SDK example: +# builds.sh STEAMWORKS?=/home/softcoder/Code/steamworks_sdk/sdk +# +# make STEAMWORKS?=/home/softcoder/Code/steamworks_sdk/sdk make $@ +if [ $? -ne 0 ]; then + echo 'ERROR: MAKE failed.' >&2; exit 2 +fi + +STEAM_MG_PATH="$HOME/.steam/steam/steamapps/common/MegaGlest/" +if [ -d ${STEAM_MG_PATH} ]; then + if [ ! -f "${STEAM_MG_PATH}/steam_appid.txt" ]; then + echo "Installing steam appid file to Megaglest Steam folder [${STEAM_MG_PATH}] ..." + cp ${CURRENTDIR}/steam_appid.txt ${STEAM_MG_PATH}/steam_appid.txt + fi + + PARAM1=$1 + prefix=STEAMWORKS?= + STEAMWORKS=${PARAM1#$prefix} + # echo "${STEAMWORKS}" + if [ ! -f "${STEAM_MG_PATH}/lib/libsteam_api.so" ]; then + echo "Installing steam sdk api to Megaglest Steam folder [${STEAM_MG_PATH}/lib/] ..." + cp ${STEAMWORKS}/redistributable_bin/linux64/libsteam_api.so ${STEAM_MG_PATH}/lib/libsteam_api.so + fi + + echo "Installing steam shim to Megaglest Steam folder [${STEAM_MG_PATH}] ..." + cp ${CURRENTDIR}/megaglest_shim ${STEAM_MG_PATH}/megaglest_shim +fi