Add Docker-based Linux release build for Ubuntu 20.04 compatibility
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -170,6 +170,7 @@ src/cc/games/tetris
|
||||
*~
|
||||
*.zip
|
||||
release-win64/
|
||||
release-linux/
|
||||
src/RandomX/build-linux/
|
||||
src/RandomX/build-win64/
|
||||
src/wallet-utility.exe
|
||||
|
||||
17
Dockerfile.build
Normal file
17
Dockerfile.build
Normal file
@@ -0,0 +1,17 @@
|
||||
FROM ubuntu:20.04
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
RUN apt-get update && apt-get install -y \
|
||||
build-essential cmake pkg-config libtool autoconf automake \
|
||||
curl git m4 g++ gcc libcurl4-gnutls-dev zlib1g-dev \
|
||||
libsodium-dev unzip zip bsdmainutils \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
WORKDIR /hush3
|
||||
|
||||
# Build script - runs inside container
|
||||
COPY build-docker-release.sh /build-docker-release.sh
|
||||
RUN chmod +x /build-docker-release.sh
|
||||
|
||||
ENTRYPOINT ["/build-docker-release.sh"]
|
||||
43
build-docker-release.sh
Executable file
43
build-docker-release.sh
Executable file
@@ -0,0 +1,43 @@
|
||||
#!/usr/bin/env bash
|
||||
# Build inside Docker container for Ubuntu 20.04 compatibility
|
||||
set -eu -o pipefail
|
||||
|
||||
cd /hush3
|
||||
|
||||
# Clean previous build artifacts that may be from the host
|
||||
make clean 2>/dev/null || true
|
||||
|
||||
# Clean host-built depends (native binaries won't work in container)
|
||||
rm -rf depends/built depends/x86_64-unknown-linux-gnu depends/work
|
||||
make -C depends clean 2>/dev/null || true
|
||||
|
||||
# Build RandomX for Linux (clean, since host build is different arch/libc)
|
||||
cd src/RandomX
|
||||
rm -rf build-linux
|
||||
mkdir -p build-linux && cd build-linux
|
||||
cmake -DARCH=native ..
|
||||
make -j$(nproc)
|
||||
cd /hush3
|
||||
|
||||
# Run the normal build
|
||||
./util/build.sh --disable-tests -j$(nproc)
|
||||
|
||||
# Package release
|
||||
echo "Creating Linux release package..."
|
||||
VERSION=$(grep -oP 'define\(_CLIENT_VERSION.*?,\s*\K[0-9]+' configure.ac | head -4 | tr '\n' '.' | sed 's/\.$//')
|
||||
VERSION=${VERSION:-3.10.5}
|
||||
RELEASE_DIR="release-linux"
|
||||
mkdir -p "$RELEASE_DIR"
|
||||
|
||||
strip -s src/hushd src/hush-cli src/hush-tx
|
||||
cp src/hushd src/hush-cli src/hush-tx "$RELEASE_DIR/"
|
||||
cp asmap.dat sapling-spend.params sapling-output.params "$RELEASE_DIR/" 2>/dev/null || true
|
||||
cp src/hush-arrakis-chain src/dragonxd src/dragonx-cli "$RELEASE_DIR/"
|
||||
|
||||
rm -f "hush-${VERSION}-linux64.zip"
|
||||
cd "$RELEASE_DIR"
|
||||
zip -9 "../hush-${VERSION}-linux64.zip" *
|
||||
cd ..
|
||||
|
||||
echo "Release package created: hush-${VERSION}-linux64.zip"
|
||||
ls -lh "hush-${VERSION}-linux64.zip"
|
||||
10
build.sh
10
build.sh
@@ -41,6 +41,16 @@ if [[ "${1:-}" == "--win-release" ]]; then
|
||||
exit $?
|
||||
fi
|
||||
|
||||
# Check for --linux-release flag (builds inside Ubuntu 20.04 container for max compatibility)
|
||||
if [[ "${1:-}" == "--linux-release" ]]; then
|
||||
shift
|
||||
echo "Building Linux release inside Ubuntu 20.04 Docker container..."
|
||||
sudo docker build -t hush-builder -f Dockerfile.build .
|
||||
sudo docker run --rm -v "$SCRIPT_DIR:/hush3" hush-builder "$@"
|
||||
echo "Docker build complete. Release is in release-linux/"
|
||||
exit $?
|
||||
fi
|
||||
|
||||
# run correct build script for detected OS
|
||||
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
|
||||
check_and_clean_target "linux"
|
||||
|
||||
@@ -3,8 +3,8 @@ AC_PREREQ([2.60])
|
||||
define(_CLIENT_VERSION_MAJOR, 3)
|
||||
dnl Must be kept in sync with src/clientversion.h , ugh!
|
||||
define(_CLIENT_VERSION_MINOR, 10)
|
||||
define(_CLIENT_VERSION_REVISION, 4)
|
||||
define(_CLIENT_VERSION_BUILD, 50)
|
||||
define(_CLIENT_VERSION_REVISION, 5)
|
||||
define(_CLIENT_VERSION_BUILD, 0)
|
||||
define(_ZC_BUILD_VAL, m4_if(m4_eval(_CLIENT_VERSION_BUILD < 25), 1, m4_incr(_CLIENT_VERSION_BUILD), m4_eval(_CLIENT_VERSION_BUILD < 50), 1, m4_eval(_CLIENT_VERSION_BUILD - 24), m4_eval(_CLIENT_VERSION_BUILD == 50), 1, , m4_eval(_CLIENT_VERSION_BUILD - 50)))
|
||||
define(_CLIENT_VERSION_SUFFIX, m4_if(m4_eval(_CLIENT_VERSION_BUILD < 25), 1, _CLIENT_VERSION_REVISION-beta$1, m4_eval(_CLIENT_VERSION_BUILD < 50), 1, _CLIENT_VERSION_REVISION-rc$1, m4_eval(_CLIENT_VERSION_BUILD == 50), 1, _CLIENT_VERSION_REVISION, _CLIENT_VERSION_REVISION-$1)))
|
||||
define(_CLIENT_VERSION_IS_RELEASE, true)
|
||||
|
||||
Reference in New Issue
Block a user