From 72a322a4066c118e9b8aa77079915d97fff860c8 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Tue, 16 Jul 2024 15:32:03 -0600 Subject: [PATCH] doc: consistently use ```sh tags for correct shell highlighting --- doc/build-unix.md | 126 ++++++++++++++++++++++++++++++++-------------- 1 file changed, 88 insertions(+), 38 deletions(-) diff --git a/doc/build-unix.md b/doc/build-unix.md index bbfa8b75454e9..d09807784b5e2 100644 --- a/doc/build-unix.md +++ b/doc/build-unix.md @@ -9,15 +9,17 @@ Note Always use absolute paths to configure and compile Dash Core and the dependencies. For example, when specifying the path of the dependency: - ../dist/configure --enable-cxx --disable-shared --with-pic --prefix=$BDB_PREFIX +```sh +../dist/configure --enable-cxx --disable-shared --with-pic --prefix=$BDB_PREFIX +``` -Here BDB_PREFIX must be an absolute path - it is defined using $(pwd) which ensures +Here `BDB_PREFIX` must be an absolute path - it is defined using $(pwd) which ensures the usage of the absolute path. To Build --------------------- -```bash +```sh ./autogen.sh ./configure make @@ -59,7 +61,9 @@ memory available when compiling Dash Core. On systems with less, gcc can be tuned to conserve memory with additional CXXFLAGS: - ./configure CXXFLAGS="--param ggc-min-expand=1 --param ggc-min-heapsize=32768" +```sh +./configure CXXFLAGS="--param ggc-min-expand=1 --param ggc-min-heapsize=32768" +``` ## Linux Distribution Specific Instructions @@ -70,11 +74,15 @@ tuned to conserve memory with additional CXXFLAGS: Build requirements: - sudo apt-get install build-essential libtool autotools-dev automake pkg-config bsdmainutils bison python3 +```sh +sudo apt-get install build-essential libtool autotools-dev automake pkg-config bsdmainutils bison python3 +``` Now, you can either build from self-compiled [depends](/depends/README.md) or install the required dependencies: - sudo apt-get install libevent-dev libboost-system-dev libboost-filesystem-dev libboost-test-dev +```sh +sudo apt-get install libevent-dev libboost-system-dev libboost-filesystem-dev libboost-test-dev +``` Berkeley DB is required for the wallet. @@ -87,21 +95,29 @@ Otherwise, you can build Berkeley DB [yourself](#berkeley-db). SQLite is required for the wallet: - sudo apt-get install libsqlite3-dev +```sh +sudo apt-get install libsqlite3-dev +``` To build Dash Core without wallet, see [*Disable-wallet mode*](#disable-wallet-mode) Optional port mapping libraries (see: `--with-miniupnpc` and `--with-natpmp`): - sudo apt-get install libminiupnpc-dev libnatpmp-dev +```sh +sudo apt-get install libminiupnpc-dev libnatpmp-dev +``` ZMQ dependencies (provides ZMQ API): - sudo apt-get install libzmq3-dev +```sh +sudo apt-get install libzmq3-dev +``` GMP dependencies (provides platform-optimized routines): - sudo apt-get install libgmp-dev +```sh +sudo apt-get install libgmp-dev +``` GUI dependencies: @@ -111,15 +127,21 @@ To build without GUI pass `--without-gui`. To build with Qt 5 you need the following: - sudo apt-get install libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools +```sh +sudo apt-get install libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools +``` Additionally, to support Wayland protocol for modern desktop environments: - sudo apt-get install qtwayland5 +```sh +sudo apt-get install qtwayland5 +``` libqrencode (optional) can be installed with: - sudo apt-get install libqrencode-dev +```sh +sudo apt-get install libqrencode-dev +``` Once these are installed, they will be found by configure and a dash-qt executable will be built by default. @@ -131,15 +153,21 @@ built by default. Build requirements: - sudo dnf install gcc-c++ libtool make autoconf automake python3 +```sh +sudo dnf install gcc-c++ libtool make autoconf automake python3 +``` Now, you can either build from self-compiled [depends](/depends/README.md) or install the required dependencies: - sudo dnf install libevent-devel boost-devel +```sh +sudo dnf install libevent-devel boost-devel +``` Berkeley DB is required for the wallet: - sudo dnf install libdb4-devel libdb4-cxx-devel +```sh +sudo dnf install libdb4-devel libdb4-cxx-devel +``` Newer Fedora releases, since Fedora 33, have only `libdb-devel` and `libdb-cxx-devel` packages, but these will install Berkeley DB 5.3 or later. This will break binary wallet compatibility with the distributed executables, which @@ -150,21 +178,29 @@ Otherwise, you can build Berkeley DB [yourself](#berkeley-db). SQLite is required for the wallet: - sudo dnf install sqlite-devel +```sh +sudo dnf install sqlite-devel +``` To build Dash Core without wallet, see [*Disable-wallet mode*](#disable-wallet-mode) Optional port mapping libraries (see: `--with-miniupnpc` and `--with-natpmp`): - sudo dnf install miniupnpc-devel libnatpmp-devel +```sh +sudo dnf install miniupnpc-devel libnatpmp-devel +``` ZMQ dependencies (provides ZMQ API): - sudo dnf install zeromq-devel +```sh +sudo dnf install zeromq-devel +``` GMP dependencies (provides platform-optimized routines): - sudo dnf install gmp-devel +```sh +sudo dnf install gmp-devel +``` GUI dependencies: @@ -174,15 +210,21 @@ To build without GUI pass `--without-gui`. To build with Qt 5 you need the following: - sudo dnf install qt5-qttools-devel qt5-qtbase-devel +```sh +sudo dnf install qt5-qttools-devel qt5-qtbase-devel +``` Additionally, to support Wayland protocol for modern desktop environments: - sudo dnf install qt5-qtwayland +```sh +sudo dnf install qt5-qtwayland +``` libqrencode (optional) can be installed with: - sudo dnf install qrencode-devel +```sh +sudo dnf install qrencode-devel +``` Once these are installed, they will be found by configure and a dash-qt executable will be built by default. @@ -213,7 +255,7 @@ It is recommended to use Berkeley DB 4.8. If you have to build it yourself, you can use [the installation script included in contrib/](contrib/install_db4.sh) like so: -```shell +```sh ./contrib/install_db4.sh `pwd` ``` @@ -293,19 +335,23 @@ Additional Configure Flags -------------------------- A list of additional configure flags can be displayed with: - ./configure --help +```sh +./configure --help +``` Setup and Build Example: Arch Linux ----------------------------------- This example lists the steps necessary to setup and build a command line only, non-wallet distribution of the latest changes on Arch Linux: - pacman -S git base-devel boost libevent python - git clone https://github.com/dashpay/dash.git - cd dash/ - ./autogen.sh - ./configure --disable-wallet --without-gui --without-miniupnpc - make check +```sh +pacman -S git base-devel boost libevent python +git clone https://github.com/dashpay/dash.git +cd dash/ +./autogen.sh +./configure --disable-wallet --without-gui --without-miniupnpc +make check +``` Note: Enabling wallet support requires either compiling against a Berkeley DB newer than 4.8 (package `db`) using `--with-incompatible-bdb`, @@ -324,16 +370,20 @@ installing the toolchain will be different. Make sure you install the build requirements mentioned above. Then, install the toolchain and curl: - sudo apt-get install g++-arm-linux-gnueabihf curl +```sh +sudo apt-get install g++-arm-linux-gnueabihf curl +``` To build executables for ARM: - cd depends - make HOST=arm-linux-gnueabihf NO_QT=1 - cd .. - ./autogen.sh - CONFIG_SITE=$PWD/depends/arm-linux-gnueabihf/share/config.site ./configure --enable-reduce-exports LDFLAGS=-static-libstdc++ - make +```sh +cd depends +make HOST=arm-linux-gnueabihf NO_QT=1 +cd .. +./autogen.sh +CONFIG_SITE=$PWD/depends/arm-linux-gnueabihf/share/config.site ./configure --enable-reduce-exports LDFLAGS=-static-libstdc++ +make +``` For further documentation on the depends system see [README.md](../depends/README.md) in the depends directory.