# LIBXAYAGAME BUILD SCRIPT # ======================== # This script is the same as the tutorial. There is no # error checking or anything fancy here. # Comment out or delete the "read -p..." lines to run # the script unattended. # This script is tested on a fresh installation of # Ubuntu 20.04.3 LTS. echo "==============================================" echo "====== UPDATE DATABASE =======================" echo "==============================================" echo "== Updating the apt database..." sudo apt-get -y update echo "==============================================" echo "====== DATABASE UPDATED ======================" echo "==============================================" #echo "==============================================" #echo "====== DATABASE UPGRADE ======================" #echo "==============================================" #echo "== Upgrading..." # sudo apt-get -y upgrade #echo "==============================================" #echo "====== UPGRADED ==============================" #echo "==============================================" echo "==============================================" echo "====== INSTALL PRE-REQUISITES ================" echo "==============================================" echo "== This will install most of the required libraries " echo "== that we need to build libxayagame. Some others will" echo "== be built from source." read -p "Press ENTER to continue..." sudo apt-get -y install build-essential libargtable2-dev libzmq3-dev zlib1g-dev libsqlite3-dev liblmdb-dev libgoogle-glog-dev libgflags-dev libprotobuf-dev protobuf-compiler python3 python-protobuf autoconf autoconf-archive automake cmake git libtool pkg-config libcurl4-openssl-dev libssl-dev libmicrohttpd-dev make read -p "Press ENTER to continue..." echo "==============================================" echo "====== PRE-REQUISITES INSTALLED ==============" echo "==============================================" echo "==============================================" echo "====== BUILD JSONCPP FROM SOURCE =============" echo "==============================================" echo "== We need v1.7.5 or higher." echo "== This will install v1.9.4." echo "== The build process is somewhat odd due" echo "== to -where- it's built, i.e. which folders." # FIXME: Version 1.9.4 has a broken pkg-config file, which we need # to fix specifically. Once a new version is released, we can get # rid of this hack. # Refer to https://github.com/xaya/libxayagame/blob/ubuntu-build/Dockerfile # for version updates. read -p "Press ENTER to continue..." cd ~/ mkdir jsoncpp && cd jsoncpp git clone -b 1.9.4 https://github.com/open-source-parsers/jsoncpp . git config user.email "test@example.com" git config user.name "Cherry Picker" git cherry-pick ac2870298ed5b5a96a688d9df07461b31f83e906 cmake . -DJSONCPP_WITH_PKGCONFIG_SUPPORT=ON -DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=OFF make -j4 sudo make install/strip read -p "Press ENTER to continue..." echo "==============================================" echo "====== JSONCPP BUILD/INSTALL COMPLETE ========" echo "==============================================" echo "==============================================" echo "====== BUILD JSON-RPC-CPP FROM SOURCE ========" echo "==============================================" read -p "Press ENTER to continue..." cd ~/ git clone https://github.com/cinemast/libjson-rpc-cpp cd libjson-rpc-cpp cmake . -DREDIS_SERVER=NO -DREDIS_CLIENT=NO -DCOMPILE_TESTS=NO -DCOMPILE_EXAMPLES=NO -DWITH_COVERAGE=NO make -j4 sudo make install/strip read -p "Press ENTER to continue..." echo "==============================================" echo "====== JSON-RPC-CPP BUILD/INSTALL COMPLETE ===" echo "==============================================" echo "==============================================" echo "====== BUILD GOOGLETEST FROM SOURCE ==========" echo "==============================================" echo "== googletest must be installed from source." read -p "Press ENTER to continue..." cd ~/ git clone https://github.com/google/googletest cd googletest cmake . make -j4 sudo make install/strip read -p "Press ENTER to continue..." echo "==============================================" echo "====== GOOGLETEST BUILD/INSTALL COMPLETE =====" echo "==============================================" echo "==============================================" echo "====== INSTALL ZMQ C++ BINDINGS ==============" echo "====== FROM SOURCE (CPPZMQ) ==================" echo "==============================================" read -p "Press ENTER to continue..." cd ~/ git clone -b v4.7.1 https://github.com/zeromq/cppzmq cd cppzmq sudo cp zmq.hpp /usr/local/include read -p "Press ENTER to continue..." echo "==============================================" echo "====== ZMQ C++ BINDINGS INSTALLED ============" echo "==============================================" echo "==============================================" echo "====== CLEAN UP & MAKE ALL INSTALLED =========" echo "====== DEPENDENCIES VISIBLE ==================" echo "==============================================" sudo ldconfig read -p "Press ENTER to continue..." echo "==============================================" echo "====== BUILD & INSTALL LIBXAYAGAME============" echo "==============================================" read -p "Press ENTER to continue..." cd ~/ git clone https://github.com/xaya/libxayagame.git cd ~/libxayagame ./autogen.sh ./configure make -j4 sudo make install read -p "Press ENTER to continue..." sudo ldconfig echo "==============================================" echo "====== LIBXAYAGAME BUILT & INSTALLED =========" echo "=============================================="