This repository was archived by the owner on May 7, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbetterbird.yml
134 lines (118 loc) · 4.52 KB
/
betterbird.yml
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
- name: Betterbird - Linux build
hosts: localhost
connection: local
gather_facts: no
vars:
betterbird_patches:
repository: https://github.com/Betterbird/thunderbird-patches.git
directory: "{{ playbook_dir }}/betterbird-patches"
tasks:
- name: check for 64-bit linux
shell:
cmd: uname -m
register: check_64bit
changed_when: false
failed_when: check_64bit.stdout != "x86_64"
- name: install necessary packages
become: yes
package:
state: present
name:
- git
- mercurial
- python3
- python3-pip
- name: clone betterbird repo
git:
repo: "{{ betterbird_patches.repository }}"
dest: "{{ betterbird_patches.directory }}"
force: yes
depth: 1
- name: include releases.yml
include_vars:
file: "{{ betterbird_patches.directory }}/releases.yml"
- name: clone base repos
include_tasks: tasks/clone_base_repo.yml
loop:
- { directory: "source",
url: "{{ current_release.repos.mozilla.url }}",
revision: "{{ current_release.repos.mozilla.revision }}" }
- { directory: "source/comm",
url: "{{ current_release.repos.comm.url }}",
revision: "{{ current_release.repos.comm.revision }}" }
loop_control:
loop_var: base_repo
- name: find all patch files
find:
paths: "{{ betterbird_patches.directory }}/{{ current_release.directory }}"
patterns: "*.patch"
recurse: yes
changed_when: false
register: betterbird_patch_files
- name: apply patches
include_tasks: tasks/apply_patches.yml
loop:
- { patches_directory: "{{ playbook_dir }}/source/.hg/patches",
series_file: "{{ betterbird_patches.directory }}/{{ current_release.directory }}/series-M-C",
patch_file_filter: "'-m-c.patch'" }
- { patches_directory: "{{ playbook_dir }}/source/comm/.hg/patches",
series_file: "{{ betterbird_patches.directory }}/{{ current_release.directory }}/series",
patch_file_filter: "not '-m-c.patch'" }
- name: bootstrap
shell:
chdir: "{{ playbook_dir }}/source"
cmd: >
./mach
--no-interactive
bootstrap
--application-choice "Firefox for Desktop"
- name: mozconfig setup
lineinfile:
path: "{{ playbook_dir }}/source/mozconfig"
create: yes
line: "{{ item }}"
loop:
- "ac_add_options --enable-application=comm/mail"
- "ac_add_options --enable-official-branding"
#
- "ac_add_options --with-branding=comm/mail/branding/betterbird"
#
- "ac_add_options --disable-updater"
- "ac_add_options --disable-crashreporter"
- "ac_add_options --disable-tests"
#
- "MOZ_REQUIRE_SIGNING="
- "MOZ_REQUIRE_ADDON_SIGNING=0"
#
- "export MOZILLA_OFFICIAL=1"
- "export MOZ_TELEMETRY_REPORTING="
- "export MOZ_NO_PIE_COMPAT=1"
- name: extra config
include_tasks: tasks/extra_config.yml
when: current_release.extra_config is defined
- name: build
shell:
chdir: "{{ playbook_dir }}/source"
cmd: ./mach build
- name: package
shell:
chdir: "{{ playbook_dir }}/source"
cmd: ./mach package
- name: find tarballs
find:
paths: "{{ playbook_dir }}/source/obj-x86_64-pc-linux-gnu/dist"
use_regex: yes
patterns: "^betterbird-.*.tar.bz2$"
register: tarballs
- set_fact:
latest_tarball: "{{ (tarballs.files | sort(attribute='ctime') | map(attribute='path') | reverse | list)[0] | basename }}"
- name: success message
debug:
msg:
- "┌──────────────────────┐"
- "│ │"
- "│ BUILD SUCCESSFUL │"
- "│ │"
- "├──────────────────────┴─────────────────────────────────{{ latest_tarball | regex_replace('.', '─') }}┐"
- "│ latest package: ./source/obj-x86_64-pc-linux-gnu/dist/{{ latest_tarball }} │"
- "└────────────────────────────────────────────────────────{{ latest_tarball | regex_replace('.', '─') }}┘"