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

Docs: Installation consolidation #1288

Merged
merged 5 commits into from
Aug 17, 2022
Merged
Show file tree
Hide file tree
Changes from 4 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
18 changes: 11 additions & 7 deletions docs/Contributing/dev-env.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ noted, that you typically only have to go through this process once unless you s
Workstation
===========

Freeciv21 can be developed on Linux, Windows and MacOS. Any current version of these OS's is acceptible. For
Freeciv21 can be developed on Linux, Windows and MacOS X. Any current version of these OS's is acceptible. For
Windows, you will need to setup either the MSYS2 environment or Visual Studio to do development.
Refer to :doc:`msys2` or :doc:`Visual Studio <visual-studio>` for more information. It should be generally
understood that :strong:`Linux` is the preferred development platform.
understood that :strong:`Linux` is the preferred development platform. For a complete set of installation
steps, you can refer to :doc:`../../General/install`.

Technically all you need is a text editor of some kind to edit the files, but most people prefer to use an
IDE.
Expand All @@ -21,14 +22,14 @@ All platforms can use `KDevelop <https://www.kdevelop.org/download>`_. However,

* On Windows, due to the nature of the integration with MSYS2, native compilation and debugging is not
supported. This is resolved with Visual Studio as the IDE.
* On MacOS, KDevelop is still considered experimental. Many Mac users
* On MacOS X, KDevelop is still considered experimental. Many Mac users
use `XCode <https://developer.apple.com/xcode/>`_.

For the best results, especially if you are editing game code and not just Longturn game rulesets or
documentation, you will want :strong:`Linux` to be your workstation OS. Many of the current developers use a
Debain variant such as Ubuntu. Instructions for getting all of the tools needed for Debian Linux can be found
in :doc:`../General/install`. Refer to the section titled `Debian Linux Notes`. Don't follow the last few
steps to clone the repository (e.g. the :code:`git clone` command), that will happen in a bit.
in :doc:`../General/install`. Do not follow the steps to clone the repository (e.g. the :code:`git clone`
command), that will happen in a bit.

GitHub
======
Expand All @@ -44,7 +45,7 @@ In order to get code pushed to the forked repository to your local workstation,
SSH key pair to share with GitHub. Follow these
`instructions <https://docs.github.com/en/authentication/connecting-to-github-with-ssh>`_.

With SSH set up, now it's time to clone the forked repository from your personal GitHub account to a local
With SSH set up, now it is time to clone the forked repository from your personal GitHub account to a local
copy on your workstation.

First make a working directory to place the files in:
Expand All @@ -59,11 +60,14 @@ First make a working directory to place the files in:
You can get the appropriate path by going to your forked copy in a browser, click the code button and then
select the SSH option as shown in this sample screenshot:

.. image:: ../_static/images/github_clone_ssh.png
.. GitHub Clone SSH:
.. figure:: ../_static/images/github_clone_ssh.png
:align: center
:height: 250
:alt: GitHub Clone SSH

GitHub Clone SSH


Once you have the proper path, here is the command to clone the repository:

Expand Down
13 changes: 7 additions & 6 deletions docs/Contributing/msys2.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
MSYS2 Windows Installer Build
*****************************
Setting up MSYS2 for Windows
****************************

This document is about building compiling Freeciv21 and building the Windows Installer packages using MSYS2
from https://www.msys2.org.
This document is about building and compiling Freeciv21 with MSYS2 on Windows. MSYS2 is available from
https://www.msys2.org. The LongTurn Community builds the Windows Installer packages using MSYS2.


Setup
Expand All @@ -25,7 +25,7 @@ This chapter is about creating new msys2 build environment.

#. The :file:`msys2_shell` will close when this is complete. Run it again and install following packages with
:code:`pacman -Su <package name>`. The packages needed for building Freeciv21 are numerous. These packages
are needed even if you don't plan to make the installer, update documentation, but only build Freeciv21 for
are needed even if you do not plan to make the installer, update documentation, but only build Freeciv21 for
local use.

#. Install these arch independent packages that are needed for building Freeciv21. With these packages it is
Expand Down Expand Up @@ -87,4 +87,5 @@ environment. The scripts create an x86_64 environment.
Build
=====

Now that you have the environment setup. You can follow the steps in :doc:`../../General/install`
Now that you have the environment setup. You can follow the steps in :doc:`../../General/install`. MSYS2 in a
Linux emulation evironment on Windows, so the commands for :file:`git`, :file:`cmake`, etc. work the same.
110 changes: 57 additions & 53 deletions docs/Contributing/visual-studio.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Setting up Visual Studio
************************
Setting up Visual Studio for Windows
************************************

Freeciv21 can be compiled using Microsoft Visual Studio |reg| and :file:`clang-cl`. This page will help you
Freeciv21 can be compiled using Microsoft Visual Studio\ |reg| and :file:`clang-cl`. This page will help you
get version 2022 up and running.

.. warning:: Visual Studio and the corresponding dependencies require a great deal of HDD space on your
Expand All @@ -22,7 +22,7 @@ and :guilabel:`Python 3 64-bit (3.9.7)`.

When ready click :guilabel:`Install`. Depending on your Internet connection speed, this may take a while.

When the installation process is finished you may be presented with a collection of options. You don't need
When the installation process is finished you may be presented with a collection of options. You do not need
Visual Studio right now, so best to close everything at this point.

Set Up VCPKG
Expand All @@ -36,8 +36,8 @@ First, create a directory on your computer to install :file:`vcpkg` into. For ex
The directory can be anywhere, however the author prefers to :strong:`not` install things in the root of the
:file:`C:\\` drive.

Open an Administrative elevated PowerShell terminal window. The easiest way to do this is to right-click on the
:guilabel:`Start Menu` and select it from the menu: :guilabel:`Windows PowerShell (Admin)`.
Open an Administrative elevated PowerShell terminal window. The easiest way to do this is to right-click on
the :guilabel:`Start Menu` and select it from the menu: :guilabel:`Windows PowerShell (Admin)`.

.. code-block:: rst

Expand All @@ -56,9 +56,9 @@ that you installed :file:`vcpkg` into. The forward slashes are correct.
Tools> exit


.. warning:: The :file:`vcpkg` website/readme will ask for you to run a :file:`vcpkg integrate install` command
to fully integrate all the packages installed into Visual Studio. :strong:`Do Not` run this command as it
actually breaks Visual Studio's ability to find and use the :file:`clang-cl` compiler, which we need.
.. warning:: The :file:`vcpkg` website/readme will ask for you to run a :file:`vcpkg integrate install`
command to fully integrate all the packages installed into Visual Studio. :strong:`Do Not` run this command
as it actually breaks Visual Studio's ability to find and use the :file:`clang-cl` compiler, which we need.

GitHub
======
Expand All @@ -74,15 +74,18 @@ In order to get code pushed to the forked repository to your local workstation,
SSH key pair to share with GitHub. Follow these
`instructions <https://docs.github.com/en/authentication/connecting-to-github-with-ssh>`_.

With SSH set up, now it's time to clone the forked repository from your personal GitHub account to a local
With SSH set up, now it is time to clone the forked repository from your personal GitHub account to a local
copy on your workstation. You can get the appropriate path by going to your forked copy in a browser, click
the code button and then select the SSH option as shown in this sample screenshot:

.. image:: ../_static/images/github_clone_ssh.png
.. GitHub Clone SSH:
.. figure:: ../_static/images/github_clone_ssh.png
:align: center
:height: 250
:alt: GitHub Clone SSH

GitHub Clone SSH


Open up Visual Studio. A menu will appear. Go to the very bottom right and click the link to
:strong:`continue without code`. Select :menuselection:`View --> Terminal` to open a terminal in the IDE if
Expand Down Expand Up @@ -119,12 +122,12 @@ You will also need to set a couple global configuration settings so :code:`git`
Build Visual Studio Solution
============================

Now let's get Visual Studio set up. Select :menuselection:`Git --> Local Repositories --> Open Local Repository`
Now let us get Visual Studio set up. Select :menuselection:`Git --> Local Repositories --> Open Local Repository`
and then select the :file:`freeciv21` folder. Visual Studio will take a minute to parse the source tree.

Select :menuselection:`File --> Open --> Folder`. Select the :file:`freeciv21` directory and then Visual Studio
will parse the files in there. It can take a few mintues for this to complete. When complete, Visual Studio
will open a :strong:`CMake Overview Pages` tab.
Select :menuselection:`File --> Open --> Folder`. Select the :file:`freeciv21` directory and then Visual
Studio will parse the files in there. It can take a few minutes for this to complete. When complete, Visual
Studio will open a :strong:`CMake Overview Pages` tab.

Microsoft provides documentation on CMake in Visual Studio --
https://docs.microsoft.com/en-us/cpp/build/cmake-projects-in-visual-studio?view=msvc-170
Expand All @@ -133,45 +136,46 @@ https://docs.microsoft.com/en-us/cpp/build/cmake-projects-in-visual-studio?view=
Final Steps and Notes
=====================

At this point Visual Studio is ready for you to configure, compile (build), and install Freeciv21.
At this point Visual Studio is ready for you to configure, compile (build), and install Freeciv21.

To configure Freeciv21 in Visual Studio you first have to select either the :file:`windows-release` or
:file:`windows-debug` configuration preset as defined in :file:`CMakePresets.json`. On the :guilabel:`Standard`
toolbar, which is enabled by default, you will click the :guilabel:`Target System` drop down box and pick the
:strong:`Local Machine` option. Next you will click the :guilabel:`Configuration` drop down box and pick the
:strong:`windows-release` or :strong:`windows-debug` option. Visual Studio will then automatically populate the
:guilabel:`Build Preset` drop down box based on what you select for :guilabel:`Configuration`. With these options
set you will lastly click :menuselection:`Project --> Configure Cache`. When this process is complete you can
then compile (build) by clicking :menuselection:`Build --> Build All`. Visual Studio will compile all targets
for Freeciv21 and place the output into the :file:`build-vs` directory. If you want to install Freeciv21 to test
any work you are doing, you can go to :menuselection:`Build --> install Freeciv21`. When complete, you should find
a fully functional install in the :file:`build-vs/install` directory.

.. note:: The first time you run the Configure Cache command (from :menuselection:`Project --> Configure Cache`)
or ask Visual Studio to generate the C++ Intellisense data, Visual Studio will invoke the :file:`vcpkg`
installation process to download and compile all of the project dependencies listed in the manifest file:
:file:`vcpkg.json`. :strong:`This will take a very long time`. On a fast computer with a good Internet connection
it will take at least 3 hours to complete. Everything will be downloaded and compiled into the
:file:`C:\\Tools\\vcpkg` directory, or wherever you configured :file:`vcpkg` earlier. Binaries for the packages
will be copied into the :file:`./build-vs/` directory inside of the main Freeciv21 directory and reused for
subsequent builds.

.. attention:: As documented in :doc:`../General/install`, there is a :file:`--target package` option available
to build a installable package for Windows. This is only available to the MSYS2 environment. This does not
mean that you can not test an install using Visual Studio. After going to
:menuselection:`Build --> install Freeciv21` you can still manually start up the client or a server as needed
to debug. To do this you will start up either the client, the server, or both and then in Visual Studio go to
:menuselection:`Debug --> Attach to Process`
:file:`windows-debug` configuration preset as defined in :file:`CMakePresets.json`. On the
:guilabel:`Standard` toolbar, which is enabled by default, you will click the :guilabel:`Target System` drop
down box and pick the :strong:`Local Machine` option. Next you will click the :guilabel:`Configuration` drop
down box and pick the :strong:`windows-release` or :strong:`windows-debug` option. Visual Studio will then
automatically populate the :guilabel:`Build Preset` drop down box based on what you select for
:guilabel:`Configuration`. With these options set you will lastly click :menuselection:`Project --> Configure
Cache`. When this process is complete you can then compile (build) by clicking
:menuselection:`Build --> Build All`. Visual Studio will compile all targets for Freeciv21 and place the
output into the :file:`build-vs` directory. If you want to install Freeciv21 to test any work you are doing,
you can go to :menuselection:`Build --> install Freeciv21`. When complete, you should find a fully functional
install in the :file:`build-vs/install` directory.

.. note:: The first time you run the Configure Cache command (from
:menuselection:`Project --> Configure Cache`) or ask Visual Studio to generate the C++ Intellisense data,
Visual Studio will invoke the :file:`vcpkg` installation process to download and compile all of the project
dependencies listed in the manifest file: :file:`vcpkg.json`. :strong:`This will take a very long time`. On
a fast computer with a good Internet connection it will take at least 3 hours to complete. Everything will
be downloaded and compiled into the :file:`C:\\Tools\\vcpkg` directory, or wherever you configured
:file:`vcpkg` earlier. Binaries for the packages will be copied into the :file:`./build-vs/` directory
inside of the main Freeciv21 directory and reused for subsequent builds.

.. attention:: As documented in :doc:`../General/install`, there is a :file:`--target package` option
available to build an installable package for Windows. This is only available to the MSYS2 environment. This
does not mean that you can not test an install using Visual Studio. After going to
:menuselection:`Build --> install Freeciv21` you can still manually start up the client or a server as
needed to debug. To do this you will start up either the client, the server, or both and then in Visual
Studio go to :menuselection:`Debug --> Attach to Process`

:strong:`Notes about Clang-Cl vs MSVC`

Freeciv21 has two custom presets specifically for Windows and Visual Studio because Visual Studio defaults to the
MSVC compiler instead of LLVM's Clang-Cl compiler that we installed earlier. The main reason why we do this is
because the code requires proprietary extensions that MSVC doesn't implement. Instead the Longturn community supports
the open source LLVM Clang-Cl compiler on Windows in Visual Studio as it supports the required proprietary
extensions (note that GNU GCC is used in :doc:`MSYS2 <msys2>` on Windows). If you select any preset and allow
Visual Studio to configure with the Ninja generator and MSVC compiler you will recieve a great number of errors
and the build will fail.
Freeciv21 has two custom presets specifically for Windows and Visual Studio because Visual Studio defaults to
the MSVC compiler instead of LLVM's Clang-Cl compiler that we installed earlier. The main reason why we do
this is because the code requires proprietary extensions that MSVC does not implement. Instead the Longturn
community supports the open source LLVM Clang-Cl compiler on Windows in Visual Studio as it supports the
required proprietary extensions (note that GNU GCC is used in :doc:`MSYS2 <msys2>` on Windows). If you select
any preset and allow Visual Studio to configure with the Ninja generator and MSVC compiler you will receive a
great number of errors and the build will fail.

If you are interested in configuring and compiling from the command line instead of the GUI, you can use
these commands:
Expand All @@ -184,10 +188,10 @@ these commands:


The first command configures Visual Studio to compile a Debug version of the programs and places the install
location to be a sub-directory of the :file:`build-vs` directory for use during debugging and testing purposes.
This is the same as selecting the :file:`windows-debug` preset configuration. The second and third command then
"builds" and "installs" the configured code solution. You will need to manually start the client and/or server to
test.
location to be a sub-directory of the :file:`build-vs` directory for use during debugging and testing
purposes. This is the same as selecting the :file:`windows-debug` preset configuration. The second and third
command then "builds" and "installs" the configured code solution. You will need to manually start the client
and/or server to test.


.. |reg| unicode:: U+000AE .. REGISTERED SIGN
15 changes: 4 additions & 11 deletions docs/General/Manuals/client-manual.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,13 @@ Freeciv21 Client Manual

The Freeciv21 client (``freeciv21-client``) is the main user interface that allows one to play single player
and online multiplayer games. This manual will mostly track what is in the ``master`` branch of the Freeciv21
GitHub Repository at https://github.com/longturn/freeciv21/tree/master. You can see the date that the file was
last updated at the bottom of this page in the footer.
GitHub Repository at https://github.com/longturn/freeciv21/tree/master. You can see the date that this file
was last updated at the bottom of this page in the footer.

Getting Started
===============

If you have not installed Freeciv21, then obviously you need to start :doc:`there <../install>`. Precompiled
binaries are available for tagged releases and can be found on the LongTurn GitHub Repository for Freeciv21 at
https://github.com/longturn/freeciv21/releases. The LongTurn community provides binary packages for Debian
based Linux distros (Debian, Ubuntu, Mint, etc.), Windows, and MacOS. If you are an Arch Linux user, you can
find Freeciv21 in the AUR. If you want to get code that is closer to the ``master`` branch, you will want to
compile the code yourself. The :doc:`installation <../install>` document is mostly for Linux. However, you can
also compile on Windows with the :doc:`MSYS2 <../../Contributing/msys2>` environment or Microsoft :doc:`Visual
Studio <../../Contributing/visual-studio>`.
If you have not installed Freeciv21, then obviously you need to start :doc:`there <../install>`.

If you are having trouble, come find the LongTurn Community on Discord at https://discord.gg/98krqGm. A good
place to start is the ``#questions-and-answers`` channel.
Expand Down Expand Up @@ -106,7 +99,7 @@ administrator. You can right-click on a player's row to configure details about
games at the start of a new game. Subsequent logins to a game when you `Connect to Network Game`_ will not
require another ``take`` action. You can also use the server chat line and issue this command:
``/take <player>``
* :guilabel:`Pick Nation` -- Allows you to choose the Nation of the player. See `Pick Nation`_ below.
* :guilabel:`Pick Nation` -- Allows you to choose the Nation of the player. See `Nation`_ below.
* :guilabel:`Set Difficulty` -- Set the difficulty of the AI.
* :guilabel:`Put on Team` -- Combine players into teams.
* :guilabel:`AI Toggle Player` -- Toggle if the player is an AI or a human. This is needed before you can use
Expand Down
Loading