Builder/README.md

195 lines
5.5 KiB
Markdown
Raw Normal View History

2024-11-20 01:49:30 +00:00
<p align="center">
<img src="https://weforge.xyz/Spitfire/Branding/raw/branch/main/active/browser/icon.svg" alt="Logo" width="64" height="64">
</p>
<p align="center" style="font-size: 32px;">
<strong>Spitfire Builder</strong>
</p>
<p align="center">
This is a "simple" script for building the Spitfire Browser based on Mozilla Firefox source code.
</p>
2024-12-08 14:34:31 +01:00
## Project Overview
Spitfire Builder script is a tool designed to automate the building, patching, packaging, and uploading of the Spitfire Browser, which is based on the Mozilla Firefox source code. It streamlines tasks like:
- Cloning and updating the Mozilla source repository.
- Applying patches for Spitfire.
- Building the browser for different platforms.
- Compressing and uploading builts to a remote server.
2024-11-20 01:49:30 +00:00
## Dependencies
- Mercurial (hg)
- Git
- Golang (tested with v1.21)
- Python 3.11 and pip3
2024-12-08 14:34:31 +01:00
## Flags
Below is a detailed description of all the flags supported by the Spitfire Builder script:
### **General Flags**
- **`-h`**:
Displays the help message and exits. Use this to see all available flags and their descriptions.
### **Build Process Flags**
- **`-a`**:
2024-12-21 22:02:29 +01:00
Perform all steps of the build process, including cleaning, updating the repository, building, and applying patches. (Without uploading)
2024-12-08 14:34:31 +01:00
- **`-b`**:
Compiles the source code without cleaning or updating.
- **`--clean`**:
Cleans the build directory by removing temporary or cached files.
2024-12-21 22:02:29 +01:00
- **`--full-clean`**:
Performs a full clean by removing all build artifacts (clobber).
2024-12-08 14:34:31 +01:00
- **`-u`**:
Updates the Mozilla source repository to the latest revision using Mercurial (`hg pull`).
2024-12-21 22:02:29 +01:00
- **`--pre-patch`**:
Applies pre-build patches to the source code.
- **`--post-patch`**:
Applies post-build patches to the built output.
- **`--skip-patch-update`**:
Skips updating the patches repository.
2024-12-08 14:34:31 +01:00
- **`-r`**:
Runs the built project after the build process completes successfully.
2025-02-13 07:23:16 +00:00
- **`--skip-deps`**:
Skip checking for required system dependencies.
2024-12-08 14:34:31 +01:00
### **Compression and Upload Flags**
- **`-c`**:
Compresses the build output into a `.tar.gz` file. Use with the `--upload-path` flag to specify the directory to compress.
- **`--upload`**:
Uploads the compressed build file to a remote server (e.g., SourceForge). Requires a configuration file (`sourceforge_config.json`) to define upload parameters.
- **`--upload-path=<path>`**:
Specifies the directory or file to upload. This is required for both compression and uploading.
### **Customization Flags**
- **`-t=<target>`**:
Sets the target format for the build output. The format follows `component-arch-release-platform`.
- **`-v=<version>`**:
Defines the version of the package. For nightly builds, the current date is used by default.
- **`--component=<name>`**:
Sets the name of the component being built (default: 'browser').
- **`--arch=<architecture>`**:
Specifies the architecture for the build (default: system architecture, e.g., `amd64`).
- **`--release=<type>`**:
Specifies the release type (`stable`, `nightly`, etc.). Default is `nightly`.
- **`--platform=<platform>`**:
Sets the platform for the build (default: system platform, e.g., `linux`).
## Example usage:
2025-02-13 07:23:16 +00:00
- **All build steps**:
2024-11-20 01:49:30 +00:00
```sh
go run . -a
```
2025-02-13 07:23:16 +00:00
- **All build setps without fetching new patches**:
2024-12-08 14:34:31 +01:00
```sh
2025-02-13 07:23:16 +00:00
go run . -a --skip-patch-update
2024-12-08 14:34:31 +01:00
```
2024-11-20 01:49:30 +00:00
2024-12-08 14:34:31 +01:00
- **Upload**:
2024-11-20 01:49:30 +00:00
```sh
2025-02-13 07:23:16 +00:00
go run . --upload -c
2024-11-20 01:49:30 +00:00
```
2024-12-08 14:34:31 +01:00
- **Build and upload**:
2024-11-20 01:49:30 +00:00
```sh
2025-02-13 07:23:16 +00:00
go run . --upload -c -a
2024-11-20 01:49:30 +00:00
```
2024-12-08 14:34:31 +01:00
- **Display all flags**:
2024-11-20 01:49:30 +00:00
```sh
go run . -h
```
2024-12-08 14:34:31 +01:00
## Config file for uploading example:
2024-11-20 01:49:30 +00:00
*sourceforge_config.json*
```json
{
"SFKeyPath": "~/.ssh/id_rsa.pub",
"SFUser": "internet-addict",
"SFHost": "web.sourceforge.net",
"SFProject": "spitfire-browser"
}
```
## APPINDEX example:
```
2024-12-23 11:24:42 +01:00
C:a6af7ebb5c1382084704be0b5714ab026c819d63
P:spitfire-browser
2024-11-20 01:49:30 +00:00
R:nightly
2024-12-23 11:24:42 +01:00
V:2024.12.23
2024-11-20 01:49:30 +00:00
A:amd64
2024-12-23 11:24:42 +01:00
S:838594187
I:3595780372
T:Spitfire
2024-12-08 14:34:31 +01:00
U:https://spitfirebrowser.xyz/
2024-11-20 01:49:30 +00:00
L:AGPL-3.0
o:browser
m:Internet Addict
2024-12-23 11:24:42 +01:00
t:1734949294
2024-11-20 01:49:30 +00:00
D:
p:linux
q:
2024-12-23 11:24:42 +01:00
d:https://downloads.sourceforge.net/project/spitfire-browser/browser/amd64/nightly/2024.12.23/browser-amd64-nightly-linux.tar.gz
I:https://weforge.xyz/Spitfire/Branding/raw/branch/main/active/browser/icon.svg
S:https://spitfirebrowser.xyz/static/images/screenshots/1.png
T:browser,experimental,testing
r: Automated Nightly build of Spitfire
c:a6af7ebb5c1382084704be0b5714ab026c819d63
2024-11-20 01:49:30 +00:00
```
2024-12-08 14:34:31 +01:00
## Repository structure
2024-11-20 01:49:30 +00:00
2025-02-13 07:23:16 +00:00
[Link to repositary](https://sourceforge.net/projects/spitfire-browser/)
2024-11-20 01:49:30 +00:00
```
spitfire-browser/
├── browser/
│ ├── amd64/
│ │ ├── stable/
2025-02-13 07:23:16 +00:00
│ │ │ ├── vx.x.x/deb.tar.gz
2024-11-20 01:49:30 +00:00
│ │ ├── nightly/
│ │ ├── yyyy-mm-dd/deb.tar.gz
│ ├── arm/
│ │ ├── stable/
2025-02-13 07:23:16 +00:00
│ │ │ ├── vx.x.x/
2024-11-20 01:49:30 +00:00
│ │ ├── nightly/
│ │ ├── yyyy-mm-dd/
2025-02-13 07:23:16 +00:00
├── luncher/
2024-11-20 01:49:30 +00:00
│ ├── stable/
2025-02-13 07:23:16 +00:00
│ │ ├── vx.x.x/
2024-11-20 01:49:30 +00:00
│ ├── nightly/
│ ├── yyyy-mm-dd/
2025-02-13 07:23:16 +00:00
├── installer/
2024-11-20 01:49:30 +00:00
│ ├── stable/
2025-02-13 07:23:16 +00:00
│ │ ├── vx.x.x/
2024-11-20 01:49:30 +00:00
│ ├── nightly/
│ ├── yyyy-mm-dd/
2025-02-13 07:23:16 +00:00
├── addons/ (planned)
2024-11-20 01:49:30 +00:00
│ ├── themes/
│ │ ├── stable/
│ │ │ ├── x.x.x/
│ │ ├── nightly/
│ │ ├── yyyy-mm-dd/
│ ├── custom-configs/
│ │ ├── stable/
│ │ │ ├── x.x.x/
│ │ ├── nightly/
│ │ ├── yyyy-mm-dd/
│ ├── search-engines/
│ ├── stable/
│ │ ├── x.x.x/
│ ├── nightly/
│ ├── yyyy-mm-dd/
├── APPINDEX
```