Modernize Qt dependency path
This commit is contained in:
@@ -6,10 +6,6 @@ JOBS="${JOBS:-1}"
|
||||
HOST="${HOST:-x86_64-pc-linux-gnu}"
|
||||
PREFIX="$ROOT/depends/$HOST"
|
||||
BASE_CONFIG="$PREFIX/share/config.site"
|
||||
CONFIG_SITE_FILE="${CONFIG_SITE_FILE:-/tmp/agrarian-linux-wallet-config.site}"
|
||||
QT_PKG_CONFIG_DIR="${QT_PKG_CONFIG_DIR:-/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/share/pkgconfig}"
|
||||
QT_BINDIR="${QT_BINDIR:-/usr/lib/qt5/bin}"
|
||||
PROTOC_BINDIR="${PROTOC_BINDIR:-/usr/bin}"
|
||||
|
||||
require_cmd() {
|
||||
if ! command -v "$1" >/dev/null 2>&1; then
|
||||
@@ -31,36 +27,24 @@ require_cmd make
|
||||
require_cmd pkg-config
|
||||
require_cmd gcc
|
||||
require_cmd g++
|
||||
require_cmd sed
|
||||
require_cmd cp
|
||||
require_cmd "$PROTOC_BINDIR/protoc"
|
||||
require_path "$QT_BINDIR/moc"
|
||||
require_path "$QT_BINDIR/uic"
|
||||
require_path "$QT_BINDIR/rcc"
|
||||
require_path "$QT_BINDIR/lrelease"
|
||||
require_path "$QT_BINDIR/lupdate"
|
||||
require_cmd cmake
|
||||
require_cmd ninja
|
||||
|
||||
echo "Building native depends for $HOST..."
|
||||
make -C depends -j"$JOBS"
|
||||
make -C depends HOST="$HOST" NO_QT=0 -j"$JOBS"
|
||||
require_path "$BASE_CONFIG"
|
||||
|
||||
cp "$BASE_CONFIG" "$CONFIG_SITE_FILE"
|
||||
sed -i.old \
|
||||
-e "s#^with_qt_bindir=.*#with_qt_bindir='$QT_BINDIR'#" \
|
||||
-e "s#^with_protoc_bindir=.*#with_protoc_bindir='$PROTOC_BINDIR'#" \
|
||||
-e "s#^PKG_CONFIG_LIBDIR=.*#PKG_CONFIG_LIBDIR='$PREFIX/lib/pkgconfig:$PREFIX/share/pkgconfig:$QT_PKG_CONFIG_DIR'#" \
|
||||
"$CONFIG_SITE_FILE"
|
||||
|
||||
if [[ ! -f configure ]]; then
|
||||
./autogen.sh
|
||||
fi
|
||||
|
||||
echo "Configuring Ubuntu Qt wallet build..."
|
||||
CONFIG_SITE="$CONFIG_SITE_FILE" ./configure \
|
||||
echo "Configuring Ubuntu Qt6 wallet build..."
|
||||
CONFIG_SITE="$BASE_CONFIG" ./configure \
|
||||
--disable-maintainer-mode \
|
||||
--disable-tests \
|
||||
--disable-bench \
|
||||
--with-gui=qt5
|
||||
--with-gui=qt6 \
|
||||
--with-qtdbus=no
|
||||
|
||||
echo "Building Ubuntu Qt wallet with JOBS=$JOBS..."
|
||||
make -j"$JOBS"
|
||||
|
||||
@@ -54,17 +54,18 @@ EOF
|
||||
-rpcbind=127.0.0.1 -rpcport="$RPCPORT" -port="$PORT" -keypool=1 -daemon
|
||||
|
||||
for _ in $(seq 1 "$WAIT_SECONDS"); do
|
||||
if rpc getinfo >/dev/null 2>&1; then
|
||||
if rpc getwalletinfo >/dev/null 2>&1; then
|
||||
break
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
|
||||
if ! rpc getinfo >/dev/null; then
|
||||
echo "Timed out waiting for RPC on 127.0.0.1:$RPCPORT" >&2
|
||||
if ! rpc getwalletinfo >/dev/null; then
|
||||
echo "Timed out waiting for wallet RPC on 127.0.0.1:$RPCPORT" >&2
|
||||
tail -n 80 "$DATADIR/regtest/debug.log" >&2 || true
|
||||
exit 1
|
||||
fi
|
||||
rpc getinfo >/dev/null
|
||||
rpc getwalletinfo >/dev/null
|
||||
rpc getmininginfo >/dev/null
|
||||
rpc getstakingstatus >/dev/null
|
||||
|
||||
Executable
+48
@@ -0,0 +1,48 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
DATADIR="${DATADIR:-$(mktemp -d /tmp/agrarian-qt-smoke.XXXXXX)}"
|
||||
LOGFILE="${LOGFILE:-/tmp/agrarian-qt-smoke.log}"
|
||||
WAIT_SECONDS="${WAIT_SECONDS:-25}"
|
||||
AGRARIAN_QT="${AGRARIAN_QT:-$ROOT/src/qt/agrarian-qt}"
|
||||
|
||||
require_path() {
|
||||
if [[ ! -x "$1" ]]; then
|
||||
echo "Missing executable: $1" >&2
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
require_path "$AGRARIAN_QT"
|
||||
mkdir -p "$DATADIR"
|
||||
rm -f "$LOGFILE"
|
||||
|
||||
set +e
|
||||
timeout --kill-after=5s "${WAIT_SECONDS}s" xvfb-run -a "$AGRARIAN_QT" \
|
||||
-regtest -datadir="$DATADIR" -choosedatadir=0 -debug=qt -debug=rpc \
|
||||
-printtoconsole -server=0 -listen=0 -dnsseed=0 -connect=0 >"$LOGFILE" 2>&1
|
||||
exit_code=$?
|
||||
set -e
|
||||
|
||||
if [[ "$exit_code" -ne 124 ]]; then
|
||||
echo "Expected Qt wallet to keep running until timeout, got exit code $exit_code" >&2
|
||||
tail -n 80 "$LOGFILE" >&2 || true
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! grep -q "init message: Done loading" "$LOGFILE"; then
|
||||
echo "Qt wallet did not reach Done loading" >&2
|
||||
tail -n 120 "$LOGFILE" >&2 || true
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if grep -E "No functional TLS|No such signal|Unknown property" "$LOGFILE" >/dev/null; then
|
||||
echo "Qt wallet logged a Qt6 runtime compatibility warning" >&2
|
||||
grep -E "No functional TLS|No such signal|Unknown property" "$LOGFILE" >&2 || true
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Agrarian Qt smoke test passed"
|
||||
echo " datadir: $DATADIR"
|
||||
echo " log: $LOGFILE"
|
||||
Executable
+102
@@ -0,0 +1,102 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
DATADIR="${DATADIR:-$(mktemp -d /tmp/agrarian-wallet-smoke.XXXXXX)}"
|
||||
RPCPORT="${RPCPORT:-36435}"
|
||||
PORT="${PORT:-36436}"
|
||||
WAIT_SECONDS="${WAIT_SECONDS:-90}"
|
||||
AGRARIAND="${AGRARIAND:-$ROOT/src/agrariand}"
|
||||
AGRARIAN_CLI="${AGRARIAN_CLI:-$ROOT/src/agrarian-cli}"
|
||||
BACKUP="${BACKUP:-/tmp/agrarian-wallet-backup-smoke.dat}"
|
||||
|
||||
cleanup() {
|
||||
if [[ -x "$AGRARIAN_CLI" && -d "$DATADIR" ]]; then
|
||||
"$AGRARIAN_CLI" -datadir="$DATADIR" -regtest \
|
||||
-rpcuser=wallet -rpcpassword=wallet-pass -rpcport="$RPCPORT" stop >/dev/null 2>&1 || true
|
||||
fi
|
||||
}
|
||||
trap cleanup EXIT
|
||||
|
||||
require_path() {
|
||||
if [[ ! -x "$1" ]]; then
|
||||
echo "Missing executable: $1" >&2
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
rpc() {
|
||||
"$AGRARIAN_CLI" -datadir="$DATADIR" -regtest \
|
||||
-rpcuser=wallet -rpcpassword=wallet-pass -rpcconnect=127.0.0.1 \
|
||||
-rpcport="$RPCPORT" "$@"
|
||||
}
|
||||
|
||||
require_path "$AGRARIAND"
|
||||
require_path "$AGRARIAN_CLI"
|
||||
|
||||
mkdir -p "$DATADIR"
|
||||
cat > "$DATADIR/agrarian.conf" <<EOF
|
||||
regtest=1
|
||||
server=1
|
||||
rpcuser=wallet
|
||||
rpcpassword=wallet-pass
|
||||
rpcbind=127.0.0.1
|
||||
rpcallowip=127.0.0.1
|
||||
listen=0
|
||||
dnsseed=0
|
||||
upnp=0
|
||||
staking=0
|
||||
keypool=10
|
||||
EOF
|
||||
|
||||
"$AGRARIAND" -datadir="$DATADIR" -regtest -server -listen=0 -dnsseed=0 \
|
||||
-connect=0 -upnp=0 -staking=0 -rpcuser=wallet -rpcpassword=wallet-pass \
|
||||
-rpcbind=127.0.0.1 -rpcport="$RPCPORT" -port="$PORT" -keypool=10 -daemon
|
||||
|
||||
for _ in $(seq 1 "$WAIT_SECONDS"); do
|
||||
if rpc getinfo >/dev/null 2>&1; then
|
||||
break
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
|
||||
if ! rpc getinfo >/dev/null; then
|
||||
echo "Timed out waiting for RPC on 127.0.0.1:$RPCPORT" >&2
|
||||
tail -n 80 "$DATADIR/regtest/debug.log" >&2 || true
|
||||
exit 1
|
||||
fi
|
||||
|
||||
rpc getwalletinfo >/dev/null
|
||||
receive_address="$(rpc getnewaddress receive)"
|
||||
send_address="$(rpc getnewaddress sendtest)"
|
||||
rpc generate 101 >/dev/null
|
||||
mined_balance="$(rpc getbalance)"
|
||||
txid="$(rpc sendtoaddress "$send_address" 1.0)"
|
||||
rpc generate 1 >/dev/null
|
||||
rpc gettransaction "$txid" >/dev/null
|
||||
|
||||
rm -f "$BACKUP"
|
||||
rpc backupwallet "$BACKUP"
|
||||
test -s "$BACKUP"
|
||||
|
||||
set +e
|
||||
encrypt_output="$(rpc encryptwallet smoke-passphrase 2>&1)"
|
||||
encrypt_code=$?
|
||||
set -e
|
||||
if [[ "$encrypt_code" -ne 0 ]]; then
|
||||
echo "$encrypt_output" >&2
|
||||
exit "$encrypt_code"
|
||||
fi
|
||||
|
||||
sleep 2
|
||||
if rpc getinfo >/dev/null 2>&1; then
|
||||
echo "Expected encryptwallet to stop the daemon, but RPC is still available" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Agrarian wallet smoke test passed"
|
||||
echo " datadir: $DATADIR"
|
||||
echo " receive_address: $receive_address"
|
||||
echo " send_txid: $txid"
|
||||
echo " mined_balance_before_send: $mined_balance"
|
||||
echo " backup: $BACKUP"
|
||||
Reference in New Issue
Block a user