0
Fork 0
mirror of https://codeberg.org/librewolf/source.git synced 2024-12-22 05:33:03 -05:00
LibreWolf/README.md

123 lines
5.6 KiB
Markdown
Raw Normal View History

2021-11-20 01:57:42 -05:00
## Building LibreWolf from source:
2021-11-21 07:19:07 -05:00
First, let's **[download the latest tarball](https://gitlab.com/librewolf-community/browser/source/-/jobs/artifacts/main/raw/librewolf-95.0.2-3.source.tar.gz?job=build-job)**. This tarball is the latest produced by the CI.
2021-11-21 22:36:24 -05:00
To download the latest from a script, use wget/curl like this:
2021-11-21 22:34:04 -05:00
```
wget -O librewolf-95.0.2-3.source.tar.gz https://gitlab.com/librewolf-community/browser/source/-/jobs/artifacts/main/raw/librewolf-95.0.2-3.source.tar.gz?job=build-job
curl -L -o librewolf-95.0.2-3.source.tar.gz https://gitlab.com/librewolf-community/browser/source/-/jobs/artifacts/main/raw/librewolf-95.0.2-3.source.tar.gz?job=build-job
2021-11-21 22:34:04 -05:00
```
2021-11-21 02:52:50 -05:00
2021-12-27 18:55:58 -05:00
Next, we create ourselves a build folder and extract the tarball.
```
mkdir build
cd build
tar xf ../librewolf-95.0.2-3.source.tar.gz
2021-12-27 18:55:58 -05:00
```
Next step, if you have not done so already, you must _create the build environment_:
2021-12-27 18:55:58 -05:00
```
2021-12-29 00:17:59 -05:00
librewolf-95.0.2/lw/mozfetch.sh
2021-12-27 18:55:58 -05:00
```
This would create a _mozilla-unified_ folder in our 'build' folder, or basically anywhere that is your current working directory. It takes about an hour for me to complete, but it needs to be done only once. This step might fail and cause problems. Hack a bit, and if that fails you can ask on our [Gitter](https://gitter.im/librewolf-community/librewolf)/[Matrix](https://matrix.to/#/#librewolf:matrix.org) channels. There is no need to actually build _mozilla-unified_ (Mozilla Nightly) itself, nor is the folder needed to build LibreWolf. So you can remove it: `rm -rf mozilla-unfied` if you don't plan on using/exploring it.
Since Firefox 95.0, we need to install an additional library, the 'wasi sdk'. This library sandboxes wasm libraries, which is what we do want. The script to do this is: `setup-wasi-linux.sh` but it's still experimental for us.
So you have the option to either: setup the wasi sdk using _setup-wasi-linux.sh_ perhaps modifying it.
Or, the other option is to not use these sandbox libraries: In this case we can't use our standard _mozconfig_ symlink from _mozconfig.new_ into _mozconfig.new.without-wasi_. In that case you have to type something along the lines of:
```
cd librewolf-95.0.2
cp lw/mozconfig.new.without-wasi mozconfig
cd ..
```
2021-12-27 18:55:58 -05:00
Now we're ready to actually build LibreWolf:
```
2021-12-29 00:17:59 -05:00
cd librewolf-95.0.2
2021-12-27 18:55:58 -05:00
./mach build
```
Also takes me an hour. Then, we can run it:
```
./mach run
```
Or make a package:
```
./mach package
```
2021-12-29 01:00:40 -05:00
### I want to keep up to date with the latest, but compile myself
1. To first clone the repo:
```
git clone https://gitlab.com/librewolf-community/browser/source.git
cd source
make librewolf
```
2. To keep up-to-date:
```
git pull
make librewolf
```
2021-12-28 22:30:14 -05:00
## [dev info] How to use this repo instead of [Common](https://gitlab.com/librewolf-community/browser/common):
Since the dawn of time, we have used **Common** to get _patches_, _source_files_, including _source_files/{branding}_
2021-12-28 22:30:14 -05:00
2021-12-28 22:32:06 -05:00
This source repo supports all that, because it uses these same things to produce the tarball. As far as I can tell, the mapping from Common to Source would be:
2021-12-28 22:30:14 -05:00
* _[patches](https://gitlab.com/librewolf-community/browser/common/-/tree/master/patches)_ -> _[patches](https://gitlab.com/librewolf-community/browser/source/-/tree/main/patches)_
* _[source\_files](https://gitlab.com/librewolf-community/browser/common/-/tree/master/source_files)/search-config.json_ -> _[assets](https://gitlab.com/librewolf-community/browser/source/-/tree/main/assets)/search-config.json_
* _source\_files/browser/[branding](https://gitlab.com/librewolf-community/browser/common/-/tree/master/source_files/browser/branding)/librewolf_ -> _themes/browser/[branding](https://gitlab.com/librewolf-community/browser/source/-/tree/main/themes/browser/branding)/librewolf_
With this mapping, I hope that other builders that can't use our tarball (afterMozilla project, weird distro's), still use the same source/patches as the builders that do use it.
2021-12-28 22:37:46 -05:00
### Another feature
The file [assets/patches.txt](https://gitlab.com/librewolf-community/browser/source/-/blob/main/assets/patches.txt) defines what patches go in. These are not the only patches a builder will use, weird distro's etc, will use additional patches. those patches can live in the repo of that distro, or in a subfolder here. I hope this gives everybody the freedom to build anyway they please, like in Common, but with the added benefit that we produce a source tarball.
2021-12-28 22:30:14 -05:00
2021-12-30 08:02:06 -05:00
### Implementing a build script the new way:
The repository has a short [example shell script](https://gitlab.com/librewolf-community/browser/source/-/blob/main/scripts/fetch-build.sh) on how to use the new-style tarball approach instead of the older patching-it-yourself approach.
2021-12-28 22:30:14 -05:00
## [dev info] Building the LibreWolf source tarball:
2021-12-27 18:55:58 -05:00
Luckly, you don't need the build environment for this. If you don't have write access, just:
```
git clone https://gitlab.com/librewolf-community/browser/source.git
cd source
make all
```
If you **do** have write access, we're first gonna check for a newer version of Firefox:
```
git clone git@gitlab.com:librewolf-community/browser/source.git
cd source
make check
```
If there is a new version, it's a good time to git commit and trigger a CI build job.
```
git commit -am v$(cat version)-$(cat release) && git push
2021-12-27 18:55:58 -05:00
```
To build the source archive:
```
make all
```
If you have a working build environment, you can build librewolf with:
```
make librewolf
```
This extracts the source, and then tries to `./mach build && ./mach package`.
2021-12-29 00:54:09 -05:00
## FAQ: Common issues when setting up the Mozilla build environment
1. it doesnt find a suitable python.
```
export MACH_USE_SYSTEM_PYTHON=1
make librewolf
```
2. <python-package-1> requires <python-package-2, which is not installed.
```
pip3 install <python-package=2>
```
And retry.