Advertisement
Guest User

Untitled

a guest
Jan 19th, 2020
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.88 KB | None | 0 0
  1. ### INSTRUCTIONS FOR BUILDING EXTERNAL LIBS - FEEL FREE TO MAKE A SCRIPT OUT OF IT ###
  2. ### KEEP SUMOKOIN ANDROID BRANCH UPDATED WITH OUR LATEST MASTER FOR THE LIBS TO BE UPDATED ###
  3.  
  4. apt-get update && apt-get install -y unzip automake build-essential curl file pkg-config git python libtool
  5. mkdir /opt/android/
  6. cd /opt/android
  7.  
  8. curl -s -O https://cmake.org/files/v3.12/cmake-3.12.1.tar.gz
  9. tar -xzf cmake-3.12.1.tar.gz
  10. cd cmake-3.12.1
  11. ./configure
  12. make -j 4
  13. make install
  14.  
  15. cd /opt/android
  16. curl -s -O https://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip
  17. unzip android-ndk-r17b-linux-x86_64.zip
  18. rm -f android-ndk-r17b-linux-x86_64.zip
  19. ln -s android-ndk-r17b ndk
  20. ndk/build/tools/make_standalone_toolchain.py --api 21 --stl=libc++ --arch arm --install-dir /opt/android/tool/arm
  21. ndk/build/tools/make_standalone_toolchain.py --api 21 --stl=libc++ --arch arm64 --install-dir /opt/android/tool/arm64
  22. ndk/build/tools/make_standalone_toolchain.py --api 21 --stl=libc++ --arch x86 --install-dir /opt/android/tool/x86
  23. ndk/build/tools/make_standalone_toolchain.py --api 21 --stl=libc++ --arch x86_64 --install-dir /opt/android/tool/x86_64
  24.  
  25.  
  26. git clone https://github.com/m2049r/android-openssl.git --depth=1
  27. curl -L -s -O https://github.com/openssl/openssl/archive/OpenSSL_1_0_2l.tar.gz
  28. cd android-openssl
  29. tar xfz ../OpenSSL_1_0_2l.tar.gz
  30. rm -f ../OpenSSL_1_0_2l.tar.gz
  31. ANDROID_NDK_ROOT=/opt/android/ndk ./build-all-arch.sh
  32.  
  33. mkdir -p /opt/android/build/openssl/{arm,arm64,x86,x86_64}
  34. cp -a /opt/android/android-openssl/prebuilt/armeabi /opt/android/build/openssl/arm/lib
  35. cp -a /opt/android/android-openssl/prebuilt/arm64-v8a /opt/android/build/openssl/arm64/lib
  36. cp -a /opt/android/android-openssl/prebuilt/x86 /opt/android/build/openssl/x86/lib
  37. cp -a /opt/android/android-openssl/prebuilt/x86_64 /opt/android/build/openssl/x86_64/lib
  38. cp -aL /opt/android/android-openssl/openssl-OpenSSL_1_0_2l/include/openssl/ /opt/android/build/openssl/include
  39. ln -s /opt/android/build/openssl/include /opt/android/build/openssl/arm/include
  40. ln -s /opt/android/build/openssl/include /opt/android/build/openssl/arm64/include
  41. ln -s /opt/android/build/openssl/include /opt/android/build/openssl/x86/include
  42. ln -s /opt/android/build/openssl/include /opt/android/build/openssl/x86_64/include
  43. ln -sf /opt/android/build/openssl/include /opt/android/tool/arm/sysroot/usr/include/openssl
  44. ln -sf /opt/android/build/openssl/arm/lib/*.so /opt/android/tool/arm/sysroot/usr/lib
  45. ln -sf /opt/android/build/openssl/include /opt/android/tool/arm64/sysroot/usr/include/openssl
  46. ln -sf /opt/android/build/openssl/arm64/lib/*.so /opt/android/tool/arm64/sysroot/usr/lib
  47. ln -sf /opt/android/build/openssl/include /opt/android/tool/x86/sysroot/usr/include/openssl
  48. ln -sf /opt/android/build/openssl/x86/lib/*.so /opt/android/tool/x86/sysroot/usr/lib
  49. ln -sf /opt/android/build/openssl/include /opt/android/tool/x86_64/sysroot/usr/include/openssl
  50. ln -sf /opt/android/build/openssl/x86_64/lib/*.so /opt/android/tool/x86_64/sysroot/usr/lib64
  51.  
  52. cd /opt/android
  53. curl -s -L -o boost_1_67_0.tar.bz2 https://sourceforge.net/projects/boost/files/boost/1.67.0/boost_1_67_0.tar.bz2/download
  54. tar -xvf boost_1_67_0.tar.bz2
  55. rm -f /usr/boost_1_67_0.tar.bz2
  56. cd boost_1_67_0
  57. ./bootstrap.sh
  58. PATH=/opt/android/tool/arm/arm-linux-androideabi/bin:/opt/android/tool/arm/bin:$PATH ./b2 --build-type=minimal link=static runtime-link=static --with-chrono --with-date_time --with-filesystem --with-program_options --with-regex --with-serialization --with-system --with-thread --build-dir=android-arm --prefix=/opt/android/build/boost/arm --includedir=/opt/android/build/boost/include toolset=clang threading=multi threadapi=pthread target-os=android install
  59. PATH=/opt/android/tool/arm64/aarch64-linux-android/bin:/opt/android/tool/arm64/bin:$PATH ./b2 --build-type=minimal link=static runtime-link=static --with-chrono --with-date_time --with-filesystem --with-program_options --with-regex --with-serialization --with-system --with-thread --build-dir=android-arm64 --prefix=/opt/android/build/boost/arm64 --includedir=/opt/android/build/boost/include toolset=clang threading=multi threadapi=pthread target-os=android install
  60. PATH=/opt/android/tool/x86/i686-linux-android/bin:/opt/android/tool/x86/bin:$PATH ./b2 --build-type=minimal link=static runtime-link=static --with-chrono --with-date_time --with-filesystem --with-program_options --with-regex --with-serialization --with-system --with-thread --build-dir=android-x86 --prefix=/opt/android/build/boost/x86 --includedir=/opt/android/build/boost/include toolset=clang threading=multi threadapi=pthread target-os=android install
  61. PATH=/opt/android/tool/x86_64/x86_64-linux-android/bin:/opt/android/tool/x86_64/bin:$PATH ./b2 --build-type=minimal link=static runtime-link=static --with-chrono --with-date_time --with-filesystem --with-program_options --with-regex --with-serialization --with-system --with-thread --build-dir=android-x86_64 --prefix=/opt/android/build/boost/x86_64 --includedir=/opt/android/build/boost/include toolset=clang threading=multi threadapi=pthread target-os=android install
  62. ln -sf ../include /opt/android/build/boost/arm
  63. ln -sf ../include /opt/android/build/boost/arm64
  64. ln -sf ../include /opt/android/build/boost/x86
  65. ln -sf ../include /opt/android/build/boost/x86_64
  66.  
  67.  
  68. cd /opt/android
  69. git clone https://github.com/jedisct1/libsodium.git -b 1.0.17 --depth=1
  70. cd libsodium
  71. test `git rev-parse HEAD` = b732443c442239c2e0184820e9b23cca0de0828c || exit 1
  72. ./autogen.sh
  73. #### ignore the version info warnings ####
  74. PATH=/opt/android/tool/arm/arm-linux-androideabi/bin:/opt/android/tool/arm/bin:$PATH ; CC=clang CXX=clang++ CFLAGS="-fPIC" CXXFLAGS="-fPIC" ./configure --prefix=/opt/android/build/libsodium/arm --host=arm-linux-androideabi --enable-static --disable-shared && make && make install && make clean
  75. PATH=/opt/android/tool/arm64/aarch64-linux-android/bin:/opt/android/tool/arm64/bin:$PATH ; CC=clang CXX=clang++ CFLAGS="-fPIC" CXXFLAGS="-fPIC" ./configure --prefix=/opt/android/build/libsodium/arm64 --host=aarch64-linux-android --enable-static --disable-shared && make && make install && make clean
  76. PATH=/opt/android/tool/x86/i686-linux-android/bin:/opt/android/tool/x86/bin:$PATH ; CC=clang CXX=clang++ CFLAGS="-fPIC" CXXFLAGS="-fPIC" ./configure --prefix=/opt/android/build/libsodium/x86 --host=i686-linux-android --enable-static --disable-shared && make && make install && make clean
  77. PATH=/opt/android/tool/x86_64/x86_64-linux-android/bin:/opt/android/tool/x86_64/bin:$PATH ; CC=clang CXX=clang++ CFLAGS="-fPIC" CXXFLAGS="-fPIC" ./configure --prefix=/opt/android/build/libsodium/x86_64 --host=x86_64-linux-android --enable-static --disable-shared && make && make install && make clean
  78.  
  79. cd /opt/android
  80. git clone https://github.com/zeromq/libzmq.git -b v4.3.1 --depth=1
  81. cd libzmq
  82. test `git rev-parse HEAD` = 2cb1240db64ce1ea299e00474c646a2453a8435b || exit 1
  83. ./autogen.sh
  84. PATH=/opt/android/tool/arm/arm-linux-androideabi/bin:/opt/android/tool/arm/bin:$PATH ; CC=clang CXX=clang++ CFLAGS="-fPIC" CXXFLAGS="-fPIC" ./configure --prefix=/opt/android/build/libzmq/arm --host=arm-linux-androideabi --enable-static --disable-shared && make && make install && ldconfig && make clean
  85. PATH=/opt/android/tool/arm64/aarch64-linux-android/bin:/opt/android/tool/arm64/bin:$PATH ; CC=clang CXX=clang++ CFLAGS="-fPIC" CXXFLAGS="-fPIC" ./configure --prefix=/opt/android/build/libzmq/arm64 --host=aarch64-linux-android --enable-static --disable-shared && make && make install && ldconfig && make clean
  86. PATH=/opt/android/tool/x86/i686-linux-android/bin:/opt/android/tool/x86/bin:$PATH ; CC=clang CXX=clang++ CFLAGS="-fPIC" CXXFLAGS="-fPIC" ./configure --prefix=/opt/android/build/libzmq/x86 --host=i686-linux-android --enable-static --disable-shared && make && make install && ldconfig && make clean
  87. PATH=/opt/android/tool/x86_64/x86_64-linux-android/bin:/opt/android/tool/x86_64/bin:$PATH ; CC=clang CXX=clang++ CFLAGS="-fPIC" CXXFLAGS="-fPIC" ./configure --prefix=/opt/android/build/libzmq/x86_64 --host=x86_64-linux-android --enable-static --disable-shared && make && make install && ldconfig && make clean
  88.  
  89.  
  90. cd /opt/android
  91. git clone --recursive https://github.com/sumoprojects/sumokoin.git -b android-wallet
  92. #### for convenience, for working with build-all-archs and collecting needed files scripts and for copy pasting directly to android wallet directory ##
  93. mv /opt/android/sumokoin /opt/android/monero/
  94. cd monero
  95. mkdir -p build/release
  96. sudo apt update && sudo apt install build-essential cmake pkg-config libunbound-dev libunwind8-dev liblzma-dev libreadline6-dev libldns-dev libexpat1-dev doxygen graphviz libpgm-dev qttools5-dev-tools libhidapi-dev libusb-dev libprotobuf-dev protobuf-compiler
  97. chmod u+x build-all-archs.sh
  98. ./build-all-archs.sh
  99.  
  100. #### BRINGING THE FILES WE NEED INTO SUMOKOIN ANDROID WALLET ####
  101. cd <path-to-sumokoinandroidwallet>/external-libs
  102. find . -name "*.a" -or -name "*.h" -type f -delete
  103. ./collect.sh
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement