Ravenports generated: 02 Jan 2023 22:26
[ravenports.git] / bucket_67 / thunderbird
1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
2
3 NAMEBASE=               thunderbird
4 VERSION=                102.6.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.6.1/source
13 DISTFILE[1]=            thunderbird-102.6.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 8b8cb5d7532ad8ee65061d2f284ae9f0470e7614dfcfc3c37ca945bcb96d1183    508826308 thunderbird-102.6.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:9644:patches/patch-bug847568]
451 # Allow building against system-wide graphite2/harfbuzz.
452
453 diff --git config/system-headers.mozbuild config/system-headers.mozbuild
454 index a1b58eb..a0a0943 100644
455 --- config/system-headers.mozbuild
456 +++ config/system-headers.mozbuild
457 @@ -1289,6 +1289,19 @@ if CONFIG['MOZ_ENABLE_LIBPROXY']:
458          'proxy.h',
459      ]
460  
461 +if CONFIG['MOZ_SYSTEM_GRAPHITE2']:
462 +    system_headers += [
463 +        'graphite2/Font.h',
464 +        'graphite2/Segment.h',
465 +    ]
466 +
467 +if CONFIG['MOZ_SYSTEM_HARFBUZZ']:
468 +    system_headers += [
469 +        'harfbuzz/hb-glib.h',
470 +        'harfbuzz/hb-ot.h',
471 +        'harfbuzz/hb.h',
472 +    ]
473 +
474  if CONFIG['MOZ_SYSTEM_LIBVPX']:
475      system_headers += [
476          'vpx_mem/vpx_mem.h',
477 diff --git dom/base/moz.build dom/base/moz.build
478 index d390adf..4508f19 100644
479 --- dom/base/moz.build
480 +++ dom/base/moz.build
481 @@ -576,6 +576,9 @@ FINAL_LIBRARY = "xul"
482  if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk":
483      CXXFLAGS += CONFIG["MOZ_GTK3_CFLAGS"]
484  
485 +if CONFIG["MOZ_SYSTEM_HARFBUZZ"]:
486 +    CXXFLAGS += CONFIG["MOZ_HARFBUZZ_CFLAGS"]
487 +
488  GeneratedFile(
489      "UseCounterList.h",
490      script="gen-usecounters.py",
491 diff --git gfx/graphite2/geckoextra/moz.build gfx/graphite2/geckoextra/moz.build
492 new file mode 100644
493 index 0000000..24e8d7a
494 --- /dev/null
495 +++ gfx/graphite2/geckoextra/moz.build
496 @@ -0,0 +1,21 @@
497 +# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
498 +# vim: set filetype=python:
499 +# This Source Code Form is subject to the terms of the Mozilla Public
500 +# License, v. 2.0. If a copy of the MPL was not distributed with this
501 +# file, You can obtain one at http://mozilla.org/MPL/2.0/.
502 +
503 +EXPORTS.graphite2 += [
504 +    'include/GraphiteExtra.h',
505 +    'include/GraphiteStructsForRLBox.h',
506 +]
507 +
508 +UNIFIED_SOURCES += [
509 +    '../geckoextra/src/GraphiteExtra.cpp',
510 +]
511 +
512 +CXXFLAGS += CONFIG['MOZ_GRAPHITE2_CFLAGS']
513 +
514 +# Match bundled graphite2 configuration
515 +AllowCompilerWarnings()
516 +
517 +FINAL_LIBRARY = 'gkmedias'
518 diff --git gfx/graphite2/moz-gr-update.sh gfx/graphite2/moz-gr-update.sh
519 index b91d9c1..a97e6eb 100755
520 --- gfx/graphite2/moz-gr-update.sh
521 +++ gfx/graphite2/moz-gr-update.sh
522 @@ -1,6 +1,7 @@
523  #!/bin/bash
524  
525  # Script used to update the Graphite2 library in the mozilla source tree
526 +# and bump version for --with-system-graphite2
527  
528  # This script lives in gfx/graphite2, along with the library source,
529  # but must be run from the top level of the mozilla-central tree.
530 @@ -37,12 +38,16 @@ echo "See" $0 "for update procedure." >> gfx/graphite2/README.mozilla
531  #find gfx/graphite2/ -name "*.cpp" -exec perl -p -i -e "s/<cstdio>/<stdio.h>/;s/Windows.h/windows.h/;" {} \;
532  #find gfx/graphite2/ -name "*.h" -exec perl -p -i -e "s/<cstdio>/<stdio.h>/;s/Windows.h/windows.h/;" {} \;
533  
534 +# chase version for --with-system-graphite2
535 +perl -p -i -e "s/[0-9]+\,[0-9]+\,[0-9]+/$RELEASE/ and tr/./,/ \
536 +  if /GR2_VERSION_REQUIRE/" old-configure.in
537 +
538  # summarize what's been touched
539  echo Updated to $RELEASE.
540  echo Here is what changed in the gfx/graphite2 directory:
541  echo
542  
543 -hg stat gfx/graphite2
544 +hg stat old-configure.in gfx/graphite2
545  
546  echo
547  echo If gfx/graphite2/src/files.mk has changed, please make corresponding
548 diff --git gfx/harfbuzz/README-mozilla gfx/harfbuzz/README-mozilla
549 index 3180257..4587a3b 100644
550 --- gfx/harfbuzz/README-mozilla
551 +++ gfx/harfbuzz/README-mozilla
552 @@ -21,3 +21,8 @@ from within the gfx/harfbuzz directory.
553  
554  If the collection of source files changes, manual updates to moz.build may be
555  needed as we don't use the upstream makefiles.
556 +
557 +The in-tree copy may be omitted during build by --with-system-harfbuzz.
558 +Make sure to keep pkg-config version check within toolkit/moz.configure in sync
559 +with checkout version or increment latest tag by one if it's not based
560 +on upstream release.
561 diff --git gfx/moz.build gfx/moz.build
562 index 4d6d63d..cd57b0c 100644
563 --- gfx/moz.build
564 +++ gfx/moz.build
565 @@ -10,6 +10,14 @@ with Files("**"):
566  with Files("wr/**"):
567      BUG_COMPONENT = ("Core", "Graphics: WebRender")
568  
569 +if CONFIG["MOZ_SYSTEM_GRAPHITE2"]:
570 +    DIRS += ["graphite2/geckoextra"]
571 +else:
572 +    DIRS += ["graphite2/src" ]
573 +
574 +if not CONFIG["MOZ_SYSTEM_HARFBUZZ"]:
575 +    DIRS += ["harfbuzz/src"]
576 +
577  DIRS += [
578      "cairo",
579      "2d",
580 @@ -19,8 +27,6 @@ DIRS += [
581      "qcms",
582      "gl",
583      "layers",
584 -    "graphite2/src",
585 -    "harfbuzz/src",
586      "ots/src",
587      "thebes",
588      "ipc",
589 diff --git gfx/skia/generate_mozbuild.py gfx/skia/generate_mozbuild.py
590 index 5e0fd17..860b80a 100755
591 --- gfx/skia/generate_mozbuild.py
592 +++ gfx/skia/generate_mozbuild.py
593 @@ -96,6 +96,9 @@ if CONFIG['CC_TYPE'] in ('clang', 'clang-cl'):
594          '-Wno-unused-private-field',
595      ]
596  
597 +if CONFIG['MOZ_SYSTEM_HARFBUZZ']:
598 +    CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS']
599 +
600  if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk', 'android'):
601      LOCAL_INCLUDES += [
602          "/gfx/cairo/cairo/src",
603 diff --git gfx/skia/moz.build gfx/skia/moz.build
604 index 524bd28..615c93b 100755
605 --- gfx/skia/moz.build
606 +++ gfx/skia/moz.build
607 @@ -488,6 +488,9 @@ if CONFIG['CC_TYPE'] in ('clang', 'clang-cl'):
608          '-Wno-unused-private-field',
609      ]
610  
611 +if CONFIG['MOZ_SYSTEM_HARFBUZZ']:
612 +    CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS']
613 +
614  if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk', 'android'):
615      LOCAL_INCLUDES += [
616          "/gfx/cairo/cairo/src",
617 diff --git gfx/thebes/moz.build gfx/thebes/moz.build
618 index baa6f09..4f02a9e 100644
619 --- gfx/thebes/moz.build
620 +++ gfx/thebes/moz.build
621 @@ -286,7 +286,13 @@ if CONFIG["MOZ_WAYLAND"]:
622  
623  LOCAL_INCLUDES += CONFIG["SKIA_INCLUDES"]
624  
625 -DEFINES["GRAPHITE2_STATIC"] = True
626 +if CONFIG["MOZ_SYSTEM_GRAPHITE2"]:
627 +    CXXFLAGS += CONFIG["MOZ_GRAPHITE2_CFLAGS"]
628 +else:
629 +    DEFINES["GRAPHITE2_STATIC"] = True
630 +
631 +if CONFIG["MOZ_SYSTEM_HARFBUZZ"]:
632 +    CXXFLAGS += CONFIG["MOZ_HARFBUZZ_CFLAGS"]
633  
634  if CONFIG["CC_TYPE"] == "clang":
635      # Suppress warnings from Skia header files.
636 diff --git intl/unicharutil/util/moz.build intl/unicharutil/util/moz.build
637 index 301eb9a..7cece5e 100644
638 --- intl/unicharutil/util/moz.build
639 +++ intl/unicharutil/util/moz.build
640 @@ -25,6 +25,9 @@ UNIFIED_SOURCES += [
641      "nsUnicodeProperties.cpp",
642  ]
643  
644 +if CONFIG["MOZ_SYSTEM_HARFBUZZ"]:
645 +    CXXFLAGS += CONFIG["MOZ_HARFBUZZ_CFLAGS"]
646 +
647  include("/ipc/chromium/chromium-config.mozbuild")
648  
649  GeneratedFile(
650 diff --git netwerk/dns/moz.build netwerk/dns/moz.build
651 index f769e27..315bdd4 100644
652 --- netwerk/dns/moz.build
653 +++ netwerk/dns/moz.build
654 @@ -102,6 +102,9 @@ GeneratedFile(
655      "etld_data.inc", script="prepare_tlds.py", inputs=["effective_tld_names.dat"]
656  )
657  
658 +if CONFIG["MOZ_SYSTEM_HARFBUZZ"]:
659 +    CXXFLAGS += CONFIG["MOZ_HARFBUZZ_CFLAGS"]
660 +
661  # need to include etld_data.inc
662  LOCAL_INCLUDES += [
663      "/netwerk/base",
664 diff --git old-configure.in old-configure.in
665 index d147957..d332b34 100644
666 --- old-configure.in
667 +++ old-configure.in
668 @@ -1335,6 +1335,27 @@ fi
669  AC_DEFINE_UNQUOTED(MOZ_MACBUNDLE_ID,$MOZ_MACBUNDLE_ID)
670  AC_SUBST(MOZ_MACBUNDLE_ID)
671  
672 +dnl ========================================================
673 +dnl Check for graphite2
674 +dnl ========================================================
675 +if test -n "$MOZ_SYSTEM_GRAPHITE2"; then
676 +    dnl graphite2.pc has bogus version, check manually
677 +    _SAVE_CFLAGS=$CFLAGS
678 +    CFLAGS="$CFLAGS $MOZ_GRAPHITE2_CFLAGS"
679 +    AC_TRY_COMPILE([ #include <graphite2/Font.h>
680 +                     #define GR2_VERSION_REQUIRE(major,minor,bugfix)  \
681 +                             ( GR2_VERSION_MAJOR * 10000 + GR2_VERSION_MINOR \
682 +                               * 100 + GR2_VERSION_BUGFIX >= \
683 +                               (major) * 10000 + (minor) * 100 + (bugfix) )
684 +                   ], [
685 +                     #if !GR2_VERSION_REQUIRE(1,3,14)
686 +                     #error "Insufficient graphite2 version."
687 +                     #endif
688 +                   ], [],
689 +                   [AC_MSG_ERROR([--with-system-graphite2 requested but no working libgraphite2 found])])
690 +    CFLAGS=$_SAVE_CFLAGS
691 +fi
692 +
693  dnl ========================================================
694  dnl = Child Process Name for IPC
695  dnl ========================================================
696 diff --git toolkit/library/moz.build toolkit/library/moz.build
697 index 2c3f869..e8a9d23 100644
698 --- toolkit/library/moz.build
699 +++ toolkit/library/moz.build
700 @@ -269,6 +269,12 @@ if CONFIG["MOZ_SYSTEM_PNG"]:
701  if CONFIG["MOZ_SYSTEM_WEBP"]:
702      OS_LIBS += CONFIG["MOZ_WEBP_LIBS"]
703  
704 +if CONFIG["MOZ_SYSTEM_GRAPHITE2"]:
705 +    OS_LIBS += CONFIG["MOZ_GRAPHITE2_LIBS"]
706 +
707 +if CONFIG["MOZ_SYSTEM_HARFBUZZ"]:
708 +    OS_LIBS += CONFIG["MOZ_HARFBUZZ_LIBS"]
709 +
710  if CONFIG["MOZ_SYSTEM_LIBEVENT"]:
711      OS_LIBS += CONFIG["MOZ_LIBEVENT_LIBS"]
712  
713 diff --git toolkit/moz.configure toolkit/moz.configure
714 index 0069865..9bb1864 100644
715 --- toolkit/moz.configure
716 +++ toolkit/moz.configure
717 @@ -1058,6 +1058,25 @@ def geckodriver_default(enable_tests, target, cross_compile, hazard, asan, autom
718          return False
719      return True
720  
721 +# Graphite2
722 +# ==============================================================
723 +option("--with-system-graphite2",
724 +       help="Use system graphite2 (located with pkgconfig)")
725 +
726 +system_graphite2 = pkg_check_modules("MOZ_GRAPHITE2", "graphite2",
727 +                                     when="--with-system-graphite2")
728 +
729 +set_config("MOZ_SYSTEM_GRAPHITE2", depends_if(system_graphite2)(lambda _: True))
730 +
731 +# HarfBuzz
732 +# ==============================================================
733 +option("--with-system-harfbuzz",
734 +       help="Use system harfbuzz (located with pkgconfig)")
735 +
736 +system_harfbuzz = pkg_check_modules("MOZ_HARFBUZZ", "harfbuzz >= 2.7.4",
737 +                                    when="--with-system-harfbuzz")
738 +
739 +set_config("MOZ_SYSTEM_HARFBUZZ", depends_if(system_harfbuzz)(lambda _: True))
740  
741  option(
742      "--enable-geckodriver",
743
744
745 [FILE:406:patches/patch-comm__third_party__rnpdefs.mozbuild]
746 --- comm/third_party/rnpdefs.mozbuild.orig      2021-08-11 20:13:25.176921000 +0200
747 +++ comm/third_party/rnpdefs.mozbuild   2021-08-11 20:14:08.855374000 +0200
748 @@ -43,6 +43,6 @@
749      OS_LIBS += [static_libdir, "-l:libc++.a", "-l:libc++abi.a"]
750  
751  
752 -if CONFIG["OS_ARCH"] in ("Linux", "SunOS"):
753 +if CONFIG["OS_ARCH"] in ("Linux", "FreeBSD", "DragonFly", "SunOS"):
754      CFLAGS += ["-fPIC"]
755      CXXFLAGS += ["-fPIC"]
756
757
758 [FILE:421:patches/patch-comm_mail_app_nsMailApp.cpp]
759 --- comm/mail/app/nsMailApp.cpp.orig    2020-07-13 18:10:03 UTC
760 +++ comm/mail/app/nsMailApp.cpp
761 @@ -306,6 +306,9 @@ int main(int argc, char* argv[], char* e
762    }
763  #endif
764  
765 +  setenv("MOZ_GMP_PATH", "%%LOCALBASE%%/lib/browser_plugins/symlinks/gecko", 0);
766 +  setenv("MOZ_PLUGIN_PATH", "%%LOCALBASE%%/lib/browser_plugins/symlinks/gecko", 0);
767 +
768  #ifdef HAS_DLL_BLOCKLIST
769    DllBlocklist_Initialize(gBlocklistInitFlags);
770  #endif
771
772
773 [FILE:914:patches/patch-env-api-keys]
774 # Accept API keys from environment like before bug 1294585
775
776 --- build/moz.configure/keyfiles.configure
777 +++ build/moz.configure/keyfiles.configure
778 @@ -19,6 +19,7 @@ def keyfile(desc, default=None, help=None, callback=lambda x: x):
779      @checking("for the %s key" % desc, lambda x: x and x is not no_key)
780      @imports(_from="__builtin__", _import="open")
781      @imports(_from="__builtin__", _import="IOError")
782 +    @imports(_from="os", _import="environ")
783      def keyfile(value):
784          if value:
785              try:
786 @@ -29,7 +30,7 @@ def keyfile(desc, default=None, help=None, callback=lambda x: x):
787                      raise FatalCheckError("'%s' is empty." % value[0])
788              except IOError as e:
789                  raise FatalCheckError("'%s': %s." % (value[0], e.strerror))
790 -        return no_key
791 +        return environ.get("MOZ_%s_KEY" % desc.upper().replace(" ", "_")) or no_key
792  
793      return keyfile
794  
795
796
797 [FILE:890:patches/patch-gfx_skia_skia_src_core_SkCpu.cpp]
798 Regressed by https://svnweb.freebsd.org/changeset/base/324815
799
800 gfx/skia/skia/src/core/SkCpu.cpp:81:27: error: use of undeclared identifier 'getauxval'
801         uint32_t hwcaps = getauxval(AT_HWCAP);
802                           ^
803
804 --- gfx/skia/skia/src/core/SkCpu.cpp.orig       2020-07-13 18:06:57 UTC
805 +++ gfx/skia/skia/src/core/SkCpu.cpp
806 @@ -72,6 +72,20 @@
807          return features;
808      }
809  
810 +#elif defined(SK_CPU_ARM64) && defined(__FreeBSD__)
811 +    #include <machine/armreg.h>
812 +
813 +    static uint32_t read_cpu_features() {
814 +        uint32_t features = 0;
815 +        uint64_t id_aa64isar0;
816 +
817 +        id_aa64isar0 = READ_SPECIALREG(ID_AA64ISAR0_EL1);
818 +        if (ID_AA64ISAR0_CRC32(id_aa64isar0) == ID_AA64ISAR0_CRC32_BASE) {
819 +            features |= SkCpu::CRC32;
820 +        }
821 +        return features;
822 +    }
823 +
824  #elif defined(SK_CPU_ARM64) && __has_include(<sys/auxv.h>)
825      #include <sys/auxv.h>
826  
827
828
829 [FILE:361:patches/patch-third__party_libwebrtc_build_build__config.h]
830 --- third_party/libwebrtc/build/build_config.h.orig     2022-09-12 16:44:50 UTC
831 +++ third_party/libwebrtc/build/build_config.h
832 @@ -72,7 +72,7 @@
833  #define OS_WIN 1
834  #elif defined(__Fuchsia__)
835  #define OS_FUCHSIA 1
836 -#elif defined(__FreeBSD__)
837 +#elif defined(__FreeBSD__) || defined(__DragonFly__)
838  #define OS_FREEBSD 1
839  #elif defined(__NetBSD__)
840  #define OS_NETBSD 1
841
842
843 [FILE:1490:patches/patch-tools_profiler_core_patform.cpp]
844 commit 45a7951cb6a9b1735b9b6cec89db69b5933715c7
845 Author: Christoph Moench-Tegeder <cmt@FreeBSD.org>
846 Date:   Mon Mar 28 21:54:35 2022 +0200
847
848     FreeBSD can use sched_getcpu() from 1400046/1300524 on
849
850 diff --git tools/profiler/core/platform.cpp tools/profiler/core/platform.cpp
851 index 92bcc1100687..2f17a88942a8 100644
852 --- tools/profiler/core/platform.cpp
853 +++ tools/profiler/core/platform.cpp
854 @@ -111,6 +111,20 @@
855  #  include <cpuid.h>
856  #endif
857  
858 +#if defined(GP_OS_freebsd)
859 +#include <sys/param.h>
860 +// "after making CPU_SET macros compatible with glibc"
861 +#  if __FreeBSD_version > 1400045 || (__FreeBSD_version > 1300523 && __FreeBSD_version < 1400000)
862 +#  include <sched.h>
863 +#  else
864 +#    if __x86_64__ || __i386__
865 +// similar cpuid_count() trick as on Darwin, using LLVM
866 +// but not for all CPUs
867 +#      include <cpuid.h>
868 +#    endif
869 +#  endif
870 +#endif
871 +
872  #if defined(GP_OS_windows)
873  #  include <processthreadsapi.h>
874  
875 @@ -6368,6 +6382,19 @@ void profiler_mark_thread_awake() {
876      cpuId = ebx >> 24;
877    }
878  #  endif
879 +#elif defined(GP_OS_freebsd) 
880 +#  if __FreeBSD_version > 1400045 || (__FreeBSD_version > 1300523 && __FreeBSD_version < 1400000)
881 +  cpuId = sched_getcpu();
882 +#  elif defined(__amd64__)
883 +  unsigned int eax, ebx, ecx, edx;
884 +  __cpuid_count(1, 0, eax, ebx, ecx, edx);
885 +  // Check if we have an APIC.
886 +  if ((edx & (1 << 9))) {
887 +    // APIC ID is bits 24-31 of EBX
888 +    cpuId = ebx >> 24;
889 +  }
890 +#  endif
891 +// the fallthrough is cpuID = 0
892  #else
893    cpuId = sched_getcpu();
894  #endif
895
896
897 [FILE:290:files/thunderbird.desktop]
898 [Desktop Entry]
899 Encoding=UTF-8
900 Name=Thunderbird
901 GenericName=Mail Client
902 Comment=Mail client and News Reader
903 Exec=thunderbird %u
904 Icon=thunderbird.png
905 StartupNotify=true
906 Terminal=false
907 Type=Application
908 Categories=Network;Email;News;InstantMessaging;
909 MimeType=application/mbox;message/rfc822;
910