/
KagamiBuild
203 lines (184 loc) · 6.57 KB
/
KagamiBuild
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
# Description: Standalone web browser from mozilla.org
# URL: https://www.mozilla.org/firefox/
# Maintainer: protonesso, nagakamira at gmail dot com
# Depends on: python autoconf2.13 llvm cbindgen node unzip zip dbus-glib gtk3 gtk2 libnotify nss libpulse startup-notification icu libevent libwebp dav1d aom libvpx ffmpeg
# Dep x86_64: nasm yasm
# Dep i386: nasm yasm
# Section: web
name=firefox
version=78.10.1
release=1
source=("https://archive.mozilla.org/pub/$name/releases/${version}esr/source/$name-${version}esr.source.tar.xz")
clear_vendor_checksums() {
sed -i 's/\("files":{\)[^}]*/\1/' third_party/rust/$1/.cargo-checksum.json
}
build() {
filter-flags -flto -fsanitize=cfi -fsanitize-cfi-cross-dso
export LDFLAGS="-Wl,-rpath,/usr/lib/firefox"
export SHELL=/usr/bin/bash
export PYTHON=/usr/bin/python3
export RUSTFLAGS="$RUSTFLAGS -C debuginfo=0"
export CXXSTDLIB=c++
case "$BARCH" in
x86_64)
export RTARGET="x86_64-unknown-linux-musl"
;;
i386)
export RTARGET="i686-unknown-linux-musl"
;;
arm64)
export RTARGET="aarch64-unknown-linux-musl"
;;
arm)
export RTARGET="armv7-unknown-linux-musleabihf"
;;
*)
die "Architecture is not set or is not supported by Rust Language"
esac
cd "$SRC"/$name-$version
patch -Np1 -i "$STUFF"/firefox/fix-fortify-system-wrappers.patch
patch -Np1 -i "$STUFF"/firefox/fix-tools.patch
patch -Np1 -i "$STUFF"/firefox/mallinfo.patch
patch -Np1 -i "$STUFF"/firefox/disable-moz-stackwalk.patch
patch -Np1 -i "$STUFF"/firefox/fix-webrtc-glibcisms.patch
patch -Np1 -i "$STUFF"/firefox/fd6847c9416f9eebde636e21d794d25d1be8791d.patch
patch -Np1 -i "$STUFF"/firefox/remove-faulty-libvpx-check.patch
patch -Np1 -i "$STUFF"/firefox/sandbox-fork.patch
patch -Np1 -i "$STUFF"/firefox/sandbox-sched_setscheduler.patch
patch -Np1 -i "$STUFF"/firefox/allow-custom-rust-vendor.patch
patch -Np1 -i "$STUFF"/firefox/0002-Bug-1667736-Update-packed_simd-to-compile-on-Rust-1..patch
cp "$STUFF"/firefox/stab.h toolkit/crashreporter/google-breakpad/src/
clear_vendor_checksums target-lexicon-0.9.0
clear_vendor_checksums packed_simd
export MOZILLA_OFFICIAL=1
export MOZ_SERVICES_METRICS=
export MOZ_PAY=
export MOZ_SERVICES_HEALTHREPORTER=
export MOZ_SERVICES_FXACCOUNTS=
export MOZ_SERVICES_METRICS=
export MOZ_DATA_REPORTING=
export MOZ_DEVICES=
export MOZ_REQUIRE_SIGNING=
export MOZ_TELEMETRY_REPORTING=
cd "$SRC"
mkdir -p build
cd build
"$SRC"/$name-$version/configure \
--prefix=/usr \
--with-distribution-id=io.github.ataraxialinux \
--with-system-icu \
--with-system-jpeg \
--with-system-libevent \
--with-system-libvpx \
--with-system-nspr \
--with-system-nss \
--with-system-png \
--with-system-webp \
--with-system-zlib \
--enable-application=browser \
--enable-av1 \
--enable-default-toolkit=cairo-gtk3-wayland \
--enable-hardening \
--enable-linker=lld \
--enable-official-branding \
--enable-optimize \
--enable-proxy-bypass-protection \
--enable-release \
--enable-rust-simd \
--enable-system-ffi \
--enable-system-pixman \
--disable-crashreporter \
--disable-debug \
--disable-debug-symbols \
--disable-elf-hack \
--disable-eme \
--disable-gold \
--disable-jack \
--disable-jemalloc \
--disable-necko-wifi \
--disable-parental-controls \
--disable-tests \
--disable-updater \
--disable-webrtc \
--host=$RTARGET \
--target=$RTARGET
make
make DESTDIR="$PKG" install
attr -q -s pax.flags -V "em" "$PKG"/usr/lib/firefox/firefox
attr -q -s pax.flags -V "em" "$PKG"/usr/lib/firefox/plugin-container
for i in 16 22 24 32 48 64 128 256; do
install -Dm644 "$SRC"/$name-$version/browser/branding/official/default$i.png "$PKG"/usr/share/icons/hicolor/${i}x${i}/apps/firefox.png
done
mkdir -p "$PKG"/usr/share/pixmaps
ln -sf /usr/share/icons/hicolor/128x128/apps/firefox.png "$PKG"/usr/share/pixmaps/firefox.png
mkdir -p "$PKG"/usr/bin/
ln -sf /usr/lib/firefox/firefox "$PKG"/usr/bin/firefox
mkdir -p "$PKG"/usr/share/applications
cat > "$PKG"/usr/share/applications/firefox.desktop <<-EOF
[Desktop Entry]
Version=1.0
Name=Firefox
GenericName=Web Browser
Comment=Browse the Web
Exec=firefox %u
Icon=firefox
Terminal=false
Type=Application
MimeType=text/html;text/xml;application/xhtml+xml;application/vnd.mozilla.xul+xml;text/mml;x-scheme-handler/http;x-scheme-handler/https;
StartupNotify=true
Categories=Network;WebBrowser;
Keywords=web;browser;internet;
Actions=new-window;new-private-window;profile-manager-window;
[Desktop Action new-window]
Name=Open a New Window
Exec=firefox --new-window %u
[Desktop Action new-private-window]
Name=Open a New Private Window
Exec=firefox --private-window %u
[Desktop Action profile-manager-window]
Name=Open the Profile Manager
Exec=firefox --ProfileManager
EOF
mkdir -p "$PKG"/usr/share/appdata
cat > "$PKG"/usr/share/appdata/firefox.appdata.xml <<-EOF
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2019 Firefox contributors -->
<component type="desktop">
<id>firefox.desktop</id>
<metadata_license>CC0-1.0</metadata_license>
<name>Firefox</name>
<summary>Web Browser</summary>
<description>
<p>
Bringing together all kinds of awesomeness to make browsing better for you.
Get to your favorite sites quickly – even if you don’t remember the URLs.
Type your term into the location bar (aka the Awesome Bar) and the autocomplete
function will include possible matches from your browsing history, bookmarked
sites and open tabs.
</p>
</description>
<url type="homepage">https://www.mozilla.org</url>
<update_contact>stransky@redhat.com</update_contact>
<kudos>
<kudo>ModernToolkit</kudo>
<kudo>SearchProvider</kudo>
</kudos>
<project_group>Mozilla</project_group>
<project_license>GPL-3.0+</project_license>
<developer_name>Mozilla Corporation</developer_name>
<url type="bugtracker">https://bugzilla.mozilla.org/</url>
<url type="help">https://support.mozilla.org/</url>
<provides>
<id>firefox.desktop</id>
</provides>
<screenshots>
<screenshot type="default">https://raw.githubusercontent.com/hughsie/fedora-appstream/master/screenshots-extra/firefox/a.png</screenshot>
<screenshot>https://raw.githubusercontent.com/hughsie/fedora-appstream/master/screenshots-extra/firefox/b.png</screenshot>
<screenshot>https://raw.githubusercontent.com/hughsie/fedora-appstream/master/screenshots-extra/firefox/c.png</screenshot>
</screenshots>
<releases>
<release version="$version" date="$(date '+%F')"/>
</releases>
</component>
EOF
}