Update Cutter compilation documentation (#2238)

* add linux dependencies to the list
* make a common git clone section
This commit is contained in:
Surendrajat 2020-06-20 21:54:11 +05:30 committed by GitHub
parent d26e48f3f5
commit 061636d714
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7,6 +7,26 @@ Building
that we provide pre-compiled binaries for Windows, Linux and macOS on
our `release page. <https://github.com/radareorg/cutter/releases/latest>`_
Getting the Source
------------------
Make sure you've ``git`` installed in your system (`Installation guide <https://git-scm.com/book/en/v2/Getting-Started-Installing-Git>`_) and do the following:
.. code-block:: sh
git clone --recurse-submodules https://github.com/radareorg/cutter
This will clone the Cutter source and it's dependencies(radare2, etc.)
under **cutter** and you should see the following dir structure:
.. code-block:: sh
cutter/-|
|-docs/ # Cutter Documentation
|-radare2/ # radare2 submodule
|-src/ # Cutter Source Code
Following sections assume that **cutter** is your working dir. (if not, do ``cd cutter``)
Building on Linux
-----------------
@ -17,7 +37,6 @@ Requirements
On Linux, you will need:
* build-essential
* git
* cmake
* meson
* libzip-dev
@ -25,35 +44,37 @@ On Linux, you will need:
* qt5
* qt5-svg
* pkgconf
* curl*
* python-setuptools*
* KSyntaxHighlighter**
* graphviz**
On Debian-based Linux distributions, all of these packages can be installed with this single command:
`*` Recommended while building with ``make``/``Cmake``.
`**` Optional. If present, these add extra features to Cutter. See `CMake Building Options`_.
On Debian-based Linux distributions, all of these essential packages can be installed with this single command:
::
sudo apt install git build-essential cmake meson libzip-dev zlib1g-dev qt5-default libqt5svg5-dev qttools5-dev qttools5-dev-tools
sudo apt install build-essential cmake meson libzip-dev zlib1g-dev qt5-default libqt5svg5-dev qttools5-dev qttools5-dev-tools
On Arch-based Linux distributions, build-essential should be replaced by base-devel:
.. note::
For Ubuntu 18.04 and lower, ``meson`` should be installed with ``pip install --upgrade --user meson``.
On Arch-based Linux distributions:
::
sudo pacman -Syu git base-devel cmake meson qt5-base qt5-svg qt5-tools
sudo pacman -Syu base-devel cmake meson qt5-base qt5-svg qt5-tools
Building steps
~~~~~~~~~~~~~~
The official way to build Cutter on Linux is by using CMake.
First, clone the repository with its dependencies:
.. code-block:: sh
git clone --recurse-submodules https://github.com/radareorg/cutter
Then invoke CMake to build Cutter and its dependency radare2.
The recommended way to build Cutter on Linux is by using CMake. Simply invoke CMake to build Cutter and its dependency radare2.
.. code:: sh
cd cutter
mkdir build && cd build
cmake -DCUTTER_USE_BUNDLED_RADARE2=ON ../src
cmake --build .
@ -62,7 +83,6 @@ If your operating system has a newer version of CMake (> v3.12) you can use this
.. code:: sh
cd cutter
cmake -S src -B build -DCUTTER_USE_BUNDLED_RADARE2=ON
cmake --build build
@ -74,7 +94,7 @@ If your operating system has a newer version of CMake (> v3.12) you can use this
please look at the full list of `CMake Building Options`_.
After the build process is complete, you should have the Cutter executable in the `build` folder.
After the build process is complete, you should have the ``Cutter`` executable in the **build** dir.
You can now execute Cutter like this:
.. code:: sh
@ -88,8 +108,8 @@ Building on Windows
Requirements
~~~~~~~~~~~~
Cutter works on Windows starting from Windows 7 up to Windows 10.
To compile Cutter it is necessary to have installed:
Cutter works on Windows 7 or newer.
To compile Cutter it is necessary to have the following installed:
* A version of Visual Studio (2015, 2017 and 2019 are supported)
* CMake
@ -100,7 +120,7 @@ Default way
To build Cutter on Windows machines using CMake,
you will have to make sure that the executables are available
in your `%PATH%` environment variable.
in your ``%PATH%`` environment variable.
Note that the paths below may vary depending on your version of Qt and Visual Studio.
@ -131,7 +151,7 @@ Additional requirements:
Download and unpack
`Ninja <https://github.com/ninja-build/ninja/releases>`__ to the Cutter
source root directory.
source root directory (ie. **cutter** - working dir).
Note that in the below steps, the paths may vary depending on your version of Qt and Visual Studio.
@ -175,14 +195,14 @@ QtCreator will then allow you to directly edit the source code and build the pro
.. note::
For the `.pro` file to be compiled successfully, it is required
to run `prepare_r2.bat` beforehand.
On **Windows**, for the ``.pro`` file to be compiled successfully, it is required
to run ``prepare_r2.bat`` beforehand.
Compiling on Linux / macOS
~~~~~~~~~~~~~~~~~~~~~~~~~~
The easiest way, but not the one we recommend, is to simply run ``./build.sh`` from the root directory,
and let the magic happen. The script will use qmake to build Cutter.
and let the magic happen. The script will use ``qmake`` to build Cutter.
The ``build.sh`` script is meant to be deprecated and will be deleted in the future.
If you want to manually use qmake, follow these steps: