Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate Wownero scripts #33

Draft
wants to merge 14 commits into
base: main
Choose a base branch
from
Draft
5 changes: 4 additions & 1 deletion scripts/android/build_all.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
#!/bin/sh

./install_ndk.sh
./build_monero_all.sh
./build_shared.sh
./build_monero.sh
./build_wownero.sh
./build_wownero_seed.sh
./create_git_versions_file.sh
./copy_monero_deps.sh
./copy_wownero_deps.sh

Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@
./build_sodium.sh &
./build_zmq.sh &
wait
./build_monero.sh
19 changes: 3 additions & 16 deletions scripts/android/copy_monero_deps.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,8 @@
#!/bin/bash

echo ''$(git log -1 --pretty=format:"%H")' '$(date) >> build/git_commit_version.txt
VERSIONS_FILE=../../lib/git_versions.dart
EXAMPLE_VERSIONS_FILE=../../lib/git_versions_example.dart
if [ ! -f "$VERSIONS_FILE" ]; then
cp $EXAMPLE_VERSIONS_FILE $VERSIONS_FILE
fi
COMMIT=$(git log -1 --pretty=format:"%H")
OS="ANDROID"
sed -i "/\/\*${OS}_VERSION/c\\/\*${OS}_VERSION\*\/ const ${OS}_VERSION = \"$COMMIT\";" $VERSIONS_FILE
WORKDIR="$(pwd)/"build
CW_DIR="$(pwd)"/../../../flutter_libmonero
CW_EXRTERNAL_DIR=${CW_DIR}/cw_shared_external/ios/External/android
CW_WOWNERO_EXTERNAL_DIR=${CW_DIR}/cw_wownero/ios/External/android
CW_MONERO_EXTERNAL_DIR=${CW_DIR}/cw_monero/ios/External/android
for arch in "aarch" "aarch64" "i686" "x86_64"
do
Expand All @@ -33,23 +23,20 @@ esac

LIB_DIR=${CW_EXRTERNAL_DIR}/${ABI}/lib
INCLUDE_DIR=${CW_EXRTERNAL_DIR}/${ABI}/include
LIBANBOUND_PATH=${PREFIX}/lib/libunbound.a
LIBUNBOUND_PATH=${PREFIX}/lib/libunbound.a

mkdir -p $LIB_DIR
mkdir -p $INCLUDE_DIR

cp -r ${PREFIX}/lib/* $LIB_DIR
cp -r ${PREFIX}/include/* $INCLUDE_DIR

if [ -f "$LIBANBOUND_PATH" ]; then
cp $LIBANBOUND_PATH ${LIB_DIR}/monero
if [ -f "$LIBUNBOUND_PATH" ]; then
cp $LIBUNBOUND_PATH ${LIB_DIR}/monero
fi

done

mkdir -p ${CW_MONERO_EXTERNAL_DIR}/include
mkdir -p ${CW_WOWNERO_EXTERNAL_DIR}/include

cp $CW_EXRTERNAL_DIR/x86/include/monero/wallet2_api.h ${CW_MONERO_EXTERNAL_DIR}/include
cp $CW_EXRTERNAL_DIR/x86/include/wownero/wallet2_api.h ${CW_WOWNERO_EXTERNAL_DIR}/include
cp -R $CW_EXRTERNAL_DIR/x86/include/wownero_seed ${CW_WOWNERO_EXTERNAL_DIR}/include
11 changes: 11 additions & 0 deletions scripts/android/copy_wownero_deps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

WORKDIR="$(pwd)/"build
CW_DIR="$(pwd)"/../../../flutter_libmonero
CW_EXTERNAL_DIR=${CW_DIR}/cw_shared_external/ios/External/android
CW_WOWNERO_EXTERNAL_DIR=${CW_DIR}/cw_wownero/ios/External/android

mkdir -p ${CW_WOWNERO_EXTERNAL_DIR}/include

cp $CW_EXTERNAL_DIR/x86/include/wownero/wallet2_api.h ${CW_WOWNERO_EXTERNAL_DIR}/include
cp -R $CW_EXTERNAL_DIR/x86/include/wownero_seed ${CW_WOWNERO_EXTERNAL_DIR}/include
11 changes: 11 additions & 0 deletions scripts/android/create_git_versions_file.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

echo ''$(git log -1 --pretty=format:"%H")' '$(date) >> build/git_commit_version.txt
VERSIONS_FILE=../../lib/git_versions.dart
EXAMPLE_VERSIONS_FILE=../../lib/git_versions_example.dart
if [ ! -f "$VERSIONS_FILE" ]; then
cp $EXAMPLE_VERSIONS_FILE $VERSIONS_FILE
fi
COMMIT=$(git log -1 --pretty=format:"%H")
OS="ANDROID"
sed -i "/\/\*${OS}_VERSION/c\\/\*${OS}_VERSION\*\/ const ${OS}_VERSION = \"$COMMIT\";" $VERSIONS_FILE
3 changes: 2 additions & 1 deletion scripts/ios/build_all.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/bin/sh

./install_missing_headers.sh
./build_shared.sh
./build_monero_all.sh
./build_wownero_all.sh
./create_git_versions_file.sh
./setup.sh

6 changes: 0 additions & 6 deletions scripts/ios/build_monero_all.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
#!/bin/sh

. ./config.sh
./install_missing_headers.sh
./build_openssl.sh
./build_boost.sh
./build_sodium.sh
./build_unbound.sh
./build_zmq.sh
./build_monero.sh
8 changes: 8 additions & 0 deletions scripts/ios/build_shared.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh

./install_missing_headers.sh
./build_openssl.sh
./build_boost.sh
./build_sodium.sh
./build_unbound.sh
./build_zmq.sh
6 changes: 0 additions & 6 deletions scripts/ios/build_wownero_all.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
#!/bin/sh

. ./config.sh
# already done with build_monero_all.sh
#./install_missing_headers.sh
#./build_openssl.sh
#./build_boost.sh
#./build_sodium.sh
#./build_zmq.sh
./build_wownero.sh
./build_wownero_seed.sh
11 changes: 11 additions & 0 deletions scripts/ios/create_git_versions_file.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh

echo ''$(git log -1 --pretty=format:"%H")' '$(date) >> build/git_commit_version.txt
VERSIONS_FILE=../../lib/git_versions.dart
EXAMPLE_VERSIONS_FILE=../../lib/git_versions_example.dart
if [ ! -f "$VERSIONS_FILE" ]; then
cp $EXAMPLE_VERSIONS_FILE $VERSIONS_FILE
fi
COMMIT=$(git log -1 --pretty=format:"%H")
OS="IOS"
sed -i '' "/\/\*${OS}_VERSION/c\\/\*${OS}_VERSION\*\/ const ${OS}_VERSION = \"$COMMIT\";" $VERSIONS_FILE
55 changes: 6 additions & 49 deletions scripts/ios/setup.sh
Original file line number Diff line number Diff line change
@@ -1,52 +1,9 @@
#!/bin/sh

. ./config.sh
echo ''$(git log -1 --pretty=format:"%H")' '$(date) >> build/git_commit_version.txt
VERSIONS_FILE=../../lib/git_versions.dart
EXAMPLE_VERSIONS_FILE=../../lib/git_versions_example.dart
if [ ! -f "$VERSIONS_FILE" ]; then
cp $EXAMPLE_VERSIONS_FILE $VERSIONS_FILE
fi
COMMIT=$(git log -1 --pretty=format:"%H")
OS="IOS"
sed -i '' "/\/\*${OS}_VERSION/c\\/\*${OS}_VERSION\*\/ const ${OS}_VERSION = \"$COMMIT\";" $VERSIONS_FILE
cd $EXTERNAL_IOS_LIB_DIR

LIBRANDOMX_PATH=${EXTERNAL_IOS_LIB_DIR}/monero/librandomx.a

if [ -f "$LIBRANDOMX_PATH" ]; then
cp $LIBRANDOMX_PATH ./wownero
fi

libtool -static -o libboost.a ./libboost_*.a
libtool -static -o libwownero.a ./wownero/*.a
libtool -static -o libmonero.a ./monero/*.a


CW_WOWNERO_EXTERNAL_LIB=../../../../../cw_wownero/ios/External/ios/lib
CW_WOWNERO_EXTERNAL_INCLUDE=../../../../../cw_wownero/ios/External/ios/include
CW_MONERO_EXTERNAL_LIB=../../../../../cw_monero/ios/External/ios/lib
CW_MONERO_EXTERNAL_INCLUDE=../../../../../cw_monero/ios/External/ios/include

mkdir -p $CW_MONERO_EXTERNAL_INCLUDE
mkdir -p $CW_WOWNERO_EXTERNAL_INCLUDE
mkdir -p $CW_WOWNERO_EXTERNAL_LIB
mkdir -p $CW_MONERO_EXTERNAL_LIB



ln ./libboost.a ${CW_WOWNERO_EXTERNAL_LIB}/libboost.a
ln ./libcrypto.a ${CW_WOWNERO_EXTERNAL_LIB}/libcrypto.a
ln ./libssl.a ${CW_WOWNERO_EXTERNAL_LIB}/libssl.a
ln ./libsodium.a ${CW_WOWNERO_EXTERNAL_LIB}/libsodium.a
cp ./libwownero.a $CW_WOWNERO_EXTERNAL_LIB
cp ../include/wownero/* $CW_WOWNERO_EXTERNAL_INCLUDE
cp -r ../include/wownero_seed $CW_WOWNERO_EXTERNAL_INCLUDE

ln ./libboost.a ${CW_MONERO_EXTERNAL_LIB}/libboost.a
ln ./libcrypto.a ${CW_MONERO_EXTERNAL_LIB}/libcrypto.a
ln ./libssl.a ${CW_MONERO_EXTERNAL_LIB}/libssl.a
ln ./libsodium.a ${CW_MONERO_EXTERNAL_LIB}/libsodium.a
ln ./libunbound.a ${CW_MONERO_EXTERNAL_LIB}/libunbound.a
cp ./libmonero.a $CW_MONERO_EXTERNAL_LIB
cp ../include/monero/* $CW_MONERO_EXTERNAL_INCLUDE
cd IOS_SCRIPTS_DIR
./create_git_versions_file.sh
cd IOS_SCRIPTS_DIR
./setup_monero.sh
cd IOS_SCRIPTS_DIR
./setup_wownero.sh
26 changes: 26 additions & 0 deletions scripts/ios/setup_monero.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/sh

cd $EXTERNAL_IOS_LIB_DIR

LIBRANDOMX_PATH=${EXTERNAL_IOS_LIB_DIR}/monero/librandomx.a

if [ -f "$LIBRANDOMX_PATH" ]; then
cp $LIBRANDOMX_PATH ./wownero
fi

libtool -static -o libboost.a ./libboost_*.a
libtool -static -o libmonero.a ./monero/*.a

CW_MONERO_EXTERNAL_LIB=../../../../../cw_monero/ios/External/ios/lib
CW_MONERO_EXTERNAL_INCLUDE=../../../../../cw_monero/ios/External/ios/include

mkdir -p $CW_MONERO_EXTERNAL_INCLUDE
mkdir -p $CW_MONERO_EXTERNAL_LIB

ln ./libboost.a ${CW_MONERO_EXTERNAL_LIB}/libboost.a
ln ./libcrypto.a ${CW_MONERO_EXTERNAL_LIB}/libcrypto.a
ln ./libssl.a ${CW_MONERO_EXTERNAL_LIB}/libssl.a
ln ./libsodium.a ${CW_MONERO_EXTERNAL_LIB}/libsodium.a
ln ./libunbound.a ${CW_MONERO_EXTERNAL_LIB}/libunbound.a
cp ./libmonero.a $CW_MONERO_EXTERNAL_LIB
cp ../include/monero/* $CW_MONERO_EXTERNAL_INCLUDE
26 changes: 26 additions & 0 deletions scripts/ios/setup_wownero.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/sh

cd $EXTERNAL_IOS_LIB_DIR

LIBRANDOMX_PATH=${EXTERNAL_IOS_LIB_DIR}/monero/librandomx.a

if [ -f "$LIBRANDOMX_PATH" ]; then
cp $LIBRANDOMX_PATH ./wownero
fi

libtool -static -o libboost.a ./libboost_*.a
libtool -static -o libwownero.a ./wownero/*.a

CW_WOWNERO_EXTERNAL_LIB=../../../../../cw_wownero/ios/External/ios/lib
CW_WOWNERO_EXTERNAL_INCLUDE=../../../../../cw_wownero/ios/External/ios/include

mkdir -p $CW_WOWNERO_EXTERNAL_INCLUDE
mkdir -p $CW_WOWNERO_EXTERNAL_LIB

ln ./libboost.a ${CW_WOWNERO_EXTERNAL_LIB}/libboost.a
ln ./libcrypto.a ${CW_WOWNERO_EXTERNAL_LIB}/libcrypto.a
ln ./libssl.a ${CW_WOWNERO_EXTERNAL_LIB}/libssl.a
ln ./libsodium.a ${CW_WOWNERO_EXTERNAL_LIB}/libsodium.a
cp ./libwownero.a $CW_WOWNERO_EXTERNAL_LIB
cp ../include/wownero/* $CW_WOWNERO_EXTERNAL_INCLUDE
cp -r ../include/wownero_seed $CW_WOWNERO_EXTERNAL_INCLUDE
9 changes: 9 additions & 0 deletions scripts/linux/build_all.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

mkdir -p build
./build_shared.sh
./build_monero_all.sh
./build_wownero_all.sh
./create_git_versions_file.sh
./build_monerolib.sh
./build_wownerolib.sh
10 changes: 0 additions & 10 deletions scripts/linux/build_monero_all.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
#!/bin/bash

mkdir build
./build_iconv.sh
./build_boost.sh
./build_openssl.sh
./build_sodium.sh
./build_unbound.sh
./build_zmq.sh
./build_monero.sh
./build_wownero.sh
./build_wownero_seed.sh
./copy_monero_deps.sh
./build_sharedfile.sh
12 changes: 12 additions & 0 deletions scripts/linux/build_monerolib.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh

. ./config.sh

cd build
mkdir monero_build
MONERO_BUILD=$(pwd)/monero_build

cd $MONERO_BUILD
cmake ../../cmakefiles/monero/${TYPES_OF_BUILD}
make -j$(nproc)
cp libcw_monero.so ../
8 changes: 8 additions & 0 deletions scripts/linux/build_shared.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

./build_iconv.sh
./build_boost.sh
./build_openssl.sh
./build_sodium.sh
./build_unbound.sh
./build_zmq.sh
5 changes: 5 additions & 0 deletions scripts/linux/build_wownero_all.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

./build_wownero.sh
./build_wownero_seed.sh
./copy_wownero_deps.sh
13 changes: 13 additions & 0 deletions scripts/linux/build_wownerolib.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh

. ./config.sh

cd build
mkdir wownero_build
WOWNERO_BUILD=$(pwd)/wownero_build

cd $WOWNERO_BUILD
cmake ../../cmakefiles/wownero/${TYPES_OF_BUILD}
make -j$(nproc)
cp libcw_wownero.so ../

12 changes: 4 additions & 8 deletions scripts/linux/copy_monero_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@

WORKDIR="$(pwd)/"build
CW_DIR="$(pwd)"/../../../flutter_libmonero
CW_EXRTERNAL_DIR=${CW_DIR}/cw_shared_external/ios/External/android
CW_EXTERNAL_DIR=${CW_DIR}/cw_shared_external/ios/External/android
CW_MONERO_EXTERNAL_DIR=${CW_DIR}/cw_monero/ios/External/android
CW_WOWNERO_EXTERNAL_DIR=${CW_DIR}/cw_wownero/ios/External/android
if [ -z ${TYPES_OF_BUILD+x} ]; then TYPES_OF_BUILD=x86_64; fi

for arch in $TYPES_OF_BUILD
Expand All @@ -24,8 +23,8 @@ case $arch in
ABI="x86_64";;
esac

LIB_DIR=${CW_EXRTERNAL_DIR}/${ABI}/lib
INCLUDE_DIR=${CW_EXRTERNAL_DIR}/${ABI}/include
LIB_DIR=${CW_EXTERNAL_DIR}/${ABI}/lib
INCLUDE_DIR=${CW_EXTERNAL_DIR}/${ABI}/include

mkdir -p $LIB_DIR
mkdir -p $INCLUDE_DIR
Expand All @@ -35,10 +34,7 @@ cp -r ${PREFIX}/include/* $INCLUDE_DIR


mkdir -p ${CW_MONERO_EXTERNAL_DIR}/include
mkdir -p ${CW_WOWNERO_EXTERNAL_DIR}/include

cp $PREFIX/include/monero/wallet2_api.h ${CW_MONERO_EXTERNAL_DIR}/include
cp $PREFIX/include/wownero/wallet2_api.h ${CW_WOWNERO_EXTERNAL_DIR}/include
cp -R $PREFIX/include/wownero_seed ${CW_WOWNERO_EXTERNAL_DIR}/include

done
done
Loading