2021-05-25 09:43:34 +00:00
|
|
|
.. _building:
|
|
|
|
|
|
|
|
Building
|
|
|
|
########
|
|
|
|
|
2021-07-05 16:00:58 +00:00
|
|
|
The following instructions will help you build Looking Glass from source code.
|
|
|
|
Before attempting this, you should have a basic understanding of
|
|
|
|
how to use the shell.
|
2021-05-25 09:43:34 +00:00
|
|
|
|
|
|
|
.. _download_source:
|
|
|
|
|
|
|
|
Downloading
|
|
|
|
-----------
|
|
|
|
|
2021-07-05 16:00:58 +00:00
|
|
|
Visit the Looking Glass `Download Page <https://looking-glass.io/downloads>`__,
|
|
|
|
and download the stable version (**recommended**).
|
|
|
|
You can also download a *bleeding-edge version*, or the latest RC version
|
|
|
|
during a Release Candidate cycle.
|
|
|
|
|
|
|
|
Developers can clone the source code repo with ``git``.
|
2021-05-25 09:43:34 +00:00
|
|
|
|
|
|
|
.. code:: bash
|
|
|
|
|
|
|
|
git clone --recursive https://github.com/gnif/LookingGlass.git
|
|
|
|
|
|
|
|
.. warning::
|
|
|
|
|
|
|
|
Please only clone from Git if you're a developer, and know what you're
|
|
|
|
doing. Looking Glass requires git submodules that must be setup and updated
|
|
|
|
when building. Source code downloads from the website come bundled with the
|
|
|
|
necessary submodules.
|
|
|
|
|
|
|
|
.. note::
|
|
|
|
|
|
|
|
When using the latest bleeding-edge client version,
|
|
|
|
you *MUST* download and install the corresponding host application.
|
|
|
|
|
|
|
|
.. _build_client_section:
|
|
|
|
|
|
|
|
Client
|
|
|
|
------
|
|
|
|
|
|
|
|
.. _installing_build_dependencies:
|
|
|
|
|
|
|
|
Installing Build Dependencies
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
These required libraries and tools should be installed first.
|
|
|
|
|
|
|
|
.. _client_dependencies:
|
|
|
|
|
|
|
|
Required Dependencies
|
|
|
|
^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
- cmake
|
|
|
|
- gcc \| clang
|
|
|
|
- fonts-freefont-ttf
|
|
|
|
- libegl-dev
|
|
|
|
- libgl-dev
|
2021-07-08 01:45:54 +00:00
|
|
|
- libglew-dev
|
2021-05-25 09:43:34 +00:00
|
|
|
- libfontconfig1-dev
|
|
|
|
- libgmp-dev
|
|
|
|
- libspice-protocol-dev
|
|
|
|
- make
|
|
|
|
- nettle-dev
|
|
|
|
- pkg-config
|
|
|
|
|
2021-07-15 14:03:56 +00:00
|
|
|
.. _client_deps_may_be_disabled:
|
2021-05-25 09:43:34 +00:00
|
|
|
|
|
|
|
May be disabled
|
|
|
|
<<<<<<<<<<<<<<<
|
|
|
|
|
|
|
|
These dependencies are required by default, but may be omitted if their
|
|
|
|
feature is disabled when running :ref:`cmake <client_building>`.
|
|
|
|
|
2021-07-05 16:00:58 +00:00
|
|
|
- Disable with ``cmake -DENABLE_BACKTRACE=no ..``
|
2021-05-25 09:43:34 +00:00
|
|
|
|
|
|
|
- binutils-dev
|
|
|
|
|
2021-07-05 16:00:58 +00:00
|
|
|
- Disable with ``cmake -DENABLE_X11=no ..``
|
2021-05-25 09:43:34 +00:00
|
|
|
|
|
|
|
- libx11-dev
|
|
|
|
- libxfixes-dev
|
|
|
|
- libxi-dev
|
2021-07-15 14:03:56 +00:00
|
|
|
- libxinerama-dev
|
2021-05-25 09:43:34 +00:00
|
|
|
- libxss-dev
|
|
|
|
|
2021-07-05 16:00:58 +00:00
|
|
|
- Disable with ``cmake -DENABLE_WAYLAND=no ..``
|
2021-05-25 09:43:34 +00:00
|
|
|
|
|
|
|
- libwayland-bin
|
|
|
|
- libwayland-dev
|
|
|
|
- wayland-protocols
|
|
|
|
|
2021-07-15 14:03:56 +00:00
|
|
|
.. _client_deps_deprecated:
|
|
|
|
|
|
|
|
Deprecated
|
|
|
|
<<<<<<<<<<
|
|
|
|
|
|
|
|
These dependencies may be used, but are not required, and will be removed
|
|
|
|
in the future.
|
|
|
|
|
|
|
|
- Enable with ``cmake -DENABLE_SDL=yes ..``
|
|
|
|
|
|
|
|
- libsdl2-dev
|
|
|
|
- libsdl2-ttf-dev
|
|
|
|
|
|
|
|
.. _client_fetching_with_apt:
|
|
|
|
|
|
|
|
Fetching with APT
|
|
|
|
^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
You can fetch these dependencies with the following command:
|
2021-05-25 09:43:34 +00:00
|
|
|
|
|
|
|
``apt-get install binutils-dev cmake fonts-freefont-ttf libfontconfig1-dev
|
2021-07-15 14:03:56 +00:00
|
|
|
libegl-dev libspice-protocol-dev nettle-dev libx11-dev libxi-dev libxinerama-dev
|
|
|
|
libxss-dev libwayland-dev wayland-protocols``
|
|
|
|
|
|
|
|
You may omit some dependencies, if you disable the feature which requires them
|
|
|
|
when running :ref:`cmake <client_building>`.
|
|
|
|
(See :ref:`client_deps_may_be_disabled`)
|
2021-05-25 09:43:34 +00:00
|
|
|
|
|
|
|
|
|
|
|
.. _client_building:
|
|
|
|
|
|
|
|
Building
|
|
|
|
~~~~~~~~
|
|
|
|
|
2021-07-05 16:00:58 +00:00
|
|
|
If you've downloaded the source code as a zip file, simply unzip and ``cd``
|
|
|
|
into the new directory. If you've cloned the repo with ``git``, then ``cd``
|
|
|
|
into the *LookingGlass* directory.
|
2021-05-25 09:43:34 +00:00
|
|
|
|
|
|
|
.. code:: bash
|
|
|
|
|
|
|
|
mkdir client/build
|
|
|
|
cd client/build
|
|
|
|
cmake ../
|
|
|
|
make
|
|
|
|
|
2021-07-05 16:00:58 +00:00
|
|
|
This will build the **looking-glass-client** binary, which is used to display
|
|
|
|
frames from the guest.
|
2021-05-25 09:43:34 +00:00
|
|
|
|
|
|
|
.. seealso::
|
|
|
|
|
2021-07-05 16:00:58 +00:00
|
|
|
- :ref:`Installing the Client <client_install>`
|
|
|
|
- :ref:`Client Usage <client_usage>`
|
2021-05-25 09:43:34 +00:00
|
|
|
|
|
|
|
.. note::
|
|
|
|
|
|
|
|
The most common compile error is related to backtrace support. This can be
|
|
|
|
disabled by adding the following option to the cmake command:
|
2021-07-05 16:00:58 +00:00
|
|
|
``-DENABLE_BACKTRACE=0``. However, if you disable this and need support for
|
|
|
|
a crash, use ``gdb`` to obtain a backtrace manually.
|
2021-05-25 09:43:34 +00:00
|
|
|
|
|
|
|
.. _host_building:
|
|
|
|
|
|
|
|
Host
|
|
|
|
----
|
|
|
|
|
2021-07-05 16:00:58 +00:00
|
|
|
These instructions help you build the host yourself from the
|
|
|
|
:ref:`downloaded source code <download_source>`.
|
2021-05-25 09:43:34 +00:00
|
|
|
|
|
|
|
.. warning::
|
|
|
|
Building the host from source code is not recommended for most purposes,
|
|
|
|
and should only be attempted by users who are prepared to handle issues
|
|
|
|
on their own. Please download the pre-built binary installers from
|
|
|
|
https://looking-glass.io/downloads for stability, and increased support.
|
|
|
|
|
|
|
|
.. note::
|
|
|
|
The pre-built binaries also include NvFBC support built in, which is
|
|
|
|
only available to current Nvidia SDK license holders, and cannot
|
|
|
|
be enabled when building the host without also having a license.
|
|
|
|
|
|
|
|
.. _host_win_on_win:
|
|
|
|
|
|
|
|
For Windows on Windows
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
1. Download and install msys2 x86_64 from
|
|
|
|
`http://www.msys2.org/ <http://www.msys2.org/>`__ following the setup
|
|
|
|
instructions provided
|
2021-07-05 16:00:58 +00:00
|
|
|
|
|
|
|
2. Run the MSYS2 shell
|
|
|
|
|
2021-05-25 09:43:34 +00:00
|
|
|
3. Download build dependencies with pacman
|
|
|
|
|
|
|
|
.. code:: bash
|
|
|
|
|
|
|
|
pacman -Fy
|
|
|
|
pacman -Sy git make mingw-w64-x86_64-gcc mingw-w64-x86_64-cmake
|
|
|
|
|
2021-07-05 16:00:58 +00:00
|
|
|
4. Change directory to the source tree with ``cd``
|
2021-05-25 09:43:34 +00:00
|
|
|
|
|
|
|
5. Configure the project and build it
|
|
|
|
|
|
|
|
.. code:: bash
|
|
|
|
|
2021-07-05 16:00:58 +00:00
|
|
|
mkdir host/build
|
|
|
|
cd host/build
|
2021-05-25 09:43:34 +00:00
|
|
|
cmake -G "MSYS Makefiles" ..
|
|
|
|
make
|
|
|
|
|
|
|
|
.. _host_linux_on_linux:
|
2021-07-05 16:00:58 +00:00
|
|
|
|
2021-05-25 09:43:34 +00:00
|
|
|
For Linux on Linux
|
|
|
|
~~~~~~~~~~~~~~~~~~
|
|
|
|
|
2021-07-05 16:00:58 +00:00
|
|
|
Make a ``host/build`` directory, then run ``cmake``
|
2021-05-25 09:43:34 +00:00
|
|
|
|
|
|
|
.. code:: bash
|
|
|
|
|
2021-07-05 16:00:58 +00:00
|
|
|
mkdir host/build
|
|
|
|
cd host/build
|
2021-05-25 09:43:34 +00:00
|
|
|
cmake ..
|
|
|
|
make
|
|
|
|
|
|
|
|
.. _host_win_cross_on_linux:
|
|
|
|
|
|
|
|
For Windows cross compiling on Linux
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
2021-07-05 16:00:58 +00:00
|
|
|
Like :ref:`host_linux_on_linux`, but using the mingw64 toolchain to
|
|
|
|
cross-compile a Windows ``.exe`` file.
|
2021-05-25 09:43:34 +00:00
|
|
|
|
|
|
|
.. code:: bash
|
|
|
|
|
2021-07-05 16:00:58 +00:00
|
|
|
mkdir host/build
|
|
|
|
cd host/build
|
2021-05-25 09:43:34 +00:00
|
|
|
cmake -DCMAKE_TOOLCHAIN_FILE=../toolchain-mingw64.cmake ..
|
|
|
|
make
|
|
|
|
|
|
|
|
.. _host_build_installer:
|
|
|
|
|
|
|
|
Building the Windows installer
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
2021-07-05 16:00:58 +00:00
|
|
|
1. :ref:`Build <host_win_cross_on_linux>` the host on Linux.
|
2021-05-25 09:43:34 +00:00
|
|
|
|
|
|
|
2. Install ``nsis``
|
|
|
|
|
|
|
|
.. code:: bash
|
|
|
|
|
|
|
|
apt-get install nsis
|
|
|
|
|
|
|
|
3. Use ``makensis`` to build the installer.
|
|
|
|
|
|
|
|
.. code:: bash
|
|
|
|
|
|
|
|
cd host/build/platform/Windows
|
|
|
|
makensis installer.nsi
|
|
|
|
|
|
|
|
.. _host_questions:
|
|
|
|
|
|
|
|
This will build ``looking-glass-host-setup.exe`` under
|
|
|
|
``host/build/platform/Windows/looking-glass-host-setup.exe``
|
|
|
|
|
|
|
|
.. seealso::
|
|
|
|
|
|
|
|
:ref:`Installing the Host <host_install>`
|