diff --git a/Makefile b/Makefile index 89321fc..dc61912 100644 --- a/Makefile +++ b/Makefile @@ -10,6 +10,7 @@ help : @echo "" @echo " fetch - Fetch the latest librewolf source." @echo " build - Perform './mach build && ./mach package' on it." + @echo " debug - Perform a debug build with different 'mozconfig'." @echo " artifacts - Create the setup.exe and the portable.zip." @echo "" @echo "Note: to upload, after artifacts, into the windows repo, use:" @@ -33,6 +34,9 @@ fetch : build : python3 mk.py build +debug : + python3 mk.py build-debug + artifacts : python3 mk.py artifacts diff --git a/assets/mozconfig.windows.debug b/assets/mozconfig.windows.debug new file mode 100644 index 0000000..ed7d245 --- /dev/null +++ b/assets/mozconfig.windows.debug @@ -0,0 +1,6 @@ +ac_add_options --enable-application=browser + +ac_add_options --enable-debug + +#ac_add_options --with-app-name=librewolf +ac_add_options --with-branding=browser/branding/librewolf diff --git a/mk.py b/mk.py index 38d2ee1..1225ae1 100644 --- a/mk.py +++ b/mk.py @@ -57,11 +57,11 @@ def fetch(): 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') + 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') -def build(): +def build(debug=False): exec('rm -rf librewolf-$(cat version)') exec('tar xf librewolf-$(cat version)-$(cat source_release).source.tar.gz') @@ -71,7 +71,11 @@ def build(): os.chdir('librewolf-{}'.format(version)) # patches - exec('cp -v ../assets/mozconfig.windows mozconfig') + if debug: + exec('cp -v ../assets/mozconfig.windows.debug mozconfig') + else: + exec('cp -v ../assets/mozconfig.windows mozconfig') + patch('../assets/package-manifest.patch') # perform the build and package @@ -142,7 +146,7 @@ def artifacts(): -# utility function +# Utility function to upload() function. def do_upload(filename,token): exec('echo _ >> upload.txt') exec('curl --request POST --header \"PRIVATE-TOKEN: {}\" --form \"file=@{}\" \"https://gitlab.com/api/v4/projects/13852981/uploads\" >> upload.txt'.format(token,filename),False) @@ -180,6 +184,7 @@ Use: ./mk.py ... commands: fetch build + build-debug artifacts upload @@ -198,6 +203,9 @@ for arg in sys.argv: elif arg == 'build': build() done_something = True + elif arg == 'build-debug': + build(True) + done_something = True elif arg == 'artifacts': artifacts() done_something = True