redalert2-recomp-git
LOW
maintainer 9M2PJU
0 votes
scanned 2026-10-27 09:47:05.186512
Why flagged
Uploaded within the last 14 days with 2 or fewer community votes — little peer review so far.
Triggered rules
Low
Few votes, recently uploaded
zero_votes_recent
Uploaded within the last 14 days with 2 or fewer community votes — little peer review so far.
PKGBUILD
1
# Maintainer: 9M2PJU <https://github.com/9M2PJU>
2
# Static recompilation of C&C Red Alert 2 and Yuri's Revenge to native code.
3
# Needs your OWN copy of the game (game.exe + gamemd.exe); the package ships
4
# only this repository's source. First run of redalert2-recomp-setup copies
5
# it to ~/.local/share/redalert2-recomp, finds the game in your Steam
6
# libraries (or --game-dir), then analyses, lifts and builds each game
7
# (30-60 minutes, ~6 GB, once).
8
pkgname=redalert2-recomp-git
9
_pkgname=redalert2-recomp
10
pkgver=0.1.3.r0.g0000000
11
pkgrel=2
12
pkgdesc="Static recompilation of Red Alert 2 and Yuri's Revenge to native Linux (needs your own game copy)"
13
arch=('x86_64')
14
url="https://github.com/sp00nznet/redalert2-recomp"
15
license=('MIT')
16
depends=('gcc' 'lib32-gcc-libs' 'lib32-glibc' 'cmake' 'ninja' 'pkgconf'
17
'python' 'git' 'lib32-sdl2-compat' 'lib32-sdl2_ttf' 'ttf-liberation')
18
makedepends=('git')
19
optdepends=('lib32-ffmpeg: Bink movies (intro/cutscenes); without it build with CMAKE_ARGS=-DWITH_FFMPEG=OFF'
20
'wine: play the Windows builds instead of the native ones (setup --wine)'
21
'steam: source of the game files (Proton)')
22
provides=("$_pkgname")
23
conflicts=("$_pkgname")
24
source=("git+https://github.com/sp00nznet/redalert2-recomp.git")
25
sha256sums=('SKIP')
26
27
pkgver() {
28
cd "$srcdir/$_pkgname"
29
printf "0.1.3.r%s.g%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
30
}
31
32
package() {
33
cd "$srcdir/$_pkgname"
34
35
# Pristine source tree. Build output, the game link and the venv never
36
# belong to the package: they live in the per-user copy instead.
37
install -d "$pkgdir/usr/share/$_pkgname"
38
git archive HEAD | tar -x -C "$pkgdir/usr/share/$_pkgname"
39
echo "$pkgver" > "$pkgdir/usr/share/$_pkgname/.pkg-version"
40
41
# /usr/bin/redalert2-recomp-setup
42
cat > "$pkgdir/usr/bin-redalert2-recomp-setup" <<'EOF'
43
#!/bin/sh
44
# Build/update driver: sync the packaged source to a per-user copy (the
45
# 30-60 minute pipeline needs a writable tree and your own game files) and
46
# run setup.sh there. On upgrade the source re-syncs while the game link,
47
# the function catalogues (work/) and the lifted C (src/recomp/gen*) are
48
# kept, so an update costs a recompile, not a re-lift.
49
set -e
50
SRC=/usr/share/redalert2-recomp
51
DST=${XDG_DATA_HOME:-$HOME/.local/share}/redalert2-recomp
52
VER_FILE=.pkg-version
53
want=$(cat "$SRC/$VER_FILE" 2>/dev/null || echo unknown)
54
have=$(cat "$DST/$VER_FILE" 2>/dev/null || echo none)
55
if [ ! -f "$DST/setup.sh" ] || [ "$want" != "$have" ]; then
56
if [ -f "$DST/setup.sh" ]; then
57
echo "redalert2-recomp: updating user copy $have -> $want (keeping game link, work/ and lifted C)"
58
else
59
echo "redalert2-recomp: first run, copying source to $DST"
60
fi
61
mkdir -p "$DST"
62
KEEP=$(mktemp -d)
63
for p in game work src/recomp/gen src/recomp/gen_game .venv; do
64
if [ -e "$DST/$p" ] || [ -L "$DST/$p" ]; then
65
mkdir -p "$KEEP/$(dirname "$p")"
66
mv "$DST/$p" "$KEEP/$p"
67
fi
68
done
69
find "$DST" -mindepth 1 -maxdepth 1 -exec rm -rf {} +
70
cp -a "$SRC/." "$DST/"
71
for p in game work src/recomp/gen src/recomp/gen_game .venv; do
72
if [ -e "$KEEP/$p" ] || [ -L "$KEEP/$p" ]; then
73
mkdir -p "$DST/$(dirname "$p")"
74
rm -rf "$DST/$p"
75
mv "$KEEP/$p" "$DST/$p"
76
fi
77
done
78
rm -rf "$KEEP"
79
fi
80
exec "$DST/setup.sh" "$@"
81
EOF
82
install -d "$pkgdir/usr/bin"
83
install -m755 "$pkgdir/usr/bin-redalert2-recomp-setup" "$pkgdir/usr/bin/redalert2-recomp-setup"
84
rm "$pkgdir/usr/bin-redalert2-recomp-setup"
85
86
# /usr/bin/redalert2-recomp-play
87
cat > "$pkgdir/usr/bin-redalert2-recomp-play" <<'EOF'
88
#!/bin/sh
89
# Play an already-built game out of the per-user copy.
90
set -e
91
DST=${XDG_DATA_HOME:-$HOME/.local/share}/redalert2-recomp
92
case "${1:-yr}" in
93
ra2) g=ra2; shift ;;
94
yr) g=yr; shift ;;
95
-*) g=yr ;;
96
*) echo "usage: $(basename "$0") [yr|ra2] [args...]" >&2; exit 2 ;;
97
esac
98
if [ "$g" = ra2 ]; then exe=build-linux-game/ra2; else exe=build-linux/ra2; fi
99
if [ ! -d "$DST" ] || [ ! -x "$DST/$exe" ]; then
100
echo "redalert2-recomp-play: no built $g here yet." >&2
101
echo "Run: redalert2-recomp-setup $g (needs your own copy of the game)" >&2
102
exit 1
103
fi
104
cd "$DST"
105
exec "$exe" --run "$@"
106
EOF
107
install -m755 "$pkgdir/usr/bin-redalert2-recomp-play" "$pkgdir/usr/bin/redalert2-recomp-play"
108
rm "$pkgdir/usr/bin-redalert2-recomp-play"
109
110
# Desktop entries + icon + man pages.
111
install -d "$pkgdir/usr/share/applications"
112
cat > "$pkgdir/usr/share/applications/yuris-revenge-recomp.desktop" <<'EOF'
113
[Desktop Entry]
114
Version=1.0
115
Type=Application
116
Name=Yuri's Revenge (recomp)
117
GenericName=Real-time strategy game
118
Comment=Static recompilation of Yuri's Revenge (needs your own copy of the game)
119
Exec=redalert2-recomp-play yr
120
Icon=redalert2-recomp
121
Terminal=false
122
Categories=Game;StrategyGame;
123
Keywords=ra2;yuri;revenge;recomp;command;conquer;
124
StartupNotify=false
125
EOF
126
cat > "$pkgdir/usr/share/applications/red-alert-2-recomp.desktop" <<'EOF'
127
[Desktop Entry]
128
Version=1.0
129
Type=Application
130
Name=Red Alert 2 (recomp)
131
GenericName=Real-time strategy game
132
Comment=Static recompilation of Red Alert 2 (needs your own copy of the game)
133
Exec=redalert2-recomp-play ra2
134
Icon=redalert2-recomp
135
Terminal=false
136
Categories=Game;StrategyGame;
137
Keywords=ra2;red;alert;recomp;command;conquer;
138
StartupNotify=false
139
EOF
140
install -d "$pkgdir/usr/share/icons/hicolor/scalable/apps"
141
cat > "$pkgdir/usr/share/icons/hicolor/scalable/apps/redalert2-recomp.svg" <<'EOF'
142
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">
143
<rect x="2" y="2" width="60" height="60" rx="12" fill="#1a1a1a"/>
144
<rect x="2" y="2" width="60" height="60" rx="12" fill="none" stroke="#d0342c" stroke-width="3"/>
145
<path d="M32 10 L37.5 25.5 L54 25.5 L40.7 35 L45.5 51 L32 41.5 L18.5 51 L23.3 35 L10 25.5 L26.5 25.5 Z" fill="#d0342c"/>
146
</svg>
147
EOF
148
install -d "$pkgdir/usr/share/man/man1"
149
cat > "$pkgdir/redalert2-recomp-setup.1" <<'EOF'
150
.TH REDALERT2-RECOMP-SETUP 1 "October 2026" "redalert2-recomp" "Games Manual"
151
.SH NAME
152
redalert2-recomp-setup \- build the recompiled Red Alert 2 and Yuri's Revenge
153
.SH SYNOPSIS
154
.B redalert2-recomp-setup
155
.RI [ yr | ra2 ]
156
.RI [ options ]
157
.SH DESCRIPTION
158
Static recompilation of Command & Conquer: Red Alert 2 and Yuri's Revenge to
159
native code. The package ships the source; this script copies it to
160
.I ~/.local/share/redalert2-recomp
161
on first run, finds your own copy of the game (Steam, or
162
.BR --game-dir ),
163
then analyses, lifts and builds each game (30\-60 minutes, ~6 GB, once).
164
.PP
165
You need your own copy of the game: the folder holding
166
.I game.exe
167
and
168
.IR gamemd.exe .
169
Nothing from the game is in the package.
170
.SH OPTIONS
171
.TP
172
.B yr | ra2
173
Build only that game (about half the time).
174
.TP
175
.BR --yes
176
Do not ask before installing anything.
177
.TP
178
.BR --game-dir " DIR"
179
Use this install instead of searching Steam.
180
.TP
181
.BR --force
182
Redo every step.
183
.TP
184
.BR --wine
185
Build the Windows exes and play them under Wine instead of natively.
186
.SH FILES
187
.TP
188
.I /usr/share/redalert2-recomp
189
Pristine packaged source (do not build here).
190
.TP
191
.I ~/.local/share/redalert2-recomp
192
Your per-user copy: game link, function catalogues
193
.IR ( work/ ),
194
lifted C
195
.IR ( src/recomp/gen* )
196
and builds
197
.IR ( build-linux* ).
198
.SH SEE ALSO
199
.BR redalert2-recomp-play (1)
200
.SH NOTE
201
First builds need the 32-bit toolchain plus SDL2 and ffmpeg for i386; the
202
script names the exact packages when any are missing.
203
EOF
204
cat > "$pkgdir/redalert2-recomp-play.1" <<'EOF'
205
.TH REDALERT2-RECOMP-PLAY 1 "October 2026" "redalert2-recomp" "Games Manual"
206
.SH NAME
207
redalert2-recomp-play \- play the recompiled Red Alert 2 or Yuri's Revenge
208
.SH SYNOPSIS
209
.B redalert2-recomp-play
210
.RI [ yr | ra2 ]
211
.RI [ args... ]
212
.SH DESCRIPTION
213
Runs an already-built native game out of
214
.IR ~/.local/share/redalert2-recomp :
215
.I build-linux/ra2
216
(Yuri's Revenge) or
217
.I build-linux-game/ra2
218
(Red Alert 2), with
219
.B --run
220
plus any extra args passed through. If nothing is built yet it tells you to
221
run
222
.BR redalert2-recomp-setup (1)
223
first.
224
.SH SEE ALSO
225
.BR redalert2-recomp-setup (1)
226
EOF
227
gzip -9 -n -c "$pkgdir/redalert2-recomp-setup.1" > "$pkgdir/usr/share/man/man1/redalert2-recomp-setup.1.gz"
228
gzip -9 -n -c "$pkgdir/redalert2-recomp-play.1" > "$pkgdir/usr/share/man/man1/redalert2-recomp-play.1.gz"
229
rm "$pkgdir/redalert2-recomp-setup.1" "$pkgdir/redalert2-recomp-play.1"
230
install -d "$pkgdir/usr/share/licenses/$_pkgname"
231
install -m644 LICENSE NOTICE.md "$pkgdir/usr/share/licenses/$_pkgname/"
232
}
233
Scan history
| Scanned at (UTC) | Severity | Rules |
|---|---|---|
| 2026-10-27 09:47:05 | Low | 1 |