Mac: bundle renamed Igneum Miner.app (network.igneum.miner, 0.1.0, LSMinimumSystemVersion 11.0, igneum.icns), Terminal title Igneum Miner, seed line in the first-run text, branded DMG (volume icon, background, icon slots via dmgbuild), dist/Igneum-Miner-0.1.0.dmg at 16.2 MB, tested synced against the live node on 27400/27401. Windows: packaging/windows with windres .rc files and embed-resources.sh (relink commands for the next cross-build), Igneum-Miner.iss (Program Files, Start Menu group, firewall rule, uninstall stops the processes, licence, seed line), BUILD-INSTALLER.bat and build-installer.ps1 for the project lead's PC (winget Inno Setup 6, rcedit fallback for the exe icon). Icons: brand/icons/make-icons.py makes igneum.icns, igneum.ico, the Inno wizard art and the DMG background. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
61 lines
3.6 KiB
Bash
Executable file
61 lines
3.6 KiB
Bash
Executable file
#!/usr/bin/env bash
|
|
# Gives igneumd.exe and igneum-miner.exe the coin icon and a version block (CompanyName Igneum, ProductName
|
|
# Igneum Miner, 0.1.0). Two steps, both on the Mac:
|
|
# 1. windres compiles resources/igneumd.rc and resources/igneum-miner.rc into COFF objects (cheap, always done).
|
|
# 2. --relink runs `cargo rustc` for each binary with `-C link-arg=<object>`: only the final crate is recompiled and
|
|
# relinked, every dependency comes from the cache, so it costs a few minutes after a normal cross-build. The
|
|
# objects are linked in as extra inputs, nothing in vendor/ changes. Without --relink the exact commands are
|
|
# printed, and build-installer.ps1 stamps the resources with rcedit on the PC instead.
|
|
# The resulting exes land where proto-cuda/windows-app/make-package.sh already picks them up
|
|
# (vendor/igneum-node-win/target/x86_64-pc-windows-gnu/release/).
|
|
#
|
|
# packaging/windows/embed-resources.sh compile the objects, print the relink commands
|
|
# packaging/windows/embed-resources.sh --relink also relink both exes (needs a completed cross-build in the cache)
|
|
set -euo pipefail
|
|
HERE="$(cd "$(dirname "$0")" && pwd)"
|
|
ROOT="$(cd "$HERE/../.." && pwd)"
|
|
ICONS="$ROOT/brand/icons"
|
|
OUT="$HERE/build/res"
|
|
NODE="${NODE_WORKTREE:-$ROOT/vendor/igneum-node-win}"
|
|
MINGW="/opt/homebrew/opt/mingw-w64/toolchain-x86_64/x86_64-w64-mingw32"
|
|
command -v x86_64-w64-mingw32-windres >/dev/null || { echo "x86_64-w64-mingw32-windres not found (brew install mingw-w64)" >&2; exit 1; }
|
|
[ -f "$ICONS/igneum.ico" ] || { echo "no $ICONS/igneum.ico; run python3 brand/icons/make-icons.py first" >&2; exit 1; }
|
|
mkdir -p "$OUT"
|
|
for name in igneumd igneum-miner; do
|
|
x86_64-w64-mingw32-windres -I "$ICONS" -i "$HERE/resources/$name.rc" -O coff -o "$OUT/$name.res.o"
|
|
echo "compiled $OUT/$name.res.o ($(stat -f %z "$OUT/$name.res.o") bytes)"
|
|
done
|
|
|
|
# The same environment as proto-cuda/windows-node/cross-build.sh, so the cached dependencies are reused.
|
|
export PATH="$HOME/.cargo/bin:/opt/homebrew/bin:$PATH"
|
|
export CARGO_TARGET_DIR="${CARGO_TARGET_DIR:-target}"
|
|
export CC_x86_64_pc_windows_gnu=x86_64-w64-mingw32-gcc
|
|
export CXX_x86_64_pc_windows_gnu=x86_64-w64-mingw32-g++
|
|
export AR_x86_64_pc_windows_gnu=x86_64-w64-mingw32-ar
|
|
export LIBCLANG_PATH=/opt/homebrew/opt/llvm/lib
|
|
export BINDGEN_EXTRA_CLANG_ARGS_x86_64_pc_windows_gnu="--target=x86_64-w64-mingw32 --sysroot=$MINGW -I$MINGW/include"
|
|
export CARGO_TARGET_X86_64_PC_WINDOWS_GNU_RUSTFLAGS="-C link-arg=-static -C link-arg=-static-libgcc"
|
|
|
|
relink_cmd() { # $1 package, $2 bin, $3 object
|
|
printf 'nice -n 19 cargo rustc --release -j 2 -p %s --bin %s --features igneum-pow --target x86_64-pc-windows-gnu -- -C link-arg=%q\n' "$1" "$2" "$3"
|
|
}
|
|
if [ "${1:-}" = "--relink" ]; then
|
|
cd "$NODE"
|
|
for spec in "kaspad igneumd" "igneum-miner igneum-miner"; do
|
|
set -- $spec
|
|
echo "relinking $2.exe"
|
|
eval "$(relink_cmd "$1" "$2" "$OUT/$2.res.o")"
|
|
exe="$CARGO_TARGET_DIR/x86_64-pc-windows-gnu/release/$2.exe"
|
|
x86_64-w64-mingw32-objdump -h "$exe" | grep -q '\.rsrc' && echo "$exe: .rsrc section present ($(stat -f %z "$exe") bytes)" || { echo "$exe has no .rsrc section" >&2; exit 1; }
|
|
done
|
|
else
|
|
cat <<TXT
|
|
|
|
Not relinked (no --relink). After the next cross-build (proto-cuda/windows-node/cross-build.sh), from $NODE
|
|
with the same environment variables as that script, run:
|
|
$(relink_cmd kaspad igneumd "$OUT/igneumd.res.o")
|
|
$(relink_cmd igneum-miner igneum-miner "$OUT/igneum-miner.res.o")
|
|
Then proto-cuda/windows-app/make-package.sh ships the branded exes. Check with:
|
|
x86_64-w64-mingw32-objdump -h vendor/igneum-node-win/target/x86_64-pc-windows-gnu/release/igneum-miner.exe | grep rsrc
|
|
TXT
|
|
fi
|