diff --git a/common/lib.sh b/common/lib.sh index 7e24461d7..ec12b0b37 100755 --- a/common/lib.sh +++ b/common/lib.sh @@ -1,5 +1,16 @@ #!/bin/bash +process_engine_environment () { + if [ -f "env.json" ]; then + echo "Processing env.json" + sudo apt-get update && sudo apt-get install -y jq + eval "$(jq -r "to_entries|map(\"export \(.key)=\(.value|if type==\"array\" then join(\" \") else tostring end|@sh)\")|.[]" env.json)" + else + "Using env.sh" + source env.sh + fi +} + log_environment () { pwd nproc diff --git a/common/package.sh b/common/package.sh index 568e87bae..1b2abaca3 100755 --- a/common/package.sh +++ b/common/package.sh @@ -5,7 +5,7 @@ export pstart="$PWD" source common/lib.sh pushd "engines/$ENGINE_NAME" -source env.sh +process_engine_environment log_environment popd diff --git a/common/start_build.sh b/common/start_build.sh index f2a06b57e..3fa772b50 100755 --- a/common/start_build.sh +++ b/common/start_build.sh @@ -6,7 +6,7 @@ export ROOT_DIR="$PWD" pushd "engines/$ENGINE_NAME" -source env.sh +process_engine_environment log_environment setup_dist_dirs "$STEAM_APP_ID_LIST" diff --git a/engines/gzdoom/build.sh b/engines/gzdoom/build.sh index d6ae35317..20cd36096 100755 --- a/engines/gzdoom/build.sh +++ b/engines/gzdoom/build.sh @@ -4,7 +4,7 @@ # CLONE PHASE git clone https://github.com/coelckers/gzdoom.git source pushd source -git checkout 75da94a +git checkout "$COMMIT_TAG" popd hg clone https://heptapod.host/jp-lebreton/wadsmoosh @@ -26,5 +26,6 @@ popd # COPY PHASE cp -rfv "source/build"/{gzdoom,soundfonts,*.pk3} "$diststart/common/dist/" cp -rfv assets/* "$diststart/common/dist/" + cp -rfv ./wadsmoosh "$diststart/common/dist/wadsmoosh-branch-default" ln -rsf "$diststart/common/dist/lib/libfluidsynth.so.3" "$diststart/common/dist/lib/libfluidsynth.so.2" diff --git a/engines/gzdoom/env.json b/engines/gzdoom/env.json new file mode 100644 index 000000000..6178d6545 --- /dev/null +++ b/engines/gzdoom/env.json @@ -0,0 +1,36 @@ +{ + "STEAM_APP_ID_LIST": [ + "2280", + "2300", + "2360", + "2390", + "2370", + "1118550", + "817220", + "1072150", + "1546440", + "1271050", + "1417010", + "1731320", + "317040", + "1715690", + "1988750", + "9160", + "2290", + "782330", + "1665260" + ], + "LICENSE_PATH": "./source/LICENSE", + "ADDITIONAL_LICENSES": [ + "./LICENSE", + "./wadsmoosh/license.txt" + ], + "COMMON_PACKAGE": true, + "LIBRARIES": [ + "zmusic" + ], + "APT_LIBRARIES": [ + "mercurial" + ], + "COMMIT_TAG": "g4.10.0" +} diff --git a/engines/gzdoom/env.sh b/engines/gzdoom/env.sh deleted file mode 100755 index bafc9693e..000000000 --- a/engines/gzdoom/env.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -export STEAM_APP_ID_LIST="2280 2300 2360 2390 2370 1118550 817220 1072150 1546440 1271050 1417010 1731320 317040 1715690 1988750 9160 2290 782330 1665260" -export LICENSE_PATH="./source/LICENSE" -export ADDITIONAL_LICENSES="./LICENSE ./wadsmoosh/license.txt" -export COMMON_PACKAGE="1" -export LIBRARIES="zmusic" -export APT_LIBRARIES="mercurial"