diff --git a/scripts/android/build_all.sh b/scripts/android/build_all.sh index 0eb4ff4809..f060f3cee2 100755 --- a/scripts/android/build_all.sh +++ b/scripts/android/build_all.sh @@ -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 diff --git a/scripts/android/build_monero_all.sh b/scripts/android/build_shared.sh similarity index 88% rename from scripts/android/build_monero_all.sh rename to scripts/android/build_shared.sh index 2f1bb1b033..0363873145 100755 --- a/scripts/android/build_monero_all.sh +++ b/scripts/android/build_shared.sh @@ -5,4 +5,3 @@ ./build_sodium.sh & ./build_zmq.sh & wait -./build_monero.sh diff --git a/scripts/android/copy_monero_deps.sh b/scripts/android/copy_monero_deps.sh index 51d5036ec9..1a4ff15aeb 100755 --- a/scripts/android/copy_monero_deps.sh +++ b/scripts/android/copy_monero_deps.sh @@ -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 @@ -33,7 +23,7 @@ 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 @@ -41,15 +31,12 @@ 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 diff --git a/scripts/android/copy_wownero_deps.sh b/scripts/android/copy_wownero_deps.sh new file mode 100755 index 0000000000..d3d0d81305 --- /dev/null +++ b/scripts/android/copy_wownero_deps.sh @@ -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 diff --git a/scripts/android/create_git_versions_file.sh b/scripts/android/create_git_versions_file.sh new file mode 100755 index 0000000000..12204a4247 --- /dev/null +++ b/scripts/android/create_git_versions_file.sh @@ -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 diff --git a/scripts/ios/build_all.sh b/scripts/ios/build_all.sh index fbf0682e7f..114b23488b 100755 --- a/scripts/ios/build_all.sh +++ b/scripts/ios/build_all.sh @@ -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 diff --git a/scripts/ios/build_monero_all.sh b/scripts/ios/build_monero_all.sh index b18460a2b9..5c60d542b8 100755 --- a/scripts/ios/build_monero_all.sh +++ b/scripts/ios/build_monero_all.sh @@ -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 \ No newline at end of file diff --git a/scripts/ios/build_shared.sh b/scripts/ios/build_shared.sh new file mode 100755 index 0000000000..22bf171e96 --- /dev/null +++ b/scripts/ios/build_shared.sh @@ -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 \ No newline at end of file diff --git a/scripts/ios/build_wownero_all.sh b/scripts/ios/build_wownero_all.sh index f49026565f..d9a2265313 100755 --- a/scripts/ios/build_wownero_all.sh +++ b/scripts/ios/build_wownero_all.sh @@ -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 \ No newline at end of file diff --git a/scripts/ios/create_git_versions_file.sh b/scripts/ios/create_git_versions_file.sh new file mode 100755 index 0000000000..f99b27650b --- /dev/null +++ b/scripts/ios/create_git_versions_file.sh @@ -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 diff --git a/scripts/ios/setup.sh b/scripts/ios/setup.sh index 51ad0cf6fa..219e5a4ead 100755 --- a/scripts/ios/setup.sh +++ b/scripts/ios/setup.sh @@ -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 \ No newline at end of file +cd IOS_SCRIPTS_DIR +./create_git_versions_file.sh +cd IOS_SCRIPTS_DIR +./setup_monero.sh +cd IOS_SCRIPTS_DIR +./setup_wownero.sh \ No newline at end of file diff --git a/scripts/ios/setup_monero.sh b/scripts/ios/setup_monero.sh new file mode 100755 index 0000000000..f122c604f5 --- /dev/null +++ b/scripts/ios/setup_monero.sh @@ -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 \ No newline at end of file diff --git a/scripts/ios/setup_wownero.sh b/scripts/ios/setup_wownero.sh new file mode 100755 index 0000000000..94bf41ace5 --- /dev/null +++ b/scripts/ios/setup_wownero.sh @@ -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 diff --git a/scripts/linux/build_all.sh b/scripts/linux/build_all.sh new file mode 100755 index 0000000000..2cbb856ead --- /dev/null +++ b/scripts/linux/build_all.sh @@ -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 diff --git a/scripts/linux/build_monero_all.sh b/scripts/linux/build_monero_all.sh index 3f98077532..e4bdc017cb 100755 --- a/scripts/linux/build_monero_all.sh +++ b/scripts/linux/build_monero_all.sh @@ -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 \ No newline at end of file diff --git a/scripts/linux/build_monerolib.sh b/scripts/linux/build_monerolib.sh new file mode 100755 index 0000000000..374f3aa836 --- /dev/null +++ b/scripts/linux/build_monerolib.sh @@ -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 ../ diff --git a/scripts/linux/build_shared.sh b/scripts/linux/build_shared.sh new file mode 100755 index 0000000000..36c9b053a3 --- /dev/null +++ b/scripts/linux/build_shared.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +./build_iconv.sh +./build_boost.sh +./build_openssl.sh +./build_sodium.sh +./build_unbound.sh +./build_zmq.sh diff --git a/scripts/linux/build_wownero_all.sh b/scripts/linux/build_wownero_all.sh new file mode 100755 index 0000000000..9bc00db286 --- /dev/null +++ b/scripts/linux/build_wownero_all.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +./build_wownero.sh +./build_wownero_seed.sh +./copy_wownero_deps.sh diff --git a/scripts/linux/build_wownerolib.sh b/scripts/linux/build_wownerolib.sh new file mode 100755 index 0000000000..0080502860 --- /dev/null +++ b/scripts/linux/build_wownerolib.sh @@ -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 ../ + diff --git a/scripts/linux/copy_monero_deps.sh b/scripts/linux/copy_monero_deps.sh index 7871b7690a..4d1f439a78 100755 --- a/scripts/linux/copy_monero_deps.sh +++ b/scripts/linux/copy_monero_deps.sh @@ -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 @@ -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 @@ -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 \ No newline at end of file +done diff --git a/scripts/linux/copy_wownero_deps.sh b/scripts/linux/copy_wownero_deps.sh new file mode 100755 index 0000000000..21b3992527 --- /dev/null +++ b/scripts/linux/copy_wownero_deps.sh @@ -0,0 +1,41 @@ +#!/bin/bash + +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 +if [ -z ${TYPES_OF_BUILD+x} ]; then TYPES_OF_BUILD=x86_64; fi + +for arch in $TYPES_OF_BUILD +do + +PREFIX=${WORKDIR}/prefix_${arch} +ABI="" + +case $arch in + "aarch" ) + ABI="armeabi-v7a";; + "aarch64" ) + ABI="arm64-v8a";; + "i686" ) + ABI="x86";; + "x86_64" ) + ABI="x86_64";; +esac + +LIB_DIR=${CW_EXRTERNAL_DIR}/${ABI}/lib +INCLUDE_DIR=${CW_EXRTERNAL_DIR}/${ABI}/include + +mkdir -p $LIB_DIR +mkdir -p $INCLUDE_DIR + +cp -r ${PREFIX}/lib/* $LIB_DIR +cp -r ${PREFIX}/include/* $INCLUDE_DIR + + +mkdir -p ${CW_WOWNERO_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 diff --git a/scripts/linux/build_sharedfile.sh b/scripts/linux/create_git_versions_file.sh similarity index 57% rename from scripts/linux/build_sharedfile.sh rename to scripts/linux/create_git_versions_file.sh index 9eb2684b87..3249b80b51 100755 --- a/scripts/linux/build_sharedfile.sh +++ b/scripts/linux/create_git_versions_file.sh @@ -10,19 +10,3 @@ fi COMMIT=$(git log -1 --pretty=format:"%H") OS="LINUX" sed -i "/\/\*${OS}_VERSION/c\\/\*${OS}_VERSION\*\/ const ${OS}_VERSION = \"$COMMIT\";" $VERSIONS_FILE -cd build -mkdir monero_build -mkdir wownero_build -MONERO_BUILD=$(pwd)/monero_build -WOWNERO_BUILD=$(pwd)/wownero_build - -cd $MONERO_BUILD -cmake ../../cmakefiles/monero/${TYPES_OF_BUILD} -make -j$(nproc) -cp libcw_monero.so ../ - -cd $WOWNERO_BUILD -cmake ../../cmakefiles/wownero/${TYPES_OF_BUILD} -make -j$(nproc) -cp libcw_wownero.so ../ -