diff --git a/README.md b/README.md index 09df59e..f7deafc 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,10 @@ Compiling can take some time, so be patient and wait for it to finish. It will t git clone https://git.hush.is/hush/SilentDragonLite cd SilentDragonLite ./build.sh linguist +# This defaults to using 2 cores to compile ./build.sh +# To use a custom number of cores to compile, such as 8 : +# ./build.sh -j8 ./SilentDragonLite ``` diff --git a/build.sh b/build.sh index 4624f74..c648fed 100755 --- a/build.sh +++ b/build.sh @@ -1,19 +1,9 @@ -#!/bin/bash +#!/usr/bin/env bash # Copyright 2019-2024 The Hush Developers # Released under the GPLv3 UNAME=$(uname) -if [ "$UNAME" == "Linux" ] ; then - JOBS=2 -elif [ "$UNAME" == "FreeBSD" ] ; then - JOBS=$(nproc) -elif [ "$UNAME" == "Darwin" ] ; then - JOBS=$(sysctl -n hw.ncpu) -else - JOBS=1 -fi - # check if rustc and cargo are installed, otherwise exit with error if ! command -v rustc &> /dev/null then @@ -39,8 +29,8 @@ then exit 1 fi -VERSION=$(cat src/version.h |cut -d\" -f2) -echo "Compiling SilentDragonLite $VERSION with $JOBS threads..." +VERSION=$(grep APP_VERSION src/version.h |cut -d\" -f2) +echo "Compiling SilentDragonLite $VERSION on $UNAME with args=$@" CONF=silentdragon-lite.pro set -e @@ -48,7 +38,8 @@ qbuild () { qmake $CONF CONFIG+=debug #lupdate $CONF #lrelease $CONF - make -j$JOBS + # default to 2 jobs or use the -j value given as argument to this script + make -j2 "$@" } if [ "$1" == "clean" ]; then @@ -58,7 +49,7 @@ elif [ "$1" == "linguist" ]; then lrelease $CONF elif [ "$1" == "cleanbuild" ]; then make clean - qbuild + qbuild "$@" else - qbuild + qbuild "$@" fi diff --git a/lib/src/lib.rs b/lib/src/lib.rs index f3c4013..d78c23d 100644 --- a/lib/src/lib.rs +++ b/lib/src/lib.rs @@ -44,13 +44,15 @@ pub extern fn blake3_PW(pw: *const c_char) -> *mut c_char{ }; let data = passwd.as_bytes(); -// Hash an input all at once. -let hash1 = blake3::hash(data).to_hex(); -println!("\nBlake3 Hash: {}", hash1); - -//let sttring = CString::new(hash1).unwrap(); -let e_str = CString::new(format!("{}", hash1)).unwrap(); -return e_str.into_raw(); + // Hash an input all at once. + let hash1 = blake3::hash(data).to_hex(); + // This is sensitive metadata, do not log it to stdout + //println!("\nBlake3 Hash: {}", hash1); + println!("\nBlake3 Hash calculated"); + + //let sttring = CString::new(hash1).unwrap(); + let e_str = CString::new(format!("{}", hash1)).unwrap(); + return e_str.into_raw(); } /// Create a new wallet and return the seed for the newly created wallet. diff --git a/res/libsodium/buildlibsodium.sh b/res/libsodium/buildlibsodium.sh index 12d4412..fe734fa 100755 --- a/res/libsodium/buildlibsodium.sh +++ b/res/libsodium/buildlibsodium.sh @@ -47,9 +47,9 @@ make clean echo "Compiling libsodium $VERSION" if [[ "$OSTYPE" == "darwin"* ]]; then - make CFLAGS="-mmacosx-version-min=10.11" CPPFLAGS="-mmacosx-version-min=10.11" -j4 + make CFLAGS="-mmacosx-version-min=10.11" CPPFLAGS="-mmacosx-version-min=10.11" -j8 # "$@" else - make -j8 + make -j8 # "$@" fi cd .. diff --git a/silentdragon-lite.pro b/silentdragon-lite.pro index 4b987dd..49223eb 100644 --- a/silentdragon-lite.pro +++ b/silentdragon-lite.pro @@ -184,7 +184,7 @@ else: unix:!android: target.path = /opt/$${TARGET}/bin libsodium.target = $$PWD/res/libsodium.a -libsodium.commands = res/libsodium/buildlibsodium.sh +libsodium.commands = res/libsodium/buildlibsodium.sh "$@" unix: librust.target = $$PWD/lib/target/release/libsilentdragonlite.a else:win32: librust.target = $$PWD/lib/target/x86_64-pc-windows-gnu/release/silentdragonlite.lib diff --git a/src/version.h b/src/version.h index 09253a4..67c2064 100644 --- a/src/version.h +++ b/src/version.h @@ -1,3 +1 @@ -// Copyright 2019-2024 The Hush developers -// Released under the GPLv3 -#define APP_VERSION "2.0.0" +#define APP_VERSION "2.0.1"