build: Linux release outputs binaries zip + AppImage, bundle sapling params
- Linux --linux-release now produces both ObsidianDragon-Linux-x64.zip (raw binaries) and ObsidianDragon.AppImage (single-file) - Windows --win-release keeps standalone exe alongside zip with binaries - Bundle sapling-spend.params and sapling-output.params in Linux release
This commit is contained in:
100
build.sh
100
build.sh
@@ -5,7 +5,7 @@
|
||||
#
|
||||
# Usage:
|
||||
# ./build.sh # Dev build (Linux, debug-friendly)
|
||||
# ./build.sh --linux-release # Linux release + AppImage
|
||||
# ./build.sh --linux-release # Linux release (zip + AppImage)
|
||||
# ./build.sh --win-release # Windows cross-compile (mingw-w64)
|
||||
# ./build.sh --mac-release # macOS .app bundle + DMG
|
||||
# ./build.sh --linux-release --win-release # Multiple targets
|
||||
@@ -51,7 +51,7 @@ DragonX Wallet — Unified Build Script
|
||||
Usage: $0 [options]
|
||||
|
||||
Targets (at least one required, or none for dev build):
|
||||
--linux-release Linux release build + AppImage -> release/linux/
|
||||
--linux-release Linux release (zip + AppImage) -> release/linux/
|
||||
--win-release Windows cross-compile (mingw-w64) -> release/windows/
|
||||
--mac-release macOS .app bundle + DMG -> release/mac/
|
||||
|
||||
@@ -71,7 +71,7 @@ Cross-compiling from Linux:
|
||||
|
||||
Examples:
|
||||
$0 # Quick dev build (Linux)
|
||||
$0 --linux-release # Linux release + AppImage
|
||||
$0 --linux-release # Linux release (zip + AppImage)
|
||||
$0 --win-release # Windows cross-compile
|
||||
$0 --mac-release # macOS bundle + DMG (native or osxcross)
|
||||
$0 --clean --linux-release --win-release # Clean + both
|
||||
@@ -218,7 +218,7 @@ build_dev() {
|
||||
}
|
||||
|
||||
# ═══════════════════════════════════════════════════════════════════════════════
|
||||
# RELEASE: LINUX — build + strip + bundle daemon + AppImage
|
||||
# RELEASE: LINUX — build + strip + bundle daemon + zip + AppImage
|
||||
# ═══════════════════════════════════════════════════════════════════════════════
|
||||
build_release_linux() {
|
||||
header "Release: Linux x86_64"
|
||||
@@ -249,17 +249,38 @@ build_release_linux() {
|
||||
# ── Bundle daemon ────────────────────────────────────────────────────────
|
||||
bundle_linux_daemon "bin" || warn "Daemon not bundled — wallet-only build"
|
||||
|
||||
# ── Bundle Sapling params ────────────────────────────────────────────────
|
||||
SAPLING_SPEND="" SAPLING_OUTPUT=""
|
||||
find_sapling_params && {
|
||||
cp -f "$SAPLING_SPEND" "bin/sapling-spend.params"
|
||||
cp -f "$SAPLING_OUTPUT" "bin/sapling-output.params"
|
||||
info "Bundled Sapling params"
|
||||
} || warn "Sapling params not found — not bundled"
|
||||
|
||||
# ── Package: release/linux/ ──────────────────────────────────────────────
|
||||
rm -rf "$out"
|
||||
mkdir -p "$out"
|
||||
|
||||
cp bin/ObsidianDragon "$out/"
|
||||
[[ -f bin/dragonxd ]] && cp bin/dragonxd "$out/"
|
||||
[[ -f bin/dragonx-cli ]] && cp bin/dragonx-cli "$out/"
|
||||
[[ -f bin/asmap.dat ]] && cp bin/asmap.dat "$out/"
|
||||
cp -r bin/res "$out/" 2>/dev/null || true
|
||||
local DIST="ObsidianDragon-Linux-x64"
|
||||
local dist_dir="$out/$DIST"
|
||||
mkdir -p "$dist_dir"
|
||||
|
||||
# ── AppImage ─────────────────────────────────────────────────────────────
|
||||
cp bin/ObsidianDragon "$dist_dir/"
|
||||
[[ -f bin/dragonxd ]] && cp bin/dragonxd "$dist_dir/"
|
||||
[[ -f bin/dragonx-cli ]] && cp bin/dragonx-cli "$dist_dir/"
|
||||
[[ -f bin/asmap.dat ]] && cp bin/asmap.dat "$dist_dir/"
|
||||
[[ -f bin/sapling-spend.params ]] && cp bin/sapling-spend.params "$dist_dir/"
|
||||
[[ -f bin/sapling-output.params ]] && cp bin/sapling-output.params "$dist_dir/"
|
||||
cp -r bin/res "$dist_dir/" 2>/dev/null || true
|
||||
|
||||
# ── Zip ──────────────────────────────────────────────────────────────────
|
||||
if command -v zip &>/dev/null; then
|
||||
(cd "$out" && zip -r "$DIST.zip" "$DIST")
|
||||
info "Zip: $out/$DIST.zip ($(du -h "$out/$DIST.zip" | cut -f1))"
|
||||
fi
|
||||
rm -rf "$dist_dir"
|
||||
|
||||
# ── AppImage (single-file) ───────────────────────────────────────────────
|
||||
info "Creating AppImage ..."
|
||||
local APPDIR="$bd/AppDir"
|
||||
rm -rf "$APPDIR"
|
||||
@@ -271,10 +292,11 @@ build_release_linux() {
|
||||
cp bin/ObsidianDragon "$APPDIR/usr/bin/"
|
||||
cp -r bin/res/* "$APPDIR/usr/share/ObsidianDragon/res/" 2>/dev/null || true
|
||||
|
||||
# Daemon inside AppImage
|
||||
[[ -f bin/dragonxd ]] && cp bin/dragonxd "$APPDIR/usr/bin/"
|
||||
[[ -f bin/dragonx-cli ]] && cp bin/dragonx-cli "$APPDIR/usr/bin/"
|
||||
[[ -f bin/asmap.dat ]] && cp bin/asmap.dat "$APPDIR/usr/share/ObsidianDragon/"
|
||||
[[ -f bin/dragonxd ]] && cp bin/dragonxd "$APPDIR/usr/bin/"
|
||||
[[ -f bin/dragonx-cli ]] && cp bin/dragonx-cli "$APPDIR/usr/bin/"
|
||||
[[ -f bin/asmap.dat ]] && cp bin/asmap.dat "$APPDIR/usr/share/ObsidianDragon/"
|
||||
[[ -f bin/sapling-spend.params ]] && cp bin/sapling-spend.params "$APPDIR/usr/share/ObsidianDragon/"
|
||||
[[ -f bin/sapling-output.params ]] && cp bin/sapling-output.params "$APPDIR/usr/share/ObsidianDragon/"
|
||||
|
||||
# Desktop entry
|
||||
cat > "$APPDIR/usr/share/applications/ObsidianDragon.desktop" <<'DESK'
|
||||
@@ -348,32 +370,11 @@ APPRUN
|
||||
|
||||
local ARCH
|
||||
ARCH=$(uname -m)
|
||||
local IMG_NAME="ObsidianDragon-${ARCH}.AppImage"
|
||||
cd "$bd"
|
||||
ARCH="$ARCH" "$APPIMAGETOOL" "$APPDIR" "$IMG_NAME" 2>/dev/null && {
|
||||
cp "$IMG_NAME" "$out/"
|
||||
# Rename to match Windows convention: ObsidianDragon.AppImage
|
||||
mv "$out/$IMG_NAME" "$out/ObsidianDragon.AppImage"
|
||||
ARCH="$ARCH" "$APPIMAGETOOL" "$APPDIR" "ObsidianDragon-${ARCH}.AppImage" 2>/dev/null && {
|
||||
cp "ObsidianDragon-${ARCH}.AppImage" "$out/ObsidianDragon.AppImage"
|
||||
info "AppImage: $out/ObsidianDragon.AppImage ($(du -h "$out/ObsidianDragon.AppImage" | cut -f1))"
|
||||
} || warn "AppImage creation failed (appimagetool issue) — raw binary still in release/linux/"
|
||||
|
||||
# Clean up: keep only AppImage + zip in release/linux/
|
||||
if [[ -f "$out/ObsidianDragon.AppImage" ]]; then
|
||||
# AppImage succeeded — remove everything except AppImage
|
||||
find "$out" -maxdepth 1 -type f ! -name 'ObsidianDragon.AppImage' -delete
|
||||
rm -rf "$out/res" 2>/dev/null
|
||||
|
||||
# Create zip matching Windows naming convention
|
||||
local DIST="ObsidianDragon-Linux-x64"
|
||||
local dist_dir="$out/$DIST"
|
||||
mkdir -p "$dist_dir"
|
||||
cp "$out/ObsidianDragon.AppImage" "$dist_dir/"
|
||||
if command -v zip &>/dev/null; then
|
||||
(cd "$out" && zip -r "$DIST.zip" "$DIST")
|
||||
info "Zip: $out/$DIST.zip ($(du -h "$out/$DIST.zip" | cut -f1))"
|
||||
fi
|
||||
rm -rf "$dist_dir"
|
||||
fi
|
||||
} || warn "AppImage creation failed — binaries zip still in release/linux/"
|
||||
|
||||
info "Linux release artifacts: $out/"
|
||||
ls -lh "$out/"
|
||||
@@ -601,31 +602,18 @@ HDR
|
||||
[[ -f "$DD/$f" ]] && cp "$DD/$f" "$dist_dir/"
|
||||
done
|
||||
|
||||
cat > "$dist_dir/README.txt" <<'README'
|
||||
DragonX Wallet - Windows Edition
|
||||
================================
|
||||
cp -r bin/res "$dist_dir/" 2>/dev/null || true
|
||||
|
||||
SINGLE-FILE DISTRIBUTION
|
||||
========================
|
||||
This wallet is a true single-file executable with all resources embedded.
|
||||
Just run ObsidianDragon.exe — no additional files needed!
|
||||
|
||||
On first run, the wallet will automatically extract:
|
||||
- Sapling parameters to %APPDATA%\ZcashParams\
|
||||
- asmap.dat to %APPDATA%\Hush\DRAGONX\
|
||||
|
||||
For support: https://git.dragonx.is/dragonx/ObsidianDragon
|
||||
README
|
||||
|
||||
# Copy single-file exe to release dir
|
||||
# ── Single-file exe (all resources embedded) ────────────────────────────
|
||||
cp bin/ObsidianDragon.exe "$out/"
|
||||
info "Single-file exe: $out/ObsidianDragon.exe ($(du -h "$out/ObsidianDragon.exe" | cut -f1))"
|
||||
|
||||
# ── Zip ──────────────────────────────────────────────────────────────────
|
||||
if command -v zip &>/dev/null; then
|
||||
(cd "$out" && zip -r "$DIST.zip" "$DIST")
|
||||
info "Zip: $out/$DIST.zip ($(du -h "$out/$DIST.zip" | cut -f1))"
|
||||
# Clean up: keep .zip + single-file exe, remove loose directory
|
||||
rm -rf "$dist_dir"
|
||||
fi
|
||||
rm -rf "$dist_dir"
|
||||
|
||||
info "Windows release artifacts: $out/"
|
||||
ls -lh "$out/"
|
||||
|
||||
Reference in New Issue
Block a user