samba - update to version 4.21.2
[oi-userland.git] / components / mail / thunderbird / Makefile
blob2fe48a61d8d7e97d4fdff7f04e7b0ed8c2e2578a
2 # CDDL HEADER START
4 # The contents of this file are subject to the terms of the
5 # Common Development and Distribution License (the "License").
6 # You may not use this file except in compliance with the License.
8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 # or http://www.opensolaris.org/os/licensing.
10 # See the License for the specific language governing permissions
11 # and limitations under the License.
13 # When distributing Covered Code, include this CDDL HEADER in each
14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 # If applicable, add the following below this CDDL HEADER, with the
16 # fields enclosed by brackets "[]" replaced with your own identifying
17 # information: Portions Copyright [yyyy] [name of copyright owner]
19 # CDDL HEADER END
23 # Copyright 2017 Alexander Pyhalov
24 # Copyright 2018 Michal Nowak
25 # Copyright (c) 2015, 2021, Oracle and/or its affiliates.
26 # Copyright 2021, Carsten Grzemba
27 # Copyright 2023 Niklas Poslovski
30 USE_PARALLEL_BUILD= yes
31 include ../../../make-rules/shared-macros.mk
33 # ESR should be set to esr for esr build, or an empty string for other builds
34 ESR = esr
36 # CANDIDATE_BUILD is the build number found in the candidates directory.
37 # Do not define for final release build.
38 # CANDIDATE_BUILD= 1
40 COMPONENT_NAME = thunderbird
41 COMPONENT_VERSION = 128.5.1
42 COMPONENT_SUMMARY = Mozilla Thunderbird Email Application
43 COMPONENT_PROJECT_URL = https://www.thunderbird.net/
44 COMPONENT_SRC = $(COMPONENT_NAME)-$(COMPONENT_VERSION)
45 COMPONENT_ARCHIVE = $(COMPONENT_SRC)$(ESR).source.tar.xz
46 COMPONENT_ARCHIVE_HASH= \
47 sha256:035fb708f98cf4c90a193a1b3c8a381613ae4001af8c5a62a876d469c097bb5b
48 ifndef CANDIDATE_BUILD
49 MOZILLA_FTP = https://ftp.mozilla.org/pub/$(COMPONENT_NAME)/releases/$(COMPONENT_VERSION)$(ESR)
50 else
51 MOZILLA_FTP = https://ftp.mozilla.org/pub/$(COMPONENT_NAME)/candidates/$(COMPONENT_VERSION)$(ESR)-candidates/build$(CANDIDATE_BUILD)
52 endif
53 COMPONENT_ARCHIVE_URL = $(MOZILLA_FTP)/source/$(COMPONENT_ARCHIVE)
54 COMPONENT_FMRI = mail/thunderbird
55 COMPONENT_CLASSIFICATION = Applications/Internet
57 RUST_VERSION = 1.78.0
59 # TODO: use remote hashfile to verify
60 ALLOW_UNVERIFIED_DOWNLOADS=yes
61 export ALLOW_UNVERIFIED_DOWNLOADS
63 # There are a set of .xpi files (as given in the LANG_LIST definition
64 # below) that we need. They are downloaded and unpacked individually.
66 LANG_LIST = af ar ast be bg br ca cak cs cy \
67 da de dsb el en-CA en-GB en-US es-AR es-ES es-MX et \
68 eu fi fr fy-NL ga-IE gd gl he hr hsb hu \
69 hy-AM id is it ja ka kab kk ko lt lv ms \
70 nb-NO nl nn-NO pa-IN pl pt-BR pt-PT rm ro ru sk sl \
71 sq sr sv-SE th tr uk uz vi zh-CN zh-TW
73 ifdef CANDIDATE_BUILD
74 LANG_FILES_LOCATION= \
75 https://ftp.mozilla.org/pub/thunderbird/candidates/$(COMPONENT_VERSION)$(ESR)-candidates/build$(CANDIDATE_BUILD)/linux-x86_64/xpi
76 else
77 LANG_FILES_LOCATION= \
78 https://ftp.mozilla.org/pub/$(COMPONENT_NAME)/releases/$(COMPONENT_VERSION)$(ESR)/linux-x86_64/xpi
79 endif
81 CLEAN_PATHS += $(COMPONENT_DIR)/xpi
83 CONFIGURE_DEFAULT_DIRS=no
85 include $(WS_MAKE_RULES)/common.mk
87 RUSTUP_HOME = $(BUILD_DIR)/.rust_up
88 CARGO_HOME = $(BUILD_DIR)/.cargo
90 PATH = $(CARGO_HOME)/bin:$(PATH.gnu)
92 MOZCONFIG = $(SOURCE_DIR)/mozconfig
93 GNU_ARCH= x86_64-unknown-illumos
95 ifdef DEBUG
96 # disable code optimization
97 CFLAGS =
98 CXXFLAGS =
100 MOZCONFIG_DEBUG = $(MOZCONFIG)
101 MOZCONFIG_NON_DEBUG = /dev/null
102 else
103 MOZCONFIG_DEBUG = /dev/null
104 MOZCONFIG_NON_DEBUG = $(MOZCONFIG)
105 endif
107 THUNDERBIRD_LIBDIR = /usr/lib/$(MACH64)
109 COMPONENT_PRE_CONFIGURE_ACTION += \
110 rm -f $(MOZCONFIG); \
111 echo "ac_add_options MOZILLA_OFFICIAL=1" >> $(MOZCONFIG) ; \
112 echo "ac_add_options PKG_CONFIG=/usr/bin/amd64/pkg-config" >> $(MOZCONFIG) ; \
113 echo "ac_add_options CC_TYPE=$(CC_TYPE)" >> $(MOZCONFIG) ; \
114 echo "ac_add_options CC=$(CC)" >> $(MOZCONFIG) ; \
115 echo "ac_add_options CXX=$(CXX)" >> $(MOZCONFIG) ; \
116 echo "ac_add_options --prefix=/usr" >> $(MOZCONFIG) ; \
117 echo "ac_add_options --libdir=$(THUNDERBIRD_LIBDIR)" >> $(MOZCONFIG) ; \
118 echo "ac_add_options --disable-crashreporter" >> $(MOZCONFIG) ; \
119 echo "ac_add_options --disable-debug-symbols" >> $(MOZCONFIG_NON_DEBUG) ; \
120 echo "ac_add_options --disable-install-strip" >> $(MOZCONFIG_DEBUG) ; \
121 echo "ac_add_options --disable-optimize" >> $(MOZCONFIG_DEBUG) ; \
122 echo "ac_add_options --disable-tests" >> $(MOZCONFIG) ; \
123 echo "ac_add_options --disable-updater" >> $(MOZCONFIG) ; \
124 echo "ac_add_options --enable-application=comm/mail" >> $(MOZCONFIG) ; \
125 echo "ac_add_options --enable-debug" >> $(MOZCONFIG_DEBUG) ; \
126 echo "ac_add_options --enable-jemalloc" >> $(MOZCONFIG) ; \
127 echo "ac_add_options --enable-js-shell" >> $(MOZCONFIG) ; \
128 echo "ac_add_options --enable-official-branding" >> $(MOZCONFIG) ; \
129 echo "ac_add_options --enable-optimize" >> $(MOZCONFIG_NON_DEBUG) ; \
130 echo "ac_add_options --enable-pulseaudio" >> $(MOZCONFIG) ; \
131 echo "ac_add_options --enable-replace-malloc" >> $(MOZCONFIG) ; \
132 echo "ac_add_options --enable-release" >> $(MOZCONFIG) ; \
133 echo "ac_add_options --enable-system-pixman" >> $(MOZCONFIG) ; \
134 echo "ac_add_options --enable-update-channel=release" >> $(MOZCONFIG) ; \
135 echo "ac_add_options --with-distribution-id=org.openindiana" >> $(MOZCONFIG) ; \
136 echo "ac_add_options --with-intl-api" >> $(MOZCONFIG) ; \
137 echo "ac_add_options --with-system-libevent" >> $(MOZCONFIG) ; \
138 echo "ac_add_options --with-system-zlib" >> $(MOZCONFIG) ; \
139 echo "ac_add_options --host=$(GNU_ARCH)" >> $(MOZCONFIG) ; \
140 echo "ac_add_options --target=$(GNU_ARCH)" >> $(MOZCONFIG) ; \
141 echo "ac_add_options --without-wasm-sandboxed-libraries" >> $(MOZCONFIG) ; \
143 # xpcom uses DEF XP_SOLARIS
144 CXXFLAGS += -DXP_SOLARIS -Wno-invalid-offsetof -fpermissive
146 # 28395728
147 LD_MAP_NOEXBSS.sparc=
149 # libmozgtk needs to link to gtk3 and others
150 LD_Z_IGNORE=
152 # missing symbols from gtk3 during Firefox start
153 LD_B_DIRECT=
155 LANG_FILES=$(addsuffix .xpi,$(LANG_LIST))
157 CLEAN_PATHS += $(LANG_FILES)
159 $(LANG_FILES):
160 $(FETCH) --file $@ --url $(LANG_FILES_LOCATION)/$@
162 download prep:: $(LANG_FILES)
164 CONFIGURE_OPTIONS = CC=$(CC) CXX=$(CXX)
166 CONFIGURE_ENV += RUSTUP_HOME=$(RUSTUP_HOME)
167 CONFIGURE_ENV += CARGO_HOME=$(CARGO_HOME)
168 COMPONENT_BUILD_ENV += RUSTUP_HOME=$(RUSTUP_HOME)
169 COMPONENT_BUILD_ENV += CARGO_HOME=$(CARGO_HOME)
171 COMPONENT_BUILD_ARGS += $(JOBS:%=-j%)
173 # because we touched old-configure.in and js/src/old-configure.in
174 COMPONENT_PRE_CONFIGURE_ACTION += ( \
175 export RUSTUP_HOME=$(RUSTUP_HOME); \
176 export CARGO_HOME=$(CARGO_HOME); \
177 export RUSTUP_INIT_SKIP_PATH_CHECK=yes; \
178 curl https://sh.rustup.rs -sSf | bash -s -- -y --no-modify-path; \
179 source $(CARGO_HOME)/env; \
180 rustup install $(RUST_VERSION); \
181 rustup default $(RUST_VERSION)-x86_64-unknown-illumos; \
182 rustup show; \
183 PATH=$(GCC_BINDIR):$(PATH) cargo install --root=$(CARGO_HOME) --vers 0.26.0 cbindgen; \
186 # COMPONENT_POST_BUILD_ACTION = \
187 # (cd $(@D)/mail/installer ; $(ENV) $(COMPONENT_BUILD_ENV) \
188 # $(GMAKE) $(COMPONENT_BUILD_ARGS) $(COMPONENT_BUILD_TARGETS))
190 COMPONENT_POST_INSTALL_ACTION += \
191 for file in `find $(PROTO_DIR)$(THUNDERBIRD_LIBDIR)/thunderbird -name "*.so"`; \
192 do \
193 /usr/bin/elfedit -e 'dyn:value -s RUNPATH "$(GCC_LIBDIR):$(THUNDERBIRD_LIBDIR)/thunderbird:$$ORIGIN"' $$file ; \
194 /usr/bin/elfedit -e 'dyn:value -s RPATH "$(GCC_LIBDIR):$(THUNDERBIRD_LIBDIR)/thunderbird:$$ORIGIN"' $$file ; \
195 done ;
197 # generate license file for package by using the contents from license.html
198 COMPONENT_POST_INSTALL_ACTION += \
199 unzip -c $(PROTOUSRLIBDIR64)/$(COMPONENT_NAME)/omni.ja chrome/messenger/content/messenger/license.html \
200 | LC_ALL=en_US.UTF-8 lynx --display_charset=utf-8 -stdin --dump -nolist > $(COMPONENT_NAME).license ;
203 COMPONENT_POST_INSTALL_ACTION += \
204 $(MKDIR) $(PROTO_DIR)$(THUNDERBIRD_LIBDIR)/thunderbird/distribution/extensions/; \
205 list1='$(LANG_LIST)' ; for f in $$list1 ; do \
206 $(CP) $$f.xpi \
207 $(PROTO_DIR)$(THUNDERBIRD_LIBDIR)/thunderbird/distribution/extensions/langpack-$$f@thunderbird.mozilla.org.xpi ; \
208 done ;
210 # copy distribution.ini to install staging area
211 COMPONENT_POST_INSTALL_ACTION += \
212 mkdir $(PROTO_DIR)$(THUNDERBIRD_LIBDIR)/thunderbird/distribution ; \
213 $(CP) $(COMPONENT_DIR)/files/distribution.ini $(PROTO_DIR)$(THUNDERBIRD_LIBDIR)/thunderbird/distribution/distribution.ini ;
215 COMPONENT_TEST_MASTER = $(COMPONENT_TEST_RESULTS_DIR)/results-$(MACH).master
217 COMPONENT_TEST_DIR = $(@D)/js/src
218 COMPONENT_TEST_TARGETS=check-jit-test
219 COMPONENT_TEST_TRANSFORMS = \
220 '-e "/^PASSED ALL/,/Failed:/p" ' \
221 '-e "/^FAILURES:/,/Failed:/p" ' \
222 '-e "/.*/d" '
224 # the license file is dynamically build, thus we need to remove it:
225 clean::
226 $(RM) $(COMPONENT_LICENSE_FILE)
228 # Build dependencies
229 PYTHON_REQUIRED_PACKAGES += library/python/psutil
230 PYTHON_REQUIRED_PACKAGES += runtime/python
231 REQUIRED_PACKAGES += database/sqlite-3
232 REQUIRED_PACKAGES += developer/build/autoconf-213
233 REQUIRED_PACKAGES += gnome/config/gconf
234 REQUIRED_PACKAGES += library/audio/pulseaudio
235 REQUIRED_PACKAGES += library/http-parser
236 REQUIRED_PACKAGES += runtime/nodejs-22
237 REQUIRED_PACKAGES += system/header/header-audio
238 REQUIRED_PACKAGES += web/browser/lynx
240 # Auto-generated dependencies
241 REQUIRED_PACKAGES += $(GCC_RUNTIME_PKG)
242 REQUIRED_PACKAGES += $(GXX_RUNTIME_PKG)
243 REQUIRED_PACKAGES += gnome/accessibility/at-spi2-core
244 REQUIRED_PACKAGES += library/c++/harfbuzz
245 REQUIRED_PACKAGES += library/desktop/cairo
246 REQUIRED_PACKAGES += library/desktop/gdk-pixbuf
247 REQUIRED_PACKAGES += library/desktop/gtk3
248 REQUIRED_PACKAGES += library/desktop/pango
249 REQUIRED_PACKAGES += library/glib2
250 REQUIRED_PACKAGES += library/graphics/pixman
251 REQUIRED_PACKAGES += library/libevent2
252 REQUIRED_PACKAGES += library/zlib
253 REQUIRED_PACKAGES += system/library
254 REQUIRED_PACKAGES += system/library/fontconfig
255 REQUIRED_PACKAGES += system/library/freetype-2
256 REQUIRED_PACKAGES += system/library/libdbus
257 REQUIRED_PACKAGES += system/library/math
258 REQUIRED_PACKAGES += x11/library/libx11
259 REQUIRED_PACKAGES += x11/library/libxcb
260 REQUIRED_PACKAGES += x11/library/libxext
261 REQUIRED_PACKAGES += x11/library/libxrandr