From aeeaa1bcba04a56f7e49c2c17c86ff7927827374 Mon Sep 17 00:00:00 2001 From: Bert van der Weerd Date: Sat, 8 Jan 2022 12:28:30 +0100 Subject: [PATCH] updates --- Makefile | 30 ++++++++++++++++++++++++++++++ mk.py | 16 +++++++--------- release | 2 +- 3 files changed, 38 insertions(+), 10 deletions(-) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..0013343 --- /dev/null +++ b/Makefile @@ -0,0 +1,30 @@ +.PHONY : help all clean veryclean fetch build artifact + +help : + @echo "Use: make [all] [clean] [veryclean]" + @echo "" + @echo " all - Build librewolf and it's windows artifacts." + @echo " clean - Remove output files and temporary files." + @echo " veryclean - Like 'clean', but also remove all downloaded files." + @echo "" + @echo " fetch - Fetch the latest librewolf source." + @echo " build - Perform './mach build && ./mach package' on it." + @echo " artifact - Create the setup.exe and the portable.zip." + @echo "" + +all : fetch build artifact + +clean : + +veryclean : + rm -f librewolf-*.source.tar.gz + +fetch : + python3 mk.py fetch + +build : + python3 mk.py build + +artifact : + python3 mk.py artifact + diff --git a/mk.py b/mk.py index 6617647..1192f78 100755 --- a/mk.py +++ b/mk.py @@ -27,22 +27,20 @@ def exec(cmd): # main functions def fetch(): - exec('rm -rf version release') exec('wget -q -O version https://gitlab.com/librewolf-community/browser/source/-/raw/main/version') - exec('wget -q -O release https://gitlab.com/librewolf-community/browser/source/-/raw/main/release') - exec('rm -f librewolf-$(cat version)-$(cat release).source.tar.gz') - exec('wget -O librewolf-$(cat version)-$(cat release).source.tar.gz https://gitlab.com/librewolf-community/browser/source/-/jobs/artifacts/main/raw/librewolf-$(cat version)-$(cat release).source.tar.gz?job=build-job') + 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(): exec('rm -rf librewolf-$(cat version)') exec('tar xf librewolf-$(cat version)-$(cat release).source.tar.gz') with open('version','r') as file: version = file.read().rstrip() - os.chdir('librewolf-{}'.format(version)) + os.chdir('librewolf-{}'.format(version)) exec('MACH_USE_SYSTEM_PYTHON=1 ./mach build') exec('MACH_USE_SYSTEM_PYTHON=1 ./mach package') -def artifact(): +def artifacts(): bash('# you gotta figure that out from the previous ./build.py') pass @@ -54,7 +52,7 @@ Use: ./mk.py ... commands: fetch build - artifact + artifacts ''' @@ -67,8 +65,8 @@ for arg in sys.argv: elif arg == 'build': build() done_something = True - elif arg == 'artifact': - artifact() + elif arg == 'artifacts': + artifacts() done_something = True else: if arg == sys.argv[0]: diff --git a/release b/release index 00750ed..b8626c4 100644 --- a/release +++ b/release @@ -1 +1 @@ -3 +4