Ravenports generated: 10 Dec 2022 14:08
[ravenports.git] / bucket_67 / thunderbird
1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
2
3 NAMEBASE=               thunderbird
4 VERSION=                102.5.1
5 KEYWORDS=               mail net_im news
6 VARIANTS=               standard
7 SDESC[standard]=        Mozilla Thunderbird mail/newsgroup client
8 HOMEPAGE=               https://www.thunderbird.net/
9 CONTACT=                nobody
10
11 DOWNLOAD_GROUPS=        main
12 SITES[main]=            MOZILLA/thunderbird/releases/102.5.1/source
13 DISTFILE[1]=            thunderbird-102.5.1.source.tar.xz:main
14 DF_INDEX=               1
15 SPKGS[standard]=        single
16
17 OPTIONS_AVAILABLE=      none
18 OPTIONS_STANDARD=       none
19
20 BUILD_DEPENDS=          rust:single:standard
21                         cbindgen:single:standard
22                         autoconf213:single:standard
23                         yasm:single:standard
24                         nasm:primary:standard
25                         zip:single:standard
26                         nodejs:primary:standard
27                         libvpx:single:standard
28                         evdev-proto:single:standard
29                         python-sqlite3:single:python_used
30 BUILDRUN_DEPENDS=       nss:primary:standard
31                         icu:single:standard
32                         libffi:single:standard
33                         libproxy:single:standard
34                         libevent:single:standard
35                         libcanberra:primary:standard
36                         libnotify:primary:standard
37                         harfbuzz:primary:standard
38                         aom:single:standard
39                         WebP:single:standard
40                         dav1d:single:standard
41                         ffmpeg:primary:standard
42                         dbus-glib:primary:standard
43                         startup-notification:single:standard
44                         botan:primary:standard
45 BR_DEPS[linux]=         sndio:single:standard
46
47 USES=                   cpe desktop-utils:single gmake jpeg png zlib
48                         perl:build pkgconfig iconv bz2 python:build
49                         gettext-runtime clang:keepcc
50 GNOME_COMPONENTS=       gconf gtk2 gtk3 gdkpixbuf pango
51 XORG_COMPONENTS=        x11 xcb xcomposite xdamage xext xfixes xrender xt
52                         pixman
53
54 LICENSE=                MPL:single
55 LICENSE_TERMS=          single:{{WRKSRC}}/toolkit/content/license.html
56 LICENSE_FILE=           MPL:stock
57 LICENSE_SCHEME=         solo
58
59 CPE_VENDOR=             mozilla
60 FPC_EQUIVALENT=         mail/thunderbird
61
62 MUST_CONFIGURE=         yes
63 CONFIGURE_OUTSOURCE=    yes
64 CONFIGURE_ENV=          PYTHON3={{PYTHON_CMD}}
65                         SETUPTOOLS_USE_DISTUTILS=stdlib
66
67 MAKE_ENV=               PYTHON3={{PYTHON_CMD}}
68                         CXXSTDLIB="stdc++"
69
70 QMAKE_ARGS=             --prefix="{{PREFIX}}"
71                         --with-system-nss
72                         --with-system-nspr
73                         --with-system-zlib
74                         --with-system-icu
75                         --with-system-png
76                         --with-system-jpeg
77                         --with-system-libevent
78                         --with-system-harfbuzz
79                         --with-system-graphite2
80                         --with-system-av1
81                         --with-system-webp
82                         --with-system-botan
83                         --enable-system-ffi
84                         --enable-system-pixman
85                         --enable-install-strip
86                         --enable-strip
87                         --enable-libproxy
88                         --enable-release
89                         --enable-optimize
90                         --enable-official-branding
91                         --enable-application=comm/mail
92                         --enable-update-channel=release
93                         --enable-rust-simd
94                         --with-intl-api
95                         --disable-alsa
96                         --disable-debug
97                         --disable-debug-symbols
98                         --disable-dtrace
99                         --disable-jack
100                         --disable-webrtc
101                         --disable-profiling
102                         --disable-pulseaudio
103                         --disable-tests
104                         --disable-updater
105                         --disable-hardening
106                         --without-wasm-sandboxed-libraries
107 VAR_OPSYS[linux]=       QMAKE_ARGS=--disable-elf-hack
108                         QMAKE_ARGS=--enable-audio-backends=sndio
109
110 post-patch:
111         ${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|g' \
112                 ${WRKSRC}/comm/mail/app/nsMailApp.cpp \
113                 ${WRKSRC}/browser/app/nsBrowserApp.cpp
114         (cd ${WRKSRC}/gfx/angle/checkout/src/compiler/translator && \
115                 ${REINPLACE_CMD} -e 's|<math.h>|<cmath>|' \
116                 InfoSink.h IntermNode.cpp)
117         # disable SCTP
118         ${REINPLACE_CMD} -e 's|MOZ_SCTP|MOZ_DISABLE_SCTP|' \
119                 ${WRKSRC}/netwerk/moz.build
120         # alsa headers use 'u_int32_t' and other BerkeleyDB/nvi
121         # fixed types (_XOPEN_SOURCE)
122         ${REINPLACE_CMD} -e 's@_XOPEN_SOURCE@&___@g' \
123                 ${WRKSRC}/media/libcubeb/src/cubeb_alsa.c
124         ${REINPLACE_CMD} -e 's@_POSIX_SOURCE@&___@g' \
125                 ${WRKSRC}/media/libcubeb/src/cubeb_jack.cpp
126         # Set mozilla options
127         @${ECHO_CMD} "--=> Setting configuration <=--"
128         @for arg in ${QMAKE_ARGS}; do \
129                 ${ECHO_CMD} ".mozconfig <<  $$arg" ;\
130                 ${ECHO_CMD} ac_add_options $$arg >> ${WRKSRC}/.mozconfig ;\
131         done
132         @${ECHO_CMD} LDFLAGS=\"-Wl,-rpath,${PREFIX}/lib/thunderbird\" \
133                 >> ${WRKSRC}/.mozconfig
134         # disable rust checksums
135         ${REINPLACE_CMD} -e 's/"files":{[^}]*}/"files":{}/' \
136                  ${WRKSRC}/third_party/rust/packed_simd_2/.cargo-checksum.json
137
138 post-install:
139         ${MKDIR} ${STAGEDIR}${PREFIX}/share/applications
140         ${MKDIR} ${STAGEDIR}${PREFIX}/share/pixmaps
141         ${INSTALL_DATA} ${FILESDIR}/thunderbird.desktop \
142                 ${STAGEDIR}${PREFIX}/share/applications
143         (cd ${STAGEDIR}${PREFIX}/share/pixmaps && ${LN} -sf \
144                 ../../lib/thunderbird/chrome/icons/default/default48.png \
145                 thunderbird.png)
146         # regenerate symlink to avoid absolute paths
147         ${RM} ${STAGEDIR}${PREFIX}/bin/thunderbird
148         (cd ${STAGEDIR}${PREFIX}/bin && \
149                 ${LN} -sf ../lib/thunderbird/thunderbird thunderbird)
150
151 pre-configure:
152         (cd ${WRKSRC} && ${LOCALBASE}/bin/autoconf-2.13)
153         (cd ${WRKSRC}/js/src/ && ${LOCALBASE}/bin/autoconf-2.13)
154
155 [FILE:391:descriptions/desc.single]
156 Thunderbird is a free and open source email, newsfeed, chat, and
157 calendaring client, that's easy to set up and customize. One of the core
158 principles of Thunderbird is the use and promotion of open standards -
159 this focus is a rejection of our world of closed platforms and services
160 that can't communicate with each other. We want our users to have
161 freedom and choice in how they communicate.
162
163
164 [FILE:112:distinfo]
165 d8de843fffcd10b23c348c5726bff7215c983220ab9e63a5eb7e25aa33901528    509550884 thunderbird-102.5.1.source.tar.xz
166
167
168 [FILE:850:manifests/plist.single]
169 %%ONLY-LINUX%%lib/thunderbird/
170  Throbber-small.gif
171  crashreporter
172  crashreporter.ini
173  libmozsandbox.so
174  minidump-analyzer
175 %%ONLY-LINUX%%lib/thunderbird/fonts/TwemojiMozilla.ttf
176 bin/thunderbird
177 lib/thunderbird/
178  application.ini
179  dependentlibs.list
180  liblgpllibs.so
181  libmozgtk.so
182  libmozsqlite3.so
183  librnp.so
184  libxul.so
185  omni.ja
186  pingsender
187  platform.ini
188  plugin-container
189  removed-files
190  rnp-cli
191  rnpkeys
192  thunderbird
193  thunderbird-bin
194 lib/thunderbird/chrome/icons/default/
195  default128.png
196  default16.png
197  default22.png
198  default24.png
199  default256.png
200  default32.png
201  default48.png
202  default64.png
203 lib/thunderbird/defaults/messenger/mailViews.dat
204 lib/thunderbird/defaults/pref/channel-prefs.js
205 lib/thunderbird/isp/
206  Bogofilter.sfd
207  DSPAM.sfd
208  POPFile.sfd
209  SpamAssassin.sfd
210  SpamPal.sfd
211 share/applications/thunderbird.desktop
212 share/pixmaps/thunderbird.png
213
214
215 [FILE:5405:patches/patch-addon-search]
216 https://github.com/mozilla/addons/issues/708
217 https://github.com/mozilla/addons-frontend/issues/4610
218
219 --- comm/mail/app/profile/all-thunderbird.js.orig       2022-09-10 23:48:23.616215000 +0200
220 +++ comm/mail/app/profile/all-thunderbird.js    2022-09-11 00:01:06.140736000 +0200
221 @@ -167,10 +167,10 @@
222  pref("extensions.getAddons.compatOverides.url", "https://services.addons.thunderbird.net/api/v3/addons/compat-override/?guid=%IDS%&lang=%LOCALE%");
223  pref("extensions.getAddons.link.url", "https://addons.thunderbird.net/%LOCALE%/%APP%/");
224  pref("browser.dictionaries.download.url", "https://addons.thunderbird.net/%LOCALE%/%APP%/language-tools/");
225 -pref("extensions.getAddons.recommended.url", "https://services.addons.thunderbird.net/%LOCALE%/%APP%/api/%API_VERSION%/list/recommended/all/%MAX_RESULTS%/%OS%/%VERSION%?src=thunderbird");
226 -pref("extensions.getAddons.search.browseURL", "https://addons.thunderbird.net/%LOCALE%/%APP%/search/?q=%TERMS%&appver=%VERSION%&platform=%OS%");
227 -pref("extensions.getAddons.search.url", "https://services.addons.thunderbird.net/%LOCALE%/%APP%/api/%API_VERSION%/search/%TERMS%/all/%MAX_RESULTS%/%OS%/%VERSION%/%COMPATIBILITY_MODE%?src=thunderbird");
228 -pref("extensions.webservice.discoverURL", "https://services.addons.thunderbird.net/%LOCALE%/%APP%/discovery/pane/%VERSION%/%OS%");
229 +pref("extensions.getAddons.recommended.url", "https://services.addons.thunderbird.net/%LOCALE%/%APP%/api/%API_VERSION%/list/recommended/all/%MAX_RESULTS%/Linux/%VERSION%?src=thunderbird");
230 +pref("extensions.getAddons.search.browseURL", "https://addons.thunderbird.net/%LOCALE%/%APP%/search/?q=%TERMS%&appver=%VERSION%&platform=Linux");
231 +pref("extensions.getAddons.search.url", "https://services.addons.thunderbird.net/%LOCALE%/%APP%/api/%API_VERSION%/search/%TERMS%/all/%MAX_RESULTS%/Linux/%VERSION%/%COMPATIBILITY_MODE%?src=thunderbird");
232 +pref("extensions.webservice.discoverURL", "https://services.addons.thunderbird.net/%LOCALE%/%APP%/discovery/pane/%VERSION%/Linux");
233  pref("extensions.getAddons.langpacks.url", "https://services.addons.thunderbird.net/api/v3/addons/language-tools/?app=thunderbird&type=language&appversion=%VERSION%");
234  pref("extensions.getAddons.discovery.api_url", "https://services.addons.thunderbird.net/api/v4/discovery/?lang=%LOCALE%&edition=%DISTRIBUTION%");
235  
236 @@ -202,9 +202,9 @@
237  //  .. etc ..
238  //
239  pref("extensions.update.enabled", true);
240 -pref("extensions.update.url", "https://versioncheck.addons.thunderbird.net/update/VersionCheck.php?reqVersion=%REQ_VERSION%&id=%ITEM_ID%&version=%ITEM_VERSION%&maxAppVersion=%ITEM_MAXAPPVERSION%&status=%ITEM_STATUS%&appID=%APP_ID%&appVersion=%APP_VERSION%&appOS=%APP_OS%&appABI=%APP_ABI%&locale=%APP_LOCALE%&currentAppVersion=%CURRENT_APP_VERSION%&updateType=%UPDATE_TYPE%&compatMode=%COMPATIBILITY_MODE%");
241 +pref("extensions.update.url", "https://versioncheck.addons.thunderbird.net/update/VersionCheck.php?reqVersion=%REQ_VERSION%&id=%ITEM_ID%&version=%ITEM_VERSION%&maxAppVersion=%ITEM_MAXAPPVERSION%&status=%ITEM_STATUS%&appID=%APP_ID%&appVersion=%APP_VERSION%&appOS=Linux&appABI=%APP_ABI%&locale=%APP_LOCALE%&currentAppVersion=%CURRENT_APP_VERSION%&updateType=%UPDATE_TYPE%&compatMode=%COMPATIBILITY_MODE%");
242  
243 -pref("extensions.update.background.url", "https://versioncheck-bg.addons.thunderbird.net/update/VersionCheck.php?reqVersion=%REQ_VERSION%&id=%ITEM_ID%&version=%ITEM_VERSION%&maxAppVersion=%ITEM_MAXAPPVERSION%&status=%ITEM_STATUS%&appID=%APP_ID%&appVersion=%APP_VERSION%&appOS=%APP_OS%&appABI=%APP_ABI%&locale=%APP_LOCALE%&currentAppVersion=%CURRENT_APP_VERSION%&updateType=%UPDATE_TYPE%&compatMode=%COMPATIBILITY_MODE%");
244 +pref("extensions.update.background.url", "https://versioncheck-bg.addons.thunderbird.net/update/VersionCheck.php?reqVersion=%REQ_VERSION%&id=%ITEM_ID%&version=%ITEM_VERSION%&maxAppVersion=%ITEM_MAXAPPVERSION%&status=%ITEM_STATUS%&appID=%APP_ID%&appVersion=%APP_VERSION%&appOS=Linux&appABI=%APP_ABI%&locale=%APP_LOCALE%&currentAppVersion=%CURRENT_APP_VERSION%&updateType=%UPDATE_TYPE%&compatMode=%COMPATIBILITY_MODE%");
245  
246  pref("extensions.update.interval", 86400);  // Check for updates to Extensions and
247                                              // Themes every day
248 --- toolkit/mozapps/extensions/internal/AddonRepository.jsm.orig        2022-09-11 00:01:40.212952000 +0200
249 +++ toolkit/mozapps/extensions/internal/AddonRepository.jsm     2022-09-11 00:07:14.587890000 +0200
250 @@ -592,7 +592,7 @@
251        addon.version = String(aEntry.current_version.version);
252        if (Array.isArray(aEntry.current_version.files)) {
253          for (let file of aEntry.current_version.files) {
254 -          if (file.platform == "all" || file.platform == PLATFORM) {
255 +          if (file.platform == "all" || file.platform == "linux" || file.platform == PLATFORM) {
256              if (file.url) {
257                addon.sourceURI = NetUtil.newURI(file.url);
258              }
259 --- toolkit/mozapps/extensions/internal/XPIDatabase.jsm.orig    2022-09-11 00:08:09.244518000 +0200
260 +++ toolkit/mozapps/extensions/internal/XPIDatabase.jsm 2022-09-11 00:09:56.387390000 +0200
261 @@ -569,7 +569,7 @@
262      // Something is causing errors in here
263      try {
264        for (let platform of this.targetPlatforms) {
265 -        if (platform.os == Services.appinfo.OS) {
266 +        if (platform.os == "Linux" || platform.os == Services.appinfo.OS) {
267            if (platform.abi) {
268              needsABI = true;
269              if (platform.abi === abi) {
270
271
272 [FILE:445:patches/patch-browser-app-nsBrowserApp.cpp]
273 --- browser/app/nsBrowserApp.cpp.orig   2016-09-19 16:19:28 UTC
274 +++ browser/app/nsBrowserApp.cpp
275 @@ -324,6 +324,9 @@ int main(int argc, char* argv[], char* e
276  {
277    mozilla::TimeStamp start = mozilla::TimeStamp::Now();
278  
279 +  setenv("MOZ_GMP_PATH", "%%LOCALBASE%%/lib/browser_plugins/symlinks/gecko", 0);
280 +  setenv("MOZ_PLUGIN_PATH", "%%LOCALBASE%%/lib/browser_plugins/symlinks/gecko", 0);
281 +
282  #ifdef HAS_DLL_BLOCKLIST
283    DllBlocklist_Initialize();
284  
285
286
287 [FILE:4140:patches/patch-bug1559213]
288 commit 717bba28411c
289 Author: Jory A. Pratt <anarchy@gentoo.org>
290 Date:   Thu Jun 13 11:53:00 2019 -0700
291
292     Bug 1559213 - Allow to use system av1 libs instead of bundled.
293 ---
294  config/external/moz.build      |  5 +++--
295  config/system-headers.mozbuild |  8 ++++++++
296  dom/media/platforms/moz.build  |  5 +++++
297  toolkit/moz.configure          | 19 ++++++++++++++++++-
298  4 files changed, 34 insertions(+), 3 deletions(-)
299
300 diff --git config/external/moz.build config/external/moz.build
301 index ab77121..75595d9 100644
302 --- config/external/moz.build
303 +++ config/external/moz.build
304 @@ -49,8 +49,9 @@ if not CONFIG["MOZ_SYSTEM_LIBVPX"]:
305      external_dirs += ["media/libvpx"]
306  
307  if CONFIG["MOZ_AV1"]:
308 -    external_dirs += ["media/libaom"]
309 -    external_dirs += ["media/libdav1d"]
310 +    if not CONFIG["MOZ_SYSTEM_AV1"]:
311 +        external_dirs += ["media/libaom"]
312 +        external_dirs += ["media/libdav1d"]
313  
314  if not CONFIG["MOZ_SYSTEM_PNG"]:
315      external_dirs += ["media/libpng"]
316 diff --git config/system-headers.mozbuild config/system-headers.mozbuild
317 index a1b58eb..65729f9 100644
318 --- config/system-headers.mozbuild
319 +++ config/system-headers.mozbuild
320 @@ -1289,6 +1289,14 @@ if CONFIG['MOZ_ENABLE_LIBPROXY']:
321          'proxy.h',
322      ]
323  
324 +if CONFIG['MOZ_SYSTEM_AV1']:
325 +    system_headers += [
326 +        'aom/aom_decoder.h',
327 +        'aom/aomdx.h',
328 +        'aom/aom_image.h',
329 +        'dav1d/dav1d.h',
330 +    ]
331 +
332  if CONFIG['MOZ_SYSTEM_LIBVPX']:
333      system_headers += [
334          'vpx_mem/vpx_mem.h',
335 diff --git dom/media/platforms/moz.build dom/media/platforms/moz.build
336 index 8509aec..eb6f129 100644
337 --- dom/media/platforms/moz.build
338 +++ dom/media/platforms/moz.build
339 @@ -78,6 +78,11 @@ if CONFIG["MOZ_AV1"]:
340          "agnostic/AOMDecoder.cpp",
341          "agnostic/DAV1DDecoder.cpp",
342      ]
343 +    if CONFIG['MOZ_SYSTEM_AV1']:
344 +        CXXFLAGS += CONFIG['MOZ_SYSTEM_LIBAOM_CFLAGS']
345 +        OS_LIBS += CONFIG['MOZ_SYSTEM_LIBAOM_LIBS']
346 +        CXXFLAGS += CONFIG['MOZ_SYSTEM_LIBDAV1D_CFLAGS']
347 +        OS_LIBS += CONFIG['MOZ_SYSTEM_LIBDAV1D_LIBS']
348  
349  if CONFIG["MOZ_OMX"]:
350      EXPORTS += [
351 diff --git media/ffvpx/libavcodec/moz.build media/ffvpx/libavcodec/moz.build
352 index 0069865..e806fc8 100644
353 --- media/ffvpx/libavcodec/moz.build
354 +++ media/ffvpx/libavcodec/moz.build
355 @@ -112,9 +112,15 @@ if not CONFIG['MOZ_FFVPX_AUDIOONLY']:
356              'vaapi_vp8.c',
357              'vaapi_vp9.c',
358          ]
359 +        if CONFIG["MOZ_SYSTEM_AV1"]:
360 +          CFLAGS += CONFIG['MOZ_SYSTEM_LIBDAV1D_CFLAGS']
361 +          OS_LIBS += CONFIG['MOZ_SYSTEM_LIBDAV1D_LIBS']
362 +        else:
363 +          USE_LIBS += [
364 +            'dav1d',
365 +            'media_libdav1d_asm',
366 +          ]
367          USE_LIBS += [
368 -          'dav1d',
369 -          'media_libdav1d_asm',
370            'mozva'
371          ]
372  
373 diff --git toolkit/moz.configure toolkit/moz.configure
374 index 0069865..e806fc8 100644
375 --- toolkit/moz.configure
376 +++ toolkit/moz.configure
377 @@ -523,7 +523,23 @@ def av1(value):
378          return True
379  
380  
381 -@depends(target, when=av1 & compile_environment)
382 +option("--with-system-av1",
383 +       help="Use system av1 (located with pkgconfig)")
384 +
385 +system_libaom_info = pkg_check_modules("MOZ_SYSTEM_LIBAOM", "aom >= 1.0.0",
386 +                                       when="--with-system-av1")
387 +
388 +system_libdav1d_info = pkg_check_modules("MOZ_SYSTEM_LIBDAV1D", "dav1d >= 0.1.1",
389 +                                         when="--with-system-av1")
390 +
391 +@depends(system_libaom_info, system_libdav1d_info)
392 +def system_av1(system_libaom_info, system_libdav1d_info):
393 +    has_av1_libs = False
394 +    if system_libaom_info and system_libdav1d_info:
395 +        has_av1_libs = True
396 +    return has_av1_libs
397 +
398 +@depends(target, when=av1 & depends(system_av1)(lambda v: not v) & compile_environment)
399  def dav1d_asm(target):
400      if target.cpu in ("aarch64", "x86", "x86_64"):
401          return True
402 @@ -539,6 +555,7 @@ set_config("MOZ_DAV1D_ASM", dav1d_asm)
403  set_define("MOZ_DAV1D_ASM", dav1d_asm)
404  set_config("MOZ_AV1", av1)
405  set_define("MOZ_AV1", av1)
406 +set_config("MOZ_SYSTEM_AV1", depends_if(system_av1)(lambda _: True))
407  
408  # JXL Image Codec Support
409  # ==============================================================
410
411
412 [FILE:2109:patches/patch-bug1659612]
413 media/libcubeb/src/cubeb_alsa.c:613:9: error: implicitly declaring library function 'snprintf' with type 'int (char *, unsigned int, const char *, ...)' [-Werror,-Wimplicit-function-declaration]
414     r = snprintf(node_name, sizeof(node_name), "pcm.%s", string);
415         ^
416 media/libcubeb/src/cubeb_alsa.c:613:9: note: include the header <stdio.h> or explicitly provide a declaration for 'snprintf'
417 media/libcubeb/src/cubeb_alsa.c:1168:3: error: implicitly declaring library function 'alloca' with type 'void *(unsigned int)' [-Werror,-Wimplicit-function-declaration]
418   snd_pcm_hw_params_alloca(&hw_params);
419   ^
420 /usr/local/include/alsa/pcm.h:737:39: note: expanded from macro 'snd_pcm_hw_params_alloca'
421 #define snd_pcm_hw_params_alloca(ptr) __snd_alloca(ptr, snd_pcm_hw_params)
422                                       ^
423 /usr/local/include/alsa/global.h:106:57: note: expanded from macro '__snd_alloca'
424 #define __snd_alloca(ptr,type) do { *ptr = (type##_t *) alloca(type##_sizeof()); memset(*ptr, 0, type##_sizeof()); } while (0)
425                                                         ^
426 media/libcubeb/src/cubeb_alsa.c:1168:3: note: include the header <stdlib.h> or explicitly provide a declaration for 'alloca'
427 /usr/local/include/alsa/pcm.h:737:39: note: expanded from macro 'snd_pcm_hw_params_alloca'
428 #define snd_pcm_hw_params_alloca(ptr) __snd_alloca(ptr, snd_pcm_hw_params)
429                                       ^
430 /usr/local/include/alsa/global.h:106:57: note: expanded from macro '__snd_alloca'
431 #define __snd_alloca(ptr,type) do { *ptr = (type##_t *) alloca(type##_sizeof()); memset(*ptr, 0, type##_sizeof()); } while (0)
432                                                         ^
433 2 errors generated.
434
435 --- media/libcubeb/src/cubeb_alsa.c.orig        2021-08-31 14:26:24.530548000 +0200
436 +++ media/libcubeb/src/cubeb_alsa.c     2021-08-31 14:26:43.081470000 +0200
437 @@ -5,9 +5,7 @@
438   * accompanying file LICENSE for details.
439   */
440  #undef NDEBUG
441 -#define _DEFAULT_SOURCE
442 -#define _BSD_SOURCE
443 -#define _XOPEN_SOURCE 500
444 +#define _GNU_SOURCE 1
445  #include "cubeb-internal.h"
446  #include "cubeb/cubeb.h"
447  #include <alsa/asoundlib.h>
448
449
450 [FILE:1328:patches/patch-bug1773070]
451 In file included from Unified_cpp_accessible_html0.cpp:29:
452 In file included from accessible/html/HTMLImageMapAccessible.cpp:14:
453 In file included from layout/generic/nsImageFrame.h:17:
454 In file included from ../.build/dist/include/nsDisplayList.h:50:
455 In file included from ../.build/dist/include/nsCSSRenderingBorders.h:20:
456 In file included from ../.build/dist/include/gfxUtils.h:22:
457 In file included from ../.build/dist/include/mozilla/webrender/WebRenderTypes.h:11:
458 In file included from ../.build/dist/include/mozilla/webrender/webrender_ffi.h:108:
459 ../.build/dist/include/mozilla/webrender/webrender_ffi_generated.h:gmake[4]: Leaving directory '../.build/accessible/aom'
460 24:33: error: redefinition of 'ROOT_CLIP_CHAIN'
461 constexpr static const uint64_t ROOT_CLIP_CHAIN = ~0;
462                                 ^
463 ../.build/dist/include/mozilla/webrender/webrender_ffi.h:80:16: note: previous definition is here
464 const uint64_t ROOT_CLIP_CHAIN = ~0;
465                ^
466
467 --- gfx/webrender_bindings/webrender_ffi.h.orig 2022-05-23 17:12:36 UTC
468 +++ gfx/webrender_bindings/webrender_ffi.h
469 @@ -77,8 +77,6 @@ using WrPipelineIdEpochs = nsTArray<WrPipelineIdAndEpo
470  struct WrPipelineIdAndEpoch;
471  using WrPipelineIdEpochs = nsTArray<WrPipelineIdAndEpoch>;
472  
473 -const uint64_t ROOT_CLIP_CHAIN = ~0;
474 -
475  }  // namespace wr
476  }  // namespace mozilla
477  
478
479
480 [FILE:9644:patches/patch-bug847568]
481 # Allow building against system-wide graphite2/harfbuzz.
482
483 diff --git config/system-headers.mozbuild config/system-headers.mozbuild
484 index a1b58eb..a0a0943 100644
485 --- config/system-headers.mozbuild
486 +++ config/system-headers.mozbuild
487 @@ -1289,6 +1289,19 @@ if CONFIG['MOZ_ENABLE_LIBPROXY']:
488          'proxy.h',
489      ]
490  
491 +if CONFIG['MOZ_SYSTEM_GRAPHITE2']:
492 +    system_headers += [
493 +        'graphite2/Font.h',
494 +        'graphite2/Segment.h',
495 +    ]
496 +
497 +if CONFIG['MOZ_SYSTEM_HARFBUZZ']:
498 +    system_headers += [
499 +        'harfbuzz/hb-glib.h',
500 +        'harfbuzz/hb-ot.h',
501 +        'harfbuzz/hb.h',
502 +    ]
503 +
504  if CONFIG['MOZ_SYSTEM_LIBVPX']:
505      system_headers += [
506          'vpx_mem/vpx_mem.h',
507 diff --git dom/base/moz.build dom/base/moz.build
508 index d390adf..4508f19 100644
509 --- dom/base/moz.build
510 +++ dom/base/moz.build
511 @@ -576,6 +576,9 @@ FINAL_LIBRARY = "xul"
512  if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk":
513      CXXFLAGS += CONFIG["MOZ_GTK3_CFLAGS"]
514  
515 +if CONFIG["MOZ_SYSTEM_HARFBUZZ"]:
516 +    CXXFLAGS += CONFIG["MOZ_HARFBUZZ_CFLAGS"]
517 +
518  GeneratedFile(
519      "UseCounterList.h",
520      script="gen-usecounters.py",
521 diff --git gfx/graphite2/geckoextra/moz.build gfx/graphite2/geckoextra/moz.build
522 new file mode 100644
523 index 0000000..24e8d7a
524 --- /dev/null
525 +++ gfx/graphite2/geckoextra/moz.build
526 @@ -0,0 +1,21 @@
527 +# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
528 +# vim: set filetype=python:
529 +# This Source Code Form is subject to the terms of the Mozilla Public
530 +# License, v. 2.0. If a copy of the MPL was not distributed with this
531 +# file, You can obtain one at http://mozilla.org/MPL/2.0/.
532 +
533 +EXPORTS.graphite2 += [
534 +    'include/GraphiteExtra.h',
535 +    'include/GraphiteStructsForRLBox.h',
536 +]
537 +
538 +UNIFIED_SOURCES += [
539 +    '../geckoextra/src/GraphiteExtra.cpp',
540 +]
541 +
542 +CXXFLAGS += CONFIG['MOZ_GRAPHITE2_CFLAGS']
543 +
544 +# Match bundled graphite2 configuration
545 +AllowCompilerWarnings()
546 +
547 +FINAL_LIBRARY = 'gkmedias'
548 diff --git gfx/graphite2/moz-gr-update.sh gfx/graphite2/moz-gr-update.sh
549 index b91d9c1..a97e6eb 100755
550 --- gfx/graphite2/moz-gr-update.sh
551 +++ gfx/graphite2/moz-gr-update.sh
552 @@ -1,6 +1,7 @@
553  #!/bin/bash
554  
555  # Script used to update the Graphite2 library in the mozilla source tree
556 +# and bump version for --with-system-graphite2
557  
558  # This script lives in gfx/graphite2, along with the library source,
559  # but must be run from the top level of the mozilla-central tree.
560 @@ -37,12 +38,16 @@ echo "See" $0 "for update procedure." >> gfx/graphite2/README.mozilla
561  #find gfx/graphite2/ -name "*.cpp" -exec perl -p -i -e "s/<cstdio>/<stdio.h>/;s/Windows.h/windows.h/;" {} \;
562  #find gfx/graphite2/ -name "*.h" -exec perl -p -i -e "s/<cstdio>/<stdio.h>/;s/Windows.h/windows.h/;" {} \;
563  
564 +# chase version for --with-system-graphite2
565 +perl -p -i -e "s/[0-9]+\,[0-9]+\,[0-9]+/$RELEASE/ and tr/./,/ \
566 +  if /GR2_VERSION_REQUIRE/" old-configure.in
567 +
568  # summarize what's been touched
569  echo Updated to $RELEASE.
570  echo Here is what changed in the gfx/graphite2 directory:
571  echo
572  
573 -hg stat gfx/graphite2
574 +hg stat old-configure.in gfx/graphite2
575  
576  echo
577  echo If gfx/graphite2/src/files.mk has changed, please make corresponding
578 diff --git gfx/harfbuzz/README-mozilla gfx/harfbuzz/README-mozilla
579 index 3180257..4587a3b 100644
580 --- gfx/harfbuzz/README-mozilla
581 +++ gfx/harfbuzz/README-mozilla
582 @@ -21,3 +21,8 @@ from within the gfx/harfbuzz directory.
583  
584  If the collection of source files changes, manual updates to moz.build may be
585  needed as we don't use the upstream makefiles.
586 +
587 +The in-tree copy may be omitted during build by --with-system-harfbuzz.
588 +Make sure to keep pkg-config version check within toolkit/moz.configure in sync
589 +with checkout version or increment latest tag by one if it's not based
590 +on upstream release.
591 diff --git gfx/moz.build gfx/moz.build
592 index 4d6d63d..cd57b0c 100644
593 --- gfx/moz.build
594 +++ gfx/moz.build
595 @@ -10,6 +10,14 @@ with Files("**"):
596  with Files("wr/**"):
597      BUG_COMPONENT = ("Core", "Graphics: WebRender")
598  
599 +if CONFIG["MOZ_SYSTEM_GRAPHITE2"]:
600 +    DIRS += ["graphite2/geckoextra"]
601 +else:
602 +    DIRS += ["graphite2/src" ]
603 +
604 +if not CONFIG["MOZ_SYSTEM_HARFBUZZ"]:
605 +    DIRS += ["harfbuzz/src"]
606 +
607  DIRS += [
608      "cairo",
609      "2d",
610 @@ -19,8 +27,6 @@ DIRS += [
611      "qcms",
612      "gl",
613      "layers",
614 -    "graphite2/src",
615 -    "harfbuzz/src",
616      "ots/src",
617      "thebes",
618      "ipc",
619 diff --git gfx/skia/generate_mozbuild.py gfx/skia/generate_mozbuild.py
620 index 5e0fd17..860b80a 100755
621 --- gfx/skia/generate_mozbuild.py
622 +++ gfx/skia/generate_mozbuild.py
623 @@ -96,6 +96,9 @@ if CONFIG['CC_TYPE'] in ('clang', 'clang-cl'):
624          '-Wno-unused-private-field',
625      ]
626  
627 +if CONFIG['MOZ_SYSTEM_HARFBUZZ']:
628 +    CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS']
629 +
630  if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk', 'android'):
631      LOCAL_INCLUDES += [
632          "/gfx/cairo/cairo/src",
633 diff --git gfx/skia/moz.build gfx/skia/moz.build
634 index 524bd28..615c93b 100755
635 --- gfx/skia/moz.build
636 +++ gfx/skia/moz.build
637 @@ -488,6 +488,9 @@ if CONFIG['CC_TYPE'] in ('clang', 'clang-cl'):
638          '-Wno-unused-private-field',
639      ]
640  
641 +if CONFIG['MOZ_SYSTEM_HARFBUZZ']:
642 +    CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS']
643 +
644  if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk', 'android'):
645      LOCAL_INCLUDES += [
646          "/gfx/cairo/cairo/src",
647 diff --git gfx/thebes/moz.build gfx/thebes/moz.build
648 index baa6f09..4f02a9e 100644
649 --- gfx/thebes/moz.build
650 +++ gfx/thebes/moz.build
651 @@ -286,7 +286,13 @@ if CONFIG["MOZ_WAYLAND"]:
652  
653  LOCAL_INCLUDES += CONFIG["SKIA_INCLUDES"]
654  
655 -DEFINES["GRAPHITE2_STATIC"] = True
656 +if CONFIG["MOZ_SYSTEM_GRAPHITE2"]:
657 +    CXXFLAGS += CONFIG["MOZ_GRAPHITE2_CFLAGS"]
658 +else:
659 +    DEFINES["GRAPHITE2_STATIC"] = True
660 +
661 +if CONFIG["MOZ_SYSTEM_HARFBUZZ"]:
662 +    CXXFLAGS += CONFIG["MOZ_HARFBUZZ_CFLAGS"]
663  
664  if CONFIG["CC_TYPE"] == "clang":
665      # Suppress warnings from Skia header files.
666 diff --git intl/unicharutil/util/moz.build intl/unicharutil/util/moz.build
667 index 301eb9a..7cece5e 100644
668 --- intl/unicharutil/util/moz.build
669 +++ intl/unicharutil/util/moz.build
670 @@ -25,6 +25,9 @@ UNIFIED_SOURCES += [
671      "nsUnicodeProperties.cpp",
672  ]
673  
674 +if CONFIG["MOZ_SYSTEM_HARFBUZZ"]:
675 +    CXXFLAGS += CONFIG["MOZ_HARFBUZZ_CFLAGS"]
676 +
677  include("/ipc/chromium/chromium-config.mozbuild")
678  
679  GeneratedFile(
680 diff --git netwerk/dns/moz.build netwerk/dns/moz.build
681 index f769e27..315bdd4 100644
682 --- netwerk/dns/moz.build
683 +++ netwerk/dns/moz.build
684 @@ -102,6 +102,9 @@ GeneratedFile(
685      "etld_data.inc", script="prepare_tlds.py", inputs=["effective_tld_names.dat"]
686  )
687  
688 +if CONFIG["MOZ_SYSTEM_HARFBUZZ"]:
689 +    CXXFLAGS += CONFIG["MOZ_HARFBUZZ_CFLAGS"]
690 +
691  # need to include etld_data.inc
692  LOCAL_INCLUDES += [
693      "/netwerk/base",
694 diff --git old-configure.in old-configure.in
695 index d147957..d332b34 100644
696 --- old-configure.in
697 +++ old-configure.in
698 @@ -1335,6 +1335,27 @@ fi
699  AC_DEFINE_UNQUOTED(MOZ_MACBUNDLE_ID,$MOZ_MACBUNDLE_ID)
700  AC_SUBST(MOZ_MACBUNDLE_ID)
701  
702 +dnl ========================================================
703 +dnl Check for graphite2
704 +dnl ========================================================
705 +if test -n "$MOZ_SYSTEM_GRAPHITE2"; then
706 +    dnl graphite2.pc has bogus version, check manually
707 +    _SAVE_CFLAGS=$CFLAGS
708 +    CFLAGS="$CFLAGS $MOZ_GRAPHITE2_CFLAGS"
709 +    AC_TRY_COMPILE([ #include <graphite2/Font.h>
710 +                     #define GR2_VERSION_REQUIRE(major,minor,bugfix)  \
711 +                             ( GR2_VERSION_MAJOR * 10000 + GR2_VERSION_MINOR \
712 +                               * 100 + GR2_VERSION_BUGFIX >= \
713 +                               (major) * 10000 + (minor) * 100 + (bugfix) )
714 +                   ], [
715 +                     #if !GR2_VERSION_REQUIRE(1,3,14)
716 +                     #error "Insufficient graphite2 version."
717 +                     #endif
718 +                   ], [],
719 +                   [AC_MSG_ERROR([--with-system-graphite2 requested but no working libgraphite2 found])])
720 +    CFLAGS=$_SAVE_CFLAGS
721 +fi
722 +
723  dnl ========================================================
724  dnl = Child Process Name for IPC
725  dnl ========================================================
726 diff --git toolkit/library/moz.build toolkit/library/moz.build
727 index 2c3f869..e8a9d23 100644
728 --- toolkit/library/moz.build
729 +++ toolkit/library/moz.build
730 @@ -269,6 +269,12 @@ if CONFIG["MOZ_SYSTEM_PNG"]:
731  if CONFIG["MOZ_SYSTEM_WEBP"]:
732      OS_LIBS += CONFIG["MOZ_WEBP_LIBS"]
733  
734 +if CONFIG["MOZ_SYSTEM_GRAPHITE2"]:
735 +    OS_LIBS += CONFIG["MOZ_GRAPHITE2_LIBS"]
736 +
737 +if CONFIG["MOZ_SYSTEM_HARFBUZZ"]:
738 +    OS_LIBS += CONFIG["MOZ_HARFBUZZ_LIBS"]
739 +
740  if CONFIG["MOZ_SYSTEM_LIBEVENT"]:
741      OS_LIBS += CONFIG["MOZ_LIBEVENT_LIBS"]
742  
743 diff --git toolkit/moz.configure toolkit/moz.configure
744 index 0069865..9bb1864 100644
745 --- toolkit/moz.configure
746 +++ toolkit/moz.configure
747 @@ -1058,6 +1058,25 @@ def geckodriver_default(enable_tests, target, cross_compile, hazard, asan, autom
748          return False
749      return True
750  
751 +# Graphite2
752 +# ==============================================================
753 +option("--with-system-graphite2",
754 +       help="Use system graphite2 (located with pkgconfig)")
755 +
756 +system_graphite2 = pkg_check_modules("MOZ_GRAPHITE2", "graphite2",
757 +                                     when="--with-system-graphite2")
758 +
759 +set_config("MOZ_SYSTEM_GRAPHITE2", depends_if(system_graphite2)(lambda _: True))
760 +
761 +# HarfBuzz
762 +# ==============================================================
763 +option("--with-system-harfbuzz",
764 +       help="Use system harfbuzz (located with pkgconfig)")
765 +
766 +system_harfbuzz = pkg_check_modules("MOZ_HARFBUZZ", "harfbuzz >= 2.7.4",
767 +                                    when="--with-system-harfbuzz")
768 +
769 +set_config("MOZ_SYSTEM_HARFBUZZ", depends_if(system_harfbuzz)(lambda _: True))
770  
771  option(
772      "--enable-geckodriver",
773
774
775 [FILE:406:patches/patch-comm__third_party__rnpdefs.mozbuild]
776 --- comm/third_party/rnpdefs.mozbuild.orig      2021-08-11 20:13:25.176921000 +0200
777 +++ comm/third_party/rnpdefs.mozbuild   2021-08-11 20:14:08.855374000 +0200
778 @@ -43,6 +43,6 @@
779      OS_LIBS += [static_libdir, "-l:libc++.a", "-l:libc++abi.a"]
780  
781  
782 -if CONFIG["OS_ARCH"] in ("Linux", "SunOS"):
783 +if CONFIG["OS_ARCH"] in ("Linux", "FreeBSD", "DragonFly", "SunOS"):
784      CFLAGS += ["-fPIC"]
785      CXXFLAGS += ["-fPIC"]
786
787
788 [FILE:421:patches/patch-comm_mail_app_nsMailApp.cpp]
789 --- comm/mail/app/nsMailApp.cpp.orig    2020-07-13 18:10:03 UTC
790 +++ comm/mail/app/nsMailApp.cpp
791 @@ -306,6 +306,9 @@ int main(int argc, char* argv[], char* e
792    }
793  #endif
794  
795 +  setenv("MOZ_GMP_PATH", "%%LOCALBASE%%/lib/browser_plugins/symlinks/gecko", 0);
796 +  setenv("MOZ_PLUGIN_PATH", "%%LOCALBASE%%/lib/browser_plugins/symlinks/gecko", 0);
797 +
798  #ifdef HAS_DLL_BLOCKLIST
799    DllBlocklist_Initialize(gBlocklistInitFlags);
800  #endif
801
802
803 [FILE:914:patches/patch-env-api-keys]
804 # Accept API keys from environment like before bug 1294585
805
806 --- build/moz.configure/keyfiles.configure
807 +++ build/moz.configure/keyfiles.configure
808 @@ -19,6 +19,7 @@ def keyfile(desc, default=None, help=None, callback=lambda x: x):
809      @checking("for the %s key" % desc, lambda x: x and x is not no_key)
810      @imports(_from="__builtin__", _import="open")
811      @imports(_from="__builtin__", _import="IOError")
812 +    @imports(_from="os", _import="environ")
813      def keyfile(value):
814          if value:
815              try:
816 @@ -29,7 +30,7 @@ def keyfile(desc, default=None, help=None, callback=lambda x: x):
817                      raise FatalCheckError("'%s' is empty." % value[0])
818              except IOError as e:
819                  raise FatalCheckError("'%s': %s." % (value[0], e.strerror))
820 -        return no_key
821 +        return environ.get("MOZ_%s_KEY" % desc.upper().replace(" ", "_")) or no_key
822  
823      return keyfile
824  
825
826
827 [FILE:890:patches/patch-gfx_skia_skia_src_core_SkCpu.cpp]
828 Regressed by https://svnweb.freebsd.org/changeset/base/324815
829
830 gfx/skia/skia/src/core/SkCpu.cpp:81:27: error: use of undeclared identifier 'getauxval'
831         uint32_t hwcaps = getauxval(AT_HWCAP);
832                           ^
833
834 --- gfx/skia/skia/src/core/SkCpu.cpp.orig       2020-07-13 18:06:57 UTC
835 +++ gfx/skia/skia/src/core/SkCpu.cpp
836 @@ -72,6 +72,20 @@
837          return features;
838      }
839  
840 +#elif defined(SK_CPU_ARM64) && defined(__FreeBSD__)
841 +    #include <machine/armreg.h>
842 +
843 +    static uint32_t read_cpu_features() {
844 +        uint32_t features = 0;
845 +        uint64_t id_aa64isar0;
846 +
847 +        id_aa64isar0 = READ_SPECIALREG(ID_AA64ISAR0_EL1);
848 +        if (ID_AA64ISAR0_CRC32(id_aa64isar0) == ID_AA64ISAR0_CRC32_BASE) {
849 +            features |= SkCpu::CRC32;
850 +        }
851 +        return features;
852 +    }
853 +
854  #elif defined(SK_CPU_ARM64) && __has_include(<sys/auxv.h>)
855      #include <sys/auxv.h>
856  
857
858
859 [FILE:361:patches/patch-third__party_libwebrtc_build_build__config.h]
860 --- third_party/libwebrtc/build/build_config.h.orig     2022-09-12 16:44:50 UTC
861 +++ third_party/libwebrtc/build/build_config.h
862 @@ -72,7 +72,7 @@
863  #define OS_WIN 1
864  #elif defined(__Fuchsia__)
865  #define OS_FUCHSIA 1
866 -#elif defined(__FreeBSD__)
867 +#elif defined(__FreeBSD__) || defined(__DragonFly__)
868  #define OS_FREEBSD 1
869  #elif defined(__NetBSD__)
870  #define OS_NETBSD 1
871
872
873 [FILE:1490:patches/patch-tools_profiler_core_patform.cpp]
874 commit 45a7951cb6a9b1735b9b6cec89db69b5933715c7
875 Author: Christoph Moench-Tegeder <cmt@FreeBSD.org>
876 Date:   Mon Mar 28 21:54:35 2022 +0200
877
878     FreeBSD can use sched_getcpu() from 1400046/1300524 on
879
880 diff --git tools/profiler/core/platform.cpp tools/profiler/core/platform.cpp
881 index 92bcc1100687..2f17a88942a8 100644
882 --- tools/profiler/core/platform.cpp
883 +++ tools/profiler/core/platform.cpp
884 @@ -111,6 +111,20 @@
885  #  include <cpuid.h>
886  #endif
887  
888 +#if defined(GP_OS_freebsd)
889 +#include <sys/param.h>
890 +// "after making CPU_SET macros compatible with glibc"
891 +#  if __FreeBSD_version > 1400045 || (__FreeBSD_version > 1300523 && __FreeBSD_version < 1400000)
892 +#  include <sched.h>
893 +#  else
894 +#    if __x86_64__ || __i386__
895 +// similar cpuid_count() trick as on Darwin, using LLVM
896 +// but not for all CPUs
897 +#      include <cpuid.h>
898 +#    endif
899 +#  endif
900 +#endif
901 +
902  #if defined(GP_OS_windows)
903  #  include <processthreadsapi.h>
904  
905 @@ -6368,6 +6382,19 @@ void profiler_mark_thread_awake() {
906      cpuId = ebx >> 24;
907    }
908  #  endif
909 +#elif defined(GP_OS_freebsd) 
910 +#  if __FreeBSD_version > 1400045 || (__FreeBSD_version > 1300523 && __FreeBSD_version < 1400000)
911 +  cpuId = sched_getcpu();
912 +#  elif defined(__amd64__)
913 +  unsigned int eax, ebx, ecx, edx;
914 +  __cpuid_count(1, 0, eax, ebx, ecx, edx);
915 +  // Check if we have an APIC.
916 +  if ((edx & (1 << 9))) {
917 +    // APIC ID is bits 24-31 of EBX
918 +    cpuId = ebx >> 24;
919 +  }
920 +#  endif
921 +// the fallthrough is cpuID = 0
922  #else
923    cpuId = sched_getcpu();
924  #endif
925
926
927 [FILE:290:files/thunderbird.desktop]
928 [Desktop Entry]
929 Encoding=UTF-8
930 Name=Thunderbird
931 GenericName=Mail Client
932 Comment=Mail client and News Reader
933 Exec=thunderbird %u
934 Icon=thunderbird.png
935 StartupNotify=true
936 Terminal=false
937 Type=Application
938 Categories=Network;Email;News;InstantMessaging;
939 MimeType=application/mbox;message/rfc822;
940