diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c4ae324..00516b8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,11 +1,49 @@ stages: - build + - release -build-job: +Build: stage: build + variables: + GIT_SUBMODULE_STRATEGY: recursive script: - make all + - echo VERSION=$(cat version) >> variables.env + - echo RELEASE=$(cat release) >> variables.env artifacts: paths: - - librewolf-*.source.* + - librewolf-*.source.tar.gz + reports: + dotenv: variables.env +Release: + stage: release + when: manual + allow_failure: false + image: ubuntu + needs: + - job: "Build" + artifacts: true + only: + - main + except: + - merge_requests + before_script: + - apt-get update + - apt-get install -y curl + - curl -L --output /usr/local/bin/release-cli "https://release-cli-downloads.s3.amazonaws.com/latest/release-cli-linux-amd64" + - chmod +x /usr/local/bin/release-cli + script: + - | + curl \ + --header "JOB-TOKEN: $CI_JOB_TOKEN" \ + --upload-file librewolf-$VERSION-$RELEASE.source.tar.gz \ + "$CI_API_V4_URL/projects/$CI_PROJECT_ID/packages/generic/librewolf-source/$VERSION-$RELEASE/librewolf-$VERSION-$RELEASE.source.tar.gz" + release: + tag_name: "$VERSION-$RELEASE" + description: "LibreWolf v$VERSION-$RELEASE" + assets: + links: + - name: librewolf-$VERSION-$RELEASE.source.tar.gz + link_type: package + url: $CI_API_V4_URL/projects/$CI_PROJECT_ID/packages/generic/librewolf-source/$VERSION-$RELEASE/librewolf-$VERSION-$RELEASE.source.tar.gz diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..f48d85d --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "submodules/settings"] + path = submodules/settings + url = https://gitlab.com/librewolf-community/settings.git diff --git a/Makefile b/Makefile index 63b42a6..fb6b58b 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY : all help clean veryclean librewolf-patches check librewolf +.PHONY : help check all clean veryclean bootstrap build package run update version:=$(shell cat ./version) release:=$(shell cat ./release) @@ -9,67 +9,87 @@ release:=$(shell cat ./release) #ext=.tar.xz archive_create=tar cfz ext=.tar.gz -#archive_create=zip -r9 -#ext=.zip + +upstream_filename=firefox-$(version).source.tar.xz +upstream_dirname=firefox-$(version) -help : README.md +help : @echo "use: $(MAKE) [all] [check] [clean] [veryclean] [build] [package] [run]" @echo "" @echo " all - Make LibreWolf source archive ${version}-${release}." @echo " check - Check if there is a new version of Firefox." + @echo " update - Update the git submodules and README.md." @echo "" @echo " clean - Clean everything except the upstream firefox tarball." - @echo " veryclean - Clean everything and the firefox tarball." + @echo " veryclean - Clean everything including the firefox tarball." @echo "" - @echo " build - Make LibreWolf source archive and then build it." - @echo " package - Make LibreWolf source archive, then build and package it." - @echo " run - Make LibreWolf source archive, then build and run it." + @echo " bootstrap - Make librewolf source archive, and bootstrap the build system." + @echo "" + @echo " build - After a bootstrap, build it." + @echo " package - After a build, package it." + @echo " run - After a build, run it." @echo "" -check : README.md - @python3 scripts/update-version.py +check : + python3 scripts/update-version.py @echo "Current release:" $$(cat ./release) -include upstream.mk - - -all : librewolf-$(version)-$(release).source$(ext) README.md - - -clean : - rm -rf *~ firefox-$(version) librewolf-$(version) librewolf-$(version)-$(release).source$(ext) - -veryclean : clean - $(MAKE) clean_upstream_file - rm -rf librewolf-$(version) - -librewolf-$(version)-$(release).source$(ext) : $(upstream_filename) ./version ./release scripts/librewolf-patches.py assets/mozconfig assets/patches.txt README.md - $(MAKE) clean_upstream_dir - rm -rf librewolf-$(version) - $(MAKE) create_lw_from_upstream_dir - python3 scripts/librewolf-patches.py $(version) - rm -f librewolf-$(version)-$(release).source$(ext) - $(archive_create) librewolf-$(version)-$(release).source$(ext) librewolf-$(version) - rm -rf librewolf-$(version) - -librewolf-$(version) : librewolf-$(version)-$(release).source$(ext) - tar xf librewolf-$(version)-$(release).source$(ext) - -build : librewolf-$(version) - (cd librewolf-$(version) && ./mach build) - -package : build - (cd librewolf-$(version) && ./mach package) - -run : build - (cd librewolf-$(version) && ./mach run) +update : README.md + git submodule update --recursive --remote README.md : README.md.in ./version ./release @sed "s/__VERSION__/$(version)/g" < $< > tmp @sed "s/__RELEASE__/$(release)/g" < tmp > $@ @rm -f tmp + +all : librewolf-$(version)-$(release).source$(ext) + + +clean : + rm -rf *~ firefox-$(version) librewolf-$(version) librewolf-$(version)-$(release).source$(ext) + +veryclean : clean + rm -f $(upstream_filename) + +# +# The actual build stuff +# + + +$(upstream_filename) : + wget -q "https://archive.mozilla.org/pub/firefox/releases/$(version)/source/firefox-$(version).source.tar.xz" + +librewolf-$(version)-$(release).source$(ext) : $(upstream_filename) ./version ./release scripts/librewolf-patches.py assets/mozconfig assets/patches.txt + rm -rf $(upstream_dirname) + rm -rf librewolf-$(version) + tar xf $(upstream_filename) + mv $(upstream_dirname) librewolf-$(version) + python3 scripts/librewolf-patches.py $(version) $(release) + rm -f librewolf-$(version)-$(release).source$(ext) + $(archive_create) librewolf-$(version)-$(release).source$(ext) librewolf-$(version) + touch librewolf-$(version) + +librewolf-$(version) : librewolf-$(version)-$(release).source$(ext) + tar xf librewolf-$(version)-$(release).source$(ext) + +debs=python3 python3-dev python3-pip +rpms=python3 python3-devel +bootstrap : librewolf-$(version) + (sudo apt -y install $(debs); true) + (sudo rpm -y install $(rpms); true) + (cd librewolf-$(version) && MOZBUILD_STATE_PATH=$$HOME/.mozbuild ./mach --no-interactive bootstrap --application-choice=browser) + +build : + (cd librewolf-$(version) && ./mach build) + +package : + (cd librewolf-$(version) && ./mach package) + +run : + (cd librewolf-$(version) && ./mach run) + diff --git a/README.md b/README.md index e37abf8..67d91b5 100644 --- a/README.md +++ b/README.md @@ -1,136 +1,75 @@ -## Building LibreWolf from source: +## LibreWolf build instructions -First, let's **[download the latest tarball](https://gitlab.com/librewolf-community/browser/source/-/jobs/artifacts/main/raw/librewolf-96.0.1-1.source.tar.gz?job=build-job)**. This tarball is the latest produced by the [CI](https://gitlab.com/librewolf-community/browser/source/-/jobs). - -To download the latest from a script, use wget/curl like this: +First, let's **[download the latest tarball](https://gitlab.com/librewolf-community/browser/source/-/jobs/artifacts/main/raw/librewolf-96.0.3-2.source.tar.gz?job=Build)**. This tarball is the latest produced by the [CI](https://gitlab.com/librewolf-community/browser/source/-/jobs). ``` -wget -O librewolf-96.0.1-1.source.tar.gz https://gitlab.com/librewolf-community/browser/source/-/jobs/artifacts/main/raw/librewolf-96.0.1-1.source.tar.gz?job=build-job -curl -L -o librewolf-96.0.1-1.source.tar.gz https://gitlab.com/librewolf-community/browser/source/-/jobs/artifacts/main/raw/librewolf-96.0.1-1.source.tar.gz?job=build-job +tar xf +cd +make bootstrap build package run ``` +#### How to make a patch: -Next, we create ourselves a build folder and extract the tarball. - +The easiest way to make patches is to go to the LibreWolf source folder: ``` -mkdir build -cd build -tar xf ../librewolf-96.0.1-1.source.tar.gz +cd librewolf-$(cat version) +git init +git add +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. -### build environment +#### Building LibreWolf with git: -Next step, if you have not done so already, you must _create the build environment_: +1. Clone the git repository via https: ``` -./librewolf-96.0.1/lw/mozfetch.sh +git clone --recursive https://gitlab.com/librewolf-community/browser/source.git ``` -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. - -#### 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: -* mozilla.org: [WebAssembly and Back Again: Fine-Grained Sandboxing in Firefox 95](https://hacks.mozilla.org/2021/12/webassembly-and-back-again-fine-grained-sandboxing-in-firefox-95/). -* [Compiling C to WebAssembly using clang/LLVM and WASI](https://00f.net/2019/04/07/compiling-to-webassembly-with-llvm-and-clang/). -* [Firefox 95 on POWER](https://www.talospace.com/2021/12/firefox-95-on-power.html). - -To setup the wasi sdk _headers_, you can use _librewolf-96.0.1/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: +or Git: ``` -cd librewolf-96.0.1 -cp lw/mozconfig.new.without-wasi mozconfig -cd .. +git clone --recursive git@gitlab.com:librewolf-community/browser/source.git ``` -### building librewolf +cd into it, build the LibreWolf tarball, bootstrap the build 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 +``` +#### How to create a patch for problems in Mozilla's [Bugzilla](https://bugzilla.mozilla.org/). -Now we're ready to actually build LibreWolf: +Well, first of all: + +* [Create an account](https://bugzilla.mozilla.org/createaccount.cgi). +* Handy link: [Bugs Filed Today](https://bugzilla.mozilla.org/buglist.cgi?cmdtype=dorem&remaction=run&namedcmd=Bugs%20Filed%20Today&sharer_id=1&list_id=15939480). +* The essential: [Firefox Source Tree Documentation](https://firefox-source-docs.mozilla.org/). + +Now that you have a patch in LibreWolf, that's not enough to upload to Mozilla. See, Mozilla only accepts patches against Nightly. So here is how to do that: ``` -cd librewolf-96.0.1 +hg clone https://hg.mozilla.org/mozilla-unified +cd mozilla-unified +hg update +MOZBUILD_STATE_PATH=$HOME/.mozbuild ./mach --no-interactive bootstrap --application-choice=browser ./mach build -``` -Also takes me an hour. Then, we can run it: -``` ./mach run ``` -Or make a package: +Now you can apply your patch to Nightly: ``` -./mach package +patch -p1 -i ../mypatch.patch ``` +Now you let Mercurial create the patch: +``` +hg diff > ../my-nightly-patch.patch +``` +And it can be uploaded to Bugzilla. -### I want to keep up to date with the latest, but compile myself +##### *(copy of Mozilla readme)* Now the fun starts -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 -``` +Time to start hacking! You should join us on [Matrix](https://chat.mozilla.org/), say hello in the [Introduction channel](https://chat.mozilla.org/#/room/#introduction:mozilla.org), and [find a bug to start working on](https://codetribute.mozilla.org/). See the [Firefox Contributors’ Quick Reference](https://firefox-source-docs.mozilla.org/contributing/contribution_quickref.html#firefox-contributors-quick-reference) to learn how to test your changes, send patches to Mozilla, update your source code locally, and more. -## [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}_ - -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: - -* _[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. - -### 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. - -### 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. - -## [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 -``` -2. requires -``` -And retry. +#### Hey, I'm using a Mac or Windows :( +We understand, life isn't always fair 😺. The same steps as above do apply, you'll just have to walk through the beginning part of the guides for [MacOS](https://firefox-source-docs.mozilla.org/setup/macos_build.html), [Windows](https://firefox-source-docs.mozilla.org/setup/windows_build.html). diff --git a/README.md.in b/README.md.in index a26b5d6..a818052 100644 --- a/README.md.in +++ b/README.md.in @@ -1,136 +1,75 @@ -## Building LibreWolf from source: +## LibreWolf build instructions -First, let's **[download the latest tarball](https://gitlab.com/librewolf-community/browser/source/-/jobs/artifacts/main/raw/librewolf-__VERSION__-__RELEASE__.source.tar.gz?job=build-job)**. This tarball is the latest produced by the [CI](https://gitlab.com/librewolf-community/browser/source/-/jobs). - -To download the latest from a script, use wget/curl like this: +First, let's **[download the latest tarball](https://gitlab.com/librewolf-community/browser/source/-/jobs/artifacts/main/raw/librewolf-__VERSION__-__RELEASE__.source.tar.gz?job=Build)**. This tarball is the latest produced by the [CI](https://gitlab.com/librewolf-community/browser/source/-/jobs). ``` -wget -O librewolf-__VERSION__-__RELEASE__.source.tar.gz https://gitlab.com/librewolf-community/browser/source/-/jobs/artifacts/main/raw/librewolf-__VERSION__-__RELEASE__.source.tar.gz?job=build-job -curl -L -o librewolf-__VERSION__-__RELEASE__.source.tar.gz https://gitlab.com/librewolf-community/browser/source/-/jobs/artifacts/main/raw/librewolf-__VERSION__-__RELEASE__.source.tar.gz?job=build-job +tar xf +cd +make bootstrap build package run ``` +#### How to make a patch: -Next, we create ourselves a build folder and extract the tarball. - +The easiest way to make patches is to go to the LibreWolf source folder: ``` -mkdir build -cd build -tar xf ../librewolf-__VERSION__-__RELEASE__.source.tar.gz +cd librewolf-$(cat version) +git init +git add +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. -### build environment +#### Building LibreWolf with git: -Next step, if you have not done so already, you must _create the build environment_: +1. Clone the git repository via https: ``` -./librewolf-__VERSION__/lw/mozfetch.sh +git clone --recursive https://gitlab.com/librewolf-community/browser/source.git ``` -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. - -#### 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: -* mozilla.org: [WebAssembly and Back Again: Fine-Grained Sandboxing in Firefox 95](https://hacks.mozilla.org/2021/12/webassembly-and-back-again-fine-grained-sandboxing-in-firefox-95/). -* [Compiling C to WebAssembly using clang/LLVM and WASI](https://00f.net/2019/04/07/compiling-to-webassembly-with-llvm-and-clang/). -* [Firefox 95 on POWER](https://www.talospace.com/2021/12/firefox-95-on-power.html). - -To setup the wasi sdk _headers_, you can use _librewolf-__VERSION__/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: +or Git: ``` -cd librewolf-__VERSION__ -cp lw/mozconfig.new.without-wasi mozconfig -cd .. +git clone --recursive git@gitlab.com:librewolf-community/browser/source.git ``` -### building librewolf +cd into it, build the LibreWolf tarball, bootstrap the build 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 +``` +#### How to create a patch for problems in Mozilla's [Bugzilla](https://bugzilla.mozilla.org/). -Now we're ready to actually build LibreWolf: +Well, first of all: + +* [Create an account](https://bugzilla.mozilla.org/createaccount.cgi). +* Handy link: [Bugs Filed Today](https://bugzilla.mozilla.org/buglist.cgi?cmdtype=dorem&remaction=run&namedcmd=Bugs%20Filed%20Today&sharer_id=1&list_id=15939480). +* The essential: [Firefox Source Tree Documentation](https://firefox-source-docs.mozilla.org/). + +Now that you have a patch in LibreWolf, that's not enough to upload to Mozilla. See, Mozilla only accepts patches against Nightly. So here is how to do that: ``` -cd librewolf-__VERSION__ +hg clone https://hg.mozilla.org/mozilla-unified +cd mozilla-unified +hg update +MOZBUILD_STATE_PATH=$HOME/.mozbuild ./mach --no-interactive bootstrap --application-choice=browser ./mach build -``` -Also takes me an hour. Then, we can run it: -``` ./mach run ``` -Or make a package: +Now you can apply your patch to Nightly: ``` -./mach package +patch -p1 -i ../mypatch.patch ``` +Now you let Mercurial create the patch: +``` +hg diff > ../my-nightly-patch.patch +``` +And it can be uploaded to Bugzilla. -### I want to keep up to date with the latest, but compile myself +##### *(copy of Mozilla readme)* Now the fun starts -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 -``` +Time to start hacking! You should join us on [Matrix](https://chat.mozilla.org/), say hello in the [Introduction channel](https://chat.mozilla.org/#/room/#introduction:mozilla.org), and [find a bug to start working on](https://codetribute.mozilla.org/). See the [Firefox Contributors’ Quick Reference](https://firefox-source-docs.mozilla.org/contributing/contribution_quickref.html#firefox-contributors-quick-reference) to learn how to test your changes, send patches to Mozilla, update your source code locally, and more. -## [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}_ - -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: - -* _[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. - -### 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. - -### 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. - -## [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 -``` -2. requires -``` -And retry. +#### Hey, I'm using a Mac or Windows :( +We understand, life isn't always fair 😺. The same steps as above do apply, you'll just have to walk through the beginning part of the guides for [MacOS](https://firefox-source-docs.mozilla.org/setup/macos_build.html), [Windows](https://firefox-source-docs.mozilla.org/setup/windows_build.html). diff --git a/assets/old-docs.md b/assets/old-docs.md new file mode 100644 index 0000000..0d30340 --- /dev/null +++ b/assets/old-docs.md @@ -0,0 +1,144 @@ + +That should be it for this readme, the stuff below is for more internal backward compatibility. So you can safely ignore it. + + + + + + +# CI documentation, wasi, and Docker + + + + +To download the latest from a script, use wget/curl like this: +``` +wget -O librewolf-__VERSION__-__RELEASE__.source.tar.gz https://gitlab.com/librewolf-community/browser/source/-/jobs/artifacts/main/raw/librewolf-__VERSION__-__RELEASE__.source.tar.gz?job=Build +curl -L -o librewolf-__VERSION__-__RELEASE__.source.tar.gz https://gitlab.com/librewolf-community/browser/source/-/jobs/artifacts/main/raw/librewolf-__VERSION__-__RELEASE__.source.tar.gz?job=Build +``` + +Next, we create ourselves a build folder and extract the tarball. + +``` +mkdir build +cd build +tar xf ../librewolf-__VERSION__-__RELEASE__.source.tar.gz +``` + +### build environment + +Next step, if you have not done so already, you must _create the build environment_: +``` +./librewolf-__VERSION__/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](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. + +#### 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: +* mozilla.org: [WebAssembly and Back Again: Fine-Grained Sandboxing in Firefox 95](https://hacks.mozilla.org/2021/12/webassembly-and-back-again-fine-grained-sandboxing-in-firefox-95/). +* [Compiling C to WebAssembly using clang/LLVM and WASI](https://00f.net/2019/04/07/compiling-to-webassembly-with-llvm-and-clang/). +* [Firefox 95 on POWER](https://www.talospace.com/2021/12/firefox-95-on-power.html). + +To setup the wasi sdk _headers_, you can use _librewolf-__VERSION__/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-__VERSION__ +cp lw/mozconfig.new.without-wasi mozconfig +cd .. +``` +### building librewolf + +Now we're ready to actually build LibreWolf: +``` +cd librewolf-__VERSION__ +./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 +``` +2. To keep up-to-date: +``` +git pull +make librewolf +``` + +## [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}_ + +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: + +* _[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. + +### 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. + +### 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. + +## [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 +``` +2. requires +``` +And retry. diff --git a/assets/patches.txt b/assets/patches.txt index 4b8884f..0cd150e 100644 --- a/assets/patches.txt +++ b/assets/patches.txt @@ -1,6 +1,9 @@ patches/allow-ubo-private-mode.patch +patches/bootstrap-without-vcs.patch patches/context-menu.patch +patches/custom-ubo-assets-bootstrap-location.patch patches/disable-data-reporting-at-compile-time.patch +patches/librewolf-pref-pane.patch patches/mozilla-vpn-ad.patch patches/mozilla_dirs.patch patches/mozilla-kde.patch @@ -18,4 +21,3 @@ patches/ui-patches/remove-organization-policy-banner.patch patches/ui-patches/remove-snippets-from-home.patch patches/ui-patches/sanitizing-description.patch patches/urlbarprovider-interventions.patch -patches/xmas.patch diff --git a/assets/uBOAssets.json b/assets/uBOAssets.json new file mode 100644 index 0000000..cb51e1e --- /dev/null +++ b/assets/uBOAssets.json @@ -0,0 +1 @@ +{"assets.json":{"content":"internal","updateAfter":7,"contentURL":"https://gitlab.com/librewolf-community/browser/source/-/raw/main/assets/uBOAssets.json"},"public_suffix_list.dat":{"content":"internal","updateAfter":19,"contentURL":["https://publicsuffix.org/list/public_suffix_list.dat","https://gitcdn.xyz/repo/publicsuffix/list/master/public_suffix_list.dat","assets/thirdparties/publicsuffix.org/list/effective_tld_names.dat"]},"ublock-badlists":{"content":"internal","updateAfter":13,"contentURL":["https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/badlists.txt","assets/ublock/badlists.txt"],"cdnURLs":["https://gitcdn.xyz/repo/uBlockOrigin/uAssets/master/filters/badlists.txt","https://cdn.jsdelivr.net/gh/uBlockOrigin/uAssets@master/filters/badlists.txt","https://cdn.statically.io/gh/uBlockOrigin/uAssets/master/filters/badlists.txt","https://combinatronics.io/uBlockOrigin/uAssets/master/filters/badlists.txt"]},"ublock-filters":{"content":"filters","group":"default","title":"uBlock filters","contentURL":["https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/filters.txt","assets/ublock/filters.txt"],"cdnURLs":["https://gitcdn.xyz/repo/uBlockOrigin/uAssets/master/filters/filters.txt","https://cdn.jsdelivr.net/gh/uBlockOrigin/uAssets@master/filters/filters.txt","https://cdn.statically.io/gh/uBlockOrigin/uAssets/master/filters/filters.txt","https://combinatronics.io/uBlockOrigin/uAssets/master/filters/filters.txt","https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/filters.txt"],"supportURL":"https://github.com/uBlockOrigin/uAssets/issues"},"ublock-badware":{"content":"filters","group":"default","title":"uBlock filters – Badware risks","contentURL":["https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/badware.txt","assets/ublock/badware.txt"],"cdnURLs":["https://gitcdn.xyz/repo/uBlockOrigin/uAssets/master/filters/badware.txt","https://cdn.jsdelivr.net/gh/uBlockOrigin/uAssets@master/filters/badware.txt","https://cdn.statically.io/gh/uBlockOrigin/uAssets/master/filters/badware.txt","https://combinatronics.io/uBlockOrigin/uAssets/master/filters/badware.txt"],"supportURL":"https://github.com/gorhill/uBlock/wiki/Badware-risks","instructionURL":"https://github.com/gorhill/uBlock/wiki/Badware-risks"},"ublock-privacy":{"content":"filters","group":"default","title":"uBlock filters – Privacy","contentURL":["https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/privacy.txt","assets/ublock/privacy.txt"],"cdnURLs":["https://gitcdn.xyz/repo/uBlockOrigin/uAssets/master/filters/privacy.txt","https://cdn.jsdelivr.net/gh/uBlockOrigin/uAssets@master/filters/privacy.txt","https://cdn.statically.io/gh/uBlockOrigin/uAssets/master/filters/privacy.txt","https://combinatronics.io/uBlockOrigin/uAssets/master/filters/privacy.txt"]},"ublock-abuse":{"content":"filters","group":"default","title":"uBlock filters – Resource abuse","contentURL":["https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/resource-abuse.txt","assets/ublock/resource-abuse.txt"],"cdnURLs":["https://gitcdn.xyz/repo/uBlockOrigin/uAssets/master/filters/resource-abuse.txt","https://cdn.jsdelivr.net/gh/uBlockOrigin/uAssets@master/filters/resource-abuse.txt","https://cdn.statically.io/gh/uBlockOrigin/uAssets/master/filters/resource-abuse.txt","https://combinatronics.io/uBlockOrigin/uAssets/master/filters/resource-abuse.txt"]},"ublock-unbreak":{"content":"filters","group":"default","title":"uBlock filters – Unbreak","contentURL":["https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/unbreak.txt","assets/ublock/unbreak.txt"],"cdnURLs":["https://gitcdn.xyz/repo/uBlockOrigin/uAssets/master/filters/unbreak.txt","https://cdn.jsdelivr.net/gh/uBlockOrigin/uAssets@master/filters/unbreak.txt","https://cdn.statically.io/gh/uBlockOrigin/uAssets/master/filters/unbreak.txt","https://combinatronics.io/uBlockOrigin/uAssets/master/filters/unbreak.txt"]},"adguard-generic":{"content":"filters","group":"ads","off":true,"title":"AdGuard Base","contentURL":"https://filters.adtidy.org/extension/ublock/filters/2_without_easylist.txt","supportURL":"https://github.com/AdguardTeam/AdguardFilters#adguard-filters","instructionURL":"https://kb.adguard.com/en/general/adguard-ad-filters"},"adguard-mobile":{"content":"filters","group":"ads","off":true,"title":"AdGuard Mobile Ads","ua":"mobile","contentURL":"https://filters.adtidy.org/extension/ublock/filters/11.txt","supportURL":"https://github.com/AdguardTeam/AdguardFilters#adguard-filters","instructionURL":"https://kb.adguard.com/en/general/adguard-ad-filters"},"easylist":{"content":"filters","group":"ads","title":"EasyList","contentURL":["https://easylist.to/easylist/easylist.txt","https://secure.fanboy.co.nz/easylist.txt","https://easylist-downloads.adblockplus.org/easylist.txt","assets/thirdparties/easylist-downloads.adblockplus.org/easylist.txt"],"supportURL":"https://easylist.to/"},"adguard-spyware":{"content":"filters","group":"privacy","off":true,"title":"AdGuard Tracking Protection","contentURL":"https://filters.adtidy.org/extension/ublock/filters/3.txt","supportURL":"https://github.com/AdguardTeam/AdguardFilters#adguard-filters","instructionURL":"https://kb.adguard.com/en/general/adguard-ad-filters"},"adguard-spyware-url":{"content":"filters","group":"privacy","title":"AdGuard URL Tracking Protection","contentURL":"https://filters.adtidy.org/extension/ublock/filters/17.txt","supportURL":"https://github.com/AdguardTeam/AdguardFilters#adguard-filters","instructionURL":"https://kb.adguard.com/en/general/adguard-ad-filters"},"block-lan":{"content":"filters","group":"privacy","off":true,"title":"Block Outsider Intrusion into LAN","contentURL":"https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/lan-block.txt","cdnURLs":["https://gitcdn.xyz/repo/uBlockOrigin/uAssets/master/filters/lan-block.txt","https://cdn.jsdelivr.net/gh/uBlockOrigin/uAssets@master/filters/lan-block.txt","https://cdn.statically.io/gh/uBlockOrigin/uAssets/master/filters/lan-block.txt","https://combinatronics.io/uBlockOrigin/uAssets/master/filters/lan-block.txt"],"supportURL":"https://github.com/uBlockOrigin/uAssets/issues"},"easyprivacy":{"content":"filters","group":"privacy","title":"EasyPrivacy","contentURL":["https://easylist.to/easylist/easyprivacy.txt","https://secure.fanboy.co.nz/easyprivacy.txt","https://easylist-downloads.adblockplus.org/easyprivacy.txt","assets/thirdparties/easylist-downloads.adblockplus.org/easyprivacy.txt"],"supportURL":"https://easylist.to/"},"urlhaus-1":{"content":"filters","group":"malware","title":"Online Malicious URL Blocklist","contentURL":["https://curben.gitlab.io/malware-filter/urlhaus-filter-online.txt","assets/thirdparties/urlhaus-filter/urlhaus-filter-online.txt"],"cdnURLs":["https://curbengh.github.io/malware-filter/urlhaus-filter-online.txt","https://curben.gitlab.io/urlhaus-filter/urlhaus-filter-online.txt","https://malware-filter.pages.dev/urlhaus-filter-online.txt","https://malware-filter.netlify.app/urlhaus-filter-online.txt"],"supportURL":"https://gitlab.com/curben/urlhaus-filter#malicious-url-blocklist"},"curben-phishing":{"content":"filters","group":"malware","title":"Phishing URL Blocklist","contentURL":"https://curben.gitlab.io/malware-filter/phishing-filter.txt","cdnURLs":["https://curbengh.github.io/phishing-filter/phishing-filter.txt","https://curben.gitlab.io/phishing-filter/phishing-filter.txt","https://phishing-filter.pages.dev/phishing-filter.txt","https://phishing-filter.netlify.app/phishing-filter.txt"],"supportURL":"https://gitlab.com/curben/phishing-filter#phishing-url-blocklist"},"curben-pup":{"content":"filters","group":"malware","off":true,"title":"PUP Domains Blocklist","contentURL":"https://curben.gitlab.io/malware-filter/pup-filter.txt","cdnURLs":["https://curbengh.github.io/pup-filter/pup-filter.txt","https://curben.gitlab.io/pup-filter/pup-filter.txt","https://pup-filter.pages.dev/pup-filter.txt","https://pup-filter.netlify.app/pup-filter.txt"],"supportURL":"https://gitlab.com/curben/pup-filter#pup-domains-blocklist"},"adguard-annoyance":{"content":"filters","group":"social","off":true,"title":"AdGuard Annoyances","contentURL":"https://filters.adtidy.org/extension/ublock/filters/14.txt","supportURL":"https://github.com/AdguardTeam/AdguardFilters#adguard-filters","instructionURL":"https://kb.adguard.com/en/general/adguard-ad-filters"},"adguard-social":{"content":"filters","group":"social","off":true,"title":"AdGuard Social Media","contentURL":"https://filters.adtidy.org/extension/ublock/filters/4.txt","supportURL":"https://github.com/AdguardTeam/AdguardFilters#adguard-filters","instructionURL":"https://kb.adguard.com/en/general/adguard-ad-filters"},"fanboy-thirdparty_social":{"content":"filters","group":"social","off":true,"title":"Anti-Facebook","contentURL":"https://secure.fanboy.co.nz/fanboy-antifacebook.txt","supportURL":"https://github.com/ryanbr/fanboy-adblock/issues"},"fanboy-annoyance":{"content":"filters","group":"social","off":true,"title":"Fanboy’s Annoyance","contentURL":"https://secure.fanboy.co.nz/fanboy-annoyance.txt","supportURL":"https://easylist.to/"},"fanboy-cookiemonster":{"content":"filters","group":"social","off":true,"title":"EasyList Cookie","contentURL":"https://secure.fanboy.co.nz/fanboy-cookiemonster.txt","supportURL":"https://github.com/easylist/easylist/issues"},"fanboy-social":{"content":"filters","group":"social","off":true,"title":"Fanboy’s Social","contentURL":["https://easylist.to/easylist/fanboy-social.txt","https://secure.fanboy.co.nz/fanboy-social.txt"],"supportURL":"https://easylist.to/"},"ublock-annoyances":{"content":"filters","group":"social","title":"uBlock filters – Annoyances","off":true,"contentURL":"https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/annoyances.txt","cdnURLs":["https://gitcdn.xyz/repo/uBlockOrigin/uAssets/master/filters/annoyances.txt","https://cdn.jsdelivr.net/gh/uBlockOrigin/uAssets@master/filters/annoyances.txt","https://cdn.statically.io/gh/uBlockOrigin/uAssets/master/filters/annoyances.txt"]},"dpollock-0":{"content":"filters","group":"multipurpose","updateAfter":11,"off":true,"title":"Dan Pollock’s hosts file","contentURL":"https://someonewhocares.org/hosts/hosts","supportURL":"https://someonewhocares.org/hosts/"},"mvps-0":{"content":"filters","group":"multipurpose","updateAfter":11,"off":true,"title":"MVPS HOSTS","contentURL":"https://winhelp2002.mvps.org/hosts.txt","supportURL":"https://winhelp2002.mvps.org/"},"plowe-0":{"content":"filters","group":"multipurpose","updateAfter":13,"title":"Peter Lowe’s Ad and tracking server list","contentURL":["https://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&showintro=1&mimetype=plaintext","assets/thirdparties/pgl.yoyo.org/as/serverlist.txt","assets/thirdparties/pgl.yoyo.org/as/serverlist"],"supportURL":"https://pgl.yoyo.org/adservers/"},"ALB-0":{"content":"filters","group":"regions","off":true,"title":"ALB: Adblock List for Albania","lang":"sq","contentURL":"https://raw.githubusercontent.com/AnXh3L0/blocklist/master/albanian-easylist-addition/Albania.txt","supportURL":"https://github.com/AnXh3L0/blocklist"},"ara-0":{"content":"filters","group":"regions","off":true,"title":"ara: Liste AR","lang":"ar","contentURL":"https://easylist-downloads.adblockplus.org/Liste_AR.txt","supportURL":"https://forums.lanik.us/viewforum.php?f=98"},"BGR-0":{"content":"filters","group":"regions","off":true,"title":"BGR: Bulgarian Adblock list","lang":"bg mk","contentURL":"https://stanev.org/abp/adblock_bg.txt","supportURL":"https://stanev.org/abp/"},"CHN-0":{"content":"filters","group":"regions","off":true,"title":"CHN: AdGuard Chinese (中文)","lang":"ug zh","contentURL":"https://filters.adtidy.org/extension/ublock/filters/224.txt","supportURL":"https://github.com/AdguardTeam/AdguardFilters#adguard-filters"},"CZE-0":{"content":"filters","group":"regions","off":true,"title":"CZE, SVK: EasyList Czech and Slovak","lang":"cs sk","contentURL":"https://raw.githubusercontent.com/tomasko126/easylistczechandslovak/master/filters.txt","supportURL":"https://github.com/tomasko126/easylistczechandslovak"},"DEU-0":{"content":"filters","group":"regions","off":true,"title":"DEU: EasyList Germany","lang":"de dsb hsb lb rm","contentURL":["https://easylist.to/easylistgermany/easylistgermany.txt","https://easylist-downloads.adblockplus.org/easylistgermany.txt"],"supportURL":"https://forums.lanik.us/viewforum.php?f=90"},"EST-0":{"content":"filters","group":"regions","off":true,"title":"EST: Eesti saitidele kohandatud filter","lang":"et","contentURL":"https://adblock.ee/list.php","supportURL":"https://adblock.ee/"},"FIN-0":{"content":"filters","group":"regions","off":true,"title":"FIN: Adblock List for Finland","lang":"fi","contentURL":"https://raw.githubusercontent.com/finnish-easylist-addition/finnish-easylist-addition/master/Finland_adb.txt","supportURL":"https://github.com/finnish-easylist-addition/finnish-easylist-addition"},"FRA-0":{"content":"filters","group":"regions","off":true,"title":"FRA: AdGuard Français","lang":"ar br ff fr lb oc son","contentURL":"https://filters.adtidy.org/extension/ublock/filters/16.txt","supportURL":"https://github.com/AdguardTeam/AdguardFilters#adguard-filters"},"GRC-0":{"content":"filters","group":"regions","off":true,"title":"GRC: Greek AdBlock Filter","lang":"el","contentURL":"https://www.void.gr/kargig/void-gr-filters.txt","supportURL":"https://github.com/kargig/greek-adblockplus-filter"},"HUN-0":{"content":"filters","group":"regions","off":true,"title":"HUN: hufilter","lang":"hu","contentURL":"https://raw.githubusercontent.com/hufilter/hufilter/master/hufilter-ublock.txt","supportURL":"https://github.com/hufilter/hufilter"},"IDN-0":{"content":"filters","group":"regions","off":true,"title":"IDN, MYS: ABPindo","lang":"id ms","contentURL":"https://raw.githubusercontent.com/ABPindo/indonesianadblockrules/master/subscriptions/abpindo.txt","supportURL":"https://github.com/ABPindo/indonesianadblockrules"},"IRN-0":{"content":"filters","group":"regions","off":true,"title":"IRN: Adblock-Iran","lang":"fa","contentURL":["https://gitcdn.xyz/repo/farrokhi/adblock-iran/master/filter.txt","https://combinatronics.io/farrokhi/adblock-iran/master/filter.txt","https://cdn.statically.io/gh/farrokhi/adblock-iran/master/filter.txt"],"supportURL":"https://github.com/farrokhi/adblock-iran"},"ISL-0":{"content":"filters","group":"regions","off":true,"title":"ISL: Icelandic ABP List","lang":"is","contentURL":"https://adblock.gardar.net/is.abp.txt","supportURL":"https://adblock.gardar.net/"},"ISR-0":{"content":"filters","group":"regions","off":true,"title":"ISR: EasyList Hebrew","lang":"he","contentURL":"https://raw.githubusercontent.com/easylist/EasyListHebrew/master/EasyListHebrew.txt","supportURL":"https://github.com/easylist/EasyListHebrew"},"ITA-0":{"content":"filters","group":"regions","off":true,"title":"ITA: EasyList Italy","lang":"it lij","contentURL":"https://easylist-downloads.adblockplus.org/easylistitaly.txt","supportURL":"https://forums.lanik.us/viewforum.php?f=96"},"JPN-1":{"content":"filters","group":"regions","off":true,"title":"JPN: AdGuard Japanese","lang":"ja","contentURL":"https://filters.adtidy.org/extension/ublock/filters/7.txt","supportURL":"https://github.com/AdguardTeam/AdguardFilters#adguard-filters","instructionURL":"https://kb.adguard.com/en/general/adguard-ad-filters"},"KOR-1":{"content":"filters","group":"regions","off":true,"title":"KOR: YousList","lang":"ko","contentURL":"https://raw.githubusercontent.com/yous/YousList/master/youslist.txt","supportURL":"https://github.com/yous/YousList"},"LTU-0":{"content":"filters","group":"regions","off":true,"title":"LTU: EasyList Lithuania","lang":"lt","contentURL":"https://raw.githubusercontent.com/EasyList-Lithuania/easylist_lithuania/master/easylistlithuania.txt","cdnURLs":["https://gitcdn.xyz/repo/EasyList-Lithuania/easylist_lithuania/master/easylistlithuania.txt","https://cdn.jsdelivr.net/gh/EasyList-Lithuania/easylist_lithuania@master/easylistlithuania.txt","https://cdn.statically.io/gl/DandelionSprout/easylist_lithuania/raw/master/easylistlithuania.txt"],"supportURL":"https://github.com/EasyList-Lithuania/easylist_lithuania"},"LVA-0":{"content":"filters","group":"regions","off":true,"title":"LVA: Latvian List","lang":"lv","contentURL":"https://notabug.org/latvian-list/adblock-latvian/raw/master/lists/latvian-list.txt","supportURL":"https://notabug.org/latvian-list/adblock-latvian"},"NLD-0":{"content":"filters","group":"regions","off":true,"title":"NLD: EasyDutch","lang":"af fy nl","contentURL":"https://raw.githubusercontent.com/EasyDutch-uBO/EasyDutch/main/EasyDutch.txt","supportURL":"https://github.com/EasyDutch-uBO/EasyDutch/"},"NOR-0":{"content":"filters","group":"regions","off":true,"title":"NOR, DNK, ISL: Dandelion Sprouts nordiske filtre","lang":"nb nn no da is","contentURL":["https://raw.githubusercontent.com/DandelionSprout/adfilt/master/NorwegianList.txt"],"cdnURLs":["https://gitcdn.xyz/repo/DandelionSprout/adfilt/master/NorwegianList.txt","https://cdn.jsdelivr.net/gh/DandelionSprout/adfilt@master/NorwegianList.txt","https://cdn.statically.io/gl/DandelionSprout/adfilt/master/NorwegianList.txt"],"supportURL":"https://github.com/DandelionSprout/adfilt"},"POL-0":{"content":"filters","group":"regions","off":true,"title":"POL: Oficjalne Polskie Filtry do AdBlocka, uBlocka Origin i AdGuarda","lang":"szl pl","contentURL":"https://raw.githubusercontent.com/MajkiIT/polish-ads-filter/master/polish-adblock-filters/adblock.txt","supportURL":"https://github.com/MajkiIT/polish-ads-filter/issues","instructionURL":"https://github.com/MajkiIT/polish-ads-filter#polish-filters-for-adblock-ublock-origin--adguard"},"POL-2":{"content":"filters","group":"regions","off":true,"title":"POL: Oficjalne polskie filtry przeciwko alertom o Adblocku","lang":"szl pl","contentURL":"https://raw.githubusercontent.com/olegwukr/polish-privacy-filters/master/anti-adblock.txt","supportURL":"https://github.com/olegwukr/polish-privacy-filters/issues"},"ROU-1":{"content":"filters","group":"regions","off":true,"title":"ROU: Romanian Ad (ROad) Block List Light","lang":"ro","contentURL":["https://road.adblock.ro/lista.txt","https://raw.githubusercontent.com/tcptomato/ROad-Block/master/road-block-filters-light.txt"],"supportURL":"https://github.com/tcptomato/ROad-Block"},"RUS-0":{"content":"filters","group":"regions","off":true,"title":"RUS: RU AdList","lang":"be kk tt ru uk uz","contentURL":"https://easylist-downloads.adblockplus.org/advblock+cssfixes.txt","supportURL":"https://forums.lanik.us/viewforum.php?f=102","instructionURL":"https://forums.lanik.us/viewtopic.php?f=102&t=22512"},"spa-0":{"content":"filters","group":"regions","off":true,"title":"spa: EasyList Spanish","lang":"an ast ca cak es eu gn gl trs quz","contentURL":"https://easylist-downloads.adblockplus.org/easylistspanish.txt","supportURL":"https://forums.lanik.us/viewforum.php?f=103"},"spa-1":{"content":"filters","group":"regions","off":true,"title":"spa, por: AdGuard Spanish/Portuguese","lang":"an ast ca cak es eu gl gn trs pt quz","contentURL":"https://filters.adtidy.org/extension/ublock/filters/9.txt","supportURL":"https://github.com/AdguardTeam/AdguardFilters#adguard-filters","instructionURL":"https://kb.adguard.com/en/general/adguard-ad-filters"},"SVN-0":{"content":"filters","group":"regions","off":true,"title":"SVN: Slovenian List","lang":"sl","contentURL":"https://raw.githubusercontent.com/betterwebleon/slovenian-list/master/filters.txt","supportURL":"https://github.com/betterwebleon/slovenian-list"},"SWE-1":{"content":"filters","group":"regions","off":true,"title":"SWE: Frellwit's Swedish Filter","lang":"sv","contentURL":"https://raw.githubusercontent.com/lassekongo83/Frellwits-filter-lists/master/Frellwits-Swedish-Filter.txt","supportURL":"https://github.com/lassekongo83/Frellwits-filter-lists"},"THA-0":{"content":"filters","group":"regions","off":true,"title":"THA: EasyList Thailand","lang":"th","contentURL":"https://raw.githubusercontent.com/easylist-thailand/easylist-thailand/master/subscription/easylist-thailand.txt","supportURL":"https://github.com/easylist-thailand/easylist-thailand"},"TUR-0":{"content":"filters","group":"regions","off":true,"title":"TUR: AdGuard Turkish","lang":"tr","contentURL":"https://filters.adtidy.org/extension/ublock/filters/13.txt","supportURL":"https://github.com/AdguardTeam/AdguardFilters#adguard-filters","instructionURL":"https://kb.adguard.com/en/general/adguard-ad-filters"},"VIE-1":{"content":"filters","group":"regions","off":true,"title":"VIE: ABPVN List","lang":"vi","contentURL":"https://raw.githubusercontent.com/abpvn/abpvn/master/filter/abpvn_ublock.txt","supportURL":"https://abpvn.com/"},"LegitimateURLShortener":{"content":"filters","group":"privacy","title":"➗ Actually Legitimate URL Shortener Tool","contentURL":"https://raw.githubusercontent.com/DandelionSprout/adfilt/master/LegitimateURLShortener.txt","supportURL":"https://github.com/DandelionSprout/adfilt/discussions/163"}} diff --git a/assets/upstream.bootstrap.mk b/assets/upstream.bootstrap.mk deleted file mode 100644 index d455f96..0000000 --- a/assets/upstream.bootstrap.mk +++ /dev/null @@ -1,14 +0,0 @@ -## handle different upstreams, like developer,nightly, or distro specific upstream cases -upstream_filename=bootstrap.py -upstream_dirname=mozilla-unified -$(upstream_filename) : - wget -q https://hg.mozilla.org/mozilla-central/raw-file/default/python/mozboot/bin/bootstrap.py -## -clean_upstream_file : - rm -f $(upstream_filename) -clean_upstream_dir : - rm -rf $(upstream_dirname) -create_lw_from_upstream_dir : - python3 bootstrap.py --no-interactive --application-choice=browser - mv $(upstream_dirname) librewolf-$(version) - diff --git a/assets/upstream.nighly.mk b/assets/upstream.nighly.mk deleted file mode 100644 index 1f44d45..0000000 --- a/assets/upstream.nighly.mk +++ /dev/null @@ -1,14 +0,0 @@ -## handle different upstreams, like developer,nightly, or distro specific upstream cases -upstream_filename=mozilla-unified -upstream_dirname=mozilla-unified -$(upstream_filename) : - hg clone https://hg.mozilla.org/mozilla-unified - (cd mozilla-unified && hg update) -## -clean_upstream_file : -clean_upstream_dir : -create_lw_from_upstream_dir : - (cd mozilla-unified && hg pull) - (cd mozilla-unified && hg update) - cp -r $(upstream_dirname) librewolf-$(version) - diff --git a/assets/upstream.std.mk b/assets/upstream.std.mk deleted file mode 100644 index cb37428..0000000 --- a/assets/upstream.std.mk +++ /dev/null @@ -1,14 +0,0 @@ -## handle different upstreams, like developer,nightly, or distro specific upstream cases -upstream_filename=firefox-$(version).source.tar.xz -upstream_dirname=firefox-$(version) -$(upstream_filename) : - wget -q https://archive.mozilla.org/pub/firefox/releases/$(version)/source/firefox-$(version).source.tar.xz -## -clean_upstream_file : - rm -f $(upstream_filename) -clean_upstream_dir : - rm -rf $(upstream_dirname) -create_lw_from_upstream_dir : - tar xf $(upstream_filename) - mv $(upstream_dirname) librewolf-$(version) - diff --git a/patches/bootstrap-without-vcs.patch b/patches/bootstrap-without-vcs.patch new file mode 100644 index 0000000..e1ad51d --- /dev/null +++ b/patches/bootstrap-without-vcs.patch @@ -0,0 +1,56 @@ +--- a/python/mozboot/mozboot/bootstrap.py ++++ b/python/mozboot/mozboot/bootstrap.py +@@ -542,10 +542,7 @@ def current_firefox_checkout(env, hg=None): + if child == "": + break + +- raise UserError( +- "Could not identify the root directory of your checkout! " +- "Are you running `mach bootstrap` in an hg or git clone?" +- ) ++ return ("local", os.getcwd()) + + + def update_git_tools(git, root_state_dir): +--- a/python/mozversioncontrol/mozversioncontrol/__init__.py ++++ b/python/mozversioncontrol/mozversioncontrol/__init__.py +@@ -672,6 +672,21 @@ class GitRepository(Repository): + self._run("config", name, value) + + ++class LocalRepository(Repository): ++ ++ def __init__(self, path): ++ super(LocalRepository, self).__init__(path, tool="true") ++ ++ @property ++ def head_ref(self): ++ return "" ++ ++ def get_tracked_files_finder(self): ++ files = [os.path.relpath(os.path.join(dp, f), self.path) for dp, dn, fn in os.walk(self.path) for f in fn] ++ files.sort() ++ return FileListFinder(files) ++ ++ + def get_repository_object(path, hg="hg", git="git"): + """Get a repository object for the repository at `path`. + If `path` is not a known VCS repository, raise an exception. +@@ -681,7 +696,7 @@ def get_repository_object(path, hg="hg", git="git"): + elif os.path.exists(os.path.join(path, ".git")): + return GitRepository(path, git=git) + else: +- raise InvalidRepoPath("Unknown VCS, or not a source checkout: %s" % path) ++ return LocalRepository(path) + + + def get_repository_from_build_config(config): +@@ -705,6 +720,8 @@ def get_repository_from_build_config(config): + return HgRepository(config.topsrcdir, hg=config.substs["HG"]) + elif flavor == "git": + return GitRepository(config.topsrcdir, git=config.substs["GIT"]) ++ elif flavor == "local": ++ return LocalRepository(config.topsrcdir) + else: + raise MissingVCSInfo("unknown VCS_CHECKOUT_TYPE value: %s" % flavor) + diff --git a/patches/custom-ubo-assets-bootstrap-location.patch b/patches/custom-ubo-assets-bootstrap-location.patch new file mode 100644 index 0000000..81a703f --- /dev/null +++ b/patches/custom-ubo-assets-bootstrap-location.patch @@ -0,0 +1,17 @@ +--- a/toolkit/components/extensions/parent/ext-storage.js ++++ b/toolkit/components/extensions/parent/ext-storage.js +@@ -177,6 +177,14 @@ this.storage = class extends ExtensionAPI { + + let data = await lookup; + if (!data) { ++ const assetsBootstrapLocation = Services.prefs.getStringPref("librewolf.uBO.assetsBootstrapLocation", undefined); ++ if (extension.id == "uBlock0@raymondhill.net" && assetsBootstrapLocation) { ++ return { ++ adminSettings: { ++ assetsBootstrapLocation ++ } ++ } ++ } + return Promise.reject({ + message: "Managed storage manifest not found", + }); diff --git a/patches/librewolf-pref-pane.patch b/patches/librewolf-pref-pane.patch new file mode 100644 index 0000000..d28f101 --- /dev/null +++ b/patches/librewolf-pref-pane.patch @@ -0,0 +1,782 @@ +diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml +new file mode 100644 +index 0000000..2badfe9 +--- /dev/null ++++ b/.gitlab-ci.yml +@@ -0,0 +1,12 @@ ++stages: ++ - build ++ ++create-patch: ++ stage: build ++ variables: ++ GIT_DEPTH: 200 ++ script: ++ - git diff 1fee314adc81000294fc0cf3196a758e4b64dace > librewolf-pref-pane.patch ++ artifacts: ++ paths: ++ - librewolf-pref-pane.patch +diff --git a/browser/components/preferences/jar.mn b/browser/components/preferences/jar.mn +index 4f3babe..97c7ec2 100644 +--- a/browser/components/preferences/jar.mn ++++ b/browser/components/preferences/jar.mn +@@ -11,6 +11,7 @@ browser.jar: + content/browser/preferences/home.js + content/browser/preferences/search.js + content/browser/preferences/privacy.js ++ content/browser/preferences/librewolf.js + content/browser/preferences/containers.js + content/browser/preferences/sync.js + content/browser/preferences/experimental.js +diff --git a/browser/components/preferences/librewolf.inc.xhtml b/browser/components/preferences/librewolf.inc.xhtml +new file mode 100644 +index 0000000..b627417 +--- /dev/null ++++ b/browser/components/preferences/librewolf.inc.xhtml +@@ -0,0 +1,206 @@ ++# This Source Code Form is subject to the terms of the Mozilla Public ++# License, v. 2.0. If a copy of the MPL was not distributed with this ++# file, You can obtain one at http://mozilla.org/MPL/2.0/. ++ ++