redalert2-recomp-git

LOW
maintainer 9M2PJU 0 votes scanned 2026-10-27 09:47:05.186512
View on AUR
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).
8pkgname=redalert2-recomp-git
9_pkgname=redalert2-recomp
10pkgver=0.1.3.r0.g0000000
11pkgrel=2
12pkgdesc="Static recompilation of Red Alert 2 and Yuri's Revenge to native Linux (needs your own game copy)"
13arch=('x86_64')
14url="https://github.com/sp00nznet/redalert2-recomp"
15license=('MIT')
16depends=('gcc' 'lib32-gcc-libs' 'lib32-glibc' 'cmake' 'ninja' 'pkgconf'
17 'python' 'git' 'lib32-sdl2-compat' 'lib32-sdl2_ttf' 'ttf-liberation')
18makedepends=('git')
19optdepends=('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)')
22provides=("$_pkgname")
23conflicts=("$_pkgname")
24source=("git+https://github.com/sp00nznet/redalert2-recomp.git")
25sha256sums=('SKIP')
26
27pkgver() {
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
32package() {
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.
49set -e
50SRC=/usr/share/redalert2-recomp
51DST=${XDG_DATA_HOME:-$HOME/.local/share}/redalert2-recomp
52VER_FILE=.pkg-version
53want=$(cat "$SRC/$VER_FILE" 2>/dev/null || echo unknown)
54have=$(cat "$DST/$VER_FILE" 2>/dev/null || echo none)
55if [ ! -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"
79fi
80exec "$DST/setup.sh" "$@"
81EOF
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.
90set -e
91DST=${XDG_DATA_HOME:-$HOME/.local/share}/redalert2-recomp
92case "${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 ;;
97esac
98if [ "$g" = ra2 ]; then exe=build-linux-game/ra2; else exe=build-linux/ra2; fi
99if [ ! -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
103fi
104cd "$DST"
105exec "$exe" --run "$@"
106EOF
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]
114Version=1.0
115Type=Application
116Name=Yuri's Revenge (recomp)
117GenericName=Real-time strategy game
118Comment=Static recompilation of Yuri's Revenge (needs your own copy of the game)
119Exec=redalert2-recomp-play yr
120Icon=redalert2-recomp
121Terminal=false
122Categories=Game;StrategyGame;
123Keywords=ra2;yuri;revenge;recomp;command;conquer;
124StartupNotify=false
125EOF
126 cat > "$pkgdir/usr/share/applications/red-alert-2-recomp.desktop" <<'EOF'
127[Desktop Entry]
128Version=1.0
129Type=Application
130Name=Red Alert 2 (recomp)
131GenericName=Real-time strategy game
132Comment=Static recompilation of Red Alert 2 (needs your own copy of the game)
133Exec=redalert2-recomp-play ra2
134Icon=redalert2-recomp
135Terminal=false
136Categories=Game;StrategyGame;
137Keywords=ra2;red;alert;recomp;command;conquer;
138StartupNotify=false
139EOF
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>
147EOF
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
152redalert2-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
158Static recompilation of Command & Conquer: Red Alert 2 and Yuri's Revenge to
159native code. The package ships the source; this script copies it to
160.I ~/.local/share/redalert2-recomp
161on first run, finds your own copy of the game (Steam, or
162.BR --game-dir ),
163then analyses, lifts and builds each game (30\-60 minutes, ~6 GB, once).
164.PP
165You need your own copy of the game: the folder holding
166.I game.exe
167and
168.IR gamemd.exe .
169Nothing from the game is in the package.
170.SH OPTIONS
171.TP
172.B yr | ra2
173Build only that game (about half the time).
174.TP
175.BR --yes
176Do not ask before installing anything.
177.TP
178.BR --game-dir " DIR"
179Use this install instead of searching Steam.
180.TP
181.BR --force
182Redo every step.
183.TP
184.BR --wine
185Build the Windows exes and play them under Wine instead of natively.
186.SH FILES
187.TP
188.I /usr/share/redalert2-recomp
189Pristine packaged source (do not build here).
190.TP
191.I ~/.local/share/redalert2-recomp
192Your per-user copy: game link, function catalogues
193.IR ( work/ ),
194lifted C
195.IR ( src/recomp/gen* )
196and builds
197.IR ( build-linux* ).
198.SH SEE ALSO
199.BR redalert2-recomp-play (1)
200.SH NOTE
201First builds need the 32-bit toolchain plus SDL2 and ffmpeg for i386; the
202script names the exact packages when any are missing.
203EOF
204 cat > "$pkgdir/redalert2-recomp-play.1" <<'EOF'
205.TH REDALERT2-RECOMP-PLAY 1 "October 2026" "redalert2-recomp" "Games Manual"
206.SH NAME
207redalert2-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
213Runs 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
220plus any extra args passed through. If nothing is built yet it tells you to
221run
222.BR redalert2-recomp-setup (1)
223first.
224.SH SEE ALSO
225.BR redalert2-recomp-setup (1)
226EOF
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)SeverityRules
2026-10-27 09:47:05 Low 1

Report a package

Reports go to the AURWatch maintainer (one person) and are read by hand. No login required.

0 / 4000
Your suggestion