From e4698ae30c6e7bbf6d69e5882f4b94349cec39dd Mon Sep 17 00:00:00 2001 From: drew2a Date: Thu, 29 Dec 2022 15:54:57 +0100 Subject: [PATCH] Update the build documentation --- .gitignore | 2 ++ doc/building/building.rst | 30 +++++++++++++++++++++------- doc/building/building_on_osx.rst | 24 +++++++++++----------- doc/building/building_on_windows.rst | 22 +++++++++++++++----- 4 files changed, 54 insertions(+), 24 deletions(-) diff --git a/.gitignore b/.gitignore index 0e2780d2337..4d393e705be 100644 --- a/.gitignore +++ b/.gitignore @@ -92,3 +92,5 @@ venv/ _build/ .Tribler/ + +.mailmap diff --git a/doc/building/building.rst b/doc/building/building.rst index 2a14a4802bc..e544ec1e6c9 100644 --- a/doc/building/building.rst +++ b/doc/building/building.rst @@ -7,26 +7,42 @@ This page contains instructions on how to build and package Tribler. Windows ======= +The most up-to-date information on building Tribler on Windows can be found `here `_. + .. include:: building_on_windows.rst MacOS ===== +The most up-to-date information on building Tribler on macOS can be found `here `_. + + .. include:: building_on_osx.rst Debian and derivatives ====================== -Run the following commands in your terminal: +The most up-to-date information on building Tribler on Ubuntu can be found `here `_. + + +Run the following commands in your terminal (assuming you are in the Tribler's repository root folder): .. code-block:: none - sudo apt-get install devscripts python-setuptools fonts-noto-color-emoji - cd tribler - build/update_version_from_git.py - python3 -m PyInstaller tribler.spec - cp -r dist/tribler build/debian/tribler/usr/share/tribler - dpkg-deb -b build/debian/tribler tribler.deb + sudo apt-get update + sudo apt-get -y install debhelper devscripts libxcb-xinerama0-dev libqt5x11extras5 + + python3 -m pip install -r requirements-build.txt + + git describe | python -c "import sys; print(next(sys.stdin).lstrip('v'))" > .TriblerVersion + git rev-parse HEAD > .TriblerCommit + + export QT_QPA_PLATFORM=offscreen + export QT_ACCESSIBILITY=1 + export QT_IM_MODULE=ibus + export "TRIBLER_VERSION=$(head -n 1 .TriblerVersion)" + + ./build/debian/makedist_debian.sh This will build a ``tribler.deb`` file, including all dependencies and required libraries. diff --git a/doc/building/building_on_osx.rst b/doc/building/building_on_osx.rst index fdddfd1bc10..7b5b7761f9d 100644 --- a/doc/building/building_on_osx.rst +++ b/doc/building/building_on_osx.rst @@ -1,30 +1,30 @@ This guide explains how to build Tribler on MacOS (10.10 to 10.13). The final result is a ``.dmg`` file which, when opened, allows ``Tribler.app`` to be copied to the Applications directory and or launched. Make sure the required packages required by Tribler are installed from the `Development instructions <../development/development_on_osx.rst>`_. -Required packages -------------------- -* eulagise: In order to attach the EULA to the ``.dmg`` file, we make use of the ``eulagise`` script. This script is written in PERL and is based on a more fully-featured script. The script can be downloaded from `GitHub `_. The builder expects the script to be executable and added to the ``PATH`` environment variable. This can be done with the following commands: - -.. code-block:: none - - cp eulagise.pl /usr/local/bin/eulagise - chmod +x /usr/local/bin/eulagise - eulagise # to test it - it should show that you should add some flags - Building Tribler on macOS ------------------------- Start by checking out the directory you want to clone (using ``git clone``). Open a terminal and ``cd`` to this new cloned directory (referenced to as ``tribler_source`` in this guide). -Next, we should inject version information into the files about the latest release. This is done by the ``update_version_from_git.py`` script found in ``Tribler/Main/Build``. Invoke it from the ``tribler_source`` directory by executing: +Next, we should inject version information into the files about the latest release: .. code-block:: none - build/update_version_from_git.py + git describe | python -c "import sys; print(next(sys.stdin).lstrip('v'))" > .TriblerVersion + git rev-parse HEAD > .TriblerCommit + + python3 ./build/update_version.py -r . Now execute the builder with the following command: .. code-block:: none + python3 -m pip install -r requirements-build.txt + + export QT_QPA_PLATFORM=offscreen + export QT_ACCESSIBILITY=1 + export QT_IM_MODULE=ibus + export "TRIBLER_VERSION=$(head -n 1 .TriblerVersion)" + build/mac/makedist_macos.sh This will create the ``.dmg`` file in the ``tribler_source/dist`` directory. diff --git a/doc/building/building_on_windows.rst b/doc/building/building_on_windows.rst index f3ef4d04673..bbb85effb94 100644 --- a/doc/building/building_on_windows.rst +++ b/doc/building/building_on_windows.rst @@ -30,15 +30,27 @@ Inside the ``build`` folder, put the following items: 3. ``libsodium.dll`` which can be downloaded from `libsodium.org `_ (as of writing version 1.0.8). 4. The openssl dll files ``libeay32.dll``, ``libssl32.dll`` and ``ssleay32.dll`` (place them in a directory named ``openssl``). -Then, set a ``PASSWORD`` `environment variable `__ with its value set to the password matching the one set in your ``.pfx`` file. +Then: + +* Set a ``PASSWORD`` `environment variable `__ with its value set to the password matching the one set in your ``.pfx`` file. +* Create the ``.TriblerVersion`` file with the result of execution of the following command: ``git describe | python -c "import sys; print(next(sys.stdin).lstrip('v'))"`` +* Create the ``.TriblerCommit`` file with the result of execution of the following command: ``git rev-parse HEAD`` +* Set the ``TRIBLER_VERSION`` environment variable with the content of the ``.TriblerVersion`` file. +* Set the ``QT_QPA_PLATFORM=offscreen`` environment variable +* Set the ``QT_ACCESSIBILITY=1`` environment variable +* Set the ``QT_IM_MODULE=ibus`` environment variable Finally, open a command prompt and enter the following commands (Change 11.0 depending on your version of Microsoft Visual Studio): -Note that for building 32 bit you need to pass anything but 64, i.e. 32 or 86 to the ``update_version_from_git.py`` script. +Note that for building 32 bit you need to pass anything but 64, i.e. 32 or 86 to the ``update_version.py`` script. .. code-block:: bash - cd tribler - python build/update_version_from_git.py 64 - build\win\makedist_win.bat 64 + + python -m pip install -r requirements-build.txt + + python build\update_version.py 64 + python build\win\replace_nsi.py -r . --architecture x64 + + build\win\makedist_win.bat This builds an ``.exe`` installer which installs Tribler.