Skip to content

Commit

Permalink
Add support for env.json (#1109)
Browse files Browse the repository at this point in the history
* Add support for env.json

* gzdoom - Switch to using env.json

* Fix

* Rebuild
  • Loading branch information
d10sfan authored Feb 29, 2024
1 parent f51cf87 commit 6a4ecd0
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 11 deletions.
11 changes: 11 additions & 0 deletions common/lib.sh
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion common/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export pstart="$PWD"
source common/lib.sh

pushd "engines/$ENGINE_NAME"
source env.sh
process_engine_environment
log_environment
popd

Expand Down
2 changes: 1 addition & 1 deletion common/start_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
3 changes: 2 additions & 1 deletion engines/gzdoom/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
36 changes: 36 additions & 0 deletions engines/gzdoom/env.json
Original file line number Diff line number Diff line change
@@ -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"
}
8 changes: 0 additions & 8 deletions engines/gzdoom/env.sh

This file was deleted.

0 comments on commit 6a4ecd0

Please sign in to comment.