firefox: update to 129.0.2
[oi-userland.git] / components / web / firefox / Makefile
blob1f889f9da4bf0a661c67102aee5bab0ea394281a
2 # This file and its contents are supplied under the terms of the
3 # Common Development and Distribution License ("CDDL"), version 1.0.
4 # You may only use this file in accordance with the terms of version
5 # 1.0 of the CDDL.
7 # A full copy of the text of the CDDL should have accompanied this
8 # source. A copy of the CDDL is also available via the Internet at
9 # http://www.illumos.org/license/CDDL.
13 # Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
14 # Copyright 2015 OpenSXCE.org Martin Bochnig <opensxce@mail.ru>
15 # Copyright 2013-2017 Alexander Pyhalov
16 # Copyright 2019 Geoffrey Weiss
17 # Copyright 2019 Michal Nowak
18 # Copyright 2021 Carsten Grzemba
21 USE_PARALLEL_BUILD = yes
22 include ../../../make-rules/shared-macros.mk
23 ENV = /usr/bin/env
25 # ESR should be set to esr for esr build, or an empty string for other builds
26 ESR =
28 # CANDIDATE_BUILD is the build number found in the candidates directory.
29 # CANDIDATE_BETA is the beta version found in the candidates directory.
30 # CANDIDATE_NIGHTLY is the nightly release hosted on github
31 # USE_HG_REPO is to use mozilla's hg source repo nstead of github
32 # Do not define any for final release build.
33 # CANDIDATE_BUILD=1
34 # CANDIDATE_BETA=8
35 # CANDIDATE_NIGHTLY=1
36 # USE_HG_REPO=1
38 COMPONENT_NAME = firefox
39 COMPONENT_VERSION = 129.0.2
40 COMPONENT_SUMMARY= Mozilla Firefox Web browser
41 COMPONENT_PROJECT_URL = https://www.mozilla.com/firefox
42 COMPONENT_SRC_NAME = $(COMPONENT_NAME)-$(COMPONENT_VERSION)
44 ifdef CANDIDATE_BETA
45 COMPONENT_ARCHIVE = $(COMPONENT_NAME)-$(COMPONENT_VERSION)b$(CANDIDATE_BETA)$(ESR).source.tar.xz
46 else
47 COMPONENT_ARCHIVE = $(COMPONENT_SRC_NAME)$(ESR).source.tar.xz
48 # CANDIDATE_BETA
49 endif
51 ifdef CANDIDATE_NIGHTLY
52 COMPONENT_GIT_HASH= edca9f888a1c638081ca4751216f309249378efc6d5c154c11653ffce23bd816
53 COMPONENT_SRC= gecko-dev-$(COMPONENT_GIT_HASH)
54 COMPONENT_ARCHIVE= $(COMPONENT_GIT_HASH).tar.gz
55 COMPONENT_ARCHIVE_URL= https://github.com/mozilla/gecko-dev/archive/$(COMPONENT_ARCHIVE)
56 ifdef USE_HG_REPO
57 COMPONENT_HG_HASH= ff0882e981495f07c521e0b00e1e83b050dfcdc2
58 COMPONENT_SRC= mozilla-central-$(COMPONENT_HG_HASH)
59 COMPONENT_ARCHIVE= $(COMPONENT_HG_HASH).zip
60 COMPONENT_ARCHIVE_URL= https://hg.mozilla.org/mozilla-central/archive/$(COMPONENT_ARCHIVE)
61 endif
62 else
63 ifndef CANDIDATE_BUILD
64 MOZILLA_FTP = https://ftp.mozilla.org/pub/$(COMPONENT_NAME)/releases/$(COMPONENT_VERSION)$(ESR)
65 else
66 ifndef CANDIDATE_BETA
67 MOZILLA_FTP = https://ftp.mozilla.org/pub/$(COMPONENT_NAME)/candidates/$(COMPONENT_VERSION)$(ESR)-candidates/build$(CANDIDATE_BUILD)
68 else
69 MOZILLA_FTP = https://ftp.mozilla.org/pub/$(COMPONENT_NAME)/candidates/$(COMPONENT_VERSION)b$(CANDIDATE_BETA)$(ESR)-candidates/build$(CANDIDATE_BUILD)
70 endif
71 endif
72 COMPONENT_SRC = $(COMPONENT_SRC_NAME)
73 COMPONENT_ARCHIVE_URL = $(MOZILLA_FTP)/source/$(COMPONENT_ARCHIVE)
74 endif
76 COMPONENT_ARCHIVE_HASH= sha256:35a1da121af474833d013ecbc1f77aa55bb35678fe06d438842d320dfab3f344
77 COMPONENT_PROJECT_URL = https://www.mozilla.com/en-US/firefox/
78 COMPONENT_FMRI= web/browser/firefox
80 RUST_VERSION = 1.79.0
82 # TODO: use remote hashfile to verify
83 ALLOW_UNVERIFIED_DOWNLOADS=yes
84 export ALLOW_UNVERIFIED_DOWNLOADS
86 LANG_LIST= ach af an ar ast az be bg bn br bs ca-valencia ca cak cs cy da de dsb el en-CA en-GB \
87 en-US eo es-AR es-CL es-ES es-MX et eu fa ff fi fr fur fy-NL ga-IE gd gl gn gu-IN he hi-IN hr hsb \
88 hu hy-AM ia id is it ja ka kab kk km kn ko lij lt lv mk mr ms my nb-NO ne-NP nl nn-NO oc pa-IN \
89 pl pt-BR pt-PT rm ro ru sat sc sco si sk skr sl son sq sr sv-SE szl ta te tg th tl tr trs uk ur uz vi xh zh-CN zh-TW
91 ifdef CANDIDATE_NIGHTLY
92 FIREFOX_UPDATE_CHANNEL=nightly
93 else
94 ifdef CANDIDATE_BETA
95 LANG_FILES_LOCATION= \
96 https://ftp.mozilla.org/pub/firefox/candidates/$(COMPONENT_VERSION)b$(CANDIDATE_BETA)$(ESR)-candidates/build$(CANDIDATE_BUILD)/linux-x86_64/xpi
97 FIREFOX_UPDATE_CHANNEL=beta
98 else
99 ifdef CANDIDATE_BUILD
100 LANG_FILES_LOCATION= \
101 https://ftp.mozilla.org/pub/firefox/candidates/$(COMPONENT_VERSION)$(ESR)-candidates/build$(CANDIDATE_BUILD)/linux-x86_64/xpi
102 FIREFOX_UPDATE_CHANNEL=default
103 else
104 LANG_FILES_LOCATION= \
105 https://ftp.mozilla.org/pub/firefox/releases/$(COMPONENT_VERSION)$(ESR)/linux-x86_64/xpi
106 FIREFOX_UPDATE_CHANNEL=default
107 endif
108 endif
109 endif
111 # handle esr case to set FIREFOX_UPDATE_CHANNEL
112 ifdef ESR
113 ifeq ($(ESR), esr)
114 FIREFOX_UPDATE_CHANNEL=esr
115 endif
116 endif
118 CONFIGURE_DEFAULT_DIRS=no
120 include $(WS_MAKE_RULES)/common.mk
122 RUSTUP_HOME = $(BUILD_DIR)/.rust_up
123 CARGO_HOME = $(BUILD_DIR)/.cargo
125 PATH = $(CARGO_HOME)/bin:$(PATH.gnu)
127 MOZCONFIG = $(SOURCE_DIR)/mozconfig
128 GNU_ARCH= x86_64-unknown-illumos
130 ifdef DEBUG
131 # disable code optimization
132 CFLAGS =
133 CXXFLAGS =
135 MOZCONFIG_DEBUG = $(MOZCONFIG)
136 MOZCONFIG_NON_DEBUG = /dev/null
137 else
138 MOZCONFIG_DEBUG = /dev/null
139 MOZCONFIG_NON_DEBUG = $(MOZCONFIG)
140 endif
142 CONFIGURE_ENV=
143 CONFIGURE_OPTIONS=
145 # clang or gcc
146 CC_TYPE = gcc
147 COMPILER.gcc= gcc
148 COMPILER.clang= clang
149 COMPILER = $(COMPILER.$(CC_TYPE))
151 CXXFLAGS += -Wno-invalid-offsetof -fpermissive
152 # xpcom uses DEF XP_SOLARIS
153 CXXFLAGS += -DXP_SOLARIS
154 # type problem compiling ffvpx with clang
155 CFLAGS += -D__int8_t_defined
157 FIREFOX_LIBDIR = $(CONFIGURE_LIBDIR.$(BITS))
159 COMPONENT_PRE_CONFIGURE_ACTION += \
160 rm -f $(MOZCONFIG); \
161 echo "ac_add_options MOZILLA_OFFICIAL=1" >> $(MOZCONFIG) ; \
162 echo "ac_add_options PKG_CONFIG=/usr/bin/amd64/pkg-config" >> $(MOZCONFIG) ; \
163 echo "ac_add_options CC_TYPE=$(CC_TYPE)" >> $(MOZCONFIG) ; \
164 echo "ac_add_options CC=$(CC)" >> $(MOZCONFIG) ; \
165 echo "ac_add_options CXX=$(CXX)" >> $(MOZCONFIG) ; \
166 echo "ac_add_options --prefix=/usr" >> $(MOZCONFIG) ; \
167 echo "ac_add_options --libdir=$(FIREFOX_LIBDIR)" >> $(MOZCONFIG) ; \
168 echo "ac_add_options --disable-crashreporter" >> $(MOZCONFIG) ; \
169 echo "ac_add_options --disable-debug-symbols" >> $(MOZCONFIG_NON_DEBUG) ; \
170 echo "ac_add_options --disable-install-strip" >> $(MOZCONFIG_DEBUG) ; \
171 echo "ac_add_options --disable-optimize" >> $(MOZCONFIG_DEBUG) ; \
172 echo "ac_add_options --disable-tests" >> $(MOZCONFIG) ; \
173 echo "ac_add_options --disable-updater" >> $(MOZCONFIG) ; \
174 echo "ac_add_options --enable-debug" >> $(MOZCONFIG_DEBUG) ; \
175 echo "ac_add_options --enable-jemalloc" >> $(MOZCONFIG) ; \
176 echo "ac_add_options --enable-js-shell" >> $(MOZCONFIG) ; \
177 echo "ac_add_options --enable-official-branding" >> $(MOZCONFIG) ; \
178 echo "ac_add_options --enable-optimize" >> $(MOZCONFIG_NON_DEBUG) ; \
179 echo "ac_add_options --enable-pulseaudio" >> $(MOZCONFIG) ; \
180 echo "ac_add_options --enable-replace-malloc" >> $(MOZCONFIG) ; \
181 echo "ac_add_options --enable-system-pixman" >> $(MOZCONFIG) ; \
182 echo "ac_add_options --enable-update-channel=$(FIREFOX_UPDATE_CHANNEL)" >> $(MOZCONFIG) ; \
183 echo "ac_add_options --with-intl-api" >> $(MOZCONFIG) ; \
184 echo "ac_add_options --with-system-zlib" >> $(MOZCONFIG) ; \
185 echo "ac_add_options --host=$(GNU_ARCH)" >> $(MOZCONFIG) ; \
186 echo "ac_add_options --target=$(GNU_ARCH)" >> $(MOZCONFIG) ; \
187 echo "ac_add_options --without-wasm-sandboxed-libraries" >> $(MOZCONFIG) ; \
188 # echo "ac_add_options --enable-bootstrap" >> $(MOZCONFIG) ; \
189 # echo "ac_add_options --with-wasi-sysroot=" >> $(MOZCONFIG) ; \
191 LD_SECEXT_OPTIONS += $(SSBD_ENABLE)
193 # 28395728
194 LD_MAP_NOEXBSS.sparc=
196 # libmozgtk needs to link to gtk3 and others
197 LD_Z_IGNORE=
199 # missing symbols from gtk3 during Firefox start
200 LD_B_DIRECT=
202 # hope to get args data in stacks of core dumps
203 LD_OPTIONS += -msave-args
205 # use a local installed rust since the system version may not be compatible
206 COMPONENT_PRE_CONFIGURE_ACTION += ( \
207 export RUSTUP_HOME=$(RUSTUP_HOME); \
208 export CARGO_HOME=$(CARGO_HOME); \
209 export RUSTUP_INIT_SKIP_PATH_CHECK=yes; \
210 curl https://sh.rustup.rs -sSf | bash -s -- -y --no-modify-path; \
211 source $(CARGO_HOME)/env; \
212 rustup install $(RUST_VERSION); \
213 rustup default $(RUST_VERSION)-x86_64-unknown-illumos; \
214 rustup show; \
215 cargo install --root=$(CARGO_HOME) --vers 0.26.0 cbindgen; \
218 ENV += CFLAGS="$(CFLAGS)"
219 ENV += CXXFLAGS="$(CXXFLAGS)"
220 ENV += PKG_CONFIG=/usr/bin/amd64/pkg-config
221 ENV += RUSTUP_HOME=$(RUSTUP_HOME)
222 ENV += CARGO_HOME=$(CARGO_HOME)
224 COMPONENT_BUILD_ARGS += $(JOBS:%=-j%)
226 CONFIGURE_ENV = $(ENV)
227 COMPONENT_BUILD_ENV = $(ENV)
228 COMPONENT_INSTALL_ENV += HOME=/tmp
230 # language support is more complex on nightly release, support on beta and later
231 ifndef CANDIDATE_NIGHTLY
232 LANG_FILES=$(addsuffix .xpi,$(LANG_LIST))
234 CLEAN_PATHS += $(LANG_FILES)
236 $(LANG_FILES):
237 $(FETCH) --file $@ --url $(LANG_FILES_LOCATION)/$@
239 download prep:: $(LANG_FILES)
240 endif
242 COMPONENT_POST_BUILD_ACTION = \
243 (cd $(@D)/browser/installer ; $(ENV) $(COMPONENT_BUILD_ENV) \
244 $(GMAKE) $(COMPONENT_BUILD_ARGS) $(COMPONENT_BUILD_TARGETS))
246 COMPONENT_POST_INSTALL_ACTION = \
247 for file in `find $(PROTO_DIR)$(FIREFOX_LIBDIR)/firefox/ -name "*.so"`; do \
248 /usr/bin/elfedit -e 'dyn:value -s RUNPATH "$(GCC_LIBDIR):$(FIREFOX_LIBDIR)/firefox:/usr/lib/mps/amd64"' $$file ; \
249 /usr/bin/elfedit -e 'dyn:value -s RPATH "$(GCC_LIBDIR):$(FIREFOX_LIBDIR)/firefox:/usr/lib/mps/amd64"' $$file ; \
250 done ; \
251 unzip -c $(PROTOUSRLIBDIR64)/$(COMPONENT_NAME)/omni.ja chrome/toolkit/content/global/license.html \
252 | LC_ALL=en_US.UTF-8 lynx --display_charset=utf-8 -stdin --dump -nolist > $(COMPONENT_NAME).license ;
254 COMPONENT_TEST_MASTER = $(COMPONENT_TEST_RESULTS_DIR)/results-$(MACH).master
256 COMPONENT_TEST_DIR = $(@D)/js/src
257 COMPONENT_TEST_TARGETS=check-jit-test
258 COMPONENT_TEST_TRANSFORMS = \
259 '-e "/^PASSED ALL/,/Failed:/p" ' \
260 '-e "/^FAILURES:/,/Failed:/p" ' \
261 '-e "/.*/d" '
263 # the license file is dynamically build, thus we need to remove it:
264 clean::
265 $(RM) $(COMPONENT_LICENSE_FILE)
267 # Build dependencies
268 PYTHON_REQUIRED_PACKAGES += library/python/psutil
269 PYTHON_REQUIRED_PACKAGES += runtime/python
270 REQUIRED_PACKAGES += database/sqlite-3
271 REQUIRED_PACKAGES += developer/build/autoconf-213
272 REQUIRED_PACKAGES += developer/lang/rustc
273 REQUIRED_PACKAGES += gnome/config/gconf
274 REQUIRED_PACKAGES += library/audio/pulseaudio
275 REQUIRED_PACKAGES += library/http-parser
276 REQUIRED_PACKAGES += runtime/nodejs-22
277 REQUIRED_PACKAGES += system/header/header-audio
278 REQUIRED_PACKAGES += web/browser/lynx
280 # Auto-generated dependencies
281 REQUIRED_PACKAGES += $(GCC_RUNTIME_PKG)
282 REQUIRED_PACKAGES += $(GXX_RUNTIME_PKG)
283 REQUIRED_PACKAGES += library/c++/harfbuzz
284 REQUIRED_PACKAGES += library/desktop/atk
285 REQUIRED_PACKAGES += library/desktop/cairo
286 REQUIRED_PACKAGES += library/desktop/gdk-pixbuf
287 REQUIRED_PACKAGES += library/desktop/gtk3
288 REQUIRED_PACKAGES += library/desktop/pango
289 REQUIRED_PACKAGES += library/glib2
290 REQUIRED_PACKAGES += library/graphics/pixman
291 REQUIRED_PACKAGES += library/zlib
292 REQUIRED_PACKAGES += system/library
293 REQUIRED_PACKAGES += system/library/fontconfig
294 REQUIRED_PACKAGES += system/library/freetype-2
295 REQUIRED_PACKAGES += system/library/libdbus
296 REQUIRED_PACKAGES += system/library/math
297 REQUIRED_PACKAGES += x11/library/libx11
298 REQUIRED_PACKAGES += x11/library/libxcb
299 REQUIRED_PACKAGES += x11/library/libxext
300 REQUIRED_PACKAGES += x11/library/libxrandr