Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the build documentation #7244

Merged
merged 1 commit into from
Dec 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,5 @@ venv/
_build/

.Tribler/

.mailmap
30 changes: 23 additions & 7 deletions doc/building/building.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://github.com/Tribler/tribler/blob/main/.github/workflows/build_windows.yml>`_.

.. include:: building_on_windows.rst

MacOS
=====

The most up-to-date information on building Tribler on macOS can be found `here <https://github.com/Tribler/tribler/blob/main/.github/workflows/build_mac.yml>`_.


.. 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 <https://github.com/Tribler/tribler/blob/main/.github/workflows/build_ubuntu.yml>`_.


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.

Expand Down
24 changes: 12 additions & 12 deletions doc/building/building_on_osx.rst
Original file line number Diff line number Diff line change
@@ -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 <https://github.com/CompoFX/compo/blob/master/tool/eulagise.pl>`_. 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.
22 changes: 17 additions & 5 deletions doc/building/building_on_windows.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,27 @@ Inside the ``build`` folder, put the following items:
3. ``libsodium.dll`` which can be downloaded from `libsodium.org <https://download.libsodium.org/libsodium/releases/>`_ (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 <https://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/sysdm_advancd_environmnt_addchange_variable.mspx?mfr=true>`__ with its value set to the password matching the one set in your ``.pfx`` file.
Then:

* Set a ``PASSWORD`` `environment variable <https://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/sysdm_advancd_environmnt_addchange_variable.mspx?mfr=true>`__ 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.