0
Fork 0
mirror of https://codeberg.org/librewolf/source.git synced 2024-12-22 05:33:03 -05:00
LibreWolf - Source Archive
Find a file
Bert van der Weerd d22449b58d
readme
2022-02-03 10:37:03 +01:00
assets removed upstream choices, where not used. 2022-02-03 09:27:17 +01:00
patches add bootstrap-without-vsc.patch 2022-02-02 21:09:37 +01:00
scripts Custom uBO assets.json patch 2022-01-26 10:30:39 +00:00
submodules removed pref-pane submodule 2022-02-03 10:17:35 +01:00
themes/browser check the version in about menu 2022-02-01 16:54:05 +01:00
.gitignore inbetween commits 2022-01-08 22:55:25 +01:00
.gitlab-ci.yml now using recursive git submodule strategy 2022-01-24 13:18:33 +01:00
.gitmodules removed pref-pane submodule 2022-02-03 10:17:35 +01:00
LICENSE Add LICENSE 2021-11-19 17:42:30 +00:00
Makefile bugfixes 2022-02-03 09:32:20 +01:00
README.md readme 2022-02-03 10:37:03 +01:00
README.md.in readme 2022-02-03 10:36:29 +01:00
release v96.0.3-1 2022-01-27 20:51:39 +01:00
version v96.0.3-1 2022-01-27 20:51:39 +01:00

The LibreWolf build instructions

  1. Clone the git repository via https:
git clone --recursive https://gitlab.com/librewolf-community/browser/source.git

or Git:

git clone --recursive git@gitlab.com:librewolf-community/browser/source.git

cd into it, build the LibreWolf tarball, bootstrap the buld environment, and finally, perform the build:

cd source
make all
make bootstrap
make build

After that, you can either build a tarball from it, or run it:

make package
make run

The easiest way to make patches is to go to the LibreWolf source folder:

cd librewolf-$(cat version)
git init
git add <path_to_file_you_changed>
git commit -am initial-commit
git diff > ../mypatch.patch

We have Gitter / Matrix rooms, and on the website we have links to the various issue trackers.

Building LibreWolf with a tarball instead of git:

First, let's download the latest tarball. This tarball is the latest produced by the CI.

tar xf <tarball>
cd <folder>
make bootstrap build package

That should be it for this readme, the stuff below is for more internal backward compatibility. So you can safely ignore it.

CI and Docker

To download the latest from a script, use wget/curl like this:

wget -O librewolf-96.0.3-1.source.tar.gz https://gitlab.com/librewolf-community/browser/source/-/jobs/artifacts/main/raw/librewolf-96.0.3-1.source.tar.gz?job=Build
curl -L -o librewolf-96.0.3-1.source.tar.gz https://gitlab.com/librewolf-community/browser/source/-/jobs/artifacts/main/raw/librewolf-96.0.3-1.source.tar.gz?job=Build

Next, we create ourselves a build folder and extract the tarball.

mkdir build
cd build
tar xf ../librewolf-96.0.3-1.source.tar.gz

build environment

Next step, if you have not done so already, you must create the build environment:

./librewolf-96.0.3/lw/mozfetch.sh

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/Matrix 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.

wasi sdk

Since Firefox 95.0, we need to install an additional library, the 'wasi sdk'. This library sandboxes wasm libraries, which is what we want, but it's still experimental for us to include properly.

A few resources:

To setup the wasi sdk headers, you can use librewolf-96.0.3/lw/setup-wasi-linux.sh. Please note that this script is a bit experimental and not all kinks have been worked out, but it should work. This might not be enough on all systems. Some systems have the wasi-libc library already installed, and some don't. It depends on the installed version of Clang/LLVM it seems, which should be v8 or above. On debian-based systems: sudo apt install wasi-libc, on Arch: https://archlinux.org/packages/community/any/wasi-libc/ (pacman -Syu wasi-libc). Instructions for macos/windows and perhaps other Linux distro's will be added here soon.

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-96.0.3
cp lw/mozconfig.new.without-wasi mozconfig
cd ..

building librewolf

Now we're ready to actually build LibreWolf:

cd librewolf-96.0.3
./mach build

Also takes me an hour. Then, we can run it:

./mach run

Or make a package:

./mach package

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
  1. To keep up-to-date:
git pull
make librewolf

[dev info] How to use this repo instead of Common:

Since the dawn of time, we have used Common to get patches, source_files, including source_files/{branding}

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:

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.

Another feature

The file 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.

Implementing a build script the new way:

The repository has a short example shell script on how to use the new-style tarball approach instead of the older patching-it-yourself approach.

[dev info] Building the LibreWolf source tarball:

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

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.

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
  1. requires <python-package-2, which is not installed.
pip3 install <python-package-2>

And retry.