Skip to content

Commit 6598031

Browse files
OldManYellsAtCloudjcalvinowens
authored andcommitted
firefox: add Whinlatter compatibility
- meta-clang is only a requirement for pre-whinlatter versions - add a config fragment to specify the correct S variable for cbindgen and wasi-sdk-native, as they need different values in whinlatter and pre-whinlatter versions - Firefox recipe specifies the AS variable to be used during compilation, however due to a change in whinlatter such changes need to be done inside tasks, otherwise the default toolchain settings overwrite these due to deferred inheritance. Move the AS specification into tasks. Co-authored-by: Calvin Owens <[email protected]> Signed-off-by: Gyorgy Sarvari <[email protected]>
1 parent 4c29a92 commit 6598031

File tree

8 files changed

+51
-17
lines changed

8 files changed

+51
-17
lines changed

meta-firefox/classes/mozilla.bbclass

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ mozilla_run_mach() {
5353
export INSTALL_SDK=0
5454
export DESTDIR="${D}"
5555

56+
export AS="${CC}"
57+
5658
cd "${S}"
5759

5860
./mach "$@"

meta-firefox/conf/layer.conf

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,9 @@ BBFILE_PATTERN_firefox-browser-layer := "^${LAYERDIR}/"
115115
BBFILE_PRIORITY_firefox-browser-layer = "7"
116116

117117
LAYERVERSION_firefox-browser-layer = "2"
118-
LAYERSERIES_COMPAT_firefox-browser-layer = "kirkstone scarthgap walnascar"
118+
LAYERSERIES_COMPAT_firefox-browser-layer = "kirkstone scarthgap walnascar whinlatter"
119119

120-
LAYERDEPENDS_firefox-browser-layer = "clang-layer core openembedded-layer"
120+
LAYERDEPENDS_firefox-browser-layer = "core openembedded-layer"
121+
LAYERDEPENDS_firefox-browser-layer:append = '${@"" if "whinlatter" in d.getVar("LAYERSERIES_CORENAMES") else " clang-layer "}'
122+
123+
require conf/post-whinlatter-s-config.inc
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# In whinlatter the UNPACKDIR location has changed, and pathes created using
2+
# the ${WORKDIR} variable are not valid anymore. However older versions still
3+
# require these. This fragment contains a list of recipes in the meta-firefox
4+
# layer that needs their "S" variable modified depending on the used Yocto
5+
# version.
6+
7+
WHINLATTER_S = "${UNPACKDIR}/${BB_GIT_DEFAULT_DESTSUFFIX}"
8+
NON_WHINLATTER_S = "${WORKDIR}/git"
9+
10+
CORRECT_S = '${@bb.utils.contains_any("LAYERSERIES_CORENAMES", "whinlatter", d.getVar("WHINLATTER_S"), d.getVar("NON_WHINLATTER_S"), d)}'
11+
12+
S:pn-cbindgen = "${CORRECT_S}"
13+
S:pn-cbindgen-native = "${CORRECT_S}"
14+
S:pn-wasi-sdk-native = "${CORRECT_S}"

meta-firefox/recipes-browser/firefox/firefox.inc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
DESCRIPTION ?= "Browser made by Mozilla"
22

33
DEPENDS:append = "pulseaudio cbindgen-native clang-native \
4-
nodejs-native python-zstandard gtk+3 \
4+
nodejs-native python3-zstandard gtk+3 \
55
libevent dbus-glib"
66

77
DEPENDS:x86-64:append = " nasm-native "
@@ -121,7 +121,6 @@ SRC_URI += "${@bb.utils.contains('PACKAGECONFIG', 'forbid-multiple-compositors',
121121
', '', d)}"
122122

123123
TOOLCHAIN:pn-firefox = "clang"
124-
AS = "${CC}"
125124

126125
DISABLE_STATIC = ""
127126

meta-firefox/recipes-devtools/cbindgen/cbindgen_0.28.0.bb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
SUMMARY = "cbindgen creates C/C++11 headers for Rust libraries which expose a public C API"
22
HOMEPAGE = "https://github.com/mozilla/cbindgen"
33
LICENSE = "MPL-2.0"
4-
LIC_FILES_CHKSUM = "file://LICENSE;md5=9741c346eef56131163e13b9db1241b3"
4+
LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=9741c346eef56131163e13b9db1241b3"
55

66
SRC_URI += "git://github.com/mozilla/cbindgen.git;protocol=https;branch=master"
77
SRCREV = "bd78bbe59b10eda6ef1255e4acda95c56c6d0279"
8-
S = "${WORKDIR}/git"
98

109
inherit cargo pkgconfig
1110

meta-firefox/recipes-devtools/python-zstandard/python-zstandard_0.21.0.bb renamed to meta-firefox/recipes-devtools/python3-zstandard/python3-zstandard_0.21.0.bb

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@ AUTHOR = "Gregory Szorc <[email protected]>"
44
LICENSE = "BSD-3-Clause"
55
LIC_FILES_CHKSUM = "file://LICENSE;md5=3ae87c50fd64b6f0942823686871e758"
66

7-
SRC_URI = "https://files.pythonhosted.org/packages/4d/70/1f883646641d7ad3944181549949d146fa19e286e892bc013f7ce1579e8f/zstandard-0.21.0.tar.gz"
8-
SRC_URI[md5sum] = "7baafeb332651d70881ce692edf912b3"
97
SRC_URI[sha256sum] = "f08e3a10d01a247877e4cb61a82a319ea746c356a3786558bed2481e6c405546"
108

11-
S = "${WORKDIR}/zstandard-0.21.0"
12-
13-
RDEPENDS_${PN} = ""
14-
15-
inherit setuptools3
9+
inherit setuptools3 pypi
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
From bf31dbdd45582713fd8727ecd3873e656f2b567a Mon Sep 17 00:00:00 2001
2+
From: Gyorgy Sarvari <[email protected]>
3+
Date: Sun, 20 Jul 2025 20:24:41 +0200
4+
Subject: [PATCH] allow compiling with cmake 4
5+
6+
Upstream-Status: Pending
7+
8+
Signed-off-by: Gyorgy Sarvari <[email protected]>
9+
---
10+
wasi-sdk.cmake | 2 +-
11+
1 file changed, 1 insertion(+), 1 deletion(-)
12+
13+
diff --git a/wasi-sdk.cmake b/wasi-sdk.cmake
14+
index 83ee9b0..a2ef1b2 100644
15+
--- a/wasi-sdk.cmake
16+
+++ b/wasi-sdk.cmake
17+
@@ -1,7 +1,7 @@
18+
# Cmake toolchain description file for the Makefile
19+
20+
# This is arbitrary, AFAIK, for now.
21+
-cmake_minimum_required(VERSION 3.4.0)
22+
+cmake_minimum_required(VERSION 3.5.0)
23+
24+
set(CMAKE_SYSTEM_NAME WASI)
25+
set(CMAKE_SYSTEM_VERSION 1)

meta-firefox/recipes-devtools/wasi-sdk/wasi-sdk-native_git.bb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,12 @@ inherit native
1010

1111
DEPENDS = "clang-native cmake-native ninja-native"
1212

13-
S = "${WORKDIR}/git"
14-
1513
SRC_URI = "gitsm://github.com/WebAssembly/wasi-sdk.git;protocol=https;branch=main"
16-
SRC_URI += "file://0001-disable-exceptions-and-bulk-memory.patch"
14+
SRC_URI += "file://0001-disable-exceptions-and-bulk-memory.patch \
15+
file://0001-allow-compiling-with-cmake-4.patch"
1716

1817
SRCREV = "3fb0057a6da0313d18dad241ef7a87aa43f1485c"
1918

20-
2119
TOOLCHAIN = "clang"
2220
TOOLCHAIN:class-native = "clang"
2321

0 commit comments

Comments
 (0)