From 1bfed68322b0bf2ed6fa90bca2b8c0004c104160 Mon Sep 17 00:00:00 2001 From: Bert van der Weerd Date: Mon, 10 Jan 2022 07:57:49 +0100 Subject: [PATCH] commit due to artifacts now having priority. --- Makefile | 2 +- assets/mozconfig.windows | 4 ++- assets/package-manifest.patch | 15 ++++++++++ mk.py | 55 ++++++++++++++++++++++++++++------- 4 files changed, 63 insertions(+), 13 deletions(-) create mode 100644 assets/package-manifest.patch diff --git a/Makefile b/Makefile index 04e9730..4fbd845 100644 --- a/Makefile +++ b/Makefile @@ -12,7 +12,7 @@ help : @echo " artifacts - Create the setup.exe and the portable.zip." @echo "" -all : fetch build artifact +all : fetch build artifacts clean : rm -rf librewolf-$(shell cat version) diff --git a/assets/mozconfig.windows b/assets/mozconfig.windows index cbc6871..7a73e00 100644 --- a/assets/mozconfig.windows +++ b/assets/mozconfig.windows @@ -11,11 +11,13 @@ ac_add_options --enable-optimize ac_add_options --enable-release ac_add_options --enable-rust-simd -ac_add_options --with-app-name=librewolf +#ac_add_options --with-app-name=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 +# see issue # https://gitlab.com/librewolf-community/browser/arch/-/issues/49 export MOZ_REQUIRE_SIGNING= mk_add_options MOZ_CRASHREPORTER=0 diff --git a/assets/package-manifest.patch b/assets/package-manifest.patch new file mode 100644 index 0000000..a1b53e8 --- /dev/null +++ b/assets/package-manifest.patch @@ -0,0 +1,15 @@ +diff --git a/browser/installer/package-manifest.in b/browser/installer/package-manifest.in +index 4daacdb..8edd77f 100644 +--- a/browser/installer/package-manifest.in ++++ b/browser/installer/package-manifest.in +@@ -397,8 +397,8 @@ bin/libfreebl_64int_3.so + ; [MaintenanceService] + ; + #ifdef MOZ_MAINTENANCE_SERVICE +-@BINPATH@/maintenanceservice.exe +-@BINPATH@/maintenanceservice_installer.exe ++;@BINPATH@/maintenanceservice.exe ++;@BINPATH@/maintenanceservice_installer.exe + #endif + + ; [Crash Reporter] diff --git a/mk.py b/mk.py index b603830..9177027 100755 --- a/mk.py +++ b/mk.py @@ -2,65 +2,98 @@ import os,sys,subprocess -# note: change this to True when *not* on windows -_native = False - # native()/bash()/exec() utility functions def native(cmd): + sys.stdout.flush() print(cmd) + sys.stdout.flush() + retval = os.system(cmd) if retval != 0: sys.exit(retval) +_no_exit = False def bash(cmd): tmp = [] tmp += ['c:/mozilla-build/msys/bin/bash.exe', '-c', cmd] + sys.stdout.flush() print(cmd) + sys.stdout.flush() + retval = subprocess.run(tmp).returncode + if _no_exit: + return if retval != 0: sys.exit(retval) +_native = False +_no_exit = False def exec(cmd): if _native: return native(cmd) return bash(cmd) -# -# windows specific actions -# +def patch(patchfile): + cmd = "patch -p1 -i {}".format(patchfile) + sys.stdout.flush() + print("\n*** -> {}".format(cmd)) + sys.stdout.flush() + + retval = os.system(cmd) + if retval != 0: + sys.stdout.flush() + print("fatal error: patch '{}' failed".format(patchfile)) + sys.stdout.flush() + sys.exit(retval) + -def win_before_build(): - exec('cp -v assets/mozconfig.windows librewolf-$(cat version)/mozconfig') # # main functions # + def fetch(): + print('mk.py: fetch(): Disabled due to "artifacts" now has priority.') + sys.exit(1) + exec('wget -q -O version https://gitlab.com/librewolf-community/browser/source/-/raw/main/version') exec('wget -q -O source_release https://gitlab.com/librewolf-community/browser/source/-/raw/main/release') exec('wget -O librewolf-$(cat version)-$(cat source_release).source.tar.gz https://gitlab.com/librewolf-community/browser/source/-/jobs/artifacts/main/raw/librewolf-$(cat version)-$(cat source_release).source.tar.gz?job=build-job') def build(): + print('mk.py: build(): Disabled due to "artifacts" now has priority.') + sys.exit(1) exec('rm -rf librewolf-$(cat version)') exec('tar xf librewolf-$(cat version)-$(cat source_release).source.tar.gz') - win_before_build() - with open('version','r') as file: version = file.read().rstrip() os.chdir('librewolf-{}'.format(version)) + + # patches + exec('cp -v ../assets/mozconfig.windows mozconfig') + patch('../assets/package-manifest.patch') exec('MACH_USE_SYSTEM_PYTHON=1 ./mach build') + _no_exit = True exec('MACH_USE_SYSTEM_PYTHON=1 ./mach package') + _no_exit = False + exec('cp -v obj-x86_64-pc-mingw32/dist/firefox-{}.en-US.win64.zip ..'.format(version)) + os.chdir('..') def artifacts(): - bash('# you gotta figure that out from the previous ./build.py') + bash('# guide - you gotta figure this out from the previous ./build.py') pass + with open('version','r') as file: + version = file.read().rstrip() + exec('cp -v librewolf-{}/obj-x86_64-pc-mingw32/dist/firefox-{}.en-US.win64.zip .'.format(version,version)) + + print('mk.py:artifacts(): done.') # # parse commandline for commands