creating mar files

This commit is contained in:
Bert van der Weerd 2022-04-27 12:53:26 +02:00
parent e95da84da6
commit 44773d461d
No known key found for this signature in database
GPG key ID: 4CFABB96ADE0F5B1
4 changed files with 31 additions and 8 deletions

View file

@ -1,4 +1,4 @@
.PHONY : help all clean veryclean fetch build artifacts update .PHONY : help all clean veryclean fetch build artifacts update full-mar
help : help :
@echo "Use: make [all] [clean] [veryclean] [check] ..." @echo "Use: make [all] [clean] [veryclean] [check] ..."
@ -7,6 +7,7 @@ help :
@echo " clean - Remove output files and temporary files." @echo " clean - Remove output files and temporary files."
@echo " veryclean - Like 'clean', but also remove all downloaded files." @echo " veryclean - Like 'clean', but also remove all downloaded files."
@echo " update - update 'version' and 'source_release' files." @echo " update - update 'version' and 'source_release' files."
@echo " full-mar - create mar setup file."
@echo "" @echo ""
@echo " fetch - Fetch the latest librewolf source." @echo " fetch - Fetch the latest librewolf source."
@echo " build - Perform './mach build && ./mach package' on it." @echo " build - Perform './mach build && ./mach package' on it."
@ -47,3 +48,6 @@ debug :
artifacts : artifacts :
python3 mk.py artifacts python3 mk.py artifacts
full-mar :
python3 mk.py full-mar

View file

@ -5,7 +5,6 @@ ac_add_options --disable-crashreporter
ac_add_options --disable-debug ac_add_options --disable-debug
ac_add_options --disable-default-browser-agent ac_add_options --disable-default-browser-agent
ac_add_options --disable-tests ac_add_options --disable-tests
ac_add_options --disable-updater
ac_add_options --enable-hardening ac_add_options --enable-hardening
ac_add_options --enable-optimize ac_add_options --enable-optimize
ac_add_options --enable-release ac_add_options --enable-release
@ -31,14 +30,9 @@ mk_add_options MOZ_TELEMETRY_REPORTING=0
# - no need to specify wasi sdk folder # - no need to specify wasi sdk folder
# #
ac_add_options --disable-updater
ac_add_options --disable-maintenance-service
ac_add_options --enable-strip ac_add_options --enable-strip
# needed for windows/mac auto update ONLY. it's a security risk so other OSses don't need it # needed for windows/mac auto update ONLY. it's a security risk so other OSses don't need it
# https://firefox-source-docs.mozilla.org/taskcluster/setting-up-an-update-server.html # https://firefox-source-docs.mozilla.org/taskcluster/setting-up-an-update-server.html
ac_add_options --disable-verify-mar ac_add_options --disable-verify-mar

25
mk.py
View file

@ -13,6 +13,28 @@ from assets.tools import exec, patch
def deps_win32(): def deps_win32():
exec('rustup target add i686-pc-windows-msvc') exec('rustup target add i686-pc-windows-msvc')
def full_mar():
with open('version','r') as file:
version = file.read().rstrip()
with open('source_release','r') as file:
source_release = file.read().rstrip()
os.chdir('librewolf-{}-{}'.format(version,source_release))
# see https://firefox-source-docs.mozilla.org/taskcluster/setting-up-an-update-server.html
objdir = 'obj-x86_64-pc-mingw32'
mar_output_path = 'MAR'
# version already set
channel = 'default'
exec('mkdir -p MAR') # output folder
exec('touch {}/dist/firefox/precomplete'.format(objdir))
exec('MAR={}/dist/host/bin/mar.exe MOZ_PRODUCT_VERSION={}-{} MAR_CHANNEL_ID={} ./tools/update-packaging/make_full_update.sh {} {}/dist/firefox'.format(objdir,version,source_release,channel,mar_output_path,objdir))
# restore state
os.chdir('..')
pass
def fetch(): def fetch():
exec('wget -q -O version https://gitlab.com/librewolf-community/browser/source/-/raw/main/version') exec('wget -q -O version https://gitlab.com/librewolf-community/browser/source/-/raw/main/version')
@ -215,6 +237,9 @@ for arg in sys.argv:
elif arg == 'artifacts': elif arg == 'artifacts':
artifacts() artifacts()
done_something = True done_something = True
elif arg == 'full-mar':
full_mar()
done_something = True
elif arg == 'upload': elif arg == 'upload':
in_upload = True in_upload = True
else: else:

View file

@ -1 +1 @@
0 1