1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
5 KEYWORDS= mail net_im news
7 SDESC[standard]= Mozilla Thunderbird mail/newsgroup client
8 HOMEPAGE= https://www.thunderbird.net/
12 SITES[main]= MOZILLA/thunderbird/releases/78.3.1/source
13 DISTFILE[1]= thunderbird-78.3.1.source.tar.xz:main
15 SPKGS[standard]= single
17 OPTIONS_AVAILABLE= none
18 OPTIONS_STANDARD= none
20 BUILD_DEPENDS= rust:single:standard
21 cbindgen:single:standard
22 autoconf213:single:standard
27 nodejs:primary:standard
28 libvpx:single:standard
29 clang:compiler:standard
30 evdev-proto:single:standard
31 autoselect-python:single:standard
32 python-sqlite3:single:python_used
33 BUILDRUN_DEPENDS= nss:primary:standard
35 libffi:single:standard
36 libproxy:single:standard
37 libevent:single:standard
38 libcanberra:primary:standard
39 libnotify:primary:standard
40 harfbuzz:primary:standard
45 ffmpeg:primary:standard
46 dbus-glib:primary:standard
47 startup-notification:single:standard
49 USES= cpe desktop-utils:single gmake jpeg png zlib
50 perl:build pkgconfig iconv python:build
52 GNOME_COMPONENTS= gconf gtk2 gtk3 gdkpixbuf pango
53 XORG_COMPONENTS= x11 xcb xcomposite xdamage xext xfixes xrender xt
57 LICENSE_TERMS= single:{{WRKSRC}}/toolkit/content/license.html
58 LICENSE_FILE= MPL:stock
62 FPC_EQUIVALENT= mail/thunderbird
65 CONFIGURE_OUTSOURCE= yes
66 CONFIGURE_ENV= PYTHON3={{PYTHON_CMD}}
67 SETUPTOOLS_USE_DISTUTILS=stdlib
69 MAKE_ENV= PYTHON3={{PYTHON_CMD}}
72 QMAKE_ARGS= --prefix="{{PREFIX}}"
77 --with-system-png="{{LOCALBASE}}"
78 --with-system-jpeg="{{LOCALBASE}}"
79 --with-system-libevent
80 --with-system-harfbuzz
81 --with-system-graphite2
85 --enable-system-pixman
86 --enable-install-strip
92 --enable-official-branding
93 --enable-application=comm/mail
94 --enable-update-channel=release
99 --disable-debug-symbols
108 VAR_OPSYS[freebsd]= CONFIGURE_ARGS=--enable-jemalloc
109 VAR_OPSYS[linux]= QMAKE_ARGS=--disable-elf-hack
112 ${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|g' \
113 ${WRKSRC}/comm/mail/app/nsMailApp.cpp \
114 ${WRKSRC}/browser/app/nsBrowserApp.cpp
115 (cd ${WRKSRC}/gfx/angle/checkout/src/compiler/translator && \
116 ${REINPLACE_CMD} -e 's|<math.h>|<cmath>|' \
117 InfoSink.h IntermNode.cpp)
119 ${REINPLACE_CMD} -e 's|MOZ_SCTP|MOZ_DISABLE_SCTP|' \
120 ${WRKSRC}/netwerk/moz.build
121 # alsa headers use 'u_int32_t' and other BerkeleyDB/nvi
122 # fixed types (_XOPEN_SOURCE)
123 ${REINPLACE_CMD} -e 's@_XOPEN_SOURCE@&___@g' \
124 ${WRKSRC}/media/libcubeb/src/cubeb_alsa.c
125 ${REINPLACE_CMD} -e 's@_POSIX_SOURCE@&___@g' \
126 ${WRKSRC}/media/libcubeb/src/cubeb_jack.cpp
127 # Set mozilla options
128 @${ECHO_CMD} "--=> Setting configuration <=--"
129 @for arg in ${QMAKE_ARGS}; do \
130 ${ECHO_CMD} ".mozconfig << $$arg" ;\
131 ${ECHO_CMD} ac_add_options $$arg >> ${WRKSRC}/.mozconfig ;\
133 @${ECHO_CMD} LDFLAGS=\"-Wl,-rpath,${PREFIX}/lib/thunderbird\" \
134 >> ${WRKSRC}/.mozconfig
136 post-patch-dragonfly:
137 ${REINPLACE_CMD} -e '/<malloc.h>/d' \
138 ${WRKSRC}/comm/ldap/c-sdk/libraries/liblber/lber-int.h
141 ${MKDIR} ${STAGEDIR}${PREFIX}/share/applications
142 ${MKDIR} ${STAGEDIR}${PREFIX}/share/pixmaps
143 ${INSTALL_DATA} ${FILESDIR}/thunderbird.desktop \
144 ${STAGEDIR}${PREFIX}/share/applications
145 (cd ${STAGEDIR}${PREFIX}/share/pixmaps && ${LN} -sf \
146 ../../lib/thunderbird/chrome/icons/default/default48.png \
148 # regenerate symlink to avoid absolute paths
149 ${RM} ${STAGEDIR}${PREFIX}/bin/thunderbird
150 (cd ${STAGEDIR}${PREFIX}/bin && \
151 ${LN} -sf ../lib/thunderbird/thunderbird thunderbird)
154 (cd ${WRKSRC} && ${LOCALBASE}/bin/autoconf-2.13)
155 (cd ${WRKSRC}/js/src/ && ${LOCALBASE}/bin/autoconf-2.13)
157 [FILE:391:descriptions/desc.single]
158 Thunderbird is a free and open source email, newsfeed, chat, and
159 calendaring client, that's easy to set up and customize. One of the core
160 principles of Thunderbird is the use and promotion of open standards -
161 this focus is a rejection of our world of closed platforms and services
162 that can't communicate with each other. We want our users to have
163 freedom and choice in how they communicate.
167 4ea61f59a819f5a8a4574b0735952e23b4c86387b8da24906129c45e71bf2718 353920472 thunderbird-78.3.1.source.tar.xz
170 [FILE:949:manifests/plist.single]
190 lib/thunderbird/chrome/icons/default/
191 calendar-alarm-dialog.png
192 calendar-event-dialog.png
193 calendar-event-summary-dialog.png
194 calendar-task-dialog.png
195 calendar-task-summary-dialog.png
204 lib/thunderbird/defaults/messenger/mailViews.dat
205 lib/thunderbird/defaults/pref/channel-prefs.js
206 lib/thunderbird/features/wetransfer@extensions.thunderbird.net.xpi
207 lib/thunderbird/gtk2/libmozgtk.so
214 share/applications/thunderbird.desktop
215 share/pixmaps/thunderbird.png
218 [FILE:5540:patches/patch-addon-search]
219 https://github.com/mozilla/addons/issues/708
220 https://github.com/mozilla/addons-frontend/issues/4610
222 diff --git mail/app/profile/all-thunderbird.js mail/app/profile/all-thunderbird.js
223 index 75c2c5e435e35..4d8c09c02759b 100644
224 --- comm/mail/app/profile/all-thunderbird.js
225 +++ comm/mail/app/profile/all-thunderbird.js
226 @@ -153,10 +153,10 @@ pref("extensions.getAddons.maxResults", 15);
227 pref("extensions.getAddons.get.url", "https://services.addons.thunderbird.net/api/v3/addons/search/?guid=%IDS%&lang=%LOCALE%");
228 pref("extensions.getAddons.compatOverides.url", "https://services.addons.thunderbird.net/api/v3/addons/compat-override/?guid=%IDS%&lang=%LOCALE%");
229 pref("extensions.getAddons.link.url", "https://addons.thunderbird.net/%LOCALE%/%APP%/");
230 -pref("extensions.getAddons.recommended.url", "https://services.addons.thunderbird.net/%LOCALE%/%APP%/api/%API_VERSION%/list/recommended/all/%MAX_RESULTS%/%OS%/%VERSION%?src=thunderbird");
231 +pref("extensions.getAddons.recommended.url", "https://services.addons.thunderbird.net/%LOCALE%/%APP%/api/%API_VERSION%/list/recommended/all/%MAX_RESULTS%/Linux/%VERSION%?src=thunderbird");
232 pref("extensions.getAddons.search.browseURL", "https://addons.thunderbird.net/%LOCALE%/%APP%/search/?q=%TERMS%");
233 -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");
234 -pref("extensions.webservice.discoverURL", "https://services.addons.thunderbird.net/%LOCALE%/%APP%/discovery/pane/%VERSION%/%OS%");
235 +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");
236 +pref("extensions.webservice.discoverURL", "https://services.addons.thunderbird.net/%LOCALE%/%APP%/discovery/pane/%VERSION%/Linux");
237 pref("extensions.getAddons.siteRegExp", "^https://.*addons\\.thunderbird\\.net");
238 pref("extensions.getAddons.langpacks.url", "https://services.addons.thunderbird.net/api/v3/addons/language-tools/?app=thunderbird&type=language&appversion=%VERSION%");
240 @@ -180,9 +180,9 @@ pref("security.cert_pinning.enforcement_level", 1);
243 pref("extensions.update.enabled", true);
244 -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%¤tAppVersion=%CURRENT_APP_VERSION%&updateType=%UPDATE_TYPE%&compatMode=%COMPATIBILITY_MODE%");
245 +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%¤tAppVersion=%CURRENT_APP_VERSION%&updateType=%UPDATE_TYPE%&compatMode=%COMPATIBILITY_MODE%");
247 -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%¤tAppVersion=%CURRENT_APP_VERSION%&updateType=%UPDATE_TYPE%&compatMode=%COMPATIBILITY_MODE%");
248 +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%¤tAppVersion=%CURRENT_APP_VERSION%&updateType=%UPDATE_TYPE%&compatMode=%COMPATIBILITY_MODE%");
250 pref("extensions.update.interval", 86400); // Check for updates to Extensions and
252 diff --git toolkit/mozapps/extensions/internal/AddonRepository.jsm toolkit/mozapps/extensions/internal/AddonRepository.jsm
253 index f70fd8d7e3bd8..81e8cd7764fdf 100644
254 --- toolkit/mozapps/extensions/internal/AddonRepository.jsm
255 +++ toolkit/mozapps/extensions/internal/AddonRepository.jsm
256 @@ -602,7 +602,7 @@ var AddonRepository = {
257 addon.version = String(aEntry.current_version.version);
258 if (Array.isArray(aEntry.current_version.files)) {
259 for (let file of aEntry.current_version.files) {
260 - if (file.platform == "all" || file.platform == PLATFORM) {
261 + if (file.platform == "all" || file.platform == "linux" || file.platform == PLATFORM) {
263 addon.sourceURI = NetUtil.newURI(file.url);
265 diff --git toolkit/mozapps/extensions/internal/XPIDatabase.jsm toolkit/mozapps/extensions/internal/XPIDatabase.jsm
266 index f70fd8d7e3bd8..81e8cd7764fdf 100644
267 --- toolkit/mozapps/extensions/internal/XPIDatabase.jsm
268 +++ toolkit/mozapps/extensions/internal/XPIDatabase.jsm
269 @@ -355,7 +355,7 @@ class AddonInternal {
270 // Something is causing errors in here
272 for (let platform of this.targetPlatforms) {
273 - if (platform.os == Services.appinfo.OS) {
274 + if (platform.os == "Linux" || platform.os == Services.appinfo.OS) {
277 if (platform.abi === abi)
280 [FILE:445:patches/patch-browser-app-nsBrowserApp.cpp]
281 --- browser/app/nsBrowserApp.cpp.orig 2016-09-19 16:19:28 UTC
282 +++ browser/app/nsBrowserApp.cpp
283 @@ -324,6 +324,9 @@ int main(int argc, char* argv[], char* e
285 mozilla::TimeStamp start = mozilla::TimeStamp::Now();
287 + setenv("MOZ_GMP_PATH", "%%LOCALBASE%%/lib/browser_plugins/symlinks/gecko", 0);
288 + setenv("MOZ_PLUGIN_PATH", "%%LOCALBASE%%/lib/browser_plugins/symlinks/gecko", 0);
290 #ifdef HAS_DLL_BLOCKLIST
291 DllBlocklist_Initialize();
295 [FILE:1800:patches/patch-bug1288587]
296 diff --git a/build/moz.configure/init.configure b/build/moz.configure/init.configure
297 index 855214a..1e91d51 100644
298 --- build/moz.configure/init.configure
299 +++ build/moz.configure/init.configure
300 @@ -251,6 +251,7 @@ option(env='PYTHON3', nargs=1, help='Python 3 interpre
301 @imports(_from='mozbuild.pythonutil', _import='find_python3_executable')
302 @imports(_from='mozbuild.pythonutil', _import='python_executable_version')
303 @imports(_from='six', _import='ensure_text')
304 +@imports(_from='__builtin__', _import='KeyError')
305 def virtualenv_python3(env_python, build_env, mozconfig, help):
306 # Avoid re-executing python when running configure --help.
308 @@ -283,6 +284,12 @@ def virtualenv_python3(env_python, build_env, mozconfi
309 python = mozconfig['vars']['added']['PYTHON3']
310 elif 'PYTHON3' in mozconfig['vars']['modified']:
311 python = mozconfig['vars']['modified']['PYTHON3'][1]
312 + for i in ('env', 'vars'):
313 + for j in ('added', 'modified'):
315 + del mozconfig[i][j]['PYTHON3']
319 log.debug("python3: executable from configuration: %r" % python)
321 @@ -365,7 +372,10 @@ def virtualenv_python3(env_python, build_env, mozconfi
322 sys.executable, manager.python_path))
323 log.info('Re-executing in the virtualenv')
325 - del os.environ['PYTHON3']
327 + del os.environ['PYTHON3']
330 # Homebrew on macOS will change Python's sys.executable to a custom
331 # value which messes with mach's virtualenv handling code. Override
332 # Homebrew's changes with the correct sys.executable value.
335 [FILE:3590:patches/patch-bug1559213]
337 Author: Jory A. Pratt <anarchy@gentoo.org>
338 Date: Thu Jun 13 11:53:00 2019 -0700
340 Bug 1559213 - Allow to use system av1 libs instead of bundled.
342 config/external/moz.build | 5 +++--
343 config/system-headers.mozbuild | 8 ++++++++
344 dom/media/platforms/moz.build | 5 +++++
345 toolkit/moz.configure | 19 ++++++++++++++++++-
346 4 files changed, 34 insertions(+), 3 deletions(-)
348 diff --git config/external/moz.build config/external/moz.build
349 index 03e4fa143bd1..a67d10b11fe6 100644
350 --- config/external/moz.build
351 +++ config/external/moz.build
352 @@ -37,8 +37,9 @@ if not CONFIG['MOZ_SYSTEM_LIBVPX']:
353 external_dirs += ['media/libvpx']
355 if CONFIG['MOZ_AV1']:
356 - external_dirs += ['media/libaom']
357 - external_dirs += ['media/libdav1d']
358 + if not CONFIG['MOZ_SYSTEM_AV1']:
359 + external_dirs += ['media/libaom']
360 + external_dirs += ['media/libdav1d']
362 if not CONFIG['MOZ_SYSTEM_PNG']:
363 external_dirs += ['media/libpng']
364 diff --git config/system-headers.mozbuild config/system-headers.mozbuild
365 index bcf5c4925564..48964a999a9b 100644
366 --- config/system-headers.mozbuild
367 +++ config/system-headers.mozbuild
368 @@ -1304,6 +1304,14 @@ if CONFIG['MOZ_ENABLE_CONTENTMANAGER']:
369 'SelectSingleContentItemPage.h',
372 +if CONFIG['MOZ_SYSTEM_AV1']:
373 + system_headers += [
374 + 'aom/aom_decoder.h',
380 if CONFIG['MOZ_SYSTEM_LIBVPX']:
383 diff --git dom/media/platforms/moz.build dom/media/platforms/moz.build
384 index 092cee0c9b66..38e45de5b5f0 100644
385 --- dom/media/platforms/moz.build
386 +++ dom/media/platforms/moz.build
387 @@ -80,6 +80,11 @@ if CONFIG['MOZ_AV1']:
388 'agnostic/AOMDecoder.cpp',
389 'agnostic/DAV1DDecoder.cpp',
391 + if CONFIG['MOZ_SYSTEM_AV1']:
392 + CXXFLAGS += CONFIG['MOZ_SYSTEM_LIBAOM_CFLAGS']
393 + OS_LIBS += CONFIG['MOZ_SYSTEM_LIBAOM_LIBS']
394 + CXXFLAGS += CONFIG['MOZ_SYSTEM_LIBDAV1D_CFLAGS']
395 + OS_LIBS += CONFIG['MOZ_SYSTEM_LIBDAV1D_LIBS']
397 if CONFIG['MOZ_OMX']:
399 diff --git toolkit/moz.configure toolkit/moz.configure
400 index 82b5a59acf42..e2329560b42b 100644
401 --- toolkit/moz.configure
402 +++ toolkit/moz.configure
403 @@ -441,7 +441,23 @@ def av1(value):
407 -@depends(target, nasm_version, when=av1 & compile_environment)
408 +option('--with-system-av1',
409 + help="Use system av1 (located with pkgconfig)")
411 +system_libaom_info = pkg_check_modules('MOZ_SYSTEM_LIBAOM', 'aom >= 1.0.0',
412 + when='--with-system-av1')
414 +system_libdav1d_info = pkg_check_modules('MOZ_SYSTEM_LIBDAV1D', 'dav1d >= 0.1.1',
415 + when='--with-system-av1')
417 +@depends(system_libaom_info, system_libdav1d_info)
418 +def system_av1(system_libaom_info, system_libdav1d_info):
419 + has_av1_libs = False
420 + if system_libaom_info and system_libdav1d_info:
421 + has_av1_libs = True
422 + return has_av1_libs
424 +@depends(target, nasm_version, when=av1 & depends(system_av1)(lambda v: not v) & compile_environment)
425 def dav1d_asm(target, nasm_version):
426 if target.os != 'Android':
427 if target.cpu == 'aarch64':
428 @@ -457,6 +473,7 @@ set_config('MOZ_DAV1D_ASM', dav1d_asm)
429 set_define('MOZ_DAV1D_ASM', dav1d_asm)
430 set_config('MOZ_AV1', av1)
431 set_define('MOZ_AV1', av1)
432 +set_config('MOZ_SYSTEM_AV1', depends_if(system_av1)(lambda _: True))
434 # Built-in fragmented MP4 support.
435 # ==============================================================
438 [FILE:1254:patches/patch-bug1618914]
439 [Wayland] Fall back to ftruncate if posix_fallocate isn't supported by filesystem.
441 diff --git widget/gtk/WindowSurfaceWayland.cpp widget/gtk/WindowSurfaceWayland.cpp
442 index 9a73326399bd5..9e42a7f1c5d18 100644
443 --- widget/gtk/WindowSurfaceWayland.cpp
444 +++ widget/gtk/WindowSurfaceWayland.cpp
445 @@ -222,20 +222,21 @@ static int WaylandAllocateShmMemory(int aSize) {
446 #ifdef HAVE_POSIX_FALLOCATE
448 ret = posix_fallocate(fd, 0, aSize);
449 } while (ret == EINTR);
453 + } else if (ret != ENODEV && ret != EINVAL && ret != EOPNOTSUPP) {
455 MOZ_CRASH("posix_fallocate() fails to allocate shm memory");
460 ret = ftruncate(fd, aSize);
461 } while (ret < 0 && errno == EINTR);
464 MOZ_CRASH("ftruncate() fails to allocate shm memory");
470 @@ -265,8 +266,8 @@ bool WaylandShmPool::Resize(int aSize) {
471 #ifdef HAVE_POSIX_FALLOCATE
473 errno = posix_fallocate(mShmPoolFd, 0, aSize);
474 } while (errno == EINTR);
475 - if (errno != 0) return false;
476 + if (errno != 0 && errno != ENODEV && errno != EINVAL && errno != EOPNOTSUPP) return false;
479 wl_shm_pool_resize(mShmPool, aSize);
482 [FILE:11510:patches/patch-bug292127]
483 --- comm/ldap/c-sdk/include/ldap.h~
484 +++ comm/ldap/c-sdk/include/ldap.h
489 +/* rename symbols to not clash with openldap (bug 292127) */
490 +#define ldap_abandon moz_ldap_abandon
491 +#define ldap_abandon_ext moz_ldap_abandon_ext
492 +#define ldap_abandoned moz_ldap_abandoned
493 +#define ldap_add moz_ldap_add
494 +#define ldap_add_ext moz_ldap_add_ext
495 +#define ldap_add_ext_s moz_ldap_add_ext_s
496 +#define ldap_add_result_entry moz_ldap_add_result_entry
497 +#define ldap_add_s moz_ldap_add_s
498 +#define ldap_ber_free moz_ldap_ber_free
499 +#define ldap_bind moz_ldap_bind
500 +#define ldap_bind_s moz_ldap_bind_s
501 +#define ldap_build_filter moz_ldap_build_filter
502 +#define ldap_cache_flush moz_ldap_cache_flush
503 +#define ldap_charray_add moz_ldap_charray_add
504 +#define ldap_charray_dup moz_ldap_charray_dup
505 +#define ldap_charray_free moz_ldap_charray_free
506 +#define ldap_charray_inlist moz_ldap_charray_inlist
507 +#define ldap_charray_merge moz_ldap_charray_merge
508 +#define ldap_charray_position moz_ldap_charray_position
509 +#define ldap_compare moz_ldap_compare
510 +#define ldap_compare_ext moz_ldap_compare_ext
511 +#define ldap_compare_ext_s moz_ldap_compare_ext_s
512 +#define ldap_compare_s moz_ldap_compare_s
513 +#define ldap_control_free moz_ldap_control_free
514 +#define ldap_controls_free moz_ldap_controls_free
515 +#define ldap_count_entries moz_ldap_count_entries
516 +#define ldap_count_messages moz_ldap_count_messages
517 +#define ldap_count_references moz_ldap_count_references
518 +#define ldap_count_values moz_ldap_count_values
519 +#define ldap_count_values_len moz_ldap_count_values_len
520 +#define ldap_create_authzid_control moz_ldap_create_authzid_control
521 +#define ldap_create_filter moz_ldap_create_filter
522 +#define ldap_create_geteffectiveRights_control moz_ldap_create_geteffectiveRights_control
523 +#define ldap_create_passwordpolicy_control moz_ldap_create_passwordpolicy_control
524 +#define ldap_create_passwordpolicy_control_ext moz_ldap_create_passwordpolicy_control_ext
525 +#define ldap_create_persistentsearch_control moz_ldap_create_persistentsearch_control
526 +#define ldap_create_proxiedauth_control moz_ldap_create_proxiedauth_control
527 +#define ldap_create_proxyauth_control moz_ldap_create_proxyauth_control
528 +#define ldap_create_sort_control moz_ldap_create_sort_control
529 +#define ldap_create_sort_keylist moz_ldap_create_sort_keylist
530 +#define ldap_create_userstatus_control moz_ldap_create_userstatus_control
531 +#define ldap_create_virtuallist_control moz_ldap_create_virtuallist_control
532 +#define ldap_delete moz_ldap_delete
533 +#define ldap_delete_ext moz_ldap_delete_ext
534 +#define ldap_delete_ext_s moz_ldap_delete_ext_s
535 +#define ldap_delete_result_entry moz_ldap_delete_result_entry
536 +#define ldap_delete_s moz_ldap_delete_s
537 +#define ldap_dn2ufn moz_ldap_dn2ufn
538 +#define ldap_entry2html moz_ldap_entry2html
539 +#define ldap_entry2html_search moz_ldap_entry2html_search
540 +#define ldap_entry2text moz_ldap_entry2text
541 +#define ldap_entry2text_search moz_ldap_entry2text_search
542 +#define ldap_err2string moz_ldap_err2string
543 +#define ldap_errlist moz_ldap_errlist
544 +#define ldap_explode moz_ldap_explode
545 +#define ldap_explode_dn moz_ldap_explode_dn
546 +#define ldap_explode_dns moz_ldap_explode_dns
547 +#define ldap_explode_rdn moz_ldap_explode_rdn
548 +#define ldap_extended_operation moz_ldap_extended_operation
549 +#define ldap_extended_operation_s moz_ldap_extended_operation_s
550 +#define ldap_find_control moz_ldap_find_control
551 +#define ldap_first_attribute moz_ldap_first_attribute
552 +#define ldap_first_disptmpl moz_ldap_first_disptmpl
553 +#define ldap_first_entry moz_ldap_first_entry
554 +#define ldap_first_message moz_ldap_first_message
555 +#define ldap_first_reference moz_ldap_first_reference
556 +#define ldap_first_searchobj moz_ldap_first_searchobj
557 +#define ldap_first_tmplcol moz_ldap_first_tmplcol
558 +#define ldap_first_tmplrow moz_ldap_first_tmplrow
559 +#define ldap_free_friendlymap moz_ldap_free_friendlymap
560 +#define ldap_free_searchprefs moz_ldap_free_searchprefs
561 +#define ldap_free_sort_keylist moz_ldap_free_sort_keylist
562 +#define ldap_free_templates moz_ldap_free_templates
563 +#define ldap_free_urldesc moz_ldap_free_urldesc
564 +#define ldap_friendly_name moz_ldap_friendly_name
565 +#define ldap_get_dn moz_ldap_get_dn
566 +#define ldap_get_entry_controls moz_ldap_get_entry_controls
567 +#define ldap_get_lang_values moz_ldap_get_lang_values
568 +#define ldap_get_lang_values_len moz_ldap_get_lang_values_len
569 +#define ldap_get_lderrno moz_ldap_get_lderrno
570 +#define ldap_get_option moz_ldap_get_option
571 +#define ldap_get_values moz_ldap_get_values
572 +#define ldap_get_values_len moz_ldap_get_values_len
573 +#define ldap_getfilter_free moz_ldap_getfilter_free
574 +#define ldap_getfirstfilter moz_ldap_getfirstfilter
575 +#define ldap_getnextfilter moz_ldap_getnextfilter
576 +#define ldap_init moz_ldap_init
577 +#define ldap_init_getfilter moz_ldap_init_getfilter
578 +#define ldap_init_getfilter_buf moz_ldap_init_getfilter_buf
579 +#define ldap_init_searchprefs moz_ldap_init_searchprefs
580 +#define ldap_init_searchprefs_buf moz_ldap_init_searchprefs_buf
581 +#define ldap_init_templates moz_ldap_init_templates
582 +#define ldap_init_templates_buf moz_ldap_init_templates_buf
583 +#define ldap_is_dns_dn moz_ldap_is_dns_dn
584 +#define ldap_is_ldap_url moz_ldap_is_ldap_url
585 +#define ldap_keysort_entries moz_ldap_keysort_entries
586 +#define ldap_ld_free moz_ldap_ld_free
587 +#define ldap_memcache_abandon moz_ldap_memcache_abandon
588 +#define ldap_memcache_append moz_ldap_memcache_append
589 +#define ldap_memcache_createkey moz_ldap_memcache_createkey
590 +#define ldap_memcache_destroy moz_ldap_memcache_destroy
591 +#define ldap_memcache_flush moz_ldap_memcache_flush
592 +#define ldap_memcache_flush_results moz_ldap_memcache_flush_results
593 +#define ldap_memcache_get moz_ldap_memcache_get
594 +#define ldap_memcache_init moz_ldap_memcache_init
595 +#define ldap_memcache_new moz_ldap_memcache_new
596 +#define ldap_memcache_result moz_ldap_memcache_result
597 +#define ldap_memcache_set moz_ldap_memcache_set
598 +#define ldap_memcache_update moz_ldap_memcache_update
599 +#define ldap_memfree moz_ldap_memfree
600 +#define ldap_modify moz_ldap_modify
601 +#define ldap_modify_ext moz_ldap_modify_ext
602 +#define ldap_modify_ext_s moz_ldap_modify_ext_s
603 +#define ldap_modify_s moz_ldap_modify_s
604 +#define ldap_modrdn moz_ldap_modrdn
605 +#define ldap_modrdn2 moz_ldap_modrdn2
606 +#define ldap_modrdn2_s moz_ldap_modrdn2_s
607 +#define ldap_modrdn_s moz_ldap_modrdn_s
608 +#define ldap_mods_free moz_ldap_mods_free
609 +#define ldap_msgdelete moz_ldap_msgdelete
610 +#define ldap_msgfree moz_ldap_msgfree
611 +#define ldap_msgid moz_ldap_msgid
612 +#define ldap_msgtype moz_ldap_msgtype
613 +#define ldap_multisort_entries moz_ldap_multisort_entries
614 +#define ldap_name2template moz_ldap_name2template
615 +#define ldap_next_attribute moz_ldap_next_attribute
616 +#define ldap_next_disptmpl moz_ldap_next_disptmpl
617 +#define ldap_next_entry moz_ldap_next_entry
618 +#define ldap_next_message moz_ldap_next_message
619 +#define ldap_next_reference moz_ldap_next_reference
620 +#define ldap_next_searchobj moz_ldap_next_searchobj
621 +#define ldap_next_tmplcol moz_ldap_next_tmplcol
622 +#define ldap_next_tmplrow moz_ldap_next_tmplrow
623 +#define ldap_oc2template moz_ldap_oc2template
624 +#define ldap_open moz_ldap_open
625 +#define ldap_parse_authzid_control moz_ldap_parse_authzid_control
626 +#define ldap_parse_entrychange_control moz_ldap_parse_entrychange_control
627 +#define ldap_parse_extended_result moz_ldap_parse_extended_result
628 +#define ldap_parse_passwd moz_ldap_parse_passwd
629 +#define ldap_parse_passwordpolicy_control moz_ldap_parse_passwordpolicy_control
630 +#define ldap_parse_passwordpolicy_control_ext moz_ldap_parse_passwordpolicy_control_ext
631 +#define ldap_parse_reference moz_ldap_parse_reference
632 +#define ldap_parse_result moz_ldap_parse_result
633 +#define ldap_parse_sasl_bind_result moz_ldap_parse_sasl_bind_result
634 +#define ldap_parse_sort_control moz_ldap_parse_sort_control
635 +#define ldap_parse_userstatus_control moz_ldap_parse_userstatus_control
636 +#define ldap_parse_virtuallist_control moz_ldap_parse_virtuallist_control
637 +#define ldap_parse_whoami moz_ldap_parse_whoami
638 +#define ldap_passwd moz_ldap_passwd
639 +#define ldap_passwd_s moz_ldap_passwd_s
640 +#define ldap_passwordpolicy_err2txt moz_ldap_passwordpolicy_err2txt
641 +#define ldap_perror moz_ldap_perror
642 +#define ldap_rename moz_ldap_rename
643 +#define ldap_rename_s moz_ldap_rename_s
644 +#define ldap_result moz_ldap_result
645 +#define ldap_result2error moz_ldap_result2error
646 +#define ldap_sasl_bind moz_ldap_sasl_bind
647 +#define ldap_sasl_bind_s moz_ldap_sasl_bind_s
648 +#define ldap_sasl_interactive_bind_ext_s moz_ldap_sasl_interactive_bind_ext_s
649 +#define ldap_sasl_interactive_bind_s moz_ldap_sasl_interactive_bind_s
650 +#define ldap_search moz_ldap_search
651 +#define ldap_search_ext moz_ldap_search_ext
652 +#define ldap_search_ext_s moz_ldap_search_ext_s
653 +#define ldap_search_s moz_ldap_search_s
654 +#define ldap_search_st moz_ldap_search_st
655 +#define ldap_set_filter_additions moz_ldap_set_filter_additions
656 +#define ldap_set_lderrno moz_ldap_set_lderrno
657 +#define ldap_set_option moz_ldap_set_option
658 +#define ldap_set_rebind_proc moz_ldap_set_rebind_proc
659 +#define ldap_setfilteraffixes moz_ldap_setfilteraffixes
660 +#define ldap_simple_bind moz_ldap_simple_bind
661 +#define ldap_simple_bind_s moz_ldap_simple_bind_s
662 +#define ldap_sort_entries moz_ldap_sort_entries
663 +#define ldap_sort_strcasecmp moz_ldap_sort_strcasecmp
664 +#define ldap_sort_values moz_ldap_sort_values
665 +#define ldap_start_tls_s moz_ldap_start_tls_s
666 +#define ldap_str2charray moz_ldap_str2charray
667 +#define ldap_tmplattrs moz_ldap_tmplattrs
668 +#define ldap_tmplerr2string moz_ldap_tmplerr2string
669 +#define ldap_tmplerrlist moz_ldap_tmplerrlist
670 +#define ldap_ufn_search_c moz_ldap_ufn_search_c
671 +#define ldap_ufn_search_ct moz_ldap_ufn_search_ct
672 +#define ldap_ufn_search_ctx moz_ldap_ufn_search_ctx
673 +#define ldap_ufn_search_s moz_ldap_ufn_search_s
674 +#define ldap_ufn_setfilter moz_ldap_ufn_setfilter
675 +#define ldap_ufn_setprefix moz_ldap_ufn_setprefix
676 +#define ldap_ufn_timeout moz_ldap_ufn_timeout
677 +#define ldap_unbind moz_ldap_unbind
678 +#define ldap_unbind_ext moz_ldap_unbind_ext
679 +#define ldap_unbind_s moz_ldap_unbind_s
680 +#define ldap_url_parse moz_ldap_url_parse
681 +#define ldap_url_parse_no_defaults moz_ldap_url_parse_no_defaults
682 +#define ldap_url_search moz_ldap_url_search
683 +#define ldap_url_search_s moz_ldap_url_search_s
684 +#define ldap_url_search_st moz_ldap_url_search_st
685 +#define ldap_utf8characters moz_ldap_utf8characters
686 +#define ldap_utf8copy moz_ldap_utf8copy
687 +#define ldap_utf8getcc moz_ldap_utf8getcc
688 +#define ldap_utf8isalnum moz_ldap_utf8isalnum
689 +#define ldap_utf8isalpha moz_ldap_utf8isalpha
690 +#define ldap_utf8isdigit moz_ldap_utf8isdigit
691 +#define ldap_utf8isspace moz_ldap_utf8isspace
692 +#define ldap_utf8isxdigit moz_ldap_utf8isxdigit
693 +#define ldap_utf8len moz_ldap_utf8len
694 +#define ldap_utf8next moz_ldap_utf8next
695 +#define ldap_utf8prev moz_ldap_utf8prev
696 +#define ldap_utf8strtok_r moz_ldap_utf8strtok_r
697 +#define ldap_vals2html moz_ldap_vals2html
698 +#define ldap_vals2text moz_ldap_vals2text
699 +#define ldap_value_free moz_ldap_value_free
700 +#define ldap_value_free_len moz_ldap_value_free_len
701 +#define ldap_version moz_ldap_version
702 +#define ldap_whoami moz_ldap_whoami
703 +#define ldap_whoami_s moz_ldap_whoami_s
704 +#define ldap_x_calloc moz_ldap_x_calloc
705 +#define ldap_x_free moz_ldap_x_free
706 +#define ldap_x_hostlist_first moz_ldap_x_hostlist_first
707 +#define ldap_x_hostlist_next moz_ldap_x_hostlist_next
708 +#define ldap_x_hostlist_statusfree moz_ldap_x_hostlist_statusfree
709 +#define ldap_x_malloc moz_ldap_x_malloc
710 +#define ldap_x_realloc moz_ldap_x_realloc
712 /* Standard LDAP API functions and declarations */
713 #include "ldap-standard.h"
717 [FILE:9904:patches/patch-bug847568]
718 # Allow building against system-wide graphite2/harfbuzz.
720 diff --git config/system-headers.mozbuild config/system-headers.mozbuild
721 index 7620b4d00623..09d3db5ca8c0 100644
722 --- config/system-headers.mozbuild
723 +++ config/system-headers.mozbuild
724 @@ -1299,6 +1299,19 @@ if CONFIG['MOZ_ENABLE_LIBPROXY']:
728 +if CONFIG['MOZ_SYSTEM_GRAPHITE2']:
729 + system_headers += [
730 + 'graphite2/Font.h',
731 + 'graphite2/Segment.h',
734 +if CONFIG['MOZ_SYSTEM_HARFBUZZ']:
735 + system_headers += [
736 + 'harfbuzz/hb-glib.h',
737 + 'harfbuzz/hb-ot.h',
741 if CONFIG['MOZ_SYSTEM_LIBVPX']:
744 diff --git dom/base/moz.build dom/base/moz.build
745 index 8e19020315ae..2fcdbb6f7b42 100644
746 --- dom/base/moz.build
747 +++ dom/base/moz.build
748 @@ -543,6 +543,9 @@ if CONFIG['MOZ_BUILD_APP'] in ['browser', 'mobile/android', 'xulrunner']:
749 if CONFIG['MOZ_X11']:
750 CXXFLAGS += CONFIG['TK_CFLAGS']
752 +if CONFIG['MOZ_SYSTEM_HARFBUZZ']:
753 + CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS']
755 GeneratedFile('UseCounterList.h', script='gen-usecounters.py',
756 entry_point='use_counter_list', inputs=['UseCounters.conf'])
758 diff --git gfx/graphite2/geckoextra/moz.build gfx/graphite2/geckoextra/moz.build
760 index 0000000000000..24e8d7a03274a
762 +++ gfx/graphite2/geckoextra/moz.build
764 +# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
765 +# vim: set filetype=python:
766 +# This Source Code Form is subject to the terms of the Mozilla Public
767 +# License, v. 2.0. If a copy of the MPL was not distributed with this
768 +# file, You can obtain one at http://mozilla.org/MPL/2.0/.
770 +EXPORTS.graphite2 += [
771 + 'include/GraphiteExtra.h',
772 + 'include/GraphiteStructsForRLBox.h',
775 +UNIFIED_SOURCES += [
776 + '../geckoextra/src/GraphiteExtra.cpp',
779 +CXXFLAGS += CONFIG['MOZ_GRAPHITE2_CFLAGS']
781 +# Match bundled graphite2 configuration
782 +AllowCompilerWarnings()
784 +FINAL_LIBRARY = 'gkmedias'
785 diff --git gfx/graphite2/moz-gr-update.sh gfx/graphite2/moz-gr-update.sh
786 index faaab1b17971..04eff5f09882 100644
787 --- gfx/graphite2/moz-gr-update.sh
788 +++ gfx/graphite2/moz-gr-update.sh
792 # Script used to update the Graphite2 library in the mozilla source tree
793 +# and bump version for --with-system-graphite2
795 # This script lives in gfx/graphite2, along with the library source,
796 # but must be run from the top level of the mozilla-central tree.
797 @@ -37,12 +38,16 @@ echo "See" $0 "for update procedure." >> gfx/graphite2/README.mozilla
798 #find gfx/graphite2/ -name "*.cpp" -exec perl -p -i -e "s/<cstdio>/<stdio.h>/;s/Windows.h/windows.h/;" {} \;
799 #find gfx/graphite2/ -name "*.h" -exec perl -p -i -e "s/<cstdio>/<stdio.h>/;s/Windows.h/windows.h/;" {} \;
801 +# chase version for --with-system-graphite2
802 +perl -p -i -e "s/[0-9]+\,[0-9]+\,[0-9]+/$RELEASE/ and tr/./,/ \
803 + if /GR2_VERSION_REQUIRE/" old-configure.in
805 # summarize what's been touched
806 echo Updated to $RELEASE.
807 echo Here is what changed in the gfx/graphite2 directory:
810 -hg stat gfx/graphite2
811 +hg stat old-configure.in gfx/graphite2
814 echo If gfx/graphite2/src/files.mk has changed, please make corresponding
815 diff --git gfx/harfbuzz/README-mozilla gfx/harfbuzz/README-mozilla
816 index 22c76a7df020..a01490bd49ee 100644
817 --- gfx/harfbuzz/README-mozilla
818 +++ gfx/harfbuzz/README-mozilla
819 @@ -15,3 +15,8 @@ from within the gfx/harfbuzz directory.
821 If the collection of source files changes, manual updates to moz.build may be
822 needed as we don't use the upstream makefiles.
824 +The in-tree copy may be omitted during build by --with-system-harfbuzz.
825 +Make sure to keep pkg-config version check within toolkit/moz.configure in sync
826 +with checkout version or increment latest tag by one if it's not based
827 +on upstream release.
828 diff --git gfx/moz.build gfx/moz.build
829 index 771f652e837a..3b358d84e384 100644
832 @@ -13,6 +13,14 @@ with Files('wr/**'):
833 if CONFIG['MOZ_TREE_CAIRO']:
836 +if CONFIG['MOZ_SYSTEM_GRAPHITE2']:
837 + DIRS += ['graphite2/geckoextra']
839 + DIRS += ['graphite2/src' ]
841 +if not CONFIG['MOZ_SYSTEM_HARFBUZZ']:
842 + DIRS += ['harfbuzz/src']
847 @@ -21,8 +29,6 @@ DIRS += [
856 diff --git gfx/skia/generate_mozbuild.py gfx/skia/generate_mozbuild.py
857 index e06ae3457a47..93faa61594a3 100755
858 --- gfx/skia/generate_mozbuild.py
859 +++ gfx/skia/generate_mozbuild.py
860 @@ -117,6 +117,9 @@ if CONFIG['CC_TYPE'] in ('clang', 'clang-cl'):
861 '-Wno-unused-private-field',
864 +if CONFIG['MOZ_SYSTEM_HARFBUZZ']:
865 + CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS']
867 if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk', 'android'):
868 CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS']
869 CXXFLAGS += CONFIG['CAIRO_FT_CFLAGS']
870 diff --git gfx/skia/moz.build gfx/skia/moz.build
871 index 2118677ca3a8..e4978b413784 100644
872 --- gfx/skia/moz.build
873 +++ gfx/skia/moz.build
874 @@ -493,6 +493,9 @@ if CONFIG['CC_TYPE'] in ('clang', 'clang-cl'):
875 '-Wno-unused-private-field',
878 +if CONFIG['MOZ_SYSTEM_HARFBUZZ']:
879 + CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS']
881 if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk', 'android'):
882 CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS']
883 CXXFLAGS += CONFIG['CAIRO_FT_CFLAGS']
884 diff --git gfx/thebes/moz.build gfx/thebes/moz.build
885 index 56f1b9fe3f4b..0ac1100b0df3 100644
886 --- gfx/thebes/moz.build
887 +++ gfx/thebes/moz.build
888 @@ -284,7 +284,13 @@ if CONFIG['MOZ_WAYLAND']:
890 LOCAL_INCLUDES += CONFIG['SKIA_INCLUDES']
892 -DEFINES['GRAPHITE2_STATIC'] = True
893 +if CONFIG['MOZ_SYSTEM_GRAPHITE2']:
894 + CXXFLAGS += CONFIG['MOZ_GRAPHITE2_CFLAGS']
896 + DEFINES['GRAPHITE2_STATIC'] = True
898 +if CONFIG['MOZ_SYSTEM_HARFBUZZ']:
899 + CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS']
901 if CONFIG['CC_TYPE'] == 'clang':
902 # Suppress warnings from Skia header files.
903 diff --git intl/unicharutil/util/moz.build intl/unicharutil/util/moz.build
904 index cb1233c56d7e..06fb1f9f174b 100644
905 --- intl/unicharutil/util/moz.build
906 +++ intl/unicharutil/util/moz.build
907 @@ -25,4 +25,7 @@ UNIFIED_SOURCES += [
908 'nsUnicodeProperties.cpp',
911 +if CONFIG['MOZ_SYSTEM_HARFBUZZ']:
912 + CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS']
914 FINAL_LIBRARY = 'xul'
915 diff --git netwerk/dns/moz.build netwerk/dns/moz.build
916 index 79c26e3e7001..c4d93bc5f7dc 100644
917 --- netwerk/dns/moz.build
918 +++ netwerk/dns/moz.build
919 @@ -86,3 +86,6 @@ USE_LIBS += ['icu']
921 if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
922 CXXFLAGS += ['-Wno-error=shadow']
924 +if CONFIG['MOZ_SYSTEM_HARFBUZZ']:
925 + CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS']
926 diff --git old-configure.in old-configure.in
927 index 95a58b634593..b614eef85c89 100644
930 @@ -2639,6 +2639,27 @@ dnl ========================================================
932 AC_SUBST(MOZ_LINUX_32_SSE2_STARTUP_ERROR)
934 +dnl ========================================================
935 +dnl Check for graphite2
936 +dnl ========================================================
937 +if test -n "$MOZ_SYSTEM_GRAPHITE2"; then
938 + dnl graphite2.pc has bogus version, check manually
939 + _SAVE_CFLAGS=$CFLAGS
940 + CFLAGS="$CFLAGS $MOZ_GRAPHITE2_CFLAGS"
941 + AC_TRY_COMPILE([ #include <graphite2/Font.h>
942 + #define GR2_VERSION_REQUIRE(major,minor,bugfix) \
943 + ( GR2_VERSION_MAJOR * 10000 + GR2_VERSION_MINOR \
944 + * 100 + GR2_VERSION_BUGFIX >= \
945 + (major) * 10000 + (minor) * 100 + (bugfix) )
947 + #if !GR2_VERSION_REQUIRE(1,3,14)
948 + #error "Insufficient graphite2 version."
951 + [AC_MSG_ERROR([--with-system-graphite2 requested but no working libgraphite2 found])])
952 + CFLAGS=$_SAVE_CFLAGS
955 dnl ========================================================
956 dnl Check for pixman and cairo
957 dnl ========================================================
958 diff --git toolkit/library/moz.build toolkit/library/moz.build
959 index 24f940e1ed7e..079a575adec3 100644
960 --- toolkit/library/moz.build
961 +++ toolkit/library/moz.build
962 @@ -248,6 +248,12 @@ if CONFIG['MOZ_SYSTEM_PNG']:
963 if CONFIG['MOZ_SYSTEM_WEBP']:
964 OS_LIBS += CONFIG['MOZ_WEBP_LIBS']
966 +if CONFIG['MOZ_SYSTEM_GRAPHITE2']:
967 + OS_LIBS += CONFIG['MOZ_GRAPHITE2_LIBS']
969 +if CONFIG['MOZ_SYSTEM_HARFBUZZ']:
970 + OS_LIBS += CONFIG['MOZ_HARFBUZZ_LIBS']
972 if CONFIG['MOZ_SYSTEM_LIBEVENT']:
973 OS_LIBS += CONFIG['MOZ_LIBEVENT_LIBS']
975 diff --git toolkit/moz.configure toolkit/moz.configure
976 index 9297e4d6f501..d8e273887e4b 100644
977 --- toolkit/moz.configure
978 +++ toolkit/moz.configure
979 @@ -937,6 +937,25 @@ add_old_configure_assignment('FT2_LIBS',
980 add_old_configure_assignment('FT2_CFLAGS',
984 +# ==============================================================
985 +option('--with-system-graphite2',
986 + help="Use system graphite2 (located with pkgconfig)")
988 +system_graphite2 = pkg_check_modules('MOZ_GRAPHITE2', 'graphite2',
989 + when='--with-system-graphite2')
991 +set_config('MOZ_SYSTEM_GRAPHITE2', depends_if(system_graphite2)(lambda _: True))
994 +# ==============================================================
995 +option('--with-system-harfbuzz',
996 + help="Use system harfbuzz (located with pkgconfig)")
998 +system_harfbuzz = pkg_check_modules('MOZ_HARFBUZZ', 'harfbuzz >= 2.6.6',
999 + when='--with-system-harfbuzz')
1001 +set_config('MOZ_SYSTEM_HARFBUZZ', depends_if(system_harfbuzz)(lambda _: True))
1003 # Remote agent (part of CDP based remote protocol)
1004 # ==============================================================
1007 [FILE:1292:patches/patch-comm_ldap_c-sdk_include_portable.h]
1008 --- comm/ldap/c-sdk/include/portable.h.orig 2020-05-21 20:31:05 UTC
1009 +++ comm/ldap/c-sdk/include/portable.h
1010 @@ -119,11 +119,15 @@
1011 # define OPENLOG_OPTIONS (LOG_PID | LOG_NOWAIT)
1014 +#ifdef __DragonFly__
1019 * some systems don't have the BSD re_comp and re_exec routines
1021 #ifndef NEED_BSDREGEX
1022 -# if (defined(SYSV) || defined(NETBSD) || defined(FREEBSD) || \
1023 +# if (defined(SYSV) || defined(NETBSD) || defined(FREEBSD) || defined(DRAGONFLY) || \
1024 defined(__OpenBSD__) || defined(linux) || defined(DARWIN)) && \
1026 # define NEED_BSDREGEX
1027 @@ -274,7 +278,7 @@ int strncasecmp(const char *, const char
1028 defined(SUNOS4) || defined(SNI) || defined(BSDI) || defined(NCR) || \
1029 defined(OSF1) || defined(NEC) || defined(VMS) || \
1030 (defined(HPUX10) && !defined(_REENTRANT)) || defined(HPUX11) || \
1031 - defined(UnixWare) || defined(NETBSD) || defined(FREEBSD) || \
1032 + defined(UnixWare) || defined(NETBSD) || defined(FREEBSD) || defined(DRAGONFLY) || \
1033 defined(OPENBSD) || (defined(LINUX) && __GLIBC__ < 2) || \
1034 (defined(AIX) && !defined(USE_REENTRANT_LIBC))
1035 # define GETHOSTBYNAME(n, r, b, l, e) gethostbyname(n)
1038 [FILE:421:patches/patch-comm_mail_app_nsMailApp.cpp]
1039 --- comm/mail/app/nsMailApp.cpp.orig 2020-07-13 18:10:03 UTC
1040 +++ comm/mail/app/nsMailApp.cpp
1041 @@ -306,6 +306,9 @@ int main(int argc, char* argv[], char* e
1045 + setenv("MOZ_GMP_PATH", "%%LOCALBASE%%/lib/browser_plugins/symlinks/gecko", 0);
1046 + setenv("MOZ_PLUGIN_PATH", "%%LOCALBASE%%/lib/browser_plugins/symlinks/gecko", 0);
1048 #ifdef HAS_DLL_BLOCKLIST
1049 DllBlocklist_Initialize(gBlocklistInitFlags);
1053 [FILE:679:patches/patch-comm_third__party_botan_configure.py]
1054 --- comm/third_party/botan/configure.py.orig 2020-07-13 18:10:04 UTC
1055 +++ comm/third_party/botan/configure.py
1056 @@ -2936,11 +2936,7 @@ def set_defaults_for_unset_options(optio
1057 options.os = find_canonical_os_name(options.os)
1059 def deduce_compiler_type_from_cc_bin(cc_bin):
1060 - if cc_bin.find('clang') != -1 or cc_bin in ['emcc', 'em++']:
1062 - if cc_bin.find('-g++') != -1 or cc_bin.find('g++') != -1:
1067 if options.compiler is None and options.compiler_binary is not None:
1068 options.compiler = deduce_compiler_type_from_cc_bin(options.compiler_binary)
1071 [FILE:286:patches/patch-comm_third__party_botan_src_build-data_os_freebsd.txt]
1072 FreeBSD 11.3 doesn't have sys/auxv.h
1074 --- comm/third_party/botan/src/build-data/os/freebsd.txt.orig 2020-09-08 23:21:51 UTC
1075 +++ comm/third_party/botan/src/build-data/os/freebsd.txt
1076 @@ -11,7 +11,6 @@ dev_random
1086 [FILE:33130:patches/patch-cubeb-oss]
1087 https://github.com/kinetiknz/cubeb/pull/600
1089 --- dom/media/CubebUtils.cpp.orig 2020-08-19 02:08:51 UTC
1090 +++ dom/media/CubebUtils.cpp
1091 @@ -126,7 +126,7 @@ const char kBrandBundleURL[] = "chrome://branding/locale/brand.properties";
1093 const char* AUDIOSTREAM_BACKEND_ID_STR[] = {
1094 "jack", "pulse", "alsa", "audiounit", "audioqueue", "wasapi",
1095 - "winmm", "directsound", "sndio", "opensl", "audiotrack", "kai"};
1096 + "winmm", "directsound", "sndio", "opensl", "oss", "audiotrack", "kai"};
1097 /* Index for failures to create an audio stream the first time. */
1098 const int CUBEB_BACKEND_INIT_FAILURE_FIRST =
1099 ArrayLength(AUDIOSTREAM_BACKEND_ID_STR);
1100 --- media/libcubeb/src/moz.build.orig 2020-08-19 02:09:19 UTC
1101 +++ media/libcubeb/src/moz.build
1102 @@ -40,6 +40,12 @@ if CONFIG['MOZ_JACK']:
1104 DEFINES['USE_JACK'] = True
1106 +if CONFIG['OS_ARCH'] in ('DragonFly', 'FreeBSD', 'SunOS'):
1110 + DEFINES['USE_OSS'] = True
1112 if CONFIG['OS_ARCH'] == 'OpenBSD':
1115 --- media/libcubeb/src/cubeb.c.orig 2020-08-19 02:09:26 UTC
1116 +++ media/libcubeb/src/cubeb.c
1117 @@ -60,6 +60,9 @@ int sun_init(cubeb ** context, char const * context_name);
1118 #if defined(USE_OPENSL)
1119 int opensl_init(cubeb ** context, char const * context_name);
1121 +#if defined(USE_OSS)
1122 +int oss_init(cubeb ** context, char const * context_name);
1124 #if defined(USE_AUDIOTRACK)
1125 int audiotrack_init(cubeb ** context, char const * context_name);
1127 @@ -165,6 +168,10 @@ cubeb_init(cubeb ** context, char const * context_name, char const * backend_nam
1128 #if defined(USE_OPENSL)
1129 init_oneshot = opensl_init;
1131 + } else if (!strcmp(backend_name, "oss")) {
1132 +#if defined(USE_OSS)
1133 + init_oneshot = oss_init;
1135 } else if (!strcmp(backend_name, "audiotrack")) {
1136 #if defined(USE_AUDIOTRACK)
1137 init_oneshot = audiotrack_init;
1138 @@ -200,6 +207,9 @@ cubeb_init(cubeb ** context, char const * context_name, char const * backend_nam
1139 #if defined(USE_ALSA)
1142 +#if defined (USE_OSS)
1145 #if defined(USE_AUDIOUNIT_RUST)
1146 audiounit_rust_init,
1149 +++ media/libcubeb/src/cubeb_oss.c
1152 + * Copyright © 2019-2020 Nia Alarie <nia@NetBSD.org>
1153 + * Copyright © 2020 Ka Ho Ng <khng300@gmail.com>
1155 + * This program is made available under an ISC-style license. See the
1156 + * accompanying file LICENSE for details.
1159 +#if defined(__FreeBSD__) && __FreeBSD__ < 12
1160 +#define _WITH_GETLINE
1162 +#include <assert.h>
1165 +#include <sys/types.h>
1166 +#include <sys/soundcard.h>
1167 +#include <sys/ioctl.h>
1169 +#include <unistd.h>
1170 +#include <pthread.h>
1171 +#include <stdbool.h>
1172 +#include <stdlib.h>
1174 +#include <string.h>
1176 +#include "cubeb/cubeb.h"
1177 +#include "cubeb_mixer.h"
1178 +#include "cubeb_strings.h"
1179 +#include "cubeb-internal.h"
1181 +/* Supported well by most hardware. */
1182 +#ifndef OSS_PREFER_RATE
1183 +#define OSS_PREFER_RATE (48000)
1186 +/* Standard acceptable minimum. */
1187 +#ifndef OSS_LATENCY_MS
1188 +#define OSS_LATENCY_MS (40)
1191 +#ifndef OSS_DEFAULT_DEVICE
1192 +#define OSS_DEFAULT_DEVICE "/dev/dsp"
1195 +#ifndef OSS_DEFAULT_MIXER
1196 +#define OSS_DEFAULT_MIXER "/dev/mixer"
1199 +#ifndef OSS_DEFAULT_NFRAMES
1200 +#define OSS_DEFAULT_NFRAMES (32)
1203 +#define ENV_AUDIO_DEVICE "AUDIO_DEVICE"
1205 +#ifndef OSS_MAX_CHANNELS
1206 +# if defined(__FreeBSD__) || defined(__DragonFly__)
1208 + * The current maximum number of channels supported
1209 + * on FreeBSD is 8.
1211 + * Reference: FreeBSD 12.1-RELEASE
1213 +# define OSS_MAX_CHANNELS (8)
1214 +# elif defined(__sun__)
1216 + * The current maximum number of channels supported
1217 + * on Illumos is 16.
1219 + * Reference: PSARC 2008/318
1221 +# define OSS_MAX_CHANNELS (16)
1223 +# define OSS_MAX_CHANNELS (2)
1227 +#if defined(__FreeBSD__) || defined(__DragonFly__)
1228 +#define SNDSTAT_BEGIN_STR "Installed devices:"
1229 +#define SNDSTAT_USER_BEGIN_STR "Installed devices from userspace:"
1230 +#define SNDSTAT_FV_BEGIN_STR "File Versions:"
1233 +static struct cubeb_ops const oss_ops;
1236 + struct cubeb_ops const * ops;
1238 + /* Our intern string store */
1239 + pthread_mutex_t mutex; /* protects devid_strs */
1240 + cubeb_strings *devid_strs;
1243 +struct oss_stream {
1244 + oss_devnode_t name;
1248 + struct stream_info {
1255 + unsigned int frame_size; /* precision in bytes * channels */
1259 +struct cubeb_stream {
1260 + struct cubeb * context;
1263 + pthread_mutex_t mutex; /* protects running, volume, frames_written */
1266 + struct oss_stream play;
1267 + struct oss_stream record;
1268 + cubeb_data_callback data_cb;
1269 + cubeb_state_callback state_cb;
1270 + uint64_t frames_written;
1271 + unsigned int nfr; /* Number of frames allocated */
1274 +static char const *
1275 +oss_cubeb_devid_intern(cubeb *context, char const * devid)
1278 + pthread_mutex_lock(&context->mutex);
1279 + is = cubeb_strings_intern(context->devid_strs, devid);
1280 + pthread_mutex_unlock(&context->mutex);
1285 +oss_init(cubeb **context, char const *context_name) {
1288 + (void)context_name;
1289 + if ((c = calloc(1, sizeof(cubeb))) == NULL) {
1290 + return CUBEB_ERROR;
1293 + if (cubeb_strings_init(&c->devid_strs) == CUBEB_ERROR) {
1297 + if (pthread_mutex_init(&c->mutex, NULL) != 0) {
1301 + c->ops = &oss_ops;
1306 + cubeb_strings_destroy(c->devid_strs);
1308 + return CUBEB_ERROR;
1312 +oss_destroy(cubeb * context)
1314 + pthread_mutex_destroy(&context->mutex);
1315 + cubeb_strings_destroy(context->devid_strs);
1319 +static char const *
1320 +oss_get_backend_id(cubeb * context)
1326 +oss_get_preferred_sample_rate(cubeb * context, uint32_t * rate)
1330 + *rate = OSS_PREFER_RATE;
1335 +oss_get_max_channel_count(cubeb * context, uint32_t * max_channels)
1339 + *max_channels = OSS_MAX_CHANNELS;
1344 +oss_get_min_latency(cubeb * context, cubeb_stream_params params,
1345 + uint32_t * latency_frames)
1349 + *latency_frames = OSS_LATENCY_MS * params.rate / 1000;
1354 +oss_free_cubeb_device_info_strings(cubeb_device_info *cdi)
1356 + free((char *)cdi->device_id);
1357 + free((char *)cdi->friendly_name);
1358 + free((char *)cdi->group_id);
1359 + cdi->device_id = NULL;
1360 + cdi->friendly_name = NULL;
1361 + cdi->group_id = NULL;
1364 +#if defined(__FreeBSD__) || defined(__DragonFly__)
1366 + * Check if the specified DSP is okay for the purpose specified
1367 + * in type. Here type can only specify one operation each time
1368 + * this helper is called.
1370 + * Return 0 if OK, otherwise 1.
1373 +oss_probe_open(const char *dsppath, cubeb_device_type type,
1374 + int *fdp, oss_audioinfo *resai)
1378 + int oflags = (type == CUBEB_DEVICE_TYPE_INPUT) ? O_RDONLY : O_WRONLY;
1379 + int dspfd = open(dsppath, oflags);
1384 + error = ioctl(dspfd, SNDCTL_AUDIOINFO, &ai);
1399 +struct sndstat_info {
1400 + oss_devnode_t devname;
1402 + cubeb_device_type type;
1407 +oss_sndstat_line_parse(char *line, int is_ud, struct sndstat_info *sinfo)
1409 + char *matchptr = line, *n = NULL;
1410 + struct sndstat_info res;
1412 + memset(&res, 0, sizeof(res));
1414 + n = strchr(matchptr, ':');
1418 + unsigned int devunit;
1420 + if (sscanf(matchptr, "pcm%u: ", &devunit) < 1)
1423 + if (snprintf(res.devname, sizeof(res.devname), "/dev/dsp%u", devunit) < 1)
1426 + if (n - matchptr >= (ssize_t)(sizeof(res.devname) - strlen("/dev/")))
1429 + strlcpy(res.devname, "/dev/", sizeof(res.devname));
1430 + strncat(res.devname, matchptr, n - matchptr);
1434 + n = strchr(matchptr, '<');
1438 + n = strrchr(matchptr, '>');
1442 + res.desc = matchptr;
1445 + n = strchr(matchptr, '(');
1449 + n = strrchr(matchptr, ')');
1453 + if (!isdigit(matchptr[0])) {
1454 + if (strstr(matchptr, "play") != NULL)
1455 + res.type |= CUBEB_DEVICE_TYPE_OUTPUT;
1456 + if (strstr(matchptr, "rec") != NULL)
1457 + res.type |= CUBEB_DEVICE_TYPE_INPUT;
1460 + if (sscanf(matchptr, "%dp:%*dv/%dr:%*dv", &p, &r) != 2)
1463 + res.type |= CUBEB_DEVICE_TYPE_OUTPUT;
1465 + res.type |= CUBEB_DEVICE_TYPE_INPUT;
1468 + if (strstr(matchptr, "default") != NULL)
1469 + res.preferred = 1;
1479 + * XXX: On FreeBSD we have to rely on SNDCTL_CARDINFO to get all
1480 + * the usable audio devices currently, as SNDCTL_AUDIOINFO will
1481 + * never return directly usable audio device nodes.
1484 +oss_enumerate_devices(cubeb * context, cubeb_device_type type,
1485 + cubeb_device_collection * collection)
1487 + cubeb_device_info *devinfop = NULL;
1488 + char *line = NULL;
1489 + size_t linecap = 0;
1490 + FILE *sndstatfp = NULL;
1491 + int collection_cnt = 0;
1495 + devinfop = calloc(1, sizeof(cubeb_device_info));
1496 + if (devinfop == NULL)
1499 + sndstatfp = fopen("/dev/sndstat", "r");
1500 + if (sndstatfp == NULL)
1502 + while (getline(&line, &linecap, sndstatfp) > 0) {
1503 + const char *devid = NULL;
1504 + struct sndstat_info sinfo;
1507 + if (!strncmp(line, SNDSTAT_FV_BEGIN_STR, strlen(SNDSTAT_FV_BEGIN_STR))) {
1511 + if (!strncmp(line, SNDSTAT_BEGIN_STR, strlen(SNDSTAT_BEGIN_STR))) {
1516 + if (!strncmp(line, SNDSTAT_USER_BEGIN_STR, strlen(SNDSTAT_USER_BEGIN_STR))) {
1521 + if (skipall || isblank(line[0]))
1524 + if (oss_sndstat_line_parse(line, is_ud, &sinfo))
1527 + devinfop[collection_cnt].type = 0;
1528 + switch (sinfo.type) {
1529 + case CUBEB_DEVICE_TYPE_INPUT:
1530 + if (type & CUBEB_DEVICE_TYPE_OUTPUT)
1533 + case CUBEB_DEVICE_TYPE_OUTPUT:
1534 + if (type & CUBEB_DEVICE_TYPE_INPUT)
1541 + if (oss_probe_open(sinfo.devname, type, NULL, &ai))
1544 + devid = oss_cubeb_devid_intern(context, sinfo.devname);
1545 + if (devid == NULL)
1548 + devinfop[collection_cnt].device_id = strdup(sinfo.devname);
1549 + asprintf((char **)&devinfop[collection_cnt].friendly_name, "%s: %s",
1550 + sinfo.devname, sinfo.desc);
1551 + devinfop[collection_cnt].group_id = strdup(sinfo.devname);
1552 + devinfop[collection_cnt].vendor_name = NULL;
1553 + if (devinfop[collection_cnt].device_id == NULL ||
1554 + devinfop[collection_cnt].friendly_name == NULL ||
1555 + devinfop[collection_cnt].group_id == NULL) {
1556 + oss_free_cubeb_device_info_strings(&devinfop[collection_cnt]);
1560 + devinfop[collection_cnt].type = type;
1561 + devinfop[collection_cnt].devid = devid;
1562 + devinfop[collection_cnt].state = CUBEB_DEVICE_STATE_ENABLED;
1563 + devinfop[collection_cnt].preferred =
1564 + (sinfo.preferred) ? CUBEB_DEVICE_PREF_ALL : CUBEB_DEVICE_PREF_NONE;
1565 + devinfop[collection_cnt].format = CUBEB_DEVICE_FMT_S16NE;
1566 + devinfop[collection_cnt].default_format = CUBEB_DEVICE_FMT_S16NE;
1567 + devinfop[collection_cnt].max_channels = ai.max_channels;
1568 + devinfop[collection_cnt].default_rate = OSS_PREFER_RATE;
1569 + devinfop[collection_cnt].max_rate = ai.max_rate;
1570 + devinfop[collection_cnt].min_rate = ai.min_rate;
1571 + devinfop[collection_cnt].latency_lo = 0;
1572 + devinfop[collection_cnt].latency_hi = 0;
1576 + void *newp = reallocarray(devinfop, collection_cnt + 1,
1577 + sizeof(cubeb_device_info));
1584 + fclose(sndstatfp);
1586 + collection->count = collection_cnt;
1587 + collection->device = devinfop;
1594 + fclose(sndstatfp);
1596 + return CUBEB_ERROR;
1602 +oss_enumerate_devices(cubeb * context, cubeb_device_type type,
1603 + cubeb_device_collection * collection)
1607 + cubeb_device_info *devinfop = NULL;
1608 + int collection_cnt = 0;
1609 + int mixer_fd = -1;
1611 + mixer_fd = open(OSS_DEFAULT_MIXER, O_RDWR);
1612 + if (mixer_fd == -1) {
1613 + LOG("Failed to open mixer %s. errno: %d", OSS_DEFAULT_MIXER, errno);
1614 + return CUBEB_ERROR;
1617 + error = ioctl(mixer_fd, SNDCTL_SYSINFO, &si);
1619 + LOG("Failed to run SNDCTL_SYSINFO on mixer %s. errno: %d", OSS_DEFAULT_MIXER, errno);
1623 + devinfop = calloc(si.numaudios, sizeof(cubeb_device_info));
1624 + if (devinfop == NULL)
1627 + collection->count = 0;
1628 + for (i = 0; i < si.numaudios; i++) {
1630 + cubeb_device_info cdi = { 0 };
1631 + const char *devid = NULL;
1634 + error = ioctl(mixer_fd, SNDCTL_AUDIOINFO, &ai);
1638 + assert(ai.dev < si.numaudios);
1643 + switch (ai.caps & DSP_CAP_DUPLEX) {
1644 + case DSP_CAP_INPUT:
1645 + if (type & CUBEB_DEVICE_TYPE_OUTPUT)
1648 + case DSP_CAP_OUTPUT:
1649 + if (type & CUBEB_DEVICE_TYPE_INPUT)
1657 + devid = oss_cubeb_devid_intern(context, ai.devnode);
1658 + cdi.device_id = strdup(ai.name);
1659 + cdi.friendly_name = strdup(ai.name);
1660 + cdi.group_id = strdup(ai.name);
1661 + if (devid == NULL || cdi.device_id == NULL || cdi.friendly_name == NULL ||
1662 + cdi.group_id == NULL) {
1663 + oss_free_cubeb_device_info_strings(&cdi);
1667 + cdi.devid = devid;
1668 + cdi.vendor_name = NULL;
1669 + cdi.state = CUBEB_DEVICE_STATE_ENABLED;
1670 + cdi.preferred = CUBEB_DEVICE_PREF_NONE;
1671 + cdi.format = CUBEB_DEVICE_FMT_S16NE;
1672 + cdi.default_format = CUBEB_DEVICE_FMT_S16NE;
1673 + cdi.max_channels = ai.max_channels;
1674 + cdi.default_rate = OSS_PREFER_RATE;
1675 + cdi.max_rate = ai.max_rate;
1676 + cdi.min_rate = ai.min_rate;
1677 + cdi.latency_lo = 0;
1678 + cdi.latency_hi = 0;
1680 + devinfop[collection_cnt++] = cdi;
1683 + collection->count = collection_cnt;
1684 + collection->device = devinfop;
1686 + if (mixer_fd != -1)
1691 + if (mixer_fd != -1)
1694 + return CUBEB_ERROR;
1700 +oss_device_collection_destroy(cubeb * context,
1701 + cubeb_device_collection * collection)
1704 + for (i = 0; i < collection->count; i++) {
1705 + oss_free_cubeb_device_info_strings(&collection->device[i]);
1707 + free(collection->device);
1708 + collection->device = NULL;
1709 + collection->count = 0;
1713 +static unsigned int
1714 +oss_chn_from_cubeb(cubeb_channel chn)
1717 + case CHANNEL_FRONT_LEFT:
1719 + case CHANNEL_FRONT_RIGHT:
1721 + case CHANNEL_FRONT_CENTER:
1723 + case CHANNEL_LOW_FREQUENCY:
1725 + case CHANNEL_BACK_LEFT:
1727 + case CHANNEL_BACK_RIGHT:
1729 + case CHANNEL_SIDE_LEFT:
1731 + case CHANNEL_SIDE_RIGHT:
1734 + return CHID_UNDEF;
1738 +static unsigned long long
1739 +oss_cubeb_layout_to_chnorder(cubeb_channel_layout layout)
1741 + unsigned int i, nchns = 0;
1742 + unsigned long long chnorder = 0;
1744 + for (i = 0; layout; i++, layout >>= 1) {
1745 + unsigned long long chid = oss_chn_from_cubeb((layout & 1) << i);
1746 + if (chid == CHID_UNDEF)
1749 + chnorder |= (chid & 0xf) << nchns * 4;
1757 +oss_copy_params(int fd, cubeb_stream * stream, cubeb_stream_params * params,
1758 + struct stream_info * sinfo)
1760 + unsigned long long chnorder;
1762 + sinfo->channels = params->channels;
1763 + sinfo->sample_rate = params->rate;
1764 + switch (params->format) {
1765 + case CUBEB_SAMPLE_S16LE:
1766 + sinfo->fmt = AFMT_S16_LE;
1767 + sinfo->precision = 16;
1769 + case CUBEB_SAMPLE_S16BE:
1770 + sinfo->fmt = AFMT_S16_BE;
1771 + sinfo->precision = 16;
1773 + case CUBEB_SAMPLE_FLOAT32NE:
1774 + sinfo->fmt = AFMT_S32_NE;
1775 + sinfo->precision = 32;
1778 + LOG("Unsupported format");
1779 + return CUBEB_ERROR_INVALID_FORMAT;
1781 + if (ioctl(fd, SNDCTL_DSP_CHANNELS, &sinfo->channels) == -1) {
1782 + return CUBEB_ERROR;
1784 + if (ioctl(fd, SNDCTL_DSP_SETFMT, &sinfo->fmt) == -1) {
1785 + return CUBEB_ERROR;
1787 + if (ioctl(fd, SNDCTL_DSP_SPEED, &sinfo->sample_rate) == -1) {
1788 + return CUBEB_ERROR;
1790 + /* Mono layout is an exception */
1791 + if (params->layout != CUBEB_LAYOUT_UNDEFINED && params->layout != CUBEB_LAYOUT_MONO) {
1792 + chnorder = oss_cubeb_layout_to_chnorder(params->layout);
1793 + if (ioctl(fd, SNDCTL_DSP_SET_CHNORDER, &chnorder) == -1)
1794 + LOG("Non-fatal error %d occured when setting channel order.", errno);
1800 +oss_stream_stop(cubeb_stream * s)
1802 + pthread_mutex_lock(&s->mutex);
1804 + s->running = false;
1805 + pthread_mutex_unlock(&s->mutex);
1806 + pthread_join(s->thread, NULL);
1808 + pthread_mutex_unlock(&s->mutex);
1814 +oss_stream_destroy(cubeb_stream * s)
1816 + oss_stream_stop(s);
1817 + pthread_mutex_destroy(&s->mutex);
1818 + if (s->play.fd != -1) {
1819 + close(s->play.fd);
1821 + if (s->record.fd != -1) {
1822 + close(s->record.fd);
1824 + free(s->play.buf);
1825 + free(s->record.buf);
1830 +oss_float_to_linear32(void * buf, unsigned sample_count, float vol)
1833 + int32_t * out = buf;
1834 + int32_t * tail = out + sample_count;
1836 + while (out < tail) {
1837 + int64_t f = *(in++) * vol * 0x80000000LL;
1838 + if (f < -INT32_MAX)
1840 + else if (f > INT32_MAX)
1847 +oss_linear32_to_float(void * buf, unsigned sample_count)
1849 + int32_t * in = buf;
1850 + float * out = buf;
1851 + float * tail = out + sample_count;
1853 + while (out < tail) {
1854 + *(out++) = (1.0 / 0x80000000LL) * *(in++);
1859 +oss_linear16_set_vol(int16_t * buf, unsigned sample_count, float vol)
1862 + int32_t multiplier = vol * 0x8000;
1864 + for (i = 0; i < sample_count; ++i) {
1865 + buf[i] = (buf[i] * multiplier) >> 15;
1870 +oss_io_routine(void * arg)
1872 + cubeb_stream *s = arg;
1873 + cubeb_state state = CUBEB_STATE_STARTED;
1874 + size_t to_read = 0;
1875 + size_t to_write = 0;
1877 + size_t write_ofs = 0;
1878 + size_t read_ofs = 0;
1882 + s->state_cb(s, s->user_ptr, CUBEB_STATE_STARTED);
1884 + if (s->record.fd != -1) {
1885 + if (ioctl(s->record.fd, SNDCTL_DSP_SETTRIGGER, &trig)) {
1886 + LOG("Error %d occured when setting trigger on record fd", errno);
1887 + state = CUBEB_STATE_ERROR;
1892 + while (state == CUBEB_STATE_STARTED) {
1893 + pthread_mutex_lock(&s->mutex);
1894 + if (!s->running) {
1895 + pthread_mutex_unlock(&s->mutex);
1896 + state = CUBEB_STATE_STOPPED;
1899 + pthread_mutex_unlock(&s->mutex);
1900 + if (s->play.fd == -1 && s->record.fd == -1) {
1902 + * Stop here if the stream is not play & record stream,
1903 + * play-only stream or record-only stream
1906 + state = CUBEB_STATE_STOPPED;
1909 + if (s->record.fd != -1 && s->record.floating) {
1910 + oss_linear32_to_float(s->record.buf,
1911 + s->record.info.channels * s->nfr);
1913 + cb_nfr = s->data_cb(s, s->user_ptr, s->record.buf, s->play.buf, s->nfr);
1914 + if (cb_nfr == CUBEB_ERROR) {
1915 + state = CUBEB_STATE_ERROR;
1918 + if (s->play.fd != -1) {
1921 + pthread_mutex_lock(&s->mutex);
1923 + pthread_mutex_unlock(&s->mutex);
1925 + if (s->play.floating) {
1926 + oss_float_to_linear32(s->play.buf,
1927 + s->play.info.channels * cb_nfr, vol);
1929 + oss_linear16_set_vol(s->play.buf,
1930 + s->play.info.channels * cb_nfr, vol);
1933 + if (cb_nfr < (long)s->nfr) {
1934 + if (s->play.fd != -1) {
1938 + * This is a record-only stream and number of frames
1939 + * returned from data_cb() is smaller than number
1940 + * of frames required to read. Stop here.
1943 + state = CUBEB_STATE_STOPPED;
1948 + if (s->record.fd != -1 && !trig) {
1949 + trig |= PCM_ENABLE_INPUT;
1950 + if (ioctl(s->record.fd, SNDCTL_DSP_SETTRIGGER, &trig)) {
1951 + LOG("Error %d occured when setting trigger on record fd", errno);
1952 + state = CUBEB_STATE_ERROR;
1957 + to_write = s->play.fd != -1 ? cb_nfr : 0;
1958 + to_read = s->record.fd != -1 ? s->nfr : 0;
1961 + while (to_write > 0 || to_read > 0) {
1963 + ssize_t n, frames;
1964 + struct pollfd pfds[2];
1966 + pfds[0].fd = s->play.fd;
1967 + pfds[0].events = POLLOUT;
1968 + pfds[0].revents = 0;
1969 + pfds[1].fd = s->record.fd;
1970 + pfds[1].events = POLLIN;
1971 + pfds[1].revents = 0;
1973 + if (to_write > 0 && to_read > 0) {
1976 + nfds = poll(pfds, 2, 10000);
1978 + if (errno == EINTR)
1980 + LOG("Error %d occured when polling playback and record fd", errno);
1981 + state = CUBEB_STATE_ERROR;
1983 + } else if (nfds == 0)
1986 + if ((pfds[0].revents & (POLLERR|POLLHUP)) ||
1987 + (pfds[1].revents & (POLLERR|POLLHUP))) {
1988 + LOG("Error %d occured on playback or record fds", errno);
1989 + state = CUBEB_STATE_ERROR;
1992 + } else if (to_write > 0) {
1993 + pfds[0].revents = POLLOUT;
1995 + pfds[1].revents = POLLIN;
1998 + if (to_write > 0 && pfds[0].revents) {
1999 + bytes = to_write * s->play.frame_size;
2000 + if ((n = write(s->play.fd, (uint8_t *)s->play.buf + write_ofs, bytes)) < 0) {
2001 + state = CUBEB_STATE_ERROR;
2004 + frames = n / s->play.frame_size;
2005 + pthread_mutex_lock(&s->mutex);
2006 + s->frames_written += frames;
2007 + pthread_mutex_unlock(&s->mutex);
2008 + to_write -= frames;
2011 + if (to_read > 0 && pfds[1].revents) {
2012 + bytes = to_read * s->record.frame_size;
2013 + if ((n = read(s->record.fd, (uint8_t *)s->record.buf + read_ofs, bytes)) < 0) {
2014 + state = CUBEB_STATE_ERROR;
2017 + frames = n / s->record.frame_size;
2018 + to_read -= frames;
2022 + if (drain && state != CUBEB_STATE_ERROR) {
2023 + state = CUBEB_STATE_DRAINED;
2028 + if (s->record.fd != -1)
2029 + ioctl(s->record.fd, SNDCTL_DSP_HALT_INPUT, NULL);
2030 + s->state_cb(s, s->user_ptr, state);
2035 +oss_calc_frag_params(unsigned int frames, unsigned int frame_size)
2038 + int blksize = OSS_DEFAULT_NFRAMES * frame_size;
2039 + int nblks = (frames * frame_size + blksize - 1) / blksize;
2040 + while ((1 << n) < blksize)
2042 + return nblks << 16 | n;
2046 +oss_stream_init(cubeb * context,
2047 + cubeb_stream ** stream,
2048 + char const * stream_name,
2049 + cubeb_devid input_device,
2050 + cubeb_stream_params * input_stream_params,
2051 + cubeb_devid output_device,
2052 + cubeb_stream_params * output_stream_params,
2053 + unsigned latency_frames,
2054 + cubeb_data_callback data_callback,
2055 + cubeb_state_callback state_callback,
2058 + int ret = CUBEB_OK;
2059 + unsigned int playnfr = 1;
2060 + unsigned int recnfr = 1;
2061 + cubeb_stream *s = NULL;
2062 + const char *defdsp;
2064 + if (!(defdsp = getenv(ENV_AUDIO_DEVICE)) || *defdsp == '\0')
2065 + defdsp = OSS_DEFAULT_DEVICE;
2067 + (void)stream_name;
2068 + if ((s = calloc(1, sizeof(cubeb_stream))) == NULL) {
2069 + ret = CUBEB_ERROR;
2072 + s->record.fd = -1;
2074 + s->nfr = OSS_DEFAULT_NFRAMES;
2075 + if (input_device != NULL) {
2076 + strlcpy(s->record.name, input_device, sizeof(s->record.name));
2078 + strlcpy(s->record.name, defdsp, sizeof(s->record.name));
2080 + if (output_device != NULL) {
2081 + strlcpy(s->play.name, output_device, sizeof(s->play.name));
2083 + strlcpy(s->play.name, defdsp, sizeof(s->play.name));
2085 + if (input_stream_params != NULL) {
2086 + unsigned int nb_channels;
2087 + if (input_stream_params->prefs & CUBEB_STREAM_PREF_LOOPBACK) {
2088 + LOG("Loopback not supported");
2089 + ret = CUBEB_ERROR_NOT_SUPPORTED;
2092 + nb_channels = cubeb_channel_layout_nb_channels(input_stream_params->layout);
2093 + if (input_stream_params->layout != CUBEB_LAYOUT_UNDEFINED &&
2094 + nb_channels != input_stream_params->channels) {
2095 + LOG("input_stream_params->layout does not match input_stream_params->channels");
2096 + ret = CUBEB_ERROR_INVALID_PARAMETER;
2099 + if (s->record.fd == -1) {
2100 + if ((s->record.fd = open(s->record.name, O_RDONLY)) == -1) {
2101 + LOG("Audio device \"%s\" could not be opened as read-only",
2103 + ret = CUBEB_ERROR_DEVICE_UNAVAILABLE;
2107 + if ((ret = oss_copy_params(s->record.fd, s, input_stream_params,
2108 + &s->record.info)) != CUBEB_OK) {
2109 + LOG("Setting record params failed");
2112 + s->record.floating = (input_stream_params->format == CUBEB_SAMPLE_FLOAT32NE);
2114 + if (output_stream_params != NULL) {
2115 + unsigned int nb_channels;
2116 + if (output_stream_params->prefs & CUBEB_STREAM_PREF_LOOPBACK) {
2117 + LOG("Loopback not supported");
2118 + ret = CUBEB_ERROR_NOT_SUPPORTED;
2121 + nb_channels = cubeb_channel_layout_nb_channels(output_stream_params->layout);
2122 + if (output_stream_params->layout != CUBEB_LAYOUT_UNDEFINED &&
2123 + nb_channels != output_stream_params->channels) {
2124 + LOG("output_stream_params->layout does not match output_stream_params->channels");
2125 + ret = CUBEB_ERROR_INVALID_PARAMETER;
2128 + if (s->play.fd == -1) {
2129 + if ((s->play.fd = open(s->play.name, O_WRONLY)) == -1) {
2130 + LOG("Audio device \"%s\" could not be opened as write-only",
2132 + ret = CUBEB_ERROR_DEVICE_UNAVAILABLE;
2136 + if ((ret = oss_copy_params(s->play.fd, s, output_stream_params,
2137 + &s->play.info)) != CUBEB_OK) {
2138 + LOG("Setting play params failed");
2141 + s->play.floating = (output_stream_params->format == CUBEB_SAMPLE_FLOAT32NE);
2143 + s->context = context;
2145 + s->state_cb = state_callback;
2146 + s->data_cb = data_callback;
2147 + s->user_ptr = user_ptr;
2148 + if (pthread_mutex_init(&s->mutex, NULL) != 0) {
2149 + LOG("Failed to create mutex");
2152 + s->play.frame_size = s->play.info.channels *
2153 + (s->play.info.precision / 8);
2154 + if (s->play.fd != -1) {
2155 + audio_buf_info bi;
2156 + int frag = oss_calc_frag_params(latency_frames, s->play.frame_size);
2157 + if (ioctl(s->play.fd, SNDCTL_DSP_SETFRAGMENT, &frag))
2158 + LOG("Failed to set play fd with SNDCTL_DSP_SETFRAGMENT. frag: 0x%x", frag);
2159 + if (ioctl(s->play.fd, SNDCTL_DSP_GETOSPACE, &bi) == 0) {
2160 + unsigned int nfr = bi.fragsize / s->play.frame_size;
2161 + if (playnfr < nfr) {
2166 + s->record.frame_size = s->record.info.channels *
2167 + (s->record.info.precision / 8);
2168 + if (s->record.fd != -1) {
2169 + audio_buf_info bi;
2170 + int frag = oss_calc_frag_params(latency_frames, s->record.frame_size);
2171 + if (ioctl(s->record.fd, SNDCTL_DSP_SETFRAGMENT, &frag))
2172 + LOG("Failed to set record fd with SNDCTL_DSP_SETFRAGMENT. frag: 0x%x",
2174 + if (ioctl(s->record.fd, SNDCTL_DSP_GETISPACE, &bi) == 0) {
2175 + unsigned int nfr = bi.fragsize / s->record.frame_size;
2176 + if (recnfr < nfr) {
2181 + if (s->play.fd != -1 && s->record.fd != -1)
2182 + s->nfr = (playnfr < recnfr) ? playnfr : recnfr;
2183 + else if (s->play.fd != -1)
2185 + else if (s->record.fd != -1)
2188 + if (s->play.fd != -1) {
2189 + if ((s->play.buf = calloc(s->nfr, s->play.frame_size)) == NULL) {
2190 + ret = CUBEB_ERROR;
2194 + if (s->record.fd != -1) {
2195 + if ((s->record.buf = calloc(s->nfr, s->record.frame_size)) == NULL) {
2196 + ret = CUBEB_ERROR;
2205 + oss_stream_destroy(s);
2211 +oss_stream_start(cubeb_stream * s)
2213 + s->running = true;
2214 + if (pthread_create(&s->thread, NULL, oss_io_routine, s) != 0) {
2215 + LOG("Couldn't create thread");
2216 + return CUBEB_ERROR;
2222 +oss_stream_get_position(cubeb_stream * s, uint64_t * position)
2224 + pthread_mutex_lock(&s->mutex);
2225 + *position = s->frames_written;
2226 + pthread_mutex_unlock(&s->mutex);
2231 +oss_stream_get_latency(cubeb_stream * s, uint32_t * latency)
2235 + if (ioctl(s->play.fd, SNDCTL_DSP_GETODELAY, &delay) == -1) {
2236 + return CUBEB_ERROR;
2239 + /* Return number of frames there */
2240 + *latency = delay / s->play.frame_size;
2245 +oss_stream_set_volume(cubeb_stream * stream, float volume)
2249 + else if (volume > 1.0)
2251 + pthread_mutex_lock(&stream->mutex);
2252 + stream->volume = volume;
2253 + pthread_mutex_unlock(&stream->mutex);
2258 +oss_get_current_device(cubeb_stream * stream, cubeb_device ** const device)
2260 + *device = calloc(1, sizeof(cubeb_device));
2261 + if (*device == NULL) {
2262 + return CUBEB_ERROR;
2264 + (*device)->input_name = stream->record.fd != -1 ?
2265 + strdup(stream->record.name) : NULL;
2266 + (*device)->output_name = stream->play.fd != -1 ?
2267 + strdup(stream->play.name) : NULL;
2272 +oss_stream_device_destroy(cubeb_stream * stream, cubeb_device * device)
2275 + free(device->input_name);
2276 + free(device->output_name);
2281 +static struct cubeb_ops const oss_ops = {
2283 + .get_backend_id = oss_get_backend_id,
2284 + .get_max_channel_count = oss_get_max_channel_count,
2285 + .get_min_latency = oss_get_min_latency,
2286 + .get_preferred_sample_rate = oss_get_preferred_sample_rate,
2287 + .enumerate_devices = oss_enumerate_devices,
2288 + .device_collection_destroy = oss_device_collection_destroy,
2289 + .destroy = oss_destroy,
2290 + .stream_init = oss_stream_init,
2291 + .stream_destroy = oss_stream_destroy,
2292 + .stream_start = oss_stream_start,
2293 + .stream_stop = oss_stream_stop,
2294 + .stream_reset_default_device = NULL,
2295 + .stream_get_position = oss_stream_get_position,
2296 + .stream_get_latency = oss_stream_get_latency,
2297 + .stream_get_input_latency = NULL,
2298 + .stream_set_volume = oss_stream_set_volume,
2299 + .stream_get_current_device = oss_get_current_device,
2300 + .stream_device_destroy = oss_stream_device_destroy,
2301 + .stream_register_device_changed_callback = NULL,
2302 + .register_device_collection_changed = NULL};
2305 [FILE:886:patches/patch-env-api-keys]
2306 # Accept API keys from environment like before bug 1294585
2308 --- build/moz.configure/keyfiles.configure
2309 +++ build/moz.configure/keyfiles.configure
2310 @@ -18,6 +18,7 @@ def keyfile(desc, help=None, callback=lambda x: x):
2311 @checking('for the %s key' % desc, lambda x: x and x is not no_key)
2312 @imports(_from='__builtin__', _import='open')
2313 @imports(_from='__builtin__', _import='IOError')
2314 + @imports(_from='os', _import='environ')
2318 @@ -28,7 +29,7 @@ def keyfile(desc, help=None, callback=lambda x: x):
2319 raise FatalCheckError("'%s' is empty." % value[0])
2320 except IOError as e:
2321 raise FatalCheckError("'%s': %s." % (value[0], e.strerror))
2323 + return environ.get('MOZ_%s_KEY' % desc.upper().replace(' ', '_')) or no_key
2329 [FILE:2142:patches/patch-freebsd11.3]
2330 Drop after FreeBSD 11.3 EOL around 2020-09-20.
2331 https://svnweb.freebsd.org/changeset/base/351766
2333 mozglue/baseprofiler/core/shared-libraries-linux.cc:374:34: error: use of undeclared
2334 identifier 'NT_GNU_BUILD_ID'
2335 if (note_header->n_type == NT_GNU_BUILD_ID) break;
2337 In file included from Unified_cpp_mozglue_baseprofiler0.cpp:137:
2338 mozglue/baseprofiler/lul/LulElf.cpp:762:32: error: use of undeclared identifier
2340 if (note_header->n_type == NT_GNU_BUILD_ID) break;
2342 In file included from Unified_cpp_tools_profiler1.cpp:38:
2343 tools/profiler/lul/LulElf.cpp:776:32: error: use of undeclared identifier
2345 if (note_header->n_type == NT_GNU_BUILD_ID) break;
2348 --- mozglue/baseprofiler/core/shared-libraries-linux.cc.orig 2020-06-25 17:04:48 UTC
2349 +++ mozglue/baseprofiler/core/shared-libraries-linux.cc
2350 @@ -50,6 +50,11 @@ extern "C" MOZ_EXPORT __attribute__((weak)) int dl_ite
2351 # define ElfW(type) Elf_##type
2354 +#if defined(GP_OS_freebsd) && !defined(NT_GNU_BUILD_ID)
2355 +// FreeBSD < 11.4 doesn't define NT_GNU_BUILD_ID
2356 +# define NT_GNU_BUILD_ID 3
2359 // ----------------------------------------------------------------------------
2360 // Starting imports from toolkit/crashreporter/google-breakpad/, as needed by
2361 // this file when moved to mozglue.
2362 --- mozglue/baseprofiler/lul/LulElf.cpp.orig 2020-06-25 17:04:48 UTC
2363 +++ mozglue/baseprofiler/lul/LulElf.cpp
2365 # define EM_AARCH64 183
2368 +#if defined(GP_OS_freebsd) && !defined(NT_GNU_BUILD_ID)
2369 +// FreeBSD < 11.4 doesn't define NT_GNU_BUILD_ID
2370 +# define NT_GNU_BUILD_ID 3
2373 // This namespace contains helper functions.
2376 --- tools/profiler/lul/LulElf.cpp.orig 2020-06-25 17:05:05 UTC
2377 +++ tools/profiler/lul/LulElf.cpp
2379 # define EM_AARCH64 183
2382 +#if defined(GP_OS_freebsd) && !defined(NT_GNU_BUILD_ID)
2383 +// FreeBSD < 11.4 doesn't define NT_GNU_BUILD_ID
2384 +# define NT_GNU_BUILD_ID 3
2387 // This namespace contains helper functions.
2392 [FILE:890:patches/patch-gfx_skia_skia_src_core_SkCpu.cpp]
2393 Regressed by https://svnweb.freebsd.org/changeset/base/324815
2395 gfx/skia/skia/src/core/SkCpu.cpp:81:27: error: use of undeclared identifier 'getauxval'
2396 uint32_t hwcaps = getauxval(AT_HWCAP);
2399 --- gfx/skia/skia/src/core/SkCpu.cpp.orig 2020-07-13 18:06:57 UTC
2400 +++ gfx/skia/skia/src/core/SkCpu.cpp
2405 +#elif defined(SK_CPU_ARM64) && defined(__FreeBSD__)
2406 + #include <machine/armreg.h>
2408 + static uint32_t read_cpu_features() {
2409 + uint32_t features = 0;
2410 + uint64_t id_aa64isar0;
2412 + id_aa64isar0 = READ_SPECIALREG(ID_AA64ISAR0_EL1);
2413 + if (ID_AA64ISAR0_CRC32(id_aa64isar0) == ID_AA64ISAR0_CRC32_BASE) {
2414 + features |= SkCpu::CRC32;
2419 #elif defined(SK_CPU_ARM64) && __has_include(<sys/auxv.h>)
2420 #include <sys/auxv.h>
2424 [FILE:290:files/thunderbird.desktop]
2428 GenericName=Mail Client
2429 Comment=Mail client and News Reader
2431 Icon=thunderbird.png
2435 Categories=Network;Email;News;InstantMessaging;
2436 MimeType=application/mbox;message/rfc822;