-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
70 lines (57 loc) · 2 KB
/
Makefile
File metadata and controls
70 lines (57 loc) · 2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#
# mksource: get firefox source archive and configure it to be built as librefox
# breakfast: clean up previously downloaded source, dirs and configure source and build
# dinner: use the already available source, configure it, and build
#
version = 143.0.1
cwd = $(shell pwd)
srcdir = $(abspath firefox-$(version))
patchesdir = $(srcdir)/patches
src_tarball = firefox-$(version).tar.xz
obj_out = $(srcdir)/obj-x86_64-pc-linux-gnu/dist/librefox-*.tar.xz
bundle_dir = $(cwd)/forge
out_dir = $(cwd)/out
settings_url = https://github.com/librefox05/settings
.PHONY: getsrc untar configure patch clobber build bundle clean mksource breakfast dinner sweep
getsrc:
wget -q --show-progress "https://archive.mozilla.org/pub/firefox/releases/$(version)/source/firefox-$(version).source.tar.xz" -O $(src_tarball)
untar:
tar -xf $(src_tarball)
configure:
rm -rf $(patchesdir)/browser/branding/librefox || true
rm -rf $(srcdir)/mozconfig || true
rm -rf $(patchesdir) || true
cp -r browser/branding/librefox $(srcdir)/browser/branding
cp -r patches $(srcdir)/
cp -r browser/base/content/aboutDialog.xhtml $(srcdir)/browser/base/content/
cp mozconfig $(srcdir)/
patch:
./apply_patches.sh $(patchesdir) $(srcdir)
clobber:
cd $(srcdir) && ./mach clobber
build:
cd $(srcdir) && \
./mach --no-interactive bootstrap --application-choice browser && \
./mach build && \
./mach package
bundle:
rm -rf $(bundle_dir)
mkdir $(bundle_dir) $(out_dir)
tar -xf $(obj_out) -C $(bundle_dir)
cd $(bundle_dir) && \
git clone $(settings_url) custom_settings && \
cp -r custom_settings/* $(bundle_dir)/librefox && \
rm -rf custom_settings && \
cd $(out_dir) && \
tar -cJf librefox-x86_64-$(version).tar.xz -C $(bundle_dir) librefox
clean:
rm -rf $(src_tarball) || true
rm -rf $(srcdir) || true
rm -rf $(out_dir) || true
rm -rf $(bundle_dir) || true
sweep:
rm -rf $(out_dir) || true
rm -rf $(bundle_dir) || true
mksource: getsrc untar configure
breakfast: clean mksource patch build bundle
dinner: sweep configure patch build bundle