xref: /OK3568_Linux_fs/yocto/meta-browser/meta-firefox/recipes-browser/firefox/firefox_68.9.0esr.bb (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1# Copyright (C) 2009-2015, O.S. Systems Software Ltda. All Rights Reserved
2# Released under the MIT license (see packages/COPYING)
3
4DESCRIPTION ?= "Browser made by mozilla"
5DEPENDS += "curl startup-notification libevent cairo libnotify \
6            virtual/libgl pulseaudio icu dbus-glib \
7            nodejs-native cbindgen-native \
8            yasm-native nasm-native unzip-native \
9            virtual/${TARGET_PREFIX}rust cargo-native ${RUSTLIB_DEP} \
10            gtk+3 \
11           "
12RDEPENDS:${PN}-dev = "dbus"
13
14LICENSE = "MPL-2.0"
15LIC_FILES_CHKSUM = "file://toolkit/content/license.html;endline=33;md5=35d7fa1c4b86c115051c925fd624a5be"
16
17CVE_PRODUCT = "mozilla:firefox"
18
19SRC_URI = "https://ftp.mozilla.org/pub/firefox/releases/${PV}/source/firefox-${PV}.source.tar.xz \
20           file://mozconfig \
21           file://mozilla-firefox.png \
22           file://mozilla-firefox.desktop \
23           file://prefs/vendor.js \
24           file://fixes/Allow-.js-preference-files-to-set-locked-prefs-with-.patch \
25           file://fixes/Bug-1526653-Include-struct-definitions-for-user_vfp-.patch \
26           file://fixes/Bug-1556197-amend-Bug-1544631-for-fixing-mips32.patch \
27           file://fixes/Bug-1560340-Only-add-confvars.sh-as-a-dependency-to-.patch \
28           file://fixes/bug1545437-enable-to-specify-rust-target.patch \
29           file://fixes/Bug-1640982-SetCARGO_PROFILE_RELEASE_LTO-true-when-e.patch \
30           file://fixes/avoid-running-autoconf2.13.patch \
31           file://fixes/pre-generated-old-configure.patch \
32           file://fixes/link-with-libpangoft.patch \
33           file://fixes/0001-Bug-1721326-Fix-build-with-glibc-2.34.patch \
34           file://fixes/0002-security-Fix-build-with-glibc-2.34.patch \
35           file://fixes/0003-Fix-build-with-Werror-Wunused-but-set-variable.patch \
36           file://fixes/0004-Fix-build-with-gcc-11.patch \
37           file://porting/Add-xptcall-support-for-SH4-processors.patch \
38           file://porting/NSS-Fix-FTBFS-on-Hurd-because-of-MAXPATHLEN.patch \
39           file://porting/Work-around-Debian-bug-844357.patch \
40           file://porting/Use-NEON_FLAGS-instead-of-VPX_ASFLAGS-for-libaom-neo.patch \
41           file://prefs/Set-javascript.options.showInConsole.patch \
42           file://prefs/Set-DPI-to-system-settings.patch \
43           file://prefs/Don-t-auto-disable-extensions-in-system-directories.patch \
44           file://debian-hacks/Add-another-preferences-directory-for-applications-p.patch \
45           file://debian-hacks/Don-t-register-plugins-if-the-MOZILLA_DISABLE_PLUGIN.patch \
46           file://debian-hacks/Don-t-error-out-when-run-time-libsqlite-is-older-tha.patch \
47           file://debian-hacks/Add-a-2-minutes-timeout-on-xpcshell-tests.patch \
48           file://debian-hacks/Don-t-build-image-gtests.patch \
49           file://debian-hacks/Allow-to-override-ICU_DATA_FILE-from-the-environment.patch \
50           file://debian-hacks/Set-program-name-from-the-remoting-name.patch \
51           file://debian-hacks/Use-the-Mozilla-Location-Service-key-when-the-Google.patch \
52           file://debian-hacks/Avoid-using-vmrs-vmsr-on-armel.patch \
53           file://debian-hacks/Use-remoting-name-for-call-to-gdk_set_program_class.patch \
54           file://debian-hacks/Use-build-id-as-langpack-version-for-reproducibility.patch \
55           file://wayland/bug1451816-workaround-for-grabbing-popup.patch \
56           file://wayland/0001-Bug-1745560-Add-missing-stub-for-wl_proxy_marshal_fl.patch \
57           file://wayland/egl/bug1571603-Disable-eglQueryString-nullptr-EGL_EXTENSIONS.patch \
58           file://wayland/egl/0001-GLLibraryLoader-Use-given-symbol-lookup-function-fir.patch \
59           file://wayland/egl/0001-Mark-GLFeature-framebuffer_multisample-as-unsupporte.patch \
60           "
61
62SRC_URI[sha256sum] = "935105e1a8a97d64daffb372690e2b566b5f07641f01470929dbbc82d20d4407"
63S = "${WORKDIR}/firefox-${MOZ_APP_BASE_VERSION}"
64
65MOZ_APP_BASE_VERSION = "${@'${PV}'.replace('esr', '')}"
66
67inherit mozilla rust-common-without-python3native
68
69TOOLCHAIN:pn-firefox = "clang"
70AS = "${CC}"
71
72DISABLE_STATIC=""
73
74ARM_INSTRUCTION_SET:armv5 = "arm"
75
76PACKAGECONFIG ??= "${@bb.utils.contains("DISTRO_FEATURES", "alsa", "alsa", "", d)} \
77                   ${@bb.utils.contains("DISTRO_FEATURES", "wayland", "wayland", "", d)} \
78                   ${@bb.utils.contains_any("TARGET_ARCH", "x86_64 arm aarch64", "webrtc", "", d)} \
79"
80PACKAGECONFIG[alsa] = "--enable-alsa,--disable-alsa,alsa-lib"
81PACKAGECONFIG[wayland] = "--enable-default-toolkit=cairo-gtk3-wayland,--enable-default-toolkit=cairo-gtk3,virtual/egl,"
82PACKAGECONFIG[gpu] = ",,,"
83PACKAGECONFIG[openmax] = "--enable-openmax,,,"
84PACKAGECONFIG[webgl] = ",,,"
85PACKAGECONFIG[webrtc] = "--enable-webrtc,--disable-webrtc,,"
86PACKAGECONFIG[forbit-multiple-compositors] = ",,,"
87
88# Add a config file to enable GPU acceleration by default.
89SRC_URI += "${@bb.utils.contains('PACKAGECONFIG', 'gpu', \
90           'file://prefs/gpu.js', '', d)}"
91
92# Additional upstream patches to support OpenMAX IL
93SRC_URI += "${@bb.utils.contains('PACKAGECONFIG', 'openmax', \
94           'file://fixes/Bug-1590977-openmax-Import-latest-OpenMAX-IL-1.1.2-headers.patch \
95            file://prefs/openmax.js \
96           ', '', d)}"
97
98SRC_URI += "${@bb.utils.contains('PACKAGECONFIG', 'webgl', \
99           'file://prefs/webgl.js', '', d)}"
100
101SRC_URI += "${@bb.utils.contains('PACKAGECONFIG', 'forbit-multiple-compositors', \
102           'file://prefs/single-compositor.js \
103            file://fixes/0001-Enable-to-suppress-multiple-compositors.patch \
104	   ', '', d)}"
105
106do_install:append() {
107    install -d ${D}${datadir}/applications
108    install -d ${D}${datadir}/pixmaps
109
110    install -m 0644 ${WORKDIR}/mozilla-firefox.desktop ${D}${datadir}/applications/
111    install -m 0644 ${WORKDIR}/mozilla-firefox.png ${D}${datadir}/pixmaps/
112    install -m 0644 ${WORKDIR}/prefs/vendor.js ${D}${libdir}/${PN}/defaults/pref/
113    if [ -n "${@bb.utils.contains_any('PACKAGECONFIG', 'gpu', '1', '', d)}" ]; then
114        install -m 0644 ${WORKDIR}/prefs/gpu.js ${D}${libdir}/${PN}/defaults/pref/
115    fi
116    if [ -n "${@bb.utils.contains('PACKAGECONFIG', 'openmax', '1', '', d)}" ]; then
117        install -m 0644 ${WORKDIR}/prefs/openmax.js ${D}${libdir}/${PN}/defaults/pref/
118    fi
119    if [ -n "${@bb.utils.contains('PACKAGECONFIG', 'webgl', '1', '', d)}" ]; then
120        install -m 0644 ${WORKDIR}/prefs/webgl.js ${D}${libdir}/${PN}/defaults/pref/
121    fi
122    if [ -n "${@bb.utils.contains('PACKAGECONFIG', 'forbit-multiple-compositors', '1', '', d)}" ]; then
123        install -m 0644 ${WORKDIR}/prefs/single-compositor.js ${D}${libdir}/${PN}/defaults/pref/
124    fi
125
126    # Fix ownership of files
127    chown root:root -R ${D}${datadir}
128    chown root:root -R ${D}${libdir}
129}
130
131FILES:${PN} = "${bindir}/${PN} \
132               ${datadir}/applications/ \
133               ${datadir}/pixmaps/ \
134               ${libdir}/${PN}/* \
135               ${libdir}/${PN}/.autoreg \
136               ${bindir}/defaults"
137FILES:${PN}-dev += "${datadir}/idl ${bindir}/${PN}-config ${libdir}/${PN}-devel-*"
138FILES:${PN}-staticdev += "${libdir}/${PN}-devel-*/sdk/lib/*.a"
139FILES:${PN}-dbg += "${libdir}/${PN}/.debug \
140                    ${libdir}/${PN}/*/.debug \
141                    ${libdir}/${PN}/*/*/.debug \
142                    ${libdir}/${PN}/*/*/*/.debug \
143                    ${libdir}/${PN}-devel-*/*/.debug \
144                    ${libdir}/${PN}-devel-*/*/*/.debug \
145                    ${libdir}/${PN}-devel-*/*/*/*/.debug \
146                    ${libdir}/${PN}/fix_linux_stack.py \
147                    ${bindir}/.debug"
148
149# We don't build XUL as system shared lib, so we can mark all libs as private
150PRIVATE_LIBS = " \
151    libmozjs.so \
152    libxpcom.so \
153    libnspr4.so \
154    libxul.so \
155    libmozalloc.so \
156    libplc4.so \
157    libplds4.so \
158    liblgpllibs.so \
159    libmozgtk.so \
160    libmozwayland.so \
161    libmozsqlite3.so \
162    libclearkey.so \
163    libmozavcodec.so \
164    libmozavutil.so \
165"
166
167# mark libraries also provided by nss as private too
168PRIVATE_LIBS += " \
169    libfreebl3.so \
170    libfreeblpriv3.so \
171    libnss3.so \
172    libnssckbi.so \
173    libsmime3.so \
174    libnssutil3.so \
175    libnssdbm3.so \
176    libssl3.so \
177    libsoftokn3.so \
178"
179
180CLEANBROKEN = "1"
181