mirror of
https://codeberg.org/librewolf/source.git
synced 2024-12-22 05:33:03 -05:00
Initial commit
This commit is contained in:
commit
49c0107a1b
16 changed files with 831 additions and 0 deletions
175
Makefile
Normal file
175
Makefile
Normal file
|
@ -0,0 +1,175 @@
|
|||
.PHONY : all help clean veryclean check source buildenv build artifacts pub purge init
|
||||
|
||||
version_file=./version
|
||||
version:=$(shell cat $(version_file))
|
||||
|
||||
include assets/Makefile.includes
|
||||
|
||||
help :
|
||||
@echo "use: make [all] [clean] [veryclean] [check]"
|
||||
@echo " [source] [pub] [buildenv] [no-cache] [upload]"
|
||||
@echo " [purge] [prune] [init]"
|
||||
@echo ""
|
||||
@echo " all - do: make source [build-all] artifacts pub"
|
||||
@echo " clean - clean the biggest folders and intermediate results."
|
||||
@echo " veryclean - clean everything, including sources and artifacts."
|
||||
@echo " check - check if there is a new version of Firefox."
|
||||
@echo ""
|
||||
@echo " source - create the source tarball."
|
||||
@echo ""
|
||||
@echo " debian10 - build the browser for debian10."
|
||||
@echo " debian11 - build the browser for debian11."
|
||||
@echo " mint20 - build the browser for mint20."
|
||||
@echo " ubuntu20 - build the browser for mint20."
|
||||
@echo ""
|
||||
@echo " pub - copy the final artifact to the pub/librewolf tree."
|
||||
@echo ""
|
||||
@echo " buildenv - 'docker build' the images needed for building."
|
||||
@echo " no-cache - 'docker build --no-cache' the images."
|
||||
@echo " upload - upload the images to docker hub."
|
||||
@echo ""
|
||||
@echo " purge/prune - remove all docker resources not currently in use."
|
||||
@echo " init - run bootstrap.py locally."
|
||||
|
||||
clean :
|
||||
make -C source clean
|
||||
|
||||
make -C build/debian10 clean
|
||||
make -C artifacts/debian10 clean
|
||||
|
||||
make -C build/debian11 clean
|
||||
make -C artifacts/debian11 clean
|
||||
|
||||
make -C build/mint20 clean
|
||||
make -C artifacts/mint20 clean
|
||||
|
||||
make -C build/ubuntu20 clean
|
||||
make -C artifacts/ubuntu20 clean
|
||||
|
||||
veryclean : # deliberately not depending on 'clean' in this case.
|
||||
make -C source veryclean
|
||||
|
||||
make -C buildenv/debian10 veryclean
|
||||
make -C build/debian10 veryclean
|
||||
make -C artifacts/debian10 veryclean
|
||||
|
||||
make -C buildenv/debian11 veryclean
|
||||
make -C build/debian11 veryclean
|
||||
make -C artifacts/debian11 veryclean
|
||||
|
||||
make -C buildenv/mint20 veryclean
|
||||
make -C build/mint20 veryclean
|
||||
make -C artifacts/mint20 veryclean
|
||||
|
||||
make -C buildenv/ubuntu20 veryclean
|
||||
make -C build/ubuntu20 veryclean
|
||||
make -C artifacts/ubuntu20 veryclean
|
||||
|
||||
|
||||
#
|
||||
# The 'all' target builds everything while trying to minimize
|
||||
# disk space.
|
||||
#
|
||||
|
||||
all : source
|
||||
make -C source pub
|
||||
|
||||
make debian10
|
||||
make -C artifacts/debian10 pub
|
||||
make -C build/debian10 veryclean # reclaim disk space
|
||||
|
||||
make debian11
|
||||
make -C artifacts/debian11 pub
|
||||
make -C build/debian11 veryclean # reclaim disk space
|
||||
|
||||
make mint20
|
||||
make -C artifacts/mint20 pub
|
||||
make -C build/mint20 veryclean # reclaim disk space
|
||||
|
||||
make ubuntu20
|
||||
make -C artifacts/ubuntu20 pub
|
||||
make -C build/ubuntu20 veryclean # reclaim disk space
|
||||
|
||||
debian10 :
|
||||
make -C build/debian10 all # perform ./mach build && ./mach package
|
||||
make -C artifacts/debian10 all # make final artifacts
|
||||
|
||||
debian11 :
|
||||
make -C build/debian11 all # perform ./mach build && ./mach package
|
||||
make -C artifacts/debian11 all # make final artifacts
|
||||
|
||||
mint20 :
|
||||
make -C build/mint20 all # perform ./mach build && ./mach package
|
||||
make -C artifacts/mint20 all # make final artifacts
|
||||
|
||||
ubuntu20 :
|
||||
make -C build/ubuntu20 all # perform ./mach build && ./mach package
|
||||
make -C artifacts/ubuntu20 all # make final artifacts
|
||||
|
||||
|
||||
#
|
||||
# Keeping ./version up to date.
|
||||
#
|
||||
|
||||
check :
|
||||
@python3 assets/update-version.py
|
||||
|
||||
|
||||
#
|
||||
# Making the source tarball
|
||||
#
|
||||
|
||||
source :
|
||||
make -C source all
|
||||
|
||||
|
||||
#
|
||||
# buildenv: Creating build environment and performing the build
|
||||
#
|
||||
|
||||
buildenv :
|
||||
make -C buildenv/debian10 build
|
||||
make -C buildenv/debian11 build
|
||||
make -C buildenv/mint20 build
|
||||
make -C buildenv/ubuntu20 build
|
||||
|
||||
no-cache :
|
||||
make -C buildenv/debian10 no-cache
|
||||
make -C buildenv/debian11 no-cache
|
||||
make -C buildenv/ubuntu20 no-cache
|
||||
|
||||
upload :
|
||||
make -C buildenv/debian10 upload
|
||||
make -C buildenv/debian11 upload
|
||||
make -C buildenv/ubuntu20 upload
|
||||
|
||||
|
||||
#
|
||||
# pub
|
||||
#
|
||||
|
||||
pub :
|
||||
make -C source pub
|
||||
make -C artifacts/debian10 pub
|
||||
make -C artifacts/debian11 pub
|
||||
make -C artifacts/mint20 pub
|
||||
make -C artifacts/ubuntu20 pub
|
||||
|
||||
|
||||
#
|
||||
# zapping all docker state..
|
||||
#
|
||||
|
||||
purge : prune
|
||||
prune :
|
||||
$(docker) system prune --all --force
|
||||
|
||||
|
||||
#
|
||||
# init: run bootstrap on local machine
|
||||
#
|
||||
|
||||
init :
|
||||
wget -q "https://hg.mozilla.org/mozilla-central/raw-file/default/python/mozboot/bin/bootstrap.py"
|
||||
python3 bootstrap.py --no-interactive --application-choice=browser
|
||||
rm -rf bootstrap.py mozilla-unified
|
40
assets/Makefile.artifacts.deb
Normal file
40
assets/Makefile.artifacts.deb
Normal file
|
@ -0,0 +1,40 @@
|
|||
.PHONY : all clean veryclean pub shell
|
||||
|
||||
version_file=../../version
|
||||
version:=$(shell cat $(version_file))
|
||||
|
||||
tag=librewolf/bs4-buildenv-$(distro)
|
||||
|
||||
build-artifact=librewolf-$(version).en-US.linux-x86_64.tar.bz2
|
||||
output=librewolf-$(version).en-US.$(distro).x86_64.deb
|
||||
|
||||
all : $(output)
|
||||
|
||||
clean :
|
||||
$(rm) -rf work
|
||||
|
||||
veryclean : clean
|
||||
rm -f $(build-artifact) $(output)
|
||||
|
||||
# pub
|
||||
pub : $(output)
|
||||
-mkdir -p ../../pub/librewolf/librewolf-$(version)
|
||||
cp -v $(output) ../../pub/librewolf/librewolf-$(version)
|
||||
|
||||
$(output) : work
|
||||
$(docker) run --rm --privileged -v $(shell pwd)/work:/work:rw $(tag) bash build-deb.sh $(version)
|
||||
cp -v work/librewolf.deb $(output)
|
||||
|
||||
work : $(build-artifact)
|
||||
$(rm) -rf work
|
||||
mkdir work
|
||||
(cd work && tar xf ../$(build-artifact))
|
||||
cp -v ../../assets/build-deb.sh work
|
||||
|
||||
$(build-artifact) :
|
||||
@(echo "Error: Please use 'make $(distro)' at top-level to build first." && false)
|
||||
|
||||
|
||||
shell : work
|
||||
$(docker) pull $(tag)
|
||||
$(docker) run -it --rm --privileged -v $(shell pwd)/work:/work:rw $(tag) bash
|
28
assets/Makefile.build
Normal file
28
assets/Makefile.build
Normal file
|
@ -0,0 +1,28 @@
|
|||
.PHONY : all clean veryclean build shell
|
||||
|
||||
version_file=../../version
|
||||
version:=$(shell cat $(version_file))
|
||||
|
||||
tag=librewolf/bs4-buildenv-$(distro)
|
||||
|
||||
|
||||
all : build
|
||||
clean :
|
||||
$(rm) -rf work
|
||||
veryclean : clean
|
||||
-$(docker) rmi $(tag)
|
||||
|
||||
work : ../../source/librewolf-$(version).source.tar.gz
|
||||
$(rm) -rf work
|
||||
$(mkdir) work
|
||||
(cd work && $(tar) xf ../$< && cd ..)
|
||||
$(chown) -R root:root work
|
||||
|
||||
build : work
|
||||
$(docker) pull $(tag)
|
||||
$(docker) run --rm --privileged -v $(shell pwd)/work:/work:rw $(tag) python3 /work/librewolf-$(version)/build-librewolf.py $(version)
|
||||
cp -v work/librewolf-$(version)/librewolf-$(version).en-US.linux-x86_64.tar.bz2 ../../artifacts/$(distro)
|
||||
|
||||
shell : work
|
||||
$(docker) pull $(tag)
|
||||
$(docker) run -it --rm --privileged -v $(shell pwd)/work:/work:rw $(tag) bash
|
21
assets/Makefile.buildenv
Normal file
21
assets/Makefile.buildenv
Normal file
|
@ -0,0 +1,21 @@
|
|||
.PHONY : all clean veryclean build no-cache upload push
|
||||
|
||||
tag=librewolf/bs4-buildenv-$(distro)
|
||||
|
||||
|
||||
all : build
|
||||
|
||||
clean :
|
||||
veryclean : clean
|
||||
-$(docker) rmi $(tag)
|
||||
|
||||
build :
|
||||
$(docker) build -t $(tag) .
|
||||
|
||||
no-cache :
|
||||
$(docker) build --no-cache -t $(tag) .
|
||||
|
||||
upload : push
|
||||
|
||||
push : build
|
||||
$(docker) push $(tag)
|
6
assets/Makefile.includes
Normal file
6
assets/Makefile.includes
Normal file
|
@ -0,0 +1,6 @@
|
|||
docker=sudo docker
|
||||
rm=sudo rm
|
||||
mkdir=sudo mkdir
|
||||
tar=sudo tar
|
||||
cp=sudo cp -v
|
||||
chown=sudo chown
|
38
assets/build-deb.sh
Executable file
38
assets/build-deb.sh
Executable file
|
@ -0,0 +1,38 @@
|
|||
mv -v librewolf lwdist
|
||||
|
||||
mkdir -p librewolf/DEBIAN
|
||||
cd librewolf/DEBIAN
|
||||
cat <<EOF > control
|
||||
Architecture: all
|
||||
Build-Depends: inkscape, librsvg2-bin
|
||||
Depends: libc6, libgcc1, libstdc++6, wget
|
||||
Description: The Librewolf Browser
|
||||
Download-Size: 56.0 MB
|
||||
Essential: no
|
||||
Installed-Size: 204 MB
|
||||
Maintainer: Bert van der Weerd <bert@stanzabird.nl>
|
||||
Package: librewolf
|
||||
Priority: optional
|
||||
Provides: gnome-www-browser, www-browser, x-www-browser
|
||||
Section: web
|
||||
EOF
|
||||
echo "Version: $1" >> control
|
||||
cd ..
|
||||
|
||||
mkdir -p usr/share/librewolf
|
||||
mv -v ../lwdist/* usr/share/librewolf
|
||||
rmdir ../lwdist
|
||||
|
||||
mkdir -p usr/bin
|
||||
cd usr/bin
|
||||
ln -vs ../share/librewolf/librewolf
|
||||
cd ../..
|
||||
|
||||
cd ..
|
||||
dpkg-deb --build librewolf
|
||||
|
||||
echo ""
|
||||
ls -lh librewolf.deb
|
||||
exit 0
|
||||
|
||||
|
138
assets/build-librewolf.py
Executable file
138
assets/build-librewolf.py
Executable file
|
@ -0,0 +1,138 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
import os
|
||||
import sys
|
||||
import optparse
|
||||
import time
|
||||
import glob
|
||||
|
||||
|
||||
start_time = time.time()
|
||||
|
||||
|
||||
parser = optparse.OptionParser()
|
||||
parser.add_option('-n', '--no-execute', dest='no_execute', default=False, action="store_true")
|
||||
options, args = parser.parse_args()
|
||||
|
||||
#
|
||||
# general functions
|
||||
#
|
||||
|
||||
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 exec(cmd, exit_on_fail = True, do_print = True):
|
||||
if cmd != '':
|
||||
if do_print:
|
||||
print(cmd)
|
||||
if not options.no_execute:
|
||||
retval = os.system(cmd)
|
||||
if retval != 0 and exit_on_fail:
|
||||
print("fatal error: command '{}' failed".format(cmd))
|
||||
script_exit(1)
|
||||
return retval
|
||||
return None
|
||||
|
||||
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)
|
||||
|
||||
def enter_srcdir(_dir = None):
|
||||
if _dir == None:
|
||||
dir = "librewolf-{}".format(version)
|
||||
else:
|
||||
dir = _dir
|
||||
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("..")
|
||||
|
||||
|
||||
#
|
||||
# The actual script
|
||||
#
|
||||
|
||||
#
|
||||
# post_build stage:
|
||||
#
|
||||
|
||||
|
||||
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]
|
||||
|
||||
_dirname = ""
|
||||
|
||||
def post_build(is_macos=False):
|
||||
print('--- post_build stage [init] ---------------------------------------')
|
||||
dirname = get_objdir()
|
||||
_dirname = dirname
|
||||
|
||||
distfolder = "dist/bin"
|
||||
if is_macos:
|
||||
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('git clone https://gitlab.com/librewolf-community/settings.git')
|
||||
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))
|
||||
exec('rm -rf settings')
|
||||
|
||||
# maybe a wget -q ?
|
||||
if not os.path.exists('package-manifest.patch'):
|
||||
exec('wget -q https://gitlab.com/librewolf-community/browser/windows/-/raw/master/patches/package-manifest.patch')
|
||||
patch('package-manifest.patch')
|
||||
|
||||
print('--- post_build stage [done] ---------------------------------------')
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# my build folder will be here:
|
||||
enter_srcdir(os.path.dirname(os.path.realpath(__file__)))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# perform the build
|
||||
exec('./mach build')
|
||||
post_build()
|
||||
exec('./mach package')
|
||||
|
||||
## copy the artifact from obj-* to a friendlier location... to: /work
|
||||
version = sys.argv[1]
|
||||
_dirname = get_objdir()
|
||||
artifact = "{}/dist/librewolf-{}.en-US.linux-x86_64.tar.bz2".format(_dirname,version)
|
||||
cmd = "cp -v {} .".format(artifact)
|
||||
exec(cmd)
|
129
assets/librewolf-patches.py
Executable file
129
assets/librewolf-patches.py
Executable file
|
@ -0,0 +1,129 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
import os
|
||||
import sys
|
||||
import optparse
|
||||
import time
|
||||
import glob
|
||||
|
||||
|
||||
start_time = time.time()
|
||||
|
||||
|
||||
parser = optparse.OptionParser()
|
||||
parser.add_option('-n', '--no-execute', dest='no_execute', default=False, action="store_true")
|
||||
parser.add_option('-P', '--no-settings-pane', dest='settings_pane', default=True, action="store_false")
|
||||
options, args = parser.parse_args()
|
||||
|
||||
#
|
||||
# general functions
|
||||
#
|
||||
|
||||
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 exec(cmd, exit_on_fail = True, do_print = True):
|
||||
if cmd != '':
|
||||
if do_print:
|
||||
print(cmd)
|
||||
if not options.no_execute:
|
||||
retval = os.system(cmd)
|
||||
if retval != 0 and exit_on_fail:
|
||||
print("fatal error: command '{}' failed".format(cmd))
|
||||
script_exit(1)
|
||||
return retval
|
||||
return None
|
||||
|
||||
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)
|
||||
|
||||
def enter_srcdir(_dir = None):
|
||||
if _dir == None:
|
||||
dir = "librewolf-{}".format(version)
|
||||
else:
|
||||
dir = _dir
|
||||
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 librewolf_patches():
|
||||
enter_srcdir('work')
|
||||
exec('git clone --recursive https://gitlab.com/librewolf-community/browser/windows.git')
|
||||
exec('git clone --recursive https://gitlab.com/librewolf-community/browser/common.git')
|
||||
leave_srcdir()
|
||||
|
||||
enter_srcdir()
|
||||
# create the right mozconfig file..
|
||||
exec('cp -v ../../assets/mozconfig .')
|
||||
|
||||
# copy branding files..
|
||||
exec("cp -vr ../work/common/source_files/browser .")
|
||||
exec("cp -v ../work/windows/files/configure.sh browser/branding/librewolf")
|
||||
|
||||
# read lines of .txt file into 'patches'
|
||||
f = open('../../assets/patches-{}.txt'.format(version), "r")
|
||||
lines = f.readlines()
|
||||
f.close()
|
||||
patches = []
|
||||
for line in lines:
|
||||
patches.append('../work/common/'+line)
|
||||
|
||||
|
||||
for p in patches:
|
||||
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 > ../librewolf-pref-pane.patch')
|
||||
os.chdir('..')
|
||||
patch('librewolf-pref-pane.patch')
|
||||
exec('rm -rf librewolf-pref-pane')
|
||||
|
||||
|
||||
# copy the build-librewolf.py script into the source folder
|
||||
exec('cp -v ../../assets/build-librewolf.py .')
|
||||
leave_srcdir()
|
||||
|
||||
|
||||
|
||||
#
|
||||
# Main functionality in this script..
|
||||
#
|
||||
|
||||
if len(args) != 1:
|
||||
sys.stderr.write('error: please specify version of librewolf source')
|
||||
sys.exit(1)
|
||||
version = args[0]
|
||||
if not os.path.exists('librewolf-{}'.format(version) + '/configure.py'):
|
||||
sys.stderr.write('error: folder doesn\'t look like a Firefox folder.')
|
||||
sys.exit(1)
|
||||
|
||||
librewolf_patches()
|
||||
|
||||
sys.exit(0) # ensure 0 exit code
|
48
assets/mozconfig
Normal file
48
assets/mozconfig
Normal file
|
@ -0,0 +1,48 @@
|
|||
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-app-name=librewolf
|
||||
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
|
21
assets/patches-94.0.1.txt
Normal file
21
assets/patches-94.0.1.txt
Normal file
|
@ -0,0 +1,21 @@
|
|||
patches/about-dialog.patch
|
||||
patches/allow-ubo-private-mode.patch
|
||||
patches/allow_dark_preference_with_rfp.patch
|
||||
patches/context-menu.patch
|
||||
patches/megabar.patch
|
||||
patches/mozilla-vpn-ad.patch
|
||||
patches/mozilla_dirs.patch
|
||||
patches/remove_addons.patch
|
||||
patches/search-config.patch
|
||||
patches/sed-patches/allow-searchengines-non-esr.patch
|
||||
patches/sed-patches/disable-pocket.patch
|
||||
patches/sed-patches/remove-internal-plugin-certs.patch
|
||||
patches/sed-patches/stop-undesired-requests.patch
|
||||
patches/ui-patches/add-language-warning.patch
|
||||
patches/ui-patches/pref-naming.patch
|
||||
patches/ui-patches/remove-branding-urlbar.patch
|
||||
patches/ui-patches/remove-cfrprefs.patch
|
||||
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
|
21
assets/patches-94.0.2.txt
Normal file
21
assets/patches-94.0.2.txt
Normal file
|
@ -0,0 +1,21 @@
|
|||
patches/about-dialog.patch
|
||||
patches/allow-ubo-private-mode.patch
|
||||
patches/allow_dark_preference_with_rfp.patch
|
||||
patches/context-menu.patch
|
||||
patches/megabar.patch
|
||||
patches/mozilla-vpn-ad.patch
|
||||
patches/mozilla_dirs.patch
|
||||
patches/remove_addons.patch
|
||||
patches/search-config.patch
|
||||
patches/sed-patches/allow-searchengines-non-esr.patch
|
||||
patches/sed-patches/disable-pocket.patch
|
||||
patches/sed-patches/remove-internal-plugin-certs.patch
|
||||
patches/sed-patches/stop-undesired-requests.patch
|
||||
patches/ui-patches/add-language-warning.patch
|
||||
patches/ui-patches/pref-naming.patch
|
||||
patches/ui-patches/remove-branding-urlbar.patch
|
||||
patches/ui-patches/remove-cfrprefs.patch
|
||||
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
|
21
assets/patches-94.0.txt
Normal file
21
assets/patches-94.0.txt
Normal file
|
@ -0,0 +1,21 @@
|
|||
patches/about-dialog.patch
|
||||
patches/allow-ubo-private-mode.patch
|
||||
patches/allow_dark_preference_with_rfp.patch
|
||||
patches/context-menu.patch
|
||||
patches/megabar.patch
|
||||
patches/mozilla-vpn-ad.patch
|
||||
patches/mozilla_dirs.patch
|
||||
patches/remove_addons.patch
|
||||
patches/search-config.patch
|
||||
patches/sed-patches/allow-searchengines-non-esr.patch
|
||||
patches/sed-patches/disable-pocket.patch
|
||||
patches/sed-patches/remove-internal-plugin-certs.patch
|
||||
patches/sed-patches/stop-undesired-requests.patch
|
||||
patches/ui-patches/add-language-warning.patch
|
||||
patches/ui-patches/pref-naming.patch
|
||||
patches/ui-patches/remove-branding-urlbar.patch
|
||||
patches/ui-patches/remove-cfrprefs.patch
|
||||
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
|
97
assets/update-version.py
Executable file
97
assets/update-version.py
Executable file
|
@ -0,0 +1,97 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
import os
|
||||
import sys
|
||||
import optparse
|
||||
|
||||
parser = optparse.OptionParser()
|
||||
parser.add_option('-n', '--no-execute', dest='no_execute', default=False, action="store_true")
|
||||
options, remainder = parser.parse_args()
|
||||
|
||||
def exec(cmd, exit_on_fail = True, do_print = True):
|
||||
if cmd != '':
|
||||
if do_print:
|
||||
print(cmd)
|
||||
if not options.no_execute:
|
||||
retval = os.system(cmd)
|
||||
if retval != 0 and exit_on_fail:
|
||||
print("fatal error: command '{}' failed".format(cmd))
|
||||
sys.exit(1)
|
||||
return retval
|
||||
return None
|
||||
|
||||
def get_version_from_file(version_filename = './version'):
|
||||
with open(version_filename) as f:
|
||||
lines = f.readlines()
|
||||
if len(lines) != 1:
|
||||
sys.stderr.write('error: ./version contains too many lines.')
|
||||
os.exit(1)
|
||||
return lines[0].strip()
|
||||
return None
|
||||
|
||||
def make_version_string(major,minor,patch):
|
||||
if patch == 0:
|
||||
return '{}.{}'.format(major,minor)
|
||||
else:
|
||||
return '{}.{}.{}'.format(major,minor,patch)
|
||||
|
||||
def firefox_release_url(ver):
|
||||
return 'https://archive.mozilla.org/pub/firefox/releases/{}/source/firefox-{}.source.tar.xz'.format(ver, ver)
|
||||
|
||||
def check_url_exists(url):
|
||||
i = exec('wget --spider {} 2>/dev/null'.format(url), exit_on_fail=False, do_print=False)
|
||||
if i == 0:
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
||||
#
|
||||
# main script
|
||||
#
|
||||
|
||||
base_version = get_version_from_file()
|
||||
|
||||
# split base_version into major.minor.patch
|
||||
split_version = base_version.split(sep='.')
|
||||
if len(split_version) > 3 or len(split_version) < 1:
|
||||
sys.stderr.write('error: ./version file contains invalid version number')
|
||||
sys.exit(1)
|
||||
elif len(split_version) == 1:
|
||||
major = int(split_version[0])
|
||||
minor = 0
|
||||
patch = 0
|
||||
elif len(split_version) == 2:
|
||||
major = int(split_version[0])
|
||||
minor = int(split_version[1])
|
||||
patch = 0
|
||||
elif len(split_version) == 3:
|
||||
major = int(split_version[0])
|
||||
minor = int(split_version[1])
|
||||
patch = int(split_version[2])
|
||||
|
||||
# now check if this version exists with Mozilla
|
||||
if not check_url_exists(firefox_release_url(make_version_string(major,minor,patch))):
|
||||
sys.stderr.write('error: The current version is unavailable.')
|
||||
sys.exit(1)
|
||||
|
||||
# Check for releases..
|
||||
s = ''
|
||||
|
||||
if check_url_exists(firefox_release_url(make_version_string(major,minor,patch+1))):
|
||||
s = ('{}.{}.{}'.format(major,minor,patch+1))
|
||||
elif check_url_exists(firefox_release_url(make_version_string(major,minor+1,0))):
|
||||
s = ('{}.{}'.format(major,minor+1))
|
||||
elif check_url_exists(firefox_release_url(make_version_string(major+1,0,0))):
|
||||
s = ('{}.0'.format(major+1))
|
||||
else:
|
||||
s = base_version
|
||||
|
||||
if s != base_version:
|
||||
print('The wheel has turned, and version {} has been released.'.format(s))
|
||||
|
||||
with open('./version', 'w') as f:
|
||||
f.write(s)
|
||||
else:
|
||||
print('Latest Firefox release is still {}.'.format(base_version))
|
||||
|
||||
sys.exit(0) # ensure 0 exit code
|
2
pub/Makefile
Normal file
2
pub/Makefile
Normal file
|
@ -0,0 +1,2 @@
|
|||
all :
|
||||
scp -r librewolf vps:pub/pub
|
45
source/Makefile
Normal file
45
source/Makefile
Normal file
|
@ -0,0 +1,45 @@
|
|||
.PHONY : all help clean veryclean fetch extract librewolf-patches pub
|
||||
version_file=../version
|
||||
version:=$(shell cat $(version_file))
|
||||
|
||||
all : librewolf-$(version).source.tar.gz
|
||||
|
||||
help :
|
||||
@echo "Use: make [all] [clean] [veryclean] [pub]"
|
||||
@echo ""
|
||||
@echo " all - build librewolf-$(version).source.tar.gz"
|
||||
@echo " clean - remove all source trees and other cruft"
|
||||
@echo " veryclean - same as clean, but also remove source archives"
|
||||
@echo " pub - copy Libewolf source to pub folder"
|
||||
|
||||
clean :
|
||||
rm -rf *~ firefox-$(version) librewolf-$(version) librewolf-$(version).source.tar.gz work
|
||||
|
||||
veryclean : clean
|
||||
rm -f firefox-$(version).source.tar.xz
|
||||
|
||||
fetch :
|
||||
rm -f firefox-$(version).source.tar.xz
|
||||
make firefox-$(version).source.tar.xz
|
||||
|
||||
firefox-$(version).source.tar.xz :
|
||||
wget -q https://archive.mozilla.org/pub/firefox/releases/$(version)/source/firefox-$(version).source.tar.xz
|
||||
|
||||
# we take this extra step seperatly because it's so important.
|
||||
librewolf-patches :
|
||||
rm -rf work && mkdir -p work
|
||||
python3 ../assets/librewolf-patches.py $(version)
|
||||
rm -rf work
|
||||
|
||||
librewolf-$(version).source.tar.gz : firefox-$(version).source.tar.xz $(version_file) ../assets/librewolf-patches.py ../assets/build-librewolf.py ../assets/mozconfig ../assets/patches-$(version).txt
|
||||
rm -rf firefox-$(version) librewolf-$(version)
|
||||
tar xf firefox-$(version).source.tar.xz
|
||||
mv firefox-$(version) librewolf-$(version)
|
||||
make librewolf-patches
|
||||
rm -f librewolf-$(version).source.tar.gz
|
||||
tar cfz librewolf-$(version).source.tar.gz librewolf-$(version)
|
||||
rm -rf librewolf-$(version)
|
||||
|
||||
pub : librewolf-$(version).source.tar.gz
|
||||
cp -v $< ../pub/librewolf/librewolf-$(version)
|
||||
|
1
version
Normal file
1
version
Normal file
|
@ -0,0 +1 @@
|
|||
94.0.1
|
Loading…
Reference in a new issue