Difference between revisions of "Fs2 open on Linux/Acquiring the Code"

From FreeSpace Wiki
Jump to: navigation, search
m (Reflect source code hosting via Git)
 
(One intermediate revision by the same user not shown)
Line 7: Line 7:
 
{{Note| This step is only for those who want the bleeding-edge source code to compile on their own. You can skip this if you intend to use a provided binary  
 
{{Note| This step is only for those who want the bleeding-edge source code to compile on their own. You can skip this if you intend to use a provided binary  
 
executable.}}
 
executable.}}
Before you begin, make sure you have write permissions on your current working directory. $HOME/$USER is a pretty safe bet. I recommend that you create a permanent /$HOME/$USER/src directory from which you run the git command, this way git will only update the files changed the next time you download the source and it's always nice to have things organized. Make sure you have git installed on your system. See the [[Fs2_open_on_Linux/Installing Git|Installing Git]] chapter on installing Git.
 
  
Now get the source. Run from a terminal:
+
This guide will walk the user through on how to acquire and download the source code locally to their machine.
  
$ git clone https://github.com/scp-fs2open/fs2open.github.com.git
+
<h1>For New Users</h1>
  
This will pull in the most recent source code from the 'master' branch.
+
This section of the code will explain on how to acquire the source code and download it to your system. For the sake of simplicity to new users, I am using Visual Studio Code to demonstrate on how to clone the source code.
<br>
+
 
 +
<h2>📖 Prerequisites</h2>
 +
 
 +
The following accounts will be required to get started with acquiring and downloading the code.
 +
 
 +
<ol>
 +
<li>git program</li>
 +
<li>GitHub Account</li>
 +
<li>Visual Studio Code</li>
 +
</ol>
 +
 
 +
<h3>ℹ️ INFORMATION</h3>
 +
 
 +
You will need to sign in to the GitHub account within Visual Studio Code to download the code seamlessly.
 +
 
 +
<h2>✅ Forking And Downloading The Code</h2>
 +
 
 +
It is usually a good practice to fork the code locally to your GitHub account. This will help in opening Pull Requests (PRs). On the FreeSpace Open GitHub page, please fork the code by pressing the fork button and following the instructions on the page.
 +
 
 +
Once the code has been forked, open the Visual Studio Code editor. In the editor, open the command palette (CTRL + SHIFT + P) and type
 +
 
 +
$ git clone (recursive)
 +
 
 +
A window shall pop up, asking where the files need to be cloned to. Please choose a location where the user has write access to, preferably under $HOME/$USER. For the sake of simplicity, I will be using
 +
 
 +
$HOME/$USER/Projects
 +
 
 +
The path to the FSO code should look like
 +
 
 +
$HOME/$USER/Projects/fs2open.github.com
 +
 
 +
If everything is done correctly, you'll be able to see the files in the Explorer tab in Visual Studio Code.
 +
 
 +
<h1>For Advanced Users</h1>
 +
 
 +
This section is for users who are already familiar with the git commands.
 +
 
 +
<h2>✅ Download The Repository Using Git</h2>
 +
 
 +
This requires the user to have downloaded and configured git on their system. Please see [[Fs2_open_on_Linux/Installing Git|Installing Git]] in case git has not been downloaded and configured.
 +
 
 +
To download the repository using git, the following command needs to be entered in a terminal:
 +
 
 +
$ git clone --recurse-submodules https://github.com/scp-fs2open/fs2open.github.com.git
 +
 
 +
Please be advised that the repository needs to be cloned to a location with read and write access to the user. A good location would be in
 +
 
 +
$HOME/$USER
 +
 
 +
<hr>
 +
 
 +
<h1>⚠️ ATTENTION</h1>
 +
<ul>
 +
<li>Please clone the repository recursively. If not cloned recursively, the code may not compile on your machine.</li>
 +
<li>In case you have cloned the code non-recursively, please remove the project directory and clone it recursively.</li>
 +
</ul>
 +
 
 +
<BR>
 +
 
 +
Once done, congratulations! You have the source code ready to be built!
  
 
[[Category:FreeSpace Open on Linux|Acquiring the Code]]
 
[[Category:FreeSpace Open on Linux|Acquiring the Code]]

Latest revision as of 06:05, 22 April 2025

« Installing the Development Libraries The fs2_open on Linux Guide
Acquiring the Code
Pre-Compile Configuration »

Note: This step is only for those who want the bleeding-edge source code to compile on their own. You can skip this if you intend to use a provided binary executable.

This guide will walk the user through on how to acquire and download the source code locally to their machine.

For New Users

This section of the code will explain on how to acquire the source code and download it to your system. For the sake of simplicity to new users, I am using Visual Studio Code to demonstrate on how to clone the source code.

📖 Prerequisites

The following accounts will be required to get started with acquiring and downloading the code.

  1. git program
  2. GitHub Account
  3. Visual Studio Code

ℹ️ INFORMATION

You will need to sign in to the GitHub account within Visual Studio Code to download the code seamlessly.

✅ Forking And Downloading The Code

It is usually a good practice to fork the code locally to your GitHub account. This will help in opening Pull Requests (PRs). On the FreeSpace Open GitHub page, please fork the code by pressing the fork button and following the instructions on the page.

Once the code has been forked, open the Visual Studio Code editor. In the editor, open the command palette (CTRL + SHIFT + P) and type

$ git clone (recursive)

A window shall pop up, asking where the files need to be cloned to. Please choose a location where the user has write access to, preferably under $HOME/$USER. For the sake of simplicity, I will be using

$HOME/$USER/Projects

The path to the FSO code should look like

$HOME/$USER/Projects/fs2open.github.com

If everything is done correctly, you'll be able to see the files in the Explorer tab in Visual Studio Code.

For Advanced Users

This section is for users who are already familiar with the git commands.

✅ Download The Repository Using Git

This requires the user to have downloaded and configured git on their system. Please see Installing Git in case git has not been downloaded and configured.

To download the repository using git, the following command needs to be entered in a terminal:

$ git clone --recurse-submodules https://github.com/scp-fs2open/fs2open.github.com.git

Please be advised that the repository needs to be cloned to a location with read and write access to the user. A good location would be in

$HOME/$USER

⚠️ ATTENTION

  • Please clone the repository recursively. If not cloned recursively, the code may not compile on your machine.
  • In case you have cloned the code non-recursively, please remove the project directory and clone it recursively.


Once done, congratulations! You have the source code ready to be built!