Project

General

Profile

SourceCode » History » Revision 48

Revision 47 (Kurtis Hanna, 12/01/2020 08:54 PM) → Revision 48/51 (Fil Lupin, 03/04/2023 02:01 PM)

h1. Source code 

 h2. Browsing the source code 

 The Replicant source code is currently hosted by the "FSF":https://www.fsf.org/ at: "git.replicant.us":https://git.replicant.us/replicant 

 There is one branch per Replicant version, such as @replicant-2.2@. 

 h2. Disk space 

 Before downloading the Replicant source code, make sure there is a considerable amount of disk space left on the drive you intend to build Replicant on. 
 It is advised to have 60-70GiB available for the Replicant source code and the produced files for one device. If you intend to build for multiple devices, every additional device will need ca. 17GiB. 

 h2. Source tree root folder 

 The path to the source tree root folder *must not contain spaces*. 

 

 h2. Installing the repo tool 

 *Warning: to install the repo tool for Replicant 6 and before, please follow instructions [[Replicant60BuildDependenciesInstallation#Debian-9-stretch|here]]* 
 *Following instructions are only to be followed for Replicant versions greater than 6.*   

 To be able download the complete source code, the "@repo@ tool":https://android.googlesource.com/tools/repo needs to be installed. The distribution you are using may already have the tool packaged and it may already been installed as part of the [[BuildDependenciesInstallation|Build dependencies installation]]. 

 It is recommended to install the @repo@ tool with the package manager. However, if the @repo@ tool is not available on your system, you can download and install it locally: 

 <pre> 
 mkdir tools 
 cd tools 
 wget https://commondatastorage.googleapis.com/git-repo-downloads/repo 
 chmod a+x repo 
 cd ../ 
 </pre> 

 In the following, it is assumed that @repo@ is installed from your system's package manager. If you have installed @repo@ locally in @../tools/repo@, replace 

 <pre> 
 repo 
 </pre> 

 with 
 <pre> 
 ../tools/repo 
 </pre> 

 at the beginning of the following commands. 

 

 h2. Initializing the repository 

 The source manifest is the list of all the git repositories that are present in the Replicant tree. 
 Each Replicant version has a dedicated branch with the proper source manifest. 

 h3. Replicant 6.0 release version 

 <pre> 
 mkdir replicant-6.0 
 cd replicant-6.0 
 repo init -u https://git.replicant.us/replicant/manifest.git -b replicant-6.0 
 </pre> 

 h3. Replicant 6.0 0004 RC2 

 <pre> 
 mkdir replicant-6.0 
 cd replicant-6.0 
 repo init -u https://git.replicant.us/replicant/manifest.git -b refs/tags/replicant-6.0-0004-rc2 
 </pre> 

 h3. Replicant 6.0 development version 

 <pre> 
 mkdir replicant-6.0-dev 
 cd replicant-6.0-dev 
 repo init -u https://git.replicant.us/replicant/manifest.git -b replicant-6.0-dev 
 </pre> 

 h3. Replicant 4.2 

 <pre> 
 mkdir replicant-4.2 
 cd replicant-4.2 
 repo init -u https://git.replicant.us/replicant/manifest.git -b replicant-4.2 
 </pre> 

 h3. Replicant 4.0 

 <pre> 
 mkdir replicant-4.0 
 cd replicant-4.0 
 repo init -u https://git.replicant.us/replicant/manifest.git -b replicant-4.0 
 </pre> 

 h3. Replicant 2.3 

 <pre> 
 mkdir replicant-2.3 
 cd replicant-2.3 
 repo init -u https://git.replicant.us/replicant/manifest.git -b replicant-2.3 
 </pre> 

 h3. Replicant 2.2 

 <pre> 
 mkdir replicant-2.2 
 cd replicant-2.2 
 repo init -u https://git.replicant.us/replicant/manifest.git -b replicant-2.2 
 </pre> 

 h2. Downloading/Updating the source code 

 Now that you have configured @repo@, you can start downloading Replicant sources for the desired version. 

 *This step is very long and can take hours to complete!* 

 <pre> 
 repo sync 
 </pre> 

 For the Replicant 6.0 release branch, it is possible and recommended to verify the signatures of the Git tags in all repositories:[[ReplicantSourceCodeTagsVerification]] 

 h3. Prebuilt apps 

 Once the source code is ready, you need to get the prebuilt applications (they are downloaded from F-Droid). Since Replicant 6.0, the prebuilt applications are checked if they were signed with the "F-Droid signing key":https://f-droid.org/wiki/page/Release_Channels_and_Signing_Keys. The signing key can be retrieved and added to your GPG keyring using: 

 <pre> 
 gpg --keyserver keys.gnupg.net --recv-key 37D2C98789D8311948394E3E41E7044E1DBA2E89 
 </pre> 

 Then you can download the prebuilts: 

 <pre> 
 vendor/replicant/get-prebuilts 
 </pre> 

 You must redo these steps each time you want to sync your tree, in order to keep it up to date. Future syncs are faster than the first one. 

 h2. Supported protocols for building Replicant 

 While the git.replicant.us git server supports @http://@, @https://@, @git://@, and @ssh://@ only @http://@ and @https://@ are supported for building Replicant. 

 This is because over time we need to move or rename repositories for various reasons. And in order to avoid breaking older Replicant versions (including specific releases that are tagged and that can't be modified anymore), we use @http://@ and @https://@ redirects, but we don't have any redirects with @git://@ or @ssh://@. 

 Using symlinks also doesn't scale as it has the side effect of making a repository appear multiple times in the cgit web interface that is used to display the repositories like the "Replicant specific repositories":https://git.replicant.us/replicant for instance.