0
Fork 0
mirror of https://codeberg.org/librewolf/source.git synced 2024-12-22 13:43:04 -05:00
LibreWolf/Makefile

96 lines
2.8 KiB
Makefile
Raw Permalink Normal View History

.PHONY : help check all clean veryclean bootstrap build package run update
2021-11-19 12:41:54 -05:00
version:=$(shell cat ./version)
release:=$(shell cat ./release)
2021-11-19 12:41:54 -05:00
2021-11-19 14:46:23 -05:00
## simplistic archive format selection
#archive_create=tar cfJ
#ext=.tar.xz
archive_create=tar cfz
ext=.tar.gz
2021-11-19 14:46:23 -05:00
upstream_filename=firefox-$(version).source.tar.xz
upstream_dirname=firefox-$(version)
2021-11-19 14:46:23 -05:00
help :
2021-12-27 18:55:58 -05:00
2022-01-13 14:34:48 -05:00
@echo "use: $(MAKE) [all] [check] [clean] [veryclean] [build] [package] [run]"
2021-11-19 12:41:54 -05:00
@echo ""
2022-01-13 14:34:48 -05:00
@echo " all - Make LibreWolf source archive ${version}-${release}."
@echo " check - Check if there is a new version of Firefox."
@echo " update - Update the git submodules and README.md."
2021-11-19 12:41:54 -05:00
@echo ""
@echo " clean - Clean everything except the upstream firefox tarball."
@echo " veryclean - Clean everything including the firefox tarball."
@echo ""
@echo " bootstrap - Make librewolf source archive, and bootstrap the build system."
2022-01-13 14:34:48 -05:00
@echo ""
@echo " build - After a bootstrap, build it."
@echo " package - After a build, package it."
@echo " run - After a build, run it."
@echo ""
2021-11-19 12:41:54 -05:00
check :
python3 scripts/update-version.py
2021-12-29 00:31:33 -05:00
@echo "Current release:" $$(cat ./release)
2021-11-19 12:41:54 -05:00
2022-01-08 16:07:06 -05:00
update : README.md
git submodule update --recursive --remote
README.md : README.md.in ./version ./release
@sed "s/__VERSION__/$(version)/g" < $< > tmp
@sed "s/__RELEASE__/$(release)/g" < tmp > $@
@rm -f tmp
2022-01-08 16:07:06 -05:00
all : librewolf-$(version)-$(release).source$(ext)
2021-11-19 14:46:23 -05:00
clean :
rm -rf *~ firefox-$(version) librewolf-$(version) librewolf-$(version)-$(release).source$(ext)
2021-11-19 14:46:23 -05:00
veryclean : clean
rm -f $(upstream_filename)
#
# The actual build stuff
#
2021-11-19 14:46:23 -05:00
$(upstream_filename) :
wget -q "https://archive.mozilla.org/pub/firefox/releases/$(version)/source/firefox-$(version).source.tar.xz"
librewolf-$(version)-$(release).source$(ext) : $(upstream_filename) ./version ./release scripts/librewolf-patches.py assets/mozconfig assets/patches.txt
rm -rf $(upstream_dirname)
2022-01-08 15:57:39 -05:00
rm -rf librewolf-$(version)
tar xf $(upstream_filename)
mv $(upstream_dirname) librewolf-$(version)
python3 scripts/librewolf-patches.py $(version) $(release)
rm -f librewolf-$(version)-$(release).source$(ext)
$(archive_create) librewolf-$(version)-$(release).source$(ext) librewolf-$(version)
2022-01-24 06:49:36 -05:00
touch librewolf-$(version)
2021-11-21 04:23:21 -05:00
librewolf-$(version) : librewolf-$(version)-$(release).source$(ext)
tar xf librewolf-$(version)-$(release).source$(ext)
2021-11-25 10:24:55 -05:00
2022-02-03 05:20:10 -05:00
debs=python3 python3-dev python3-pip
rpms=python3 python3-devel
bootstrap : librewolf-$(version)
2022-02-03 05:20:10 -05:00
(sudo apt -y install $(debs); true)
(sudo rpm -y install $(rpms); true)
2022-02-03 03:32:20 -05:00
(cd librewolf-$(version) && MOZBUILD_STATE_PATH=$$HOME/.mozbuild ./mach --no-interactive bootstrap --application-choice=browser)
build :
2022-01-13 14:34:48 -05:00
(cd librewolf-$(version) && ./mach build)
package :
2022-01-13 14:34:48 -05:00
(cd librewolf-$(version) && ./mach package)
run :
2022-01-13 14:34:48 -05:00
(cd librewolf-$(version) && ./mach run)