add source build option

This commit is contained in:
PromptPunksFauxCough 2025-02-23 07:30:54 +00:00 committed by GitHub
parent 48e1facb74
commit 0c79ef2f05
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,12 +1,12 @@
#!/bin/zsh #!/bin/bash
## ./haveno-on-qubes/scripts/1.1-haveno-templatevm_maker.sh ## ./haveno-on-qubes/scripts/1.1-haveno-templatevm_maker.sh
if [[ $# -ne 2 ]] ; then
printf "\nNo arguments provided!\n\nThis script requires two arguments to by provided:\nBinary URL & PGP Fingerprint\n\nPlease review documentation and try again.\n\nExiting now ...\n" function remote {
if [[ -z $PRECOMPILED_URL || -z $FINGERPRINT ]]; then
printf "\nNo arguments provided!\n\nThis script requires two arguments to be provided:\nBinary URL & PGP Fingerprint\n\nPlease review documentation and try again.\n\nExiting now ...\n"
exit 1 exit 1
fi fi
## Update & Upgrade ## Update & Upgrade
apt update && apt upgrade -y apt update && apt upgrade -y
@ -121,4 +121,75 @@ printf "%s \n" "Press [ENTER] to complete ..."
read ans read ans
exit exit
#poweroff #poweroff
}
function build {
if [[ -z $JAVA_URL || -z $JAVA_SHA1 || -z $SOURCE_URL ]]; then
printf "\nNo arguments provided!\n\nThis script requires three argument to be provided:\n\nURL for Java 21 JDK Debian Package\n\nSHA1 Hash for Java 21 JDK Debian Package\n\nURL for Remote Git Source Repository\n\nPlease review documentation and try again.\n\nExiting now ...\n"
exit 1
fi
# Dependancies
sudo apt install -y make git expect fakeroot
# Java
curl -fsSLo jdk21.deb ${JAVA_URL}
if [[ $(shasum ./jdk21.deb | awk '{ print $1 }') == ${JAVA_SHA1} ]] ; then printf $'SHA Hash IS valid!\n'; else printf $'WARNING: Bad Hash!\n' && exit; fi
sudo apt install -y ./jdk21.deb
# Build
git clone --depth=1 $SOURCE_URL
cd haveno
git checkout master
sed -i 's|XMR_STAGENET|XMR_MAINNET|g' desktop/package/package.gradle
./gradlew clean build --refresh-keys --refresh-dependencies
# Package
# Expect
cat <<DONE >> /tmp/haveno_package_deb.exp
set send_slow {1 .1}
proc send {ignore arg} {
sleep 1.1
exp_send -s -- \$arg
}
set timeout -1
spawn ./gradlew packageInstallers --console=plain
match_max 100000
expect -exact ""
send -- "y\r"
expect -exact ""
send -- "y\r"
expect -exact ""
send -- "y\r"
expect -exact "app-image"
send -- ""
expect eof
DONE
# Package
expect -f /tmp/haveno_package_deb.exp && find ./ -name '*.deb' -exec qvm-copy {} \;
}
if [[ $# -eq 2 ]] ; then
PRECOMPILED_URL=$1
FINGERPRINT=$2
fi
if [[ $# -eq 3 ]] ; then
JAVA_URL=$1
JAVA_SHA1=$2
SOURCE_URL=$3
fi
read -p $'Do you want to:\nInstall precompiled binary from remote git repository? (r)\n\n\t\tOR\n\nBuild source from remote git repository? (b)\n\n' rb
case $rb in
[rR] ) remote;;
[bB] ) build;;
* ) printf "\nInvalid Input.\n\nPlease Try again.\n";
# exit 1;;
esac
printf "\nCheers m8!\n"