Skip to content

Commit ed4bb20

Browse files
committed
Switch to dat3 and native sslc
1 parent 19ce390 commit ed4bb20

11 files changed

Lines changed: 42 additions & 53 deletions

File tree

.github/workflows/build.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ on:
66

77
env:
88
sfall_version: 4.5
9-
mpack_version: 4.5
109

1110
jobs:
1211
build:
@@ -18,9 +17,6 @@ jobs:
1817
- name: ShellCheck
1918
uses: ludeeus/action-shellcheck@master
2019

21-
- name: Install wine
22-
uses: devopsx/gha-ubuntu-i386-fix@master
23-
2420
- name: Install packages
2521
run: sudo DEBIAN_FRONTEND=noninteractive eatmydata apt-get install -o=Dpkg::Use-Pty=0 -y crudini dos2unix gcc p7zip
2622

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,11 @@
33
*.int
44
external
55
extra/bin/*
6-
!extra/bin/dat2.exe
76
*.rar
87
*.7z
98
data/*
109
!data/text
10+
# fetched by buildall.sh
11+
source/headers/rp
12+
source/headers/sfall
13+
source/headers/fo2tweaks

extra/bin/dat2.exe

-276 KB
Binary file not shown.

extra/build.list

Lines changed: 0 additions & 1 deletion
This file was deleted.

extra/buildall.sh

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@
22

33
set -xeu -o pipefail
44

5-
extra_dir="${extra_dir:-extra}"
6-
extra_dir="$(realpath "$extra_dir")"
7-
bin_dir="$extra_dir/bin"
8-
compile="$bin_dir/compile.exe"
5+
src="$(realpath source)"
6+
headers_dir="$src/headers"
97
dst="data/scripts"
108
mkdir -p "$dst"
119
dst="$(realpath $dst)"
@@ -39,11 +37,14 @@ fi
3937

4038
cd ..
4139

42-
files=$(cat "$extra_dir"/build.list)
43-
mkdir -p "$dst"
44-
cd source
45-
for f in $files; do
46-
# shellcheck disable=SC2001 # sed is more readable
47-
int_name="$(echo "$f" | sed 's|\.ssl$|.int|')"
48-
wine "$compile" -l -O2 -p -s -q -n "$f" -o "$dst/$int_name"
49-
done
40+
# The dependency headers include each other by relative path ("../sfall/sfall.h"), which POSIX resolves
41+
# through a symlink into the clone tree instead of lexically. So these have to be real sibling
42+
# directories - symlinks only ever worked because wine normalized ".." the Windows way.
43+
rm -rf "$headers_dir/rp" "$headers_dir/sfall" "$headers_dir/fo2tweaks"
44+
cp -r external/rp/scripts_src/headers "$headers_dir/rp"
45+
cp -r external/sfall/artifacts/scripting/headers "$headers_dir/sfall"
46+
cp -r external/fo2tweaks/source/headers/fo2tweaks "$headers_dir/fo2tweaks"
47+
48+
cd "$src"
49+
# shellcheck disable=SC2154 # from env.sh
50+
"$COMPILE" -l -O2 -p -s -q -n gl_p_party_orders.ssl -o "$dst/gl_p_party_orders.int"

extra/env.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,17 @@ extra_dir="$(realpath extra)"
66
export extra_dir
77
export bin_dir="$extra_dir/bin"
88
export mods_dir="mods"
9-
export mpack_version=${mpack_version:-4.5}
10-
export mpack_7z="mpack.7z"
119
export sfall_version=${sfall_version:-4.5}
12-
export WINEARCH=win32
13-
export WINEDEBUG=-all
1410
export mod_name=party_orders
1511

12+
SSLC_VERSION="2026-05-23-12-48-08"
13+
export SSLC_URL="https://github.com/sfall-team/sslc/releases/download/${SSLC_VERSION}/sslc-linux"
14+
export COMPILE="$bin_dir/sslc"
15+
16+
DAT3_VERSION="v0.8.0"
17+
export DAT3_URL="https://github.com/BGforgeNet/dat3/releases/download/${DAT3_VERSION}/dat3"
18+
export DAT3="$bin_dir/dat3"
19+
1620
set +xeu +o pipefail
1721

1822
# git magic to clone a subdirectory, for faster build

extra/package.sh

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@
33
set -xeu -o pipefail
44

55
export comp_dir="components"
6-
# shellcheck disable=SC2154 # from env.sh
7-
export dat2="wine $bin_dir/dat2.exe"
8-
export dat2a="wine $bin_dir/dat2.exe a -1"
9-
export file_list="file.list"
106

117
short_sha="$(git rev-parse --short HEAD)"
128
# defaults, local build or github non-tagged
@@ -27,13 +23,9 @@ dat="$mod_name.dat"
2723
# shellcheck disable=SC2154 # from env.sh
2824
mkdir -p "$mods_dir"
2925

30-
cd data
31-
rm -rf text/po # gettext translations
32-
# I don't know how to pack recursively
33-
find . -type f | sed -e 's|^\.\/||' -e 's|\/|\\|g' | sort >../file.list # replace slashes with backslashes
34-
wine "$bin_dir/dat2.exe" a "$dat" @../file.list
35-
cd ..
36-
mv "data/$dat" "$mods_dir/"
26+
rm -rf data/text/po # gettext translations
27+
# shellcheck disable=SC2154 # from env.sh
28+
"$DAT3" a -c 9 -C data "$mods_dir/$dat" '*'
3729

3830
# sfall
3931
# shellcheck disable=SC2154 # from workflow yml

extra/prepare.sh

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,19 @@
22

33
set -xeu -o pipefail
44

5-
extra_dir=${extra_dir:-extra}
6-
mpack_version=${mpack_version:-4.5}
5+
# shellcheck disable=SC2154 # from env.sh
6+
mkdir -p "$bin_dir"
77

8-
mpack_file="modderspack_$mpack_version.7z"
9-
mpack_url="https://sourceforge.net/projects/sfall/files/Modders%20pack/$mpack_file/download"
10-
compile_exe="compile.exe"
11-
mpack_compile="ScriptEditor/resources/$compile_exe"
8+
# sslc compiler
9+
# shellcheck disable=SC2154 # from env.sh
10+
if [[ ! -f "$COMPILE" ]]; then
11+
wget -q "$SSLC_URL" -O "$COMPILE"
12+
chmod +x "$COMPILE"
13+
fi
1214

13-
# directories
14-
cache_dir="$HOME/.cache/build"
15-
bin_dir="$(realpath extra/bin)"
16-
mkdir -p "$cache_dir" "$bin_dir"
17-
18-
# compile.exe, check cache
19-
wget -q "$mpack_url" -O mpack.7z
20-
7zr e mpack.7z "$mpack_compile"
21-
mv -f "$compile_exe" "$cache_dir/"
22-
# copy
23-
cp -f "$cache_dir/$compile_exe" "$bin_dir/"
15+
# dat3 packer
16+
# shellcheck disable=SC2154 # from env.sh
17+
if [[ ! -f "$DAT3" ]]; then
18+
wget -q "$DAT3_URL" -O "$DAT3"
19+
chmod +x "$DAT3"
20+
fi

source/headers/fo2tweaks

Lines changed: 0 additions & 1 deletion
This file was deleted.

source/headers/rp

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)