forked from mozilla/gecko-dev
-
Notifications
You must be signed in to change notification settings - Fork 0
/
firefox-wayland.spec
341 lines (287 loc) · 12.4 KB
/
firefox-wayland.spec
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
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
%define optimized_build 1
%global mozappdir %{_libdir}/%{name}
%global mozappdirdev %{_libdir}/%{name}-devel-%{version}
Summary: Mozilla Firefox Nightly Web browser
Name: firefox-wayland
Version: 57.1
Release: 1%{?pre_tag}%{?dist}
URL: https://www.mozilla.org/firefox/
License: MPLv1.1 or GPLv2+ or LGPLv2+
Group: Applications/Internet
Source0: %{name}-%{version}.tar.gz
BuildRequires: pkgconfig(libpng)
BuildRequires: zip
BuildRequires: bzip2-devel
BuildRequires: pkgconfig(zlib)
BuildRequires: pkgconfig(libIDL-2.0)
BuildRequires: pkgconfig(gtk+-3.0)
BuildRequires: pkgconfig(gtk+-2.0)
BuildRequires: pkgconfig(krb5)
BuildRequires: pkgconfig(pango)
BuildRequires: pkgconfig(freetype2) >= %{freetype_version}
BuildRequires: pkgconfig(xt)
BuildRequires: pkgconfig(xrender)
BuildRequires: pkgconfig(libstartup-notification-1.0)
BuildRequires: pkgconfig(dri)
BuildRequires: pkgconfig(libcurl)
BuildRequires: dbus-glib-devel
BuildRequires: autoconf213
BuildRequires: pkgconfig(libpulse)
BuildRequires: pkgconfig(icu-i18n)
BuildRequires: pkgconfig(gconf-2.0)
BuildRequires: yasm
Requires: mozilla-filesystem
BuildRequires: desktop-file-utils
BuildRequires: system-bookmarks
BuildRequires: rust
BuildRequires: cargo
BuildRequires: llvm-devel
BuildRequires: clang
Obsoletes: mozilla <= 37:1.7.13
Provides: webclient
%description
Mozilla Firefox is an open-source web browser, designed for standards
compliance, performance and portability.
#---------------------------------------------------------------------
%prep
%setup -q
# Build patches, can't change backup suffix from default because during build
# there is a compare of config and js/config directories and .orig suffix is
# ignored during this compare.
patch -p1 < firefox-install-dir.patch
%{__rm} -f .mozconfig
%{__cp} firefox-mozconfig .mozconfig
echo "ac_add_options --enable-debug" >> .mozconfig
%if !%{?optimized_build}
echo "ac_add_options --disable-optimize" >> .mozconfig
%else
%define optimize_flags "none"
# Fedora 26 (gcc7) needs to disable default build flags (mozbz#1342344)
%if 0%{?fedora} > 25
%define optimize_flags "-g -O2"
%endif
%if %{optimize_flags} != "none"
echo 'ac_add_options --enable-optimize=%{?optimize_flags}' >> .mozconfig
%else
echo 'ac_add_options --enable-optimize' >> .mozconfig
%endif
%endif
#---------------------------------------------------------------------
%build
MOZ_OPT_FLAGS="-g -O2 -fno-delete-null-pointer-checks"
%if !%{?optimized_build}
MOZ_OPT_FLAGS=$(echo "$MOZ_OPT_FLAGS" | %{__sed} -e 's/-O2//')
%endif
export CFLAGS=$MOZ_OPT_FLAGS
export CXXFLAGS=$MOZ_OPT_FLAGS
export LDFLAGS=$MOZ_LINK_FLAGS
export PREFIX='%{_prefix}'
export LIBDIR='%{_libdir}'
MOZ_SMP_FLAGS=-j1
# On x86 architectures, Mozilla can build up to 4 jobs at once in parallel,
# however builds tend to fail on other arches when building in parallel.
%ifarch %{ix86} x86_64 ppc ppc64 ppc64le aarch64
[ -z "$RPM_BUILD_NCPUS" ] && \
RPM_BUILD_NCPUS="`/usr/bin/getconf _NPROCESSORS_ONLN`"
[ "$RPM_BUILD_NCPUS" -ge 2 ] && MOZ_SMP_FLAGS=-j2
[ "$RPM_BUILD_NCPUS" -ge 4 ] && MOZ_SMP_FLAGS=-j4
[ "$RPM_BUILD_NCPUS" -ge 8 ] && MOZ_SMP_FLAGS=-j8
%endif
make -f client.mk build STRIP="/bin/true" MOZ_MAKE_FLAGS="$MOZ_SMP_FLAGS" MOZ_SERVICES_SYNC="1"
#---------------------------------------------------------------------
%install
DESTDIR=$RPM_BUILD_ROOT make -C objdir install
%{__mkdir_p} $RPM_BUILD_ROOT{%{_libdir},%{_bindir},%{_datadir}/applications}
desktop-file-install --dir $RPM_BUILD_ROOT%{_datadir}/applications firefox-wayland.desktop
# set up the firefox start script
%{__rm} -rf $RPM_BUILD_ROOT%{_bindir}/firefox
%{__cat} firefox-wayland.sh.in > $RPM_BUILD_ROOT%{_bindir}/firefox-wayland
%{__chmod} 755 $RPM_BUILD_ROOT%{_bindir}/firefox-wayland
%{__rm} -f $RPM_BUILD_ROOT/%{mozappdir}/firefox-config
%{__rm} -f $RPM_BUILD_ROOT/%{mozappdir}/update-settings.ini
for s in 16 22 24 32 48 256; do
%{__mkdir_p} $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/${s}x${s}/apps
%{__cp} -p browser/branding/official/default${s}.png \
$RPM_BUILD_ROOT%{_datadir}/icons/hicolor/${s}x${s}/apps/firefox.png
done
# Install hight contrast icon
%{__mkdir_p} $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/symbolic/apps
# Register as an application to be visible in the software center
#
# NOTE: It would be *awesome* if this file was maintained by the upstream
# project, translated and installed into the right place during `make install`.
#
# See http://www.freedesktop.org/software/appstream/docs/ for more details.
#
mkdir -p $RPM_BUILD_ROOT%{_datadir}/appdata
cat > $RPM_BUILD_ROOT%{_datadir}/appdata/%{name}.appdata.xml <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2014 Richard Hughes <[email protected]> -->
<!--
BugReportURL: https://bugzilla.mozilla.org/show_bug.cgi?id=1071061
SentUpstream: 2014-09-22
-->
<application>
<id type="desktop">firefox.desktop</id>
<metadata_license>CC0-1.0</metadata_license>
<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>
<!-- FIXME: Needs another couple of paragraphs -->
</description>
<url type="homepage">http://www.mozilla.org/en-US/</url>
<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>
<!-- FIXME: change this to an upstream email address for spec updates
<updatecontact>someone_who_cares@upstream_project.org</updatecontact>
-->
</application>
EOF
%{__mkdir_p} $RPM_BUILD_ROOT/%{mozappdir}/browser/defaults/preferences
# System config dir
%{__mkdir_p} $RPM_BUILD_ROOT/%{_sysconfdir}/%{name}/pref
# Copy over the LICENSE
%{__install} -p -c -m 644 LICENSE $RPM_BUILD_ROOT/%{mozappdir}
# Use the system hunspell dictionaries
%{__rm} -rf ${RPM_BUILD_ROOT}%{mozappdir}/dictionaries
ln -s %{_datadir}/myspell ${RPM_BUILD_ROOT}%{mozappdir}/dictionaries
# Default
%{__cp} firefox-redhat-default-prefs.js ${RPM_BUILD_ROOT}%{mozappdir}/browser/defaults/preferences
# Add distribution.ini
%{__mkdir_p} ${RPM_BUILD_ROOT}%{mozappdir}/distribution
%{__cp} distribution.ini ${RPM_BUILD_ROOT}%{mozappdir}/distribution
# Remove copied libraries to speed up build
rm -f ${RPM_BUILD_ROOT}%{mozappdirdev}/sdk/lib/libmozjs.so
rm -f ${RPM_BUILD_ROOT}%{mozappdirdev}/sdk/lib/libmozalloc.so
rm -f ${RPM_BUILD_ROOT}%{mozappdirdev}/sdk/lib/libxul.so
chmod 644 ${RPM_BUILD_ROOT}%{mozappdir}/browser/blocklist.xml
#---------------------------------------------------------------------
# Moves defaults/preferences to browser/defaults/preferences
%pretrans -p <lua>
require 'posix'
require 'os'
if (posix.stat("%{mozappdir}/browser/defaults/preferences", "type") == "link") then
posix.unlink("%{mozappdir}/browser/defaults/preferences")
posix.mkdir("%{mozappdir}/browser/defaults/preferences")
if (posix.stat("%{mozappdir}/defaults/preferences", "type") == "directory") then
for i,filename in pairs(posix.dir("%{mozappdir}/defaults/preferences")) do
os.rename("%{mozappdir}/defaults/preferences/"..filename, "%{mozappdir}/browser/defaults/preferences/"..filename)
end
f = io.open("%{mozappdir}/defaults/preferences/README","w")
if f then
f:write("Content of this directory has been moved to %{mozappdir}/browser/defaults/preferences.")
f:close()
end
end
end
%preun
# is it a final removal?
if [ $1 -eq 0 ]; then
%{__rm} -rf %{mozappdir}/components
%{__rm} -rf %{mozappdir}/extensions
%{__rm} -rf %{mozappdir}/plugins
fi
%post
update-desktop-database &> /dev/null || :
touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
%postun
update-desktop-database &> /dev/null || :
if [ $1 -eq 0 ] ; then
touch --no-create %{_datadir}/icons/hicolor &>/dev/null
gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
fi
%posttrans
gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
%files
%defattr(-,root,root,-)
%{_bindir}/firefox-wayland
%dir %{_sysconfdir}/%{name}/*
%{_datadir}/appdata/*.appdata.xml
%{_datadir}/applications/*.desktop
%dir %{mozappdir}
# That's Windows only
%exclude %{mozappdir}/removed-files
%{mozappdir}/*
%{_datadir}/icons/hicolor/16x16/apps/firefox.png
%{_datadir}/icons/hicolor/22x22/apps/firefox.png
%{_datadir}/icons/hicolor/24x24/apps/firefox.png
%{_datadir}/icons/hicolor/256x256/apps/firefox.png
%{_datadir}/icons/hicolor/32x32/apps/firefox.png
%{_datadir}/icons/hicolor/48x48/apps/firefox.png
#---------------------------------------------------------------------
%changelog
* Thu Aug 10 2017 Martin Stransky <[email protected]> 57.1-1
- Updated to latest Mozilla trunk
* Wed Aug 9 2017 Martin Stransky <[email protected]> 57.0-1
- Merged with upstream
* Mon Jul 31 2017 Martin Stransky <[email protected]> 56.5-1
- Added clang build req ([email protected])
* Mon Jul 31 2017 Martin Stransky <[email protected]> 56.4-1
- Added build fix for llvm
* Sat Jul 29 2017 Martin Stransky <[email protected]> 56.3-1
- merged with upstream
* Fri Jul 14 2017 Martin Stransky <[email protected]> 56.2-1
- Fixed rhbz#1464916 - missing popup rendering ([email protected])
- Tweaked wl_surface_damage() calls ([email protected])
- Reverted commit 32899bf0d996dbe1008bd9abd79724a8217fb6b8 as it fixes nothing
- Remove unrealize handler (rhbz#1467104) ([email protected])
- Destroy GdkWindow owned by mozcontainer when unrealize (rhbz#1467104)
- Map Wayland subsurface only when GdkWindow is already mapped
- Set damage region for wl_surface after wl_buffer attach, rhbz#1464916
- Added missing gtk_widget_input_shape_combine_region linkage (rhbz#1466377),
thanks to Hiroshi Hatake ([email protected])
- Fixed mouse transparency for popups (rhbz#1466377) ([email protected])
- Fixed rendering of noautohide panels (rhbz#1466377) ([email protected])
* Thu Jun 29 2017 Martin Stransky <[email protected]> 56.1-1
- Don't explicitly grab on Wayland (use only implicit grab), see mozbz#1377084
for details ([email protected])
- Removed the gdk_seat_* code - let's solve
https://bugzilla.mozilla.org/show_bug.cgi?id=1377084 first
- Specfile tweak - version up ([email protected])
- Don't call gdk_x11_window_get_xid() from LOG() under wayland
* Thu Jun 29 2017 Martin Stransky <[email protected]> 56.0-1
- Rpm version up to match Firefox version
* Thu Jun 29 2017 Martin Stransky <[email protected]> 55.11-1
- Removed double / to fix rpm build ([email protected])
- Merged with upstream
* Fri Jun 23 2017 Martin Stransky <[email protected]> 55.10-1
- Fixed rhbz#1464017 - [Wayland] Hamburger menu popup and other panels does not
render transparent background ([email protected])
- Fixed error handling for posix_fallocate and formatting, by Hiroshi Hatake
* Thu Jun 22 2017 Martin Stransky <[email protected]> 55.9-1
- Fixed shell launcher script ([email protected])
- Updated to latest mozilla trunk
* Tue Jun 20 2017 Martin Stransky <[email protected]> 55.8-1
- Fixed typo in launch script ([email protected])
- Updated firefox-wayland launch script ([email protected])
- Added reference to https://bugzilla.gnome.org/show_bug.cgi?id=783957
- Use subsurfaces for popup creation (rhbz#1457201) ([email protected])
* Wed May 31 2017 Martin Stransky <[email protected]> 55.7-1
- Fixed fullscreen on Weston ([email protected])
- Fixed clipboard crashes after browser start, rhbz#1455915
* Tue May 30 2017 Martin Stransky <[email protected]> 55.6-1
- Updated to latest upstream
* Fri May 26 2017 Martin Stransky <[email protected]> 55.5-1
- Don't crash when we're missing clipboard data, rhbz#1455915
* Thu May 25 2017 Martin Stransky <[email protected]> 55.4-1
- Fixed desktop file ([email protected])
* Wed May 24 2017 Martin Stransky <[email protected]> 55.3-1
- Added tito build files