Compare commits

..

No commits in common. "master" and "v95.0.2" have entirely different histories.

36 changed files with 3909 additions and 26 deletions

23
.gitignore vendored Normal file
View file

@ -0,0 +1,23 @@
/.vs
/firefox-*
/librewolf
/mozilla-unified
/tor-browser
/gecko-dev
/bootstrap.py
/mozconfig
/dist
/tmp.nsi
/tmp-permissive.nsi
/tmp-strict.nsi
/__pycache__
/sha256sums.txt
/upload.txt
build_tag
/docker/librewolf/debian10/deb/artifacts
/docker/librewolf/debian11/deb/artifacts
/docker/librewolf/fedora34/rpm/artifacts
/docker/librewolf/mint20/deb/artifacts
/docker/librewolf/ubuntu20/deb/artifacts
/docker/*.log
version

6
.gitmodules vendored Normal file
View file

@ -0,0 +1,6 @@
[submodule "settings"]
path = settings
url = https://gitlab.com/librewolf-community/settings.git
[submodule "common"]
path = common
url = https://gitlab.com/librewolf-community/browser/common.git

41
CONTRIBUTING.md Normal file
View file

@ -0,0 +1,41 @@
# How to contribute:
If you want to contribute, or just build from source yourself, below are the inistructions to do that. If there is something unclear please type your feedback in **[this ticket](https://gitlab.com/librewolf-community/browser/windows/-/issues/112)** and we can adress it.
## Reference documentation:
* [Building Firefox On Windows](https://firefox-source-docs.mozilla.org/setup/windows_build.html).
## Compiling:
To compile on Windows, you need to:
* Install Mozilla build setup tools: [MozillaBuildSetup-Latest.exe](https://ftp.mozilla.org/pub/mozilla.org/mozilla/libraries/win32/MozillaBuildSetup-Latest.exe).
* Install Microsoft visual studio community edition: [here](https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2022).
* Within Visual Studio:
** Desktop development with C++.
** Windows 10 SDK (at least 10.0.19041.0).
** C++ ATL for v143 build tools (x86 and x64).
* Open start-shell terminal and basically do the following:
```
wget -q "https://hg.mozilla.org/mozilla-central/raw-file/default/python/mozboot/bin/bootstrap.py"
python3 bootstrap.py --no-interactive --application-choice=browser
```
If you choose to, you can now build Firefox Nightly as follows:
```
cd mozilla-unified
./mach build
./mach package
./mach run # or just run it..
```
Or you can just forget about that, and remove the firefox tree:
```
rm -rf bootstrap.py mozilla-unified
```
To build the current windows setup.exe, we do the following:
```
git clone --recursive https://gitlab.com/librewolf-community/browser/windows.git
cd windows
./build.py all
```

54
Makefile Normal file
View file

@ -0,0 +1,54 @@
.phony: all clean veryclean fetch extract lw_do_patches build lw_post_build package lw_artifacts commit
BUILD=python3 build.py ${OPTS}
all :
$(BUILD) all
clean :
$(BUILD) clean
make -C docker clean
veryclean :
$(BUILD) veryclean
fetch :
$(BUILD) fetch
extract :
$(BUILD) extract
do_patches lw_do_patches :
$(BUILD) lw_do_patches
build :
$(BUILD) build
post_build lw_post_build :
$(BUILD) lw_post_build
package :
$(BUILD) package
artifacts lw_artifacts :
$(BUILD) lw_artifacts
update update_submodules :
$(BUILD) update_submodules
upload :
$(BUILD) upload
git_init :
$(BUILD) git_init
reset :
$(BUILD) reset
# Building docker files..
.phony : docker docker-all docker-clean
docker : docker-all
docker-all :
make -C docker all
docker-clean :
make -C docker clean
# git commit && git push
commit :
git commit -am "$$(date)"
git push

View file

@ -1,30 +1,19 @@
# LibreWolf Issue Tracker & Update Tools 🚀 # LibreWolf for windows
Welcome to the **LibreWolf for Windows** repository! This repository is now dedicated to the **Issue Tracker**. Submit your issues and get the latest updates on LibreWolf for Windows. * **[download latest release](https://gitlab.com/librewolf-community/browser/windows/-/releases)**
* Visit [the FAQ](https://librewolf.net/docs/faq/).
* Install via _[chocolatey](https://community.chocolatey.org/packages/librewolf)_: `choco install librewolf`
* or install via _winget_: `winget install librewolf`
* **If your LibreWolf crashes on startup**, you probably miss the right [Visual C++ Runtime](https://support.microsoft.com/en-us/topic/the-latest-supported-visual-c-downloads-2647da03-1eea-4433-9aff-95f26a218cc0). You want the _Visual Studio 2015, 2017 and 2019_ version for **x64**, which would be **[this file](https://aka.ms/vs/16/release/vc_redist.x64.exe)**.
* The .zip files are _'portable zip files'_ that allows for a user profile in the extracted zip file folders. It is _self-contained_.
To download the latest release, visit the [official LibreWolf release page](https://gitlab.com/librewolf-community/browser/bsys6/-/releases). For installation options, check out the [FAQ](https://librewolf.net/docs/faq/). # Where to submit tickets
## Update Tools 🛠️ * For all **about:config** and **librewolf.cfg** issues, go here: [[settings repository](https://gitlab.com/librewolf-community/settings/-/issues)].
* For _all other issues_ and **setup/install** issues, go here: [[issues for windows repository](https://gitlab.com/librewolf-community/browser/windows/-/issues)].
Stay secure and up-to-date with these LibreWolf update tools: # Community links
* [[reddit](https://www.reddit.com/r/LibreWolf/)] - [r/LibreWolf](https://www.reddit.com/r/LibreWolf/) 😺
1. **LibreWolf WinUpdater**: Kudos to @ltguillaume for this [automatic updater](https://codeberg.org/ltguillaume/librewolf-winupdater) that can be set up to update LibreWolf automatically or run manually. * [[gitter](https://gitter.im/librewolf-community/librewolf)], and the same room on [matrix](https://app.element.io/#/room/#librewolf-community_librewolf:gitter.im) (element.io).
* The install instructions for Windows on [librewolf.net](https://librewolf.net/installation/windows/).
2. **LibreWolf Update Checker Extension**: Created by Defkev, this [extension](https://addons.mozilla.org/en-US/firefox/addon/librewolf-updater/) will notify you when an update is available and guide you to the download link. * Want to compile it for yourself or contribute? check [CONTRIBUTING.md](https://gitlab.com/librewolf-community/browser/windows/-/blob/master/CONTRIBUTING.md).
> Please note: The *updater* can _install_ updates automatically, while the *extension* can only _check_ for updates.
## LibreWolf for Windows 🖥️
- LibreWolf supports multiple UI languages, available in settings.
- The latest **-portable.zip** release is self-contained and can be run on removable storage.
## Issue Tracker 🎫
- For issues with Settings or Advanced Settings (`about:config`), submit them to the [settings repository](https://gitlab.com/librewolf-community/settings/-/issues).
- For other issues, such as crashes/theme/graphics/speed problems, submit them to [issues for windows repository](https://gitlab.com/librewolf-community/browser/windows/-/issues).
## Building from Source 🏗️
- Our `bsys` build system supports cross-compiling from Linux to Windows. Building the Windows version from within Windows is not tested yet.
- The build system can be found here: [bsys6](https://gitlab.com/librewolf-community/browser/bsys6).

733
build.py Executable file
View file

@ -0,0 +1,733 @@
#!/usr/bin/env python3
pkgver = '95.0.2'
lwver = "{}".format(pkgver)
nightly_ver = '97.0a1'
#
# build.py - try move functionality away from that too big/horrible build script.
#
import optparse
import sys
import os
import glob
import time
start_time = time.time()
parser = optparse.OptionParser()
parser.add_option('-x', '--cross', dest='cross_compile', default=False, action="store_true")
parser.add_option('-n', '--no-execute', dest='no_execute', default=False, action="store_true")
parser.add_option('-l', '--no-librewolf', dest='no_librewolf', default=False, action="store_true")
parser.add_option('-s', '--src', dest='src', default='release')
parser.add_option('-t', '--distro', dest='distro', default='autodetect')
parser.add_option('-T', '--token', dest='token', default='')
parser.add_option('-3', '--i386', dest='i386', default=False, action="store_true")
parser.add_option('-P', '--no-settings-pane', dest='settings_pane', default=True, action="store_false")
parser.add_option('-v', '--version', dest='version', action="store", type="string")
options, remainder = parser.parse_args()
# try autodetecting options.distro
if options.distro == 'autodetect':
options.distro = 'win'
if os.path.isdir('/Applications'):
options.distro = 'osx'
elif os.path.isdir('/etc'):
options.distro = 'rpm'
if os.path.isdir('/etc/apt'):
options.distro = 'deb'
if options.version != None:
if options.src != 'release':
print('error: cant use --version and --src at the same time')
sys.exit(1)
pkgver=options.version
def script_exit(statuscode):
if (time.time() - start_time) > 60:
# print elapsed time
elapsed = time.strftime("%H:%M:%S", time.gmtime(time.time() - start_time))
print(f"\n\aElapsed time: {elapsed}")
sys.exit(statuscode)
def enter_srcdir():
dir = "firefox-{}".format(pkgver)
if options.src == 'nightly':
dir = 'mozilla-unified'
elif options.src == 'tor-browser':
dir = 'tor-browser'
elif options.src == 'gecko-dev':
dir = 'gecko-dev'
print("cd {}".format(dir))
if not options.no_execute:
try:
os.chdir(dir)
except:
print("fatal error: can't change to '{}' folder.".format(dir))
script_exit(1)
def leave_srcdir():
print("cd ..")
if not options.no_execute:
os.chdir("..")
def exec(cmd):
if cmd != '':
print(cmd)
if not options.no_execute:
retval = os.system(cmd)
if retval != 0:
print("fatal error: command '{}' failed".format(cmd))
script_exit(1)
def patch(patchfile):
cmd = "patch -p1 -i {}".format(patchfile)
print("\n*** -> {}".format(cmd))
if not options.no_execute:
retval = os.system(cmd)
if retval != 0:
print("fatal error: patch '{}' failed".format(patchfile))
script_exit(1)
#
# Utilities:
#
def execute_update_submodules():
exec("git submodule foreach git pull origin master")
def execute_git_init():
if options.src != 'release':
print("fatal error: git_init only works with the release source (--src release)")
script_exit(1)
enter_srcdir()
exec("rm -rf .git")
exec("git init")
exec("git config core.safecrlf false")
exec("git config commit.gpgsign false")
exec("git add -f * .[a-z]*")
exec("git commit -am initial")
leave_srcdir()
def execute_deps_deb():
deps1 = "python python-dev python3 python3-dev python3-distutils clang pkg-config libpulse-dev gcc"
deps2 = "curl wget nodejs libpango1.0-dev nasm yasm zip m4 libgtk-3-dev libgtk2.0-dev libdbus-glib-1-dev"
deps3 = "libxt-dev python3-pip mercurial automake autoconf libtool m4"
exec("apt install -y {} {} {}".format(deps1,deps2,deps3))
def execute_deps_rpm():
deps1 = "python3 python3-distutils-extra clang pkg-config gcc curl wget nodejs nasm yasm zip m4"
deps2 = "python3-zstandard python-zstandard python-devel python3-devel gtk3-devel llvm gtk2-devel dbus-glib-devel libXt-devel pulseaudio-libs-devel"
exec("dnf -y install {} {}".format(deps1,deps2))
def execute_deps_pkg():
deps = "wget gmake m4 python3 py37-sqlite3 pkgconf llvm node nasm zip unzip yasm"
exec("pkg install {}".format(deps))
def execute_rustup():
# rust needs special love: https://www.atechtown.com/install-rust-language-on-debian-10/
exec("curl https://sh.rustup.rs -sSf | sh")
exec("cargo install cbindgen")
def execute_mach_env():
enter_srcdir()
exec("bash ./mach create-mach-environment")
leave_srcdir()
def execute_reset():
if options.src == 'release':
path = "firefox-{}/.git/index".format(pkgver)
if not os.path.isfile(path):
print("fatal error: cannot reset '--src release' sources as it's not under version control.")
script_exit(1)
enter_srcdir()
exec("git reset --hard")
leave_srcdir()
elif options.src == 'nightly':
enter_srcdir()
exec("hg up -C")
exec("hg purge")
exec("hg pull -u")
leave_srcdir()
elif options.src == 'tor-browser':
enter_srcdir()
exec("git reset --hard")
leave_srcidr()
elif options.src == 'gecko-dev':
enter_srcdir()
exec("git reset --hard")
leave_srcdir()
#
# Targets:
#
def execute_fetch():
if options.src == 'release':
exec("rm -f firefox-{}.source.tar.xz".format(pkgver))
exec("wget -q https://archive.mozilla.org/pub/firefox/releases/{}/source/firefox-{}.source.tar.xz".format(pkgver, pkgver))
elif options.src == 'nightly':
if not os.path.isdir('mozilla-unified'):
exec("rm -f bootstrap.py")
exec("rm -rf mozilla-unified")
exec("wget -q https://hg.mozilla.org/mozilla-central/raw-file/default/python/mozboot/bin/bootstrap.py")
exec("python3 bootstrap.py --no-interactive --application-choice=browser")
elif options.src == 'tor-browser':
if not os.path.isdir('tor-browser'):
exec("rm -rf tor-browser")
exec("git clone --no-checkout --recursive https://git.torproject.org/tor-browser.git")
patch("../patches/tb-mozconfig-win10.patch")
enter_srcdir()
exec("git checkout tor-browser-89.0-10.5-1-build1")
exec("git submodule update --recursive")
leave_srcdir()
elif options.src == 'gecko-dev':
if not os.path.isdir('gecko-dev'):
exec("rm -rf gecko-dev")
exec("git clone --depth=1 https://github.com/mozilla/gecko-dev.git")
def execute_extract():
if options.src == 'release':
exec("rm -rf firefox-{}".format(pkgver))
exec("tar xf firefox-{}.source.tar.xz".format(pkgver))
def execute_build():
enter_srcdir()
#exec("bash -c \"MACH_USE_SYSTEM_PYTHON=1 ./mach build\"")
exec("bash -c \"./mach build\"")
leave_srcdir()
def execute_package():
enter_srcdir()
exec("bash -c \"./mach package\"")
leave_srcdir()
#
# LibreWolf specific:
#
def create_mozconfig(contents):
if not options.no_execute:
f = open('mozconfig', 'w')
f.write(contents)
if not options.distro == 'win':
f.write("\nac_add_options --with-app-name=librewolf")
if options.distro == 'osx' and options.cross_compile:
f.write("\nac_add_options --target=aarch64")
if options.i386:
f.write("\nac_add_options --target=i386")
f.write("\n")
f.close()
def execute_lw_do_patches():
if options.no_librewolf:
return
if not options.src in ['release','nightly','gecko-dev']:
return
enter_srcdir()
# create the right mozconfig file..
create_mozconfig(mozconfig_release)
# macos : if have compatibilty osx api headers, add that to mozconfig_release
dir = os.environ['HOME'] + '/.mozbuild/macos-sdk/MacOSX11.1.sdk'
if os.path.isdir(dir):
with open('mozconfig','a') as f:
f.write("\nac_add_options --with-macos-sdk=$HOME/.mozbuild/macos-sdk/MacOSX11.1.sdk")
f.close()
# copy branding files..
exec('echo +++ && pwd && ls ../common')
exec("cp -vr ../common/source_files/browser .")
exec("cp -v ../files/configure.sh browser/branding/librewolf")
patches = []
if options.src == 'release':
# production patches
patches = [
"../common/patches/about-dialog.patch",
# BUG: this patch seems to fail and break librewolf.exe at startup
"../common/patches/allow-ubo-private-mode.patch",
"../common/patches/context-menu.patch",
"../common/patches/megabar.patch",
"../common/patches/mozilla-vpn-ad.patch",
"../common/patches/mozilla_dirs.patch",
"../common/patches/remove_addons.patch",
# "../common/patches/search-config.patch",
"../common/patches/sed-patches/allow-searchengines-non-esr.patch",
"../common/patches/sed-patches/disable-pocket.patch",
"../common/patches/sed-patches/remove-internal-plugin-certs.patch",
"../common/patches/sed-patches/stop-undesired-requests.patch",
"../common/patches/ui-patches/add-language-warning.patch",
"../common/patches/ui-patches/pref-naming.patch",
"../common/patches/ui-patches/remove-branding-urlbar.patch",
"../common/patches/ui-patches/remove-cfrprefs.patch",
"../common/patches/ui-patches/remove-organization-policy-banner.patch",
"../common/patches/ui-patches/remove-snippets-from-home.patch",
"../common/patches/ui-patches/sanitizing-description.patch",
"../common/patches/urlbarprovider-interventions.patch",
]
for p in patches:
patch(p)
# local windows patches
for p in ["../patches/browser-confvars.patch", "../patches/package-manifest.patch"]:
patch(p)
# insert the settings pane source (experimental)
if options.settings_pane:
exec('rm -rf librewolf-pref-pane')
exec('git clone https://gitlab.com/ohfp/librewolf-pref-pane.git')
os.chdir('librewolf-pref-pane')
exec('git diff 1fee314adc81000294fc0cf3196a758e4b64dace > ../../patches/librewolf-pref-pane.patch')
os.chdir('..')
patch('../patches/librewolf-pref-pane.patch')
leave_srcdir()
def get_objdir():
pattern = "obj-*"
retval = glob.glob(pattern)
if options.no_execute:
return "obj-XXX"
if len(retval) != 1:
print("fatal error: in execute_lw_post_build(): cannot glob build output folder '{}'".format(pattern))
script_exit(1)
return retval[0]
def execute_lw_post_build():
if options.no_librewolf:
return
enter_srcdir()
dirname = get_objdir()
distfolder = "dist/bin"
if options.distro == 'osx':
distfolder = 'dist/LibreWolf.app/Contents/Resources'
if not options.no_execute:
os.makedirs("{}/{}/defaults/pref".format(dirname,distfolder), exist_ok=True)
os.makedirs("{}/{}/distribution".format(dirname,distfolder), exist_ok=True)
exec("cp -v ../settings/defaults/pref/local-settings.js {}/{}/defaults/pref/".format(dirname,distfolder))
exec("cp -v ../settings/distribution/policies.json {}/{}/distribution/".format(dirname,distfolder))
exec("cp -v ../settings/librewolf.cfg {}/{}/".format(dirname,distfolder))
leave_srcdir()
def execute_lw_artifacts():
if options.no_librewolf:
return
enter_srcdir()
if options.distro == 'win':
exe = ".exe"
ospkg = "win64"
dirname = "{}/dist/firefox".format(get_objdir())
elif options.distro == 'deb':
exe = ""
ospkg = "deb"
dirname = "{}/dist/librewolf".format(get_objdir())
elif options.distro == 'rpm':
exe = ""
ospkg = "rpm"
dirname = "{}/dist/librewolf".format(get_objdir())
elif options.distro == 'osx':
#exe = ""
#ospkg = "osx"
#dirname = "{}/dist/firefox".format(get_objdir())
exec("cp {}/dist/librewolf*.dmg ..".format(get_objdir()))
leave_srcdir()
return
exec("rm -rf ../firefox ../librewolf")
exec("cp -rv {} ..".format(dirname))
leave_srcdir()
librewolfdir = "librewolf"
if options.distro == 'osx':
librewolfdir = 'librewolf/Librewolf.app'
if options.distro == 'win':
exec("mv firefox librewolf")
if options.distro != 'osx':
if options.distro == 'win':
exec("mv -v {}/firefox{} {}/librewolf{}".format(librewolfdir,exe,librewolfdir,exe));
exec("rm -rf {}/default-browser-agent* {}/maintainanceservice* {}/pingsender* {}/firefox.*.xml {}/precomplete {}/removed-files {}/uninstall"
.format(librewolfdir,librewolfdir,librewolfdir,librewolfdir,librewolfdir,librewolfdir,librewolfdir,librewolfdir))
exec("cp -v common/source_files/browser/branding/librewolf/firefox.ico {}/librewolf.ico".format(librewolfdir))
if options.distro != 'win':
exec("cp -v files/register-librewolf files/start-librewolf files/start-librewolf.desktop.in librewolf")
# create zip filename
if options.src == 'release':
zipname = "librewolf-{}.en-US.{}.zip".format(lwver,ospkg)
elif options.src == 'nightly':
zipname = "librewolf-{}.en-US.{}-nightly.zip".format(nightly_ver,ospkg)
elif options.src == 'gecko-dev':
zipname = "librewolf-{}.en-US.{}-gecko-dev.zip".format(nightly_ver,ospkg)
# 'windows portable' zip stuff..
if options.distro == 'win':
# we need tmp to tell us what portable folder to make
if options.src == 'release':
tmp = lwver
else:
tmp = nightly_ver
exec("rm -rf librewolf-{}".format(tmp))
#exec("mkdir -p librewolf-{}/Profiles/Default librewolf-{}/LibreWolf".format(pkgver,pkgver))
os.makedirs("librewolf-{}/Profiles/Default".format(tmp), exist_ok=True)
os.makedirs("librewolf-{}/LibreWolf".format(tmp), exist_ok=True)
exec("cp -vr librewolf/* librewolf-{}/LibreWolf".format(tmp))
exec("rm -f librewolf-portable.exe")
exec("wget -q https://gitlab.com/librewolf-community/browser/windows/uploads/8347381f01806245121adcca11b7f35c/librewolf-portable.exe")
exec("mv librewolf-portable.exe librewolf-{}".format(tmp))
exec("rm -f {}".format(zipname))
exec("zip -qr9 {} librewolf-{}".format(zipname,tmp))
# 'normal' zip file..
else:
exec("rm -f {}".format(zipname))
exec("zip -qr9 {} librewolf".format(zipname))
# create installer
if options.distro == 'win':
setupname = "librewolf-{}.en-US.win64-setup.exe".format(lwver)
if options.src == 'nightly':
if os.path.isfile(setupname):
exec("rm -f tmp.exe")
exec("mv {} tmp.exe".format(setupname))
setupname = "librewolf-{}.en-US.win64-nightly-setup.exe".format(nightly_ver)
elif options.src == 'gecko-dev':
if os.path.isfile(setupname):
exec("rm -f tmp.exe")
exec("mv {} tmp.exe".format(setupname))
setupname = "librewolf-{}.en-US.win64-gecko-dev-setup.exe".format(nightly_ver)
exec("rm -f {} tmp.nsi".format(setupname))
s = lwver
if options.src == 'nightly' or options.src == 'gecko-dev':
s = nightly_ver
exec("sed \"s/pkg_version/{}/g\" < setup.nsi > tmp.nsi".format(s))
exec("makensis-3.01.exe -V1 tmp.nsi")
exec("rm -f tmp.nsi")
from_name = 'librewolf-{}.en-US.win64-setup.exe'.format(s)
if from_name != setupname:
exec("mv {} {}".format(from_name,setupname))
if os.path.isfile("tmp.exe"):
exec("mv tmp.exe librewolf-{}.en-US.win64-setup.exe".format(lwver))
def do_upload(filename):
exec("echo \".\" >> upload.txt")
exec("curl --request POST --header \"PRIVATE-TOKEN: {}\" --form \"file=@{}\" \"https://gitlab.com/api/v4/projects/13852981/uploads\" >> upload.txt".format(options.token,filename))
exec("echo \".\" >> upload.txt")
def execute_upload():
if options.token =='':
print("fatal error: You must specify a private token when using the 'upload' command.")
script_exit(1)
if options.distro == 'win':
ospkg = "win64"
elif options.distro == 'deb':
ospkg = "deb"
elif options.distro == 'rpm':
ospkg = "rpm"
elif options.distro == 'osx':
ospkg = "osx"
zip_filename = "librewolf-{}.en-US.{}.zip".format(lwver,ospkg)
setup_filename = "librewolf-{}.en-US.{}-setup.exe".format(lwver,ospkg)
# nightly_setup_filename = "librewolf-{}.en-US.{}-gecko-dev.zip".format(nightly_ver,ospkg)
if not os.path.isfile(zip_filename):
print("fatal error: File '{}' not found.".format(zip_filename))
script_exit(1)
if not os.path.isfile(setup_filename):
print("fatal error: File '{}' not found.".format(setup_filename))
script_exit(1)
# if not os.path.isfile(nightly_setup_filename):
# print("fatal error: File '{}' not found.".format(nightly_setup_filename))
# script_exit(1)
exec("sha256sum {} {} > sha256sums.txt".format(zip_filename,setup_filename))
exec("rm -f upload.txt")
do_upload(setup_filename)
do_upload(zip_filename)
# do_upload(nightly_setup_filename)
do_upload("sha256sums.txt")
print("upload.txt: Upload JSON api results are in the file \'upload.txt\'.")
#
# Main targets:
#
def execute_all():
execute_update_submodules()
execute_fetch()
execute_extract()
execute_lw_do_patches()
execute_build()
execute_lw_post_build()
execute_package()
execute_lw_artifacts()
def execute_clean():
exec("rm -rf librewolf-{} librewolf-{} librewolf-{}".format(pkgver,nightly_ver,lwver))
exec("rm -rf librewolf bootstrap.py tmp.nsi tmp.exe sha256sums.txt upload.txt librewolf-portable.exe")
for filename in glob.glob("librewolf-*"):
try:
os.remove(filename)
except:
pass
def execute_veryclean():
exec("rm -rf firefox-{}.source.tar.xz mozilla-unified tor-browser gecko-dev".format(pkgver))
exec("rm -rf firefox-{}".format(pkgver))
execute_clean()
#
# main commandline interface
#
def main():
if options.src == 'tor-browser':
options.no_librewolf = True
if len(remainder) > 0:
if not options.src in ['release','nightly','tor-browser','gecko-dev']:
print("error: option --src invalid value")
script_exit(1)
if not options.distro in ['deb','rpm', 'win','osx']:
print("error: option --distro invalid value")
script_exit(1)
for arg in remainder:
if arg == 'all':
execute_all()
elif arg == 'clean':
execute_clean()
elif arg == 'veryclean':
execute_veryclean()
# Targets:
elif arg == 'fetch':
execute_fetch()
elif arg == 'extract':
execute_extract()
elif arg == 'lw_do_patches':
execute_lw_do_patches()
elif arg == 'build':
execute_build()
elif arg == 'lw_post_build':
execute_lw_post_build()
elif arg == 'package':
execute_package()
elif arg == 'lw_artifacts':
execute_lw_artifacts()
# Utilities
elif arg == 'update_submodules':
execute_update_submodules()
elif arg == 'upload':
execute_upload()
elif arg == 'git_init':
execute_git_init()
elif arg == 'deps_deb':
execute_deps_deb()
elif arg == 'deps_rpm':
execute_deps_rpm()
elif arg == 'deps_pkg':
execute_deps_pkg()
elif arg == 'rustup':
execute_rustup()
elif arg == 'mach_env':
execute_mach_env()
elif arg == 'reset':
execute_reset()
else:
print("error: unknown command on command line: ", arg)
script_exit(1)
else:
# Print help message
print(help_message.format(options.distro))
#
# Large multiline strings
#
help_message = """# Use:
build.py [<options>] clean | all | <targets> | <utilities>
# Options:
-n,--no-execute - print commands, don't execute them
-l,--no-librewolf - skip LibreWolf specific stages.
-x,--cross - crosscompile from linux, implies -t win
-s,--src <src> - release,nightly,tor-browser,gecko-dev
(default=release)
-t,--distro <distro> - deb,rpm,win,osx (default={})
-T,--token <private_token> - private token used to upload to gitlab.com
-3,--i386 - build 32-bit
-P,--settings-pane - build with the experimental settings pane
# Targets:
all - all steps from fetch to producing setup.exe
clean - clean everything, including extracted/fetched sources
veryclean - clean like above, and also remove build artifacts.
fetch - wget or hg clone or git pull
extract - when using wget, extract the archive.
lw_do_patches - [librewolf] patch the source
build - build the browser
lw_post_build - [librewolf] insert our settings
package - package the browser into zip/apk
lw_artifacts - [librewolf] build setup.exe
# Utilities:
update_submodules - git update submodules
upload - upload the build artifacts to gitlab.com
git_init - put the source folder in a .git repository
reset - use git/mercurial to revert changes to a clean state
deps_deb - install dependencies with apt
deps_rpm - install dependencies with dnf
deps_pkg - install dependencies on freebsd
rustup - update rust
mach_env - create mach environment
"""
#
# mozconfig files:
#
mozconfig_release = """
ac_add_options --enable-application=browser
# This supposedly speeds up compilation (We test through dogfooding anyway)
ac_add_options --disable-tests
ac_add_options --enable-release
ac_add_options --enable-hardening
ac_add_options --disable-debug
#ac_add_options --enable-debug
ac_add_options --enable-rust-simd
#ac_add_options --disable-rust-simd
ac_add_options --enable-optimize
#ac_add_options --disable-optimize
# Branding
#ac_add_options --enable-update-channel=release
## theming bugs: ac_add_options --with-app-name=librewolf
## theming bugs: ac_add_options --with-app-basename=LibreWolf
#ac_add_options --with-branding=browser/branding/librewolf
#ac_add_options --with-distribution-id=io.gitlab.librewolf-community
#ac_add_options --with-unsigned-addon-scopes=app,system
#ac_add_options --allow-addon-sideload
# see issue # https://gitlab.com/librewolf-community/browser/arch/-/issues/49
export MOZ_REQUIRE_SIGNING=
# Features
ac_add_options --disable-crashreporter
ac_add_options --disable-updater
ac_add_options --disable-default-browser-agent
# Disables crash reporting, telemetry and other data gathering tools
mk_add_options MOZ_CRASHREPORTER=0
mk_add_options MOZ_DATA_REPORTING=0
mk_add_options MOZ_SERVICES_HEALTHREPORT=0
mk_add_options MOZ_TELEMETRY_REPORTING=0
# testing..
# MOZ_APP_NAME=librewolf
# This gives the same theming issue as --with-app-name=librewolf
# TODO: find out how to support sandboxed libraries
#ac_add_options --without-wasm-sandboxed-libraries
"""
main()
script_exit(0)

1
common Submodule

@ -0,0 +1 @@
Subproject commit 5baa16f8fbceef6ec48ce3cfa4f5d3a9b082a240

16
files/configure.sh Normal file
View file

@ -0,0 +1,16 @@
# 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/.
MOZ_APP_NAME=librewolf
MOZ_APP_BASENAME=LibreWolf
MOZ_APP_PROFILE=LibreWolf
MOZ_APP_VENDOR="LibreWolf Community"
MOZ_APP_DISPLAYNAME=LibreWolf
MOZ_APP_REMOTINGNAME=librewolf
MOZ_DEV_EDITION=1
MOZ_TELEMETRY_REPORTING=
MOZ_SERVICES_HEALTHREPORT=
MOZ_NORMANDY=
MOZ_REQUIRE_SIGNING=
MOZ_DEFAULT_BROWSER_AGENT=0

7
files/register-librewolf Executable file
View file

@ -0,0 +1,7 @@
#!/usr/bin/env bash
sed "s,MYDIR,$(pwd),g" < start-librewolf.desktop.in > start-librewolf.desktop
mkdir -p "$HOME/.local/share/applications/"
cp -v ./start-librewolf.desktop "$HOME/.local/share/applications/"
update-desktop-database "$HOME/.local/share/applications/"

22
files/start-librewolf Executable file
View file

@ -0,0 +1,22 @@
#!/usr/bin/env bash
# Do not (try to) connect to the session manager
unset SESSION_MANAGER
# If XAUTHORITY is unset, set it to its default value of $HOME/.Xauthority
# before we change HOME below. (See xauth(1) and #1945.) XDM and KDM rely
# on applications using this default value.
if [ -z "$XAUTHORITY" ]; then
XAUTHORITY=~/.Xauthority
export XAUTHORITY
fi
# Try to be agnostic to where we're being started from, chdir to where
# the script is.
mydir="`dirname "$0"`"
test -d "$mydir" && cd "$mydir"
#./librewolf --class "LibreWolf" -profile TorBrowser/Data/Browser/profile.default "${@}" > "$logfile" 2>&1 </dev/null &
./librewolf --detach --class "LibreWolf" > /dev/null 2>&1 </dev/null &
exit $?

View file

@ -0,0 +1,10 @@
[Desktop Entry]
Type=Application
Name=LibreWolf
GenericName=Web Browser
Comment=LibreWolf Browser
Categories=Network;WebBrowser;Security;
Exec=MYDIR/./start-librewolf
X-TorBrowser-ExecShell=MYDIR/./start-librewolf
Icon=MYDIR/./browser/chrome/icons/default/default64.png
StartupWMClass=LibreWolf

4
files/start-tor.bat Normal file
View file

@ -0,0 +1,4 @@
@rem Windows Expert Bundle:
@rem https://www.torproject.org/download/tor/
Tor\tor.exe

3
librewolf-portable/.gitignore vendored Normal file
View file

@ -0,0 +1,3 @@
librewolf-portable.aps
.vs
x64

View file

@ -0,0 +1,3 @@
# librewolf-portable
Execute librewolf.exe -profile Profiles\Default

View file

@ -0,0 +1,30 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by librewolf-portable.rc
#define IDS_APP_TITLE 103
#define IDR_MAINFRAME 128
#define IDD_LIBREWOLFPORTABLE_DIALOG 102
#define IDD_ABOUTBOX 103
#define IDM_ABOUT 104
#define IDM_EXIT 105
#define IDI_LIBREWOLFPORTABLE 107
#define IDI_SMALL 108
#define IDC_LIBREWOLFPORTABLE 109
#define IDC_MYICON 2
#ifndef IDC_STATIC
#define IDC_STATIC -1
#endif
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NO_MFC 130
#define _APS_NEXT_RESOURCE_VALUE 129
#define _APS_NEXT_COMMAND_VALUE 32771
#define _APS_NEXT_CONTROL_VALUE 1000
#define _APS_NEXT_SYMED_VALUE 110
#endif
#endif

View file

@ -0,0 +1 @@
msbuild /t:Clean,Build /p:Configuration=Release

Binary file not shown.

View file

@ -0,0 +1,69 @@
// librewolf-portable.cpp : Run librewolf.exe with -profile parameter.
//
#define _CRT_SECURE_NO_WARNINGS
#include <windows.h>
int fileExists(TCHAR* file)
{
WIN32_FIND_DATA FindFileData;
HANDLE handle = FindFirstFile(file, &FindFileData);
int found = handle != INVALID_HANDLE_VALUE;
if (found)
{
//FindClose(&handle); this will crash
FindClose(handle);
}
return found;
}
int APIENTRY wWinMain(_In_ HINSTANCE hInstance,
_In_opt_ HINSTANCE hPrevInstance,
_In_ LPWSTR lpCmdLine,
_In_ int nCmdShow)
{
//https://docs.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=cmd
//constexpr int max_path = _MAX_PATH+1;
constexpr int max_path = 32767+1;
static wchar_t path[max_path], dir[max_path], exe[max_path], cmdline[max_path];
GetModuleFileName(NULL, path, _MAX_PATH);
*wcsrchr(path,L'\\') = L'\0';
wcscpy(dir, path);
wcscat(dir, L"\\Profiles\\Default");
wcscpy(exe, path);
wcscat(exe, L"\\librewolf.exe");
if (!fileExists(exe)) {
wcscpy(exe, path);
wcscat(exe, L"\\LibreWolf\\librewolf.exe");
if (!fileExists(exe)) {
MessageBox(NULL, L"Can\'t find librewolf.exe in . or LibreWolf", path, MB_OK);
return 1;
}
}
wsprintf(cmdline, L"\"%s\" -profile \"%s\"", exe, dir);
STARTUPINFOW siStartupInfo;
PROCESS_INFORMATION piProcessInfo;
memset(&siStartupInfo, 0, sizeof(siStartupInfo));
memset(&piProcessInfo, 0, sizeof(piProcessInfo));
siStartupInfo.cb = sizeof(siStartupInfo);
if (!CreateProcess(exe, cmdline, NULL, NULL, FALSE, NORMAL_PRIORITY_CLASS, NULL, NULL, &siStartupInfo, &piProcessInfo))
{
DWORD i = GetLastError();
wsprintf(dir, L"CreateProcess() failed with error %i", i);
MessageBox(NULL, dir, L"librewolf-portable", MB_OK);
return 1;
}
return 0;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

View file

@ -0,0 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.31424.327
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "librewolf-portable", "librewolf-portable.vcxproj", "{363A5584-2FEA-46A3-A52B-7254D932AABA}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{363A5584-2FEA-46A3-A52B-7254D932AABA}.Debug|x64.ActiveCfg = Debug|x64
{363A5584-2FEA-46A3-A52B-7254D932AABA}.Debug|x64.Build.0 = Debug|x64
{363A5584-2FEA-46A3-A52B-7254D932AABA}.Debug|x86.ActiveCfg = Debug|Win32
{363A5584-2FEA-46A3-A52B-7254D932AABA}.Debug|x86.Build.0 = Debug|Win32
{363A5584-2FEA-46A3-A52B-7254D932AABA}.Release|x64.ActiveCfg = Release|x64
{363A5584-2FEA-46A3-A52B-7254D932AABA}.Release|x64.Build.0 = Release|x64
{363A5584-2FEA-46A3-A52B-7254D932AABA}.Release|x86.ActiveCfg = Release|Win32
{363A5584-2FEA-46A3-A52B-7254D932AABA}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {968E3E1E-9A31-4937-A7E9-FF45C074E14E}
EndGlobalSection
EndGlobal

View file

@ -0,0 +1,160 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{363a5584-2fea-46a3-a52b-7254d932aaba}</ProjectGuid>
<RootNamespace>librewolfportable</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="framework.h" />
<ClInclude Include="librewolf-portable.h" />
<ClInclude Include="Resource.h" />
<ClInclude Include="targetver.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="librewolf-portable.cpp" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="librewolf-portable.rc" />
</ItemGroup>
<ItemGroup>
<Image Include="librewolf-portable.ico" />
<Image Include="small.ico" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View file

@ -0,0 +1,49 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="framework.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="targetver.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Resource.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="librewolf-portable.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="librewolf-portable.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="librewolf-portable.rc">
<Filter>Resource Files</Filter>
</ResourceCompile>
</ItemGroup>
<ItemGroup>
<Image Include="small.ico">
<Filter>Resource Files</Filter>
</Image>
<Image Include="librewolf-portable.ico">
<Filter>Resource Files</Filter>
</Image>
</ItemGroup>
</Project>

View file

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup />
</Project>

View file

@ -0,0 +1,6 @@
#pragma once
// // Including SDKDDKVer.h defines the highest available Windows platform.
// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and
// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h.
#include <SDKDDKVer.h>

View file

@ -0,0 +1,29 @@
diff --git a/browser/confvars.sh b/browser/confvars.sh
index 92871c9516..1e151180dd 100644
--- a/browser/confvars.sh
+++ b/browser/confvars.sh
@@ -3,8 +3,11 @@
# 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/.
-MOZ_APP_VENDOR=Mozilla
-MOZ_UPDATER=1
+MOZ_APP_BASENAME=LibreWolf
+MOZ_APP_NAME=librewolf
+MOZ_APP_VENDOR="LibreWolf Community"
+
+MOZ_UPDATER=0
if test "$OS_ARCH" = "WINNT"; then
if ! test "$HAVE_64BIT_BUILD"; then
@@ -34,8 +36,8 @@ BROWSER_CHROME_URL=chrome://browser/content/browser.xhtml
# For mozilla-beta, mozilla-release, or mozilla-central repositories, use
# "unofficial" branding.
# For the mozilla-aurora repository, use "aurora".
-MOZ_BRANDING_DIRECTORY=browser/branding/unofficial
-MOZ_OFFICIAL_BRANDING_DIRECTORY=browser/branding/official
+MOZ_BRANDING_DIRECTORY=browser/branding/librewolf
+MOZ_OFFICIAL_BRANDING_DIRECTORY=browser/branding/librewolf
MOZ_APP_ID={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
MOZ_PROFILE_MIGRATOR=1

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,17 @@
diff --git a/browser/components/privatebrowsing/content/aboutPrivateBrowsing.html b/browser/components/privatebrowsing/content/aboutPrivateBrowsing.html
--- a/browser/components/privatebrowsing/content/aboutPrivateBrowsing.html
+++ b/browser/components/privatebrowsing/content/aboutPrivateBrowsing.html
@@ -54,13 +54,10 @@
<div class="info">
<h1 id="info-title" data-l10n-id="about-private-browsing-info-title"></h1>
<p id="info-body" data-l10n-id="about-private-browsing-info-description"></p>
- <a id="private-browsing-myths" data-l10n-id="about-private-browsing-info-myths"></a>
</div>
</div>
<div class="promo">
- <p id="private-browsing-vpn-text" class="vpn-promo" data-l10n-id="about-private-browsing-need-more-privacy"></p>
- <a id="private-browsing-vpn-link" class="vpn-promo" data-l10n-id="about-private-browsing-turn-on-vpn"></a>
</div>
</body>
</html>

View file

@ -0,0 +1,14 @@
diff --git a/browser/installer/package-manifest.in b/browser/installer/package-manifest.in
index 2bdafc86b3..789bece8e6 100644
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
@@ -302,6 +302,9 @@
; Technically this is an app pref file, but we are keeping it in the original
; gre location for now.
@RESPATH@/defaults/pref/channel-prefs.js
+@RESPATH@/defaults/pref/local-settings.js
+@RESPATH@/distribution/policies.json
+@RESPATH@/librewolf.cfg
; Background tasks-specific preferences. These are in the GRE
; location since they apply to all tasks at this time.

View file

@ -0,0 +1,70 @@
diff -r 2689403bd0d2 browser/extensions/moz.build
--- a/browser/extensions/moz.build Mon Jun 28 12:08:51 2021 +0000
+++ b/browser/extensions/moz.build Mon Jun 28 14:29:05 2021 +0200
@@ -5,11 +5,8 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
DIRS += [
- "doh-rollout",
"formautofill",
"screenshots",
- "webcompat",
- "report-site-issue",
"pictureinpicture",
]
diff -r 2689403bd0d2 browser/locales/Makefile.in
--- a/browser/locales/Makefile.in Mon Jun 28 12:08:51 2021 +0000
+++ b/browser/locales/Makefile.in Mon Jun 28 14:29:05 2021 +0200
@@ -61,7 +61,6 @@
ifneq (,$(wildcard ../extensions/formautofill/locales))
@$(MAKE) -C ../extensions/formautofill/locales AB_CD=$* XPI_NAME=locale-$*
endif
- @$(MAKE) -C ../extensions/report-site-issue/locales AB_CD=$* XPI_NAME=locale-$*
@$(MAKE) -C ../../devtools/client/locales AB_CD=$* XPI_NAME=locale-$* XPI_ROOT_APPID='$(XPI_ROOT_APPID)'
@$(MAKE) -C ../../devtools/startup/locales AB_CD=$* XPI_NAME=locale-$* XPI_ROOT_APPID='$(XPI_ROOT_APPID)'
@$(MAKE) l10n AB_CD=$* XPI_NAME=locale-$* PREF_DIR=$(PREF_DIR)
@@ -82,7 +81,6 @@
@$(MAKE) -C ../../devtools/startup/locales chrome AB_CD=$*
@$(MAKE) chrome AB_CD=$*
@$(MAKE) -C $(DEPTH)/$(MOZ_BRANDING_DIRECTORY)/locales chrome AB_CD=$*
- @$(MAKE) -C ../extensions/report-site-issue/locales chrome AB_CD=$*
package-win32-installer: $(SUBMAKEFILES)
$(MAKE) -C ../installer/windows CONFIG_DIR=l10ngen ZIP_IN='$(ZIP_OUT)' installer
diff -r 2689403bd0d2 browser/locales/filter.py
--- a/browser/locales/filter.py Mon Jun 28 12:08:51 2021 +0000
+++ b/browser/locales/filter.py Mon Jun 28 14:29:05 2021 +0200
@@ -19,7 +19,6 @@
"devtools/startup",
"browser",
"browser/extensions/formautofill",
- "browser/extensions/report-site-issue",
"extensions/spellcheck",
"other-licenses/branding/firefox",
"browser/branding/official",
diff -r 2689403bd0d2 browser/locales/l10n.ini
--- a/browser/locales/l10n.ini Mon Jun 28 12:08:51 2021 +0000
+++ b/browser/locales/l10n.ini Mon Jun 28 14:29:05 2021 +0200
@@ -13,7 +13,6 @@
devtools/client
devtools/startup
browser/extensions/formautofill
- browser/extensions/report-site-issue
[includes]
# non-central apps might want to use %(topsrcdir)s here, or other vars
diff -r 2689403bd0d2 browser/locales/l10n.toml
--- a/browser/locales/l10n.toml Mon Jun 28 12:08:51 2021 +0000
+++ b/browser/locales/l10n.toml Mon Jun 28 14:29:05 2021 +0200
@@ -132,10 +132,6 @@
l10n = "{l}browser/extensions/formautofill/**"
[[paths]]
- reference = "browser/extensions/report-site-issue/locales/en-US/**"
- l10n = "{l}browser/extensions/report-site-issue/**"
-
-[[paths]]
reference = "services/sync/locales/en-US/**"
l10n = "{l}services/sync/**"

View file

@ -0,0 +1,15 @@
diff --git a/.mozconfig b/.mozconfig
index d71c858844e3..2d295de7df72 100755
--- a/.mozconfig
+++ b/.mozconfig
@@ -16,8 +16,8 @@ export MOZILLA_OFFICIAL=1
ac_add_options --enable-optimize
ac_add_options --enable-official-branding
-# Let's support GTK3 for ESR60
-ac_add_options --enable-default-toolkit=cairo-gtk3
+## Let's support GTK3 for ESR60
+#ac_add_options --enable-default-toolkit=cairo-gtk3
ac_add_options --disable-strip
ac_add_options --disable-install-strip

View file

@ -0,0 +1,13 @@
diff --git a/browser/components/urlbar/UrlbarProviderInterventions.jsm b/browser/components/urlbar/UrlbarProviderInterventions.jsm
index e22886ce92..d46d8191f2 100644
--- a/browser/components/urlbar/UrlbarProviderInterventions.jsm
+++ b/browser/components/urlbar/UrlbarProviderInterventions.jsm
@@ -451,7 +451,7 @@ class ProviderInterventions extends UrlbarProvider {
]),
});
for (let [id, phrases] of Object.entries(DOCUMENTS)) {
- queryScorer.addDocument({ id, phrases });
+// queryScorer.addDocument({ id, phrases });
}
return queryScorer;
});

View file

@ -0,0 +1,18 @@
diff -r 536a892dd51f browser/components/privatebrowsing/content/aboutPrivateBrowsing.html
--- a/browser/components/privatebrowsing/content/aboutPrivateBrowsing.html Tue Jun 22 16:56:13 2021 +0000
+++ b/browser/components/privatebrowsing/content/aboutPrivateBrowsing.html Wed Jun 23 07:09:38 2021 +0200
@@ -58,6 +58,7 @@
</div>
</div>
+ <!--
<div class="promo">
<div class="promo-image-large">
<img src="" alt="" />
@@ -73,5 +74,6 @@
</div>
</div>
</div>
+ -->
</body>
</html>

1
settings Submodule

@ -0,0 +1 @@
Subproject commit 3b4e0f58b4bec53faa98ec85a3bca36f11a77afc

124
setup.nsi Normal file
View file

@ -0,0 +1,124 @@
#
# Change these values to fit your application...
#
!define APPNAME "LibreWolf" # Full app name, like: "Gtk+ 2.0 Hello World"
!define PROGNAME "librewolf" # executable name, like: gtk2hello
!define PROG_VERSION "pkg_version" # the program version, like: 0.3.0
!define ICON_NAME "librewolf.ico" # filename of icon to use for this app
!define COMPANYNAME "LibreWolf" # Your name, or company (or just the program name)
!define ESTIMATED_SIZE 190000 # Estimated size (in KB) of installed program for use in "add or remove programs" / 190 MB
#
# The actual installer/uninstaller, you should not need to change much here below
#
Name "${PROGNAME}"
OutFile "${PROGNAME}-${PROG_VERSION}.en-US.win64-setup.exe"
InstallDir $PROGRAMFILES64\${APPNAME}
RequestExecutionLevel admin
Page directory
Page instfiles
function .onInit
setShellVarContext all
functionEnd
Section "${PROGNAME}"
# Copy files
SetOutPath $INSTDIR
File /r librewolf\*.*
# Start Menu
createDirectory "$SMPROGRAMS\${COMPANYNAME}"
createShortCut "$SMPROGRAMS\${COMPANYNAME}\${APPNAME}.lnk" "$INSTDIR\${PROGNAME}.exe" "" "$INSTDIR\${ICON_NAME}"
createShortCut "$SMPROGRAMS\${COMPANYNAME}\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" ""
# Uninstaller
writeUninstaller "$INSTDIR\uninstall.exe"
# Registry information for add/remove programs
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "DisplayName" "${APPNAME}"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "UninstallString" "$\"$INSTDIR\uninstall.exe$\""
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "QuietUninstallString" "$\"$INSTDIR\uninstall.exe$\" /S"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "InstallLocation" "$\"$INSTDIR$\""
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "DisplayIcon" "$\"$INSTDIR\${ICON_NAME}$\""
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "Publisher" "${COMPANYNAME}"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "DisplayVersion" "${PROG_VERSION}"
# There is no option for modifying or repairing the install
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "NoModify" 1
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "NoRepair" 1
# Set the INSTALLSIZE constant (!defined at the top of this script) so Add/Remove Programs can accurately report the size
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "EstimatedSize" ${ESTIMATED_SIZE}
#
# Registry information to let Windows pick us up in the list of available browsers
#
WriteRegStr HKLM "Software\Clients\StartMenuInternet\LibreWolf" "" "LibreWolf"
WriteRegStr HKLM "Software\Clients\StartMenuInternet\LibreWolf\Capabilities" "ApplicationDescription" "LibreWolf"
WriteRegStr HKLM "Software\Clients\StartMenuInternet\LibreWolf\Capabilities" "ApplicationIcon" "$INSTDIR\librewolf.exe,0"
WriteRegStr HKLM "Software\Clients\StartMenuInternet\LibreWolf\Capabilities" "ApplicationName" "LibreWolf"
WriteRegStr HKLM "Software\Clients\StartMenuInternet\LibreWolf\Capabilities\FileAssociations" ".htm" "LibreWolfHTM"
WriteRegStr HKLM "Software\Clients\StartMenuInternet\LibreWolf\Capabilities\FileAssociations" ".html" "LibreWolfHTM"
WriteRegStr HKLM "Software\Clients\StartMenuInternet\LibreWolf\Capabilities\Startmenu" "StartMenuInternet" "LibreWolf"
WriteRegStr HKLM "Software\Clients\StartMenuInternet\LibreWolf\Capabilities\URLAssociations" "http" "LibreWolfHTM"
WriteRegStr HKLM "Software\Clients\StartMenuInternet\LibreWolf\Capabilities\URLAssociations" "https" "LibreWolfHTM"
WriteRegStr HKLM "Software\Clients\StartMenuInternet\LibreWolf\DefaultIcon" "" "$INSTDIR\librewolf.exe,0"
WriteRegStr HKLM "Software\Clients\StartMenuInternet\LibreWolf\shell\open\command" "" "$INSTDIR\librewolf.exe"
WriteRegStr HKLM "Software\RegisteredApplications" "LibreWolf" "Software\Clients\StartMenuInternet\LibreWolf\Capabilities"
WriteRegStr HKLM "Software\Classes\LibreWolfHTM" "" "LibreWolf Handler"
WriteRegStr HKLM "Software\Classes\LibreWolfHTM" "AppUserModelId" "LibreWolf"
WriteRegStr HKLM "Software\Classes\LibreWolfHTM\Application" "AppUserModelId" "LibreWolf"
WriteRegStr HKLM "Software\Classes\LibreWolfHTM\Application" "ApplicationIcon" "$INSTDIR\librewolf.exe,0"
WriteRegStr HKLM "Software\Classes\LibreWolfHTM\Application" "ApplicationName" "LibreWolf"
WriteRegStr HKLM "Software\Classes\LibreWolfHTM\Application" "ApplicationDescription" "Howling to Freedom"
WriteRegStr HKLM "Software\Classes\LibreWolfHTM\Application" "ApplicationCompany" "LibreWolf"
WriteRegStr HKLM "Software\Classes\LibreWolfHTM\DefaultIcon" "" "$INSTDIR\librewolf.exe,0"
WriteRegStr HKLM "Software\Classes\LibreWolfHTM\shell\open\command" "" "$INSTDIR\librewolf.exe %1"
SectionEnd
# Before uninstall, ask for confirmation
function un.onInit
SetShellVarContext all
# Verify the uninstaller - last chance to back out
# (commented this out, it causes problems with Chocolatey.)
# MessageBox MB_OKCANCEL "Permanantly remove ${APPNAME}?" IDOK next
# Abort
# next:
functionEnd
# Uninstaller
section "uninstall"
# Remove Start Menu launcher
delete "$SMPROGRAMS\${COMPANYNAME}\${APPNAME}.lnk"
delete "$SMPROGRAMS\${COMPANYNAME}\Uninstall.lnk"
# Try to remove the Start Menu folder - this will only happen if it is empty
rmDir "$SMPROGRAMS\${COMPANYNAME}"
# Remove files
rmDir /r $INSTDIR
# Remove uninstaller information from the registry
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}"
#
# Windows default browser integration
#
DeleteRegKey HKLM "Software\Clients\StartMenuInternet\LibreWolf"
DeleteRegKey HKLM "Software\RegisteredApplications"
DeleteRegKey HKLM "Software\Classes\LibreWolfHTM"
sectionEnd