[Buildroot] [PATCH 5/5] package/firefox: new package
Waldemar Brodkorb
wbx at openadk.org
Thu Sep 25 02:58:33 UTC 2025
Popular Webbrowser.
Tested on Raspberry PI4 (aarch64) and Qemu X86_64.
You need some fonts to be installed to make use of it,
f.e. Dejavu fonts.
To compile firefox you need a machine with approximately 24 GB of RAM.
The system PNG library can not be used, because it does not have APNG
support.
Signed-off-by: Waldemar Brodkorb <wbx at openadk.org>
---
DEVELOPERS | 1 +
package/Config.in | 1 +
package/firefox/Config.in | 53 ++++++++++++++++++++++
package/firefox/firefox.hash | 3 ++
package/firefox/firefox.mk | 88 ++++++++++++++++++++++++++++++++++++
5 files changed, 146 insertions(+)
create mode 100644 package/firefox/Config.in
create mode 100644 package/firefox/firefox.hash
create mode 100644 package/firefox/firefox.mk
diff --git a/DEVELOPERS b/DEVELOPERS
index 7915470fcc..aec811a3b0 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -3407,6 +3407,7 @@ F: package/asterisk/
F: package/cbindgen/
F: package/evilwm/
F: package/fbv/
+F: package/firefox/
F: package/libaom/
F: package/libjwt/
F: package/mksh/
diff --git a/package/Config.in b/package/Config.in
index 465ea484df..36f3db1394 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -399,6 +399,7 @@ comment "X applications"
source "package/dillo/Config.in"
source "package/docker/Config.in"
source "package/feh/Config.in"
+ source "package/firefox/Config.in"
source "package/mupdf/Config.in"
source "package/nodm/Config.in"
source "package/pcmanfm/Config.in"
diff --git a/package/firefox/Config.in b/package/firefox/Config.in
new file mode 100644
index 0000000000..75811f9d63
--- /dev/null
+++ b/package/firefox/Config.in
@@ -0,0 +1,53 @@
+config BR2_PACKAGE_FIREFOX
+ bool "firefox"
+ depends on BR2_aarch64 || BR2_x86_64
+ depends on BR2_PACKAGE_HOST_RUSTC_ARCH_SUPPORTS
+ depends on BR2_PACKAGE_XORG7
+ depends on BR2_USE_WCHAR # glib2
+ depends on BR2_TOOLCHAIN_HAS_THREADS # glib2
+ depends on BR2_USE_MMU # glib2
+ depends on BR2_INSTALL_LIBSTDCPP # pango
+ depends on BR2_TOOLCHAIN_HAS_SYNC_4 # pango -> harfbuzz
+ depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 # pango -> harfbuzz
+ depends on BR2_PACKAGE_HAS_LIBGL
+ select BR2_PACKAGE_ALSA_LIB
+ select BR2_PACKAGE_DAV1D
+ select BR2_PACKAGE_DBUS_GLIB
+ select BR2_PACKAGE_FONTCONFIG
+ select BR2_PACKAGE_HARFBUZZ
+ select BR2_PACKAGE_HOST_NODEJS
+ select BR2_PACKAGE_HOST_NODEJS_SRC
+ select BR2_PACKAGE_HOST_PYTHON3
+ select BR2_PACKAGE_HOST_PYTHON3_BZIP2
+ select BR2_PACKAGE_HOST_PYTHON3_CURSES
+ select BR2_PACKAGE_HOST_PYTHON3_SQLITE
+ select BR2_PACKAGE_HOST_PYTHON3_SSL
+ select BR2_PACKAGE_LIBFFI
+ select BR2_PACKAGE_ICU
+ select BR2_PACKAGE_JPEG
+ select BR2_PACKAGE_LIBAOM
+ select BR2_PACKAGE_LIBGTK3
+ select BR2_PACKAGE_LIBNSS
+ select BR2_PACKAGE_LIBVPX
+ select BR2_PACKAGE_PANGO
+ select BR2_PACKAGE_ZLIB
+ select BR2_PACKAGE_XLIB_LIBXCOMPOSITE
+ select BR2_PACKAGE_XLIB_LIBXCURSOR
+ select BR2_PACKAGE_XLIB_LIBXDAMAGE
+ select BR2_PACKAGE_XLIB_LIBXRANDR
+ select BR2_PACKAGE_XLIB_LIBICE
+ select BR2_PACKAGE_XLIB_LIBSM
+ help
+ Popular webbrowser.
+
+ https://www.firefox.com
+
+comment "firefox needs a toolchain w/ wchar, threads, C++"
+ depends on BR2_PACKAGE_XORG7 && BR2_USE_MMU
+ depends on !BR2_INSTALL_LIBSTDCPP
+ depends on BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS
+
+comment "firefox needs an OpenGL (GLX) provider"
+ depends on BR2_USE_MMU
+ depends on BR2_TOOLCHAIN_HAS_SYNC_4
+ depends on !BR2_PACKAGE_HAS_LIBGL
diff --git a/package/firefox/firefox.hash b/package/firefox/firefox.hash
new file mode 100644
index 0000000000..a2566529ba
--- /dev/null
+++ b/package/firefox/firefox.hash
@@ -0,0 +1,3 @@
+# Locally calculated
+sha256 956dce675c3b706d563caf07ed3ca9af632ab830be710dfd4351da78a0a2ef55 firefox-140.2.0esr.source.tar.xz
+sha256 d10965daab0b819bef778c629a94cdd094ffb4ede37239b3d263884a574352c0 toolkit/content/license.html
diff --git a/package/firefox/firefox.mk b/package/firefox/firefox.mk
new file mode 100644
index 0000000000..ea62dc62e8
--- /dev/null
+++ b/package/firefox/firefox.mk
@@ -0,0 +1,88 @@
+################################################################################
+#
+# firefox
+#
+################################################################################
+
+FIREFOX_VERSION = 140.2.0esr
+FIREFOX_SOURCE = firefox-$(FIREFOX_VERSION).source.tar.xz
+FIREFOX_SITE = https://ftp.mozilla.org/pub/firefox/releases/$(FIREFOX_VERSION)/source
+FIREFOX_LICENSE = MPL-2.0
+FIREFOX_LICENSE_FILES = toolkit/content/license.html
+FIREFOX_DEPENDENCIES = \
+ host-nodejs \
+ host-cbindgen \
+ host-clang \
+ host-nasm \
+ alsa-lib \
+ dav1d \
+ dbus-glib \
+ fontconfig \
+ harfbuzz \
+ jpeg \
+ libaom \
+ libgtk3 \
+ libnss \
+ libvpx \
+ pango \
+ pixman \
+ zlib \
+ xlib_libXcomposite \
+ xlib_libXcursor \
+ xlib_libXdamage \
+ xlib_libXrandr \
+ xlib_libICE \
+ xlib_libSM
+
+FIREFOX_CONF_OPTS = \
+ --enable-application=browser \
+ --enable-official-branding \
+ --disable-audio-backends \
+ --disable-webrtc \
+ --disable-printing \
+ --without-wasm-sandboxed-libraries \
+ --disable-profiling \
+ --disable-pulseaudio \
+ --disable-crashreporter \
+ --disable-tests \
+ --with-system-av1 \
+ --with-system-ffi \
+ --with-system-icu \
+ --with-system-jpeg \
+ --with-system-libvpx \
+ --with-system-nss \
+ --with-system-pixman \
+ --with-system-zlib \
+ --with-clang-path=$(HOST_DIR)/bin/clang
+
+# build directory can't be the directory where configure are there, so..
+define FIREFOX_CONFIGURE_CMDS
+ (mkdir -p $(@D)/build; cd $(@D)/build; rm -rf config.cache; \
+ PATH=$(BR_PATH) \
+ CC="$(TARGET_CC)" \
+ CFLAGS="$(TARGET_CFLAGS)" \
+ CROSS_COMPILE=1 \
+ ../configure \
+ --target=$(GNU_TARGET_NAME) \
+ --with-toolchain-prefix=$(GNU_TARGET_NAME)- \
+ --prefix=/usr \
+ $(FIREFOX_CONF_OPTS) \
+ )
+endef
+
+define FIREFOX_BUILD_CMDS
+ $(MAKE) -C $(@D)/build \
+ CC="$(TARGET_CC)" \
+ CFLAGS="$(TARGET_CFLAGS)" \
+ all
+endef
+
+define FIREFOX_INSTALL_TARGET_CMDS
+ $(MAKE) -C $(@D)/build \
+ DESTDIR=$(TARGET_DIR) \
+ CC="$(TARGET_CC)" \
+ CFLAGS="$(TARGET_CFLAGS)" \
+ install
+endef
+
+$(eval $(generic-package))
--
2.47.3
More information about the buildroot
mailing list