1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
7 SDESC[standard]= Mozilla web browser
8 HOMEPAGE= https://www.mozilla.org/en-US/firefox/
9 CONTACT= Leonid_Bobrov[mazocomp@disroot.org]
12 SITES[main]= MOZILLA/firefox/releases/68.0.1/source
13 DISTFILE[1]= firefox-68.0.1.source.tar.xz:main
15 SPKGS[standard]= single
17 OPTIONS_AVAILABLE= none
18 OPTIONS_STANDARD= none
20 BUILD_DEPENDS= autoconf213:single:standard
22 cbindgen:single:standard
23 nodejs:primary:standard
24 python-sqlite3:single:py27
29 clang:compiler:standard
30 BUILDRUN_DEPENDS= bzip2:shared:standard
31 dbus-glib:primary:standard
32 ffmpeg:primary:standard
33 harfbuzz:primary:standard
35 libcanberra:primary:standard
36 libevent:single:standard
37 libffi:single:standard
38 libnotify:primary:standard
39 libproxy:single:standard
41 sqlite:single:standard
42 startup-notification:single:standard
44 USES= cpe desktop-utils:single gmake jpeg perl:build
45 pkgconfig png python:py27 zlib
46 GNOME_COMPONENTS= gconf gdkpixbuf gtk2 gtk3
47 XORG_COMPONENTS= pixman xcb
50 LICENSE_TERMS= single:{{WRKSRC}}/toolkit/content/license.html
51 LICENSE_FILE= MPL:stock
55 FPC_EQUIVALENT= www/firefox
58 CONFIGURE_OUTSOURCE= yes
60 QMAKE_ARGS= --enable-application=browser
61 --enable-chrome-format=omni
62 --enable-default-toolkit=cairo-gtk3
64 --enable-install-strip
65 --enable-official-branding
68 --enable-startup-notification
72 --enable-system-pixman
73 --enable-system-sqlite
76 --disable-debug-symbols
88 --with-system-graphite2
89 --with-system-harfbuzz
91 --with-system-jpeg="{{LOCALBASE}}"
92 --with-system-libevent
95 --with-system-png="{{LOCALBASE}}"
97 VAR_OPSYS[freebsd]= CONFIGURE_ARGS=--enable-jemalloc
98 VAR_OPSYS[linux]= QMAKE_ARGS=--disable-elf-hack
101 ${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|g' \
102 ${WRKSRC}/browser/app/nsBrowserApp.cpp
103 ${REINPLACE_CMD} -e 's/%u/%U/' -e '/X-MultipleArgs/d' \
104 -e '/^Icon/s/=.*/=firefox/' \
105 ${WRKSRC}/taskcluster/docker/firefox-snap/firefox.desktop
106 (cd ${WRKSRC}/gfx/angle/checkout/src/compiler/translator && \
107 ${REINPLACE_CMD} -e 's|<math.h>|<cmath>|' \
108 InfoSink.h IntermNode.cpp)
110 ${REINPLACE_CMD} -e 's|MOZ_SCTP|MOZ_DISABLE_SCTP|' \
111 ${WRKSRC}/netwerk/moz.build
112 # Set mozilla options
113 @${ECHO_CMD} "--=> Setting configuration <=--"
114 @for arg in ${QMAKE_ARGS}; do \
115 ${ECHO_CMD} ".mozconfig << $$arg" ;\
116 ${ECHO_CMD} ac_add_options $$arg >> ${WRKSRC}/.mozconfig ;\
118 @${ECHO_CMD} LDFLAGS=\"-Wl,-rpath,${PREFIX}/lib/firefox\" \
119 >> ${WRKSRC}/.mozconfig
122 @${MKDIR} ${STAGEDIR}${PREFIX}/share/pixmaps \
123 ${STAGEDIR}${PREFIX}/share/applications
124 ${INSTALL_DATA} ${WRKSRC}/taskcluster/docker/firefox-snap/firefox.desktop \
125 ${STAGEDIR}${PREFIX}/share/applications/
126 ${LN} -sf ${PREFIX}/lib/firefox/browser/chrome/icons/default/default48.png \
127 ${STAGEDIR}${PREFIX}/share/pixmaps/firefox.png
130 (cd ${WRKSRC} && ${LOCALBASE}/bin/autoconf-2.13)
131 (cd ${WRKSRC}/js/src/ && ${LOCALBASE}/bin/autoconf-2.13)
133 [FILE:527:descriptions/desc.single]
134 Firefox is a full-featured standard-compliant web browser, built on the
135 Mozilla codebase by thousands of contributors around the world.
136 It is extensible through thousands of user-contributed extensions, and
139 * Improved Tabbed Browsing, with tab grouping;
142 * Search Suggestions;
149 * Phishing Protection;
151 * Search Engine Manager.
155 6037f77bdab29d79ca5e3fbd1d32f6c209e09d2066189a13dc7f7491227f5568 311390092 firefox-68.0.1.source.tar.xz
158 [FILE:1029:manifests/plist.single]
159 %%ONLY-LINUX%%lib/firefox/
165 %%ONLY-LINUX%%lib/firefox/browser/crashreporter-override.ini
166 %%ONLY-LINUX%%lib/firefox/fonts/TwemojiMozilla.ttf
188 lib/firefox/browser/chrome/icons/default/
194 lib/firefox/browser/features/
195 formautofill@mozilla.org.xpi
196 fxmonitor@mozilla.org.xpi
197 screenshots@mozilla.org.xpi
198 webcompat-reporter@mozilla.org.xpi
199 webcompat@mozilla.org.xpi
200 lib/firefox/defaults/pref/channel-prefs.js
201 lib/firefox/gmp-clearkey/0.1/
204 lib/firefox/gtk2/libmozgtk.so
205 share/applications/firefox.desktop
206 share/pixmaps/firefox.png
209 [FILE:4614:patches/patch-addon-search]
210 https://github.com/mozilla/addons/issues/708
211 https://github.com/mozilla/addons-frontend/issues/4610
213 diff --git browser/app/profile/firefox.js browser/app/profile/firefox.js
214 index 75c2c5e435e35..4d8c09c02759b 100644
215 --- browser/app/profile/firefox.js.orig 2019-05-17 00:33:14 UTC
216 +++ browser/app/profile/firefox.js
217 @@ -40,8 +40,8 @@ pref("extensions.webextOptionalPermissio
218 pref("extensions.getAddons.cache.enabled", true);
219 pref("extensions.getAddons.get.url", "https://services.addons.mozilla.org/api/v3/addons/search/?guid=%IDS%&lang=%LOCALE%");
220 pref("extensions.getAddons.compatOverides.url", "https://services.addons.mozilla.org/api/v3/addons/compat-override/?guid=%IDS%&lang=%LOCALE%");
221 -pref("extensions.getAddons.search.browseURL", "https://addons.mozilla.org/%LOCALE%/firefox/search?q=%TERMS%&platform=%OS%&appver=%VERSION%");
222 -pref("extensions.webservice.discoverURL", "https://discovery.addons.mozilla.org/%LOCALE%/firefox/discovery/pane/%VERSION%/%OS%/%COMPATIBILITY_MODE%");
223 +pref("extensions.getAddons.search.browseURL", "https://addons.mozilla.org/%LOCALE%/firefox/search?q=%TERMS%&platform=Linux&appver=%VERSION%");
224 +pref("extensions.webservice.discoverURL", "https://discovery.addons.mozilla.org/%LOCALE%/firefox/discovery/pane/%VERSION%/Linux/%COMPATIBILITY_MODE%");
225 pref("extensions.getAddons.link.url", "https://addons.mozilla.org/%LOCALE%/firefox/");
226 pref("extensions.getAddons.langpacks.url", "https://services.addons.mozilla.org/api/v3/addons/language-tools/?app=firefox&type=language&appversion=%VERSION%");
228 @@ -175,8 +175,8 @@ pref("app.update.service.enabled", true)
231 pref("extensions.update.enabled", true);
232 -pref("extensions.update.url", "https://versioncheck.addons.mozilla.org/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%");
233 -pref("extensions.update.background.url", "https://versioncheck-bg.addons.mozilla.org/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%");
234 +pref("extensions.update.url", "https://versioncheck.addons.mozilla.org/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%");
235 +pref("extensions.update.background.url", "https://versioncheck-bg.addons.mozilla.org/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%");
236 pref("extensions.update.interval", 86400); // Check for updates to Extensions and
239 --- toolkit/mozapps/extensions/internal/AddonRepository.jsm.orig 2019-05-17 00:35:08 UTC
240 +++ toolkit/mozapps/extensions/internal/AddonRepository.jsm
241 @@ -610,7 +610,7 @@ var AddonRepository = {
242 addon.version = String(aEntry.current_version.version);
243 if (Array.isArray(aEntry.current_version.files)) {
244 for (let file of aEntry.current_version.files) {
245 - if (file.platform == "all" || file.platform == PLATFORM) {
246 + if (file.platform == "all" || file.platform == "linux" || file.platform == PLATFORM) {
248 addon.sourceURI = NetUtil.newURI(file.url);
250 --- toolkit/mozapps/extensions/internal/XPIDatabase.jsm.orig 2019-05-17 00:35:08 UTC
251 +++ toolkit/mozapps/extensions/internal/XPIDatabase.jsm
252 @@ -400,7 +400,7 @@ class AddonInternal {
253 // Something is causing errors in here
255 for (let platform of this.targetPlatforms) {
256 - if (platform.os == Services.appinfo.OS) {
257 + if (platform.os == "Linux" || platform.os == Services.appinfo.OS) {
260 if (platform.abi === abi)
263 [FILE:423:patches/patch-browser-app-nsBrowserApp.cpp]
264 --- browser/app/nsBrowserApp.cpp.orig 2019-05-17 00:33:14 UTC
265 +++ browser/app/nsBrowserApp.cpp
266 @@ -275,6 +275,9 @@ int main(int argc, char* argv[], char* e
270 + setenv("MOZ_GMP_PATH", "%%LOCALBASE%%/lib/browser_plugins/symlinks/gecko", 0);
271 + setenv("MOZ_PLUGIN_PATH", "%%LOCALBASE%%/lib/browser_plugins/symlinks/gecko", 0);
273 #ifdef HAS_DLL_BLOCKLIST
274 DllBlocklist_Initialize(gBlocklistInitFlags);
278 [FILE:2829:patches/patch-bug1288587]
279 diff --git a/build/moz.configure/init.configure b/build/moz.configure/init.configure
280 index 855214a..1e91d51 100644
281 --- build/moz.configure/init.configure
282 +++ build/moz.configure/init.configure
283 @@ -165,16 +165,17 @@ option(env='PYTHON', nargs=1, help='Python interpreter')
284 # ==============================================================
285 @depends('PYTHON', check_build_environment, mozconfig, '--help')
288 @imports('subprocess')
289 @imports(_from='mozbuild.configure.util', _import='LineIO')
290 @imports(_from='mozbuild.virtualenv', _import='VirtualenvManager')
291 @imports(_from='mozbuild.virtualenv', _import='verify_python_version')
292 +@imports(_from='__builtin__', _import='KeyError')
293 @imports('distutils.sysconfig')
294 def virtualenv_python(env_python, build_env, mozconfig, help):
298 python = env_python[0] if env_python else None
300 # Ideally we'd rely on the mozconfig injection from mozconfig_options,
301 @@ -184,16 +185,22 @@ def virtualenv_python(env_python, build_env, mozconfig, help):
302 if 'PYTHON' in mozconfig['env']['added']:
303 python = mozconfig['env']['added']['PYTHON']
304 elif 'PYTHON' in mozconfig['env']['modified']:
305 python = mozconfig['env']['modified']['PYTHON'][1]
306 elif 'PYTHON' in mozconfig['vars']['added']:
307 python = mozconfig['vars']['added']['PYTHON']
308 elif 'PYTHON' in mozconfig['vars']['modified']:
309 python = mozconfig['vars']['modified']['PYTHON'][1]
310 + for i in ('env', 'vars'):
311 + for j in ('added', 'modified'):
313 + del mozconfig[i][j]['PYTHON']
317 with LineIO(lambda l: log.error(l)) as out:
318 verify_python_version(out)
319 topsrcdir, topobjdir = build_env.topsrcdir, build_env.topobjdir
320 if topobjdir.endswith('/js/src'):
321 topobjdir = topobjdir[:-7]
323 with LineIO(lambda l: log.info(l)) as out:
324 @@ -255,17 +262,20 @@ def virtualenv_python(env_python, build_env, mozconfig
325 log.info('Creating Python environment')
326 manager.build(python)
328 python = normsep(manager.python_path)
330 if not normsep(sys.executable).startswith(normsep(virtualenvs_root)):
331 log.info('Reexecuting in the virtualenv')
333 - del os.environ['PYTHON']
335 + del os.environ['PYTHON']
338 # One would prefer to use os.execl, but that's completely borked on
340 sys.exit(subprocess.call([python] + sys.argv))
342 # We are now in the virtualenv
343 if not distutils.sysconfig.get_python_lib():
344 die('Could not determine python site packages directory')
348 [FILE:1253:patches/patch-bug1507655]
349 Revert bug 1497976 as close_fds on Python 2 is too slow
351 diff --git build/moz.configure/util.configure build/moz.configure/util.configure
352 index 25862fee7c32..3fc725a5124e 100644
353 --- build/moz.configure/util.configure
354 +++ build/moz.configure/util.configure
357 # A wrapper to obtain a process' output and return code.
358 # Returns a tuple (retcode, stdout, stderr).
360 @imports(_from='__builtin__', _import='unicode')
361 @imports('subprocess')
362 @imports(_from='mozbuild.shellutil', _import='quote')
365 log.debug('Executing: `%s`', quote(*args))
366 proc = subprocess.Popen(args, stdout=subprocess.PIPE,
367 - stderr=subprocess.PIPE,
368 - # On Python 2 on Windows, close_fds prevents the
369 - # process from inheriting stdout/stderr.
370 - # Elsewhere, it simply prevents it from inheriting
371 - # extra file descriptors, which is what we want.
372 - close_fds=os.name != 'nt',
374 + stderr=subprocess.PIPE, **kwargs)
375 stdout, stderr = proc.communicate()
376 return proc.wait(), stdout, stderr
380 [FILE:3590:patches/patch-bug1559213]
382 Author: Jory A. Pratt <anarchy@gentoo.org>
383 Date: Thu Jun 13 11:53:00 2019 -0700
385 Bug 1559213 - Allow to use system av1 libs instead of bundled.
387 config/external/moz.build | 5 +++--
388 config/system-headers.mozbuild | 8 ++++++++
389 dom/media/platforms/moz.build | 5 +++++
390 toolkit/moz.configure | 19 ++++++++++++++++++-
391 4 files changed, 34 insertions(+), 3 deletions(-)
393 diff --git config/external/moz.build config/external/moz.build
394 index 03e4fa143bd1..a67d10b11fe6 100644
395 --- config/external/moz.build
396 +++ config/external/moz.build
397 @@ -37,8 +37,9 @@ if not CONFIG['MOZ_SYSTEM_LIBVPX']:
398 external_dirs += ['media/libvpx']
400 if CONFIG['MOZ_AV1']:
401 - external_dirs += ['media/libaom']
402 - external_dirs += ['media/libdav1d']
403 + if not CONFIG['MOZ_SYSTEM_AV1']:
404 + external_dirs += ['media/libaom']
405 + external_dirs += ['media/libdav1d']
407 if not CONFIG['MOZ_SYSTEM_PNG']:
408 external_dirs += ['media/libpng']
409 diff --git config/system-headers.mozbuild config/system-headers.mozbuild
410 index bcf5c4925564..48964a999a9b 100644
411 --- config/system-headers.mozbuild
412 +++ config/system-headers.mozbuild
413 @@ -1304,6 +1304,14 @@ if CONFIG['MOZ_ENABLE_CONTENTMANAGER']:
414 'SelectSingleContentItemPage.h',
417 +if CONFIG['MOZ_SYSTEM_AV1']:
418 + system_headers += [
419 + 'aom/aom_decoder.h',
425 if CONFIG['MOZ_SYSTEM_LIBVPX']:
428 diff --git dom/media/platforms/moz.build dom/media/platforms/moz.build
429 index 092cee0c9b66..38e45de5b5f0 100644
430 --- dom/media/platforms/moz.build
431 +++ dom/media/platforms/moz.build
432 @@ -80,6 +80,11 @@ if CONFIG['MOZ_AV1']:
433 'agnostic/AOMDecoder.cpp',
434 'agnostic/DAV1DDecoder.cpp',
436 + if CONFIG['MOZ_SYSTEM_AV1']:
437 + CXXFLAGS += CONFIG['MOZ_SYSTEM_LIBAOM_CFLAGS']
438 + OS_LIBS += CONFIG['MOZ_SYSTEM_LIBAOM_LIBS']
439 + CXXFLAGS += CONFIG['MOZ_SYSTEM_LIBDAV1D_CFLAGS']
440 + OS_LIBS += CONFIG['MOZ_SYSTEM_LIBDAV1D_LIBS']
442 if CONFIG['MOZ_OMX']:
444 diff --git toolkit/moz.configure toolkit/moz.configure
445 index 82b5a59acf42..e2329560b42b 100644
446 --- toolkit/moz.configure
447 +++ toolkit/moz.configure
448 @@ -441,7 +441,23 @@ def av1(value):
452 -@depends(target, nasm_version, when=av1 & compile_environment)
453 +option('--with-system-av1',
454 + help="Use system av1 (located with pkgconfig)")
456 +system_libaom_info = pkg_check_modules('MOZ_SYSTEM_LIBAOM', 'aom >= 1.0.0',
457 + when='--with-system-av1')
459 +system_libdav1d_info = pkg_check_modules('MOZ_SYSTEM_LIBDAV1D', 'dav1d >= 0.1.1',
460 + when='--with-system-av1')
462 +@depends(system_libaom_info, system_libdav1d_info)
463 +def system_av1(system_libaom_info, system_libdav1d_info):
464 + has_av1_libs = False
465 + if system_libaom_info and system_libdav1d_info:
466 + has_av1_libs = True
467 + return has_av1_libs
469 +@depends(target, nasm_version, when=av1 & depends(system_av1)(lambda v: not v) & compile_environment)
470 def dav1d_asm(target, nasm_version):
471 if target.os != 'Android':
472 if target.cpu == 'aarch64':
473 @@ -457,6 +473,7 @@ set_config('MOZ_DAV1D_ASM', dav1d_asm)
474 set_define('MOZ_DAV1D_ASM', dav1d_asm)
475 set_config('MOZ_AV1', av1)
476 set_define('MOZ_AV1', av1)
477 +set_config('MOZ_SYSTEM_AV1', depends_if(system_av1)(lambda _: True))
479 # Built-in fragmented MP4 support.
480 # ==============================================================
483 [FILE:9009:patches/patch-bug847568]
484 # Allow building against system-wide graphite2/harfbuzz.
486 diff --git config/system-headers.mozbuild config/system-headers.mozbuild
487 index 7620b4d00623..09d3db5ca8c0 100644
488 --- config/system-headers.mozbuild
489 +++ config/system-headers.mozbuild
490 @@ -1300,6 +1300,19 @@ if CONFIG['MOZ_ENABLE_CONTENTMANAGER']:
491 'SelectSingleContentItemPage.h',
494 +if CONFIG['MOZ_SYSTEM_GRAPHITE2']:
495 + system_headers += [
496 + 'graphite2/Font.h',
497 + 'graphite2/Segment.h',
500 +if CONFIG['MOZ_SYSTEM_HARFBUZZ']:
501 + system_headers += [
502 + 'harfbuzz/hb-glib.h',
503 + 'harfbuzz/hb-ot.h',
507 if CONFIG['MOZ_SYSTEM_LIBVPX']:
510 diff --git dom/base/moz.build dom/base/moz.build
511 index 8e19020315ae..2fcdbb6f7b42 100644
512 --- dom/base/moz.build
513 +++ dom/base/moz.build
514 @@ -495,6 +495,9 @@ if CONFIG['MOZ_BUILD_APP'] in ['browser', 'mobile/android', 'xulrunner']:
515 if CONFIG['MOZ_X11']:
516 CXXFLAGS += CONFIG['TK_CFLAGS']
518 +if CONFIG['MOZ_SYSTEM_HARFBUZZ']:
519 + CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS']
522 'PropertyUseCounterMap.inc',
524 diff --git gfx/graphite2/moz-gr-update.sh gfx/graphite2/moz-gr-update.sh
525 index faaab1b17971..04eff5f09882 100644
526 --- gfx/graphite2/moz-gr-update.sh
527 +++ gfx/graphite2/moz-gr-update.sh
531 # Script used to update the Graphite2 library in the mozilla source tree
532 +# and bump version for --with-system-graphite2
534 # This script lives in gfx/graphite2, along with the library source,
535 # but must be run from the top level of the mozilla-central tree.
536 @@ -37,12 +38,16 @@ echo "See" $0 "for update procedure." >> gfx/graphite2/README.mozilla
537 #find gfx/graphite2/ -name "*.cpp" -exec perl -p -i -e "s/<cstdio>/<stdio.h>/;s/Windows.h/windows.h/;" {} \;
538 #find gfx/graphite2/ -name "*.h" -exec perl -p -i -e "s/<cstdio>/<stdio.h>/;s/Windows.h/windows.h/;" {} \;
540 +# chase version for --with-system-graphite2
541 +perl -p -i -e "s/[0-9]+\,[0-9]+\,[0-9]+/$RELEASE/ and tr/./,/ \
542 + if /GR2_VERSION_REQUIRE/" old-configure.in
544 # summarize what's been touched
545 echo Updated to $RELEASE.
546 echo Here is what changed in the gfx/graphite2 directory:
549 -hg stat gfx/graphite2
550 +hg stat old-configure.in gfx/graphite2
553 echo If gfx/graphite2/src/files.mk has changed, please make corresponding
554 diff --git gfx/harfbuzz/README-mozilla gfx/harfbuzz/README-mozilla
555 index 22c76a7df020..a01490bd49ee 100644
556 --- gfx/harfbuzz/README-mozilla
557 +++ gfx/harfbuzz/README-mozilla
558 @@ -15,3 +15,8 @@ from within the gfx/harfbuzz directory.
560 If the collection of source files changes, manual updates to moz.build may be
561 needed as we don't use the upstream makefiles.
563 +The in-tree copy may be omitted during build by --with-system-harfbuzz.
564 +Make sure to keep pkg-config version check within toolkit/moz.configure in sync
565 +with checkout version or increment latest tag by one if it's not based
566 +on upstream release.
567 diff --git gfx/moz.build gfx/moz.build
568 index 771f652e837a..3b358d84e384 100644
571 @@ -10,6 +10,12 @@ with Files('**'):
572 if CONFIG['MOZ_TREE_CAIRO']:
575 +if not CONFIG['MOZ_SYSTEM_GRAPHITE2']:
576 + DIRS += ['graphite2/src' ]
578 +if not CONFIG['MOZ_SYSTEM_HARFBUZZ']:
579 + DIRS += ['harfbuzz/src']
584 @@ -18,8 +24,6 @@ DIRS += [
593 diff --git gfx/skia/generate_mozbuild.py gfx/skia/generate_mozbuild.py
594 index e06ae3457a47..93faa61594a3 100755
595 --- gfx/skia/generate_mozbuild.py
596 +++ gfx/skia/generate_mozbuild.py
597 @@ -148,6 +148,9 @@ if CONFIG['CC_TYPE'] in ('clang', 'clang-cl'):
598 '-Wno-unused-private-field',
601 +if CONFIG['MOZ_SYSTEM_HARFBUZZ']:
602 + CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS']
604 if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk3', 'android'):
605 CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS']
606 CXXFLAGS += CONFIG['CAIRO_FT_CFLAGS']
607 diff --git gfx/skia/moz.build gfx/skia/moz.build
608 index 2118677ca3a8..e4978b413784 100644
609 --- gfx/skia/moz.build
610 +++ gfx/skia/moz.build
611 @@ -822,6 +822,9 @@ if CONFIG['CC_TYPE'] in ('clang', 'clang-cl'):
612 '-Wno-unused-private-field',
615 +if CONFIG['MOZ_SYSTEM_HARFBUZZ']:
616 + CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS']
618 if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk3', 'android'):
619 CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS']
620 CXXFLAGS += CONFIG['CAIRO_FT_CFLAGS']
621 diff --git gfx/thebes/moz.build gfx/thebes/moz.build
622 index 56f1b9fe3f4b..0ac1100b0df3 100644
623 --- gfx/thebes/moz.build
624 +++ gfx/thebes/moz.build
625 @@ -288,7 +288,13 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk3':
627 LOCAL_INCLUDES += CONFIG['SKIA_INCLUDES']
629 -DEFINES['GRAPHITE2_STATIC'] = True
630 +if CONFIG['MOZ_SYSTEM_GRAPHITE2']:
631 + CXXFLAGS += CONFIG['MOZ_GRAPHITE2_CFLAGS']
633 + DEFINES['GRAPHITE2_STATIC'] = True
635 +if CONFIG['MOZ_SYSTEM_HARFBUZZ']:
636 + CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS']
638 if CONFIG['CC_TYPE'] == 'clang':
639 # Suppress warnings from Skia header files.
640 diff --git intl/unicharutil/util/moz.build intl/unicharutil/util/moz.build
641 index cb1233c56d7e..06fb1f9f174b 100644
642 --- intl/unicharutil/util/moz.build
643 +++ intl/unicharutil/util/moz.build
644 @@ -25,4 +25,7 @@ UNIFIED_SOURCES += [
645 'nsUnicodeProperties.cpp',
648 +if CONFIG['MOZ_SYSTEM_HARFBUZZ']:
649 + CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS']
651 FINAL_LIBRARY = 'xul'
652 diff --git netwerk/dns/moz.build netwerk/dns/moz.build
653 index 79c26e3e7001..c4d93bc5f7dc 100644
654 --- netwerk/dns/moz.build
655 +++ netwerk/dns/moz.build
656 @@ -76,3 +76,6 @@ USE_LIBS += ['icu']
658 if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
659 CXXFLAGS += ['-Wno-error=shadow']
661 +if CONFIG['MOZ_SYSTEM_HARFBUZZ']:
662 + CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS']
663 diff --git old-configure.in old-configure.in
664 index 95a58b634593..b614eef85c89 100644
667 @@ -3951,6 +3951,27 @@ dnl ========================================================
669 AC_SUBST(MOZ_LINUX_32_SSE2_STARTUP_ERROR)
671 +dnl ========================================================
672 +dnl Check for graphite2
673 +dnl ========================================================
674 +if test -n "$MOZ_SYSTEM_GRAPHITE2"; then
675 + dnl graphite2.pc has bogus version, check manually
676 + _SAVE_CFLAGS=$CFLAGS
677 + CFLAGS="$CFLAGS $MOZ_GRAPHITE2_CFLAGS"
678 + AC_TRY_COMPILE([ #include <graphite2/Font.h>
679 + #define GR2_VERSION_REQUIRE(major,minor,bugfix) \
680 + ( GR2_VERSION_MAJOR * 10000 + GR2_VERSION_MINOR \
681 + * 100 + GR2_VERSION_BUGFIX >= \
682 + (major) * 10000 + (minor) * 100 + (bugfix) )
684 + #if !GR2_VERSION_REQUIRE(1,3,12)
685 + #error "Insufficient graphite2 version."
688 + [AC_MSG_ERROR([--with-system-graphite2 requested but no working libgraphite2 found])])
689 + CFLAGS=$_SAVE_CFLAGS
692 dnl ========================================================
693 dnl Check for pixman and cairo
694 dnl ========================================================
695 diff --git toolkit/library/moz.build toolkit/library/moz.build
696 index 24f940e1ed7e..079a575adec3 100644
697 --- toolkit/library/moz.build
698 +++ toolkit/library/moz.build
699 @@ -226,6 +226,12 @@ if CONFIG['MOZ_SYSTEM_PNG']:
700 if CONFIG['MOZ_SYSTEM_WEBP']:
701 OS_LIBS += CONFIG['MOZ_WEBP_LIBS']
703 +if CONFIG['MOZ_SYSTEM_GRAPHITE2']:
704 + OS_LIBS += CONFIG['MOZ_GRAPHITE2_LIBS']
706 +if CONFIG['MOZ_SYSTEM_HARFBUZZ']:
707 + OS_LIBS += CONFIG['MOZ_HARFBUZZ_LIBS']
709 if CONFIG['MOZ_SYSTEM_LIBEVENT']:
710 OS_LIBS += CONFIG['MOZ_LIBEVENT_LIBS']
712 diff --git toolkit/moz.configure toolkit/moz.configure
713 index 9297e4d6f501..d8e273887e4b 100644
714 --- toolkit/moz.configure
715 +++ toolkit/moz.configure
716 @@ -894,6 +894,26 @@ add_old_configure_assignment('FT2_LIBS',
717 add_old_configure_assignment('FT2_CFLAGS',
721 +# ==============================================================
722 +option('--with-system-graphite2',
723 + help="Use system graphite2 (located with pkgconfig)")
725 +system_graphite2 = pkg_check_modules('MOZ_GRAPHITE2', 'graphite2',
726 + when='--with-system-graphite2')
728 +set_config('MOZ_SYSTEM_GRAPHITE2', depends_if(system_graphite2)(lambda _: True))
731 +# ==============================================================
732 +option('--with-system-harfbuzz',
733 + help="Use system harfbuzz (located with pkgconfig)")
735 +system_harfbuzz = pkg_check_modules('MOZ_HARFBUZZ', 'harfbuzz >= 2.4.0',
736 + when='--with-system-harfbuzz')
738 +set_config('MOZ_SYSTEM_HARFBUZZ', depends_if(system_harfbuzz)(lambda _: True))
740 # Marionette remote protocol
741 # ==============================================================
745 [FILE:879:patches/patch-dom_media_flac_FlacDecoder.cpp]
746 Enable FLAC on platforms without ffvpx like powerpc*
748 diff --git dom/media/flac/FlacDecoder.cpp dom/media/flac/FlacDecoder.cpp
749 index 53fc3c9937f7..b23771ab80fa 100644
750 --- dom/media/flac/FlacDecoder.cpp.orig 2019-05-17 00:33:25 UTC
751 +++ dom/media/flac/FlacDecoder.cpp
753 #include "FlacDecoder.h"
754 #include "MediaContainerType.h"
755 #include "mozilla/StaticPrefs.h"
756 +#include "PDMFactory.h"
760 @@ -14,6 +15,10 @@ namespace mozilla {
761 bool FlacDecoder::IsEnabled() {
763 return StaticPrefs::MediaFlacEnabled();
764 +#elif defined(MOZ_FFMPEG)
765 + RefPtr<PDMFactory> platform = new PDMFactory();
766 + return StaticPrefs::MediaFlacEnabled() && platform->SupportsMimeType(NS_LITERAL_CSTRING("audio/flac"),
767 + /* DecoderDoctorDiagnostics* */ nullptr);
769 // Until bug 1295886 is fixed.
773 [FILE:893:patches/patch-env-api-keys]
774 # Accept API keys from environment like before bug 1294585
776 --- build/moz.configure/keyfiles.configure.orig 2019-05-17 00:33:19 UTC
777 +++ build/moz.configure/keyfiles.configure
778 @@ -18,6 +18,7 @@ def keyfile(desc, default=None, help=Non
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')
786 @@ -28,7 +29,7 @@ def keyfile(desc, default=None, help=Non
787 raise FatalCheckError("'%s' is empty." % value[0])
789 raise FatalCheckError("'%s': %s." % (value[0], e.strerror))
791 + return environ.get('MOZ_%s_KEY' % desc.upper().replace(' ', '_')) or no_key
797 [FILE:890:patches/patch-gfx_skia_skia_src_core_SkCpu.cpp]
798 Regressed by https://svnweb.freebsd.org/changeset/base/324815
800 gfx/skia/skia/src/core/SkCpu.cpp:81:27: error: use of undeclared identifier 'getauxval'
801 uint32_t hwcaps = getauxval(AT_HWCAP);
804 --- gfx/skia/skia/src/core/SkCpu.cpp.orig 2019-05-17 00:34:23 UTC
805 +++ gfx/skia/skia/src/core/SkCpu.cpp
810 +#elif defined(SK_CPU_ARM64) && defined(__FreeBSD__)
811 + #include <machine/armreg.h>
813 + static uint32_t read_cpu_features() {
814 + uint32_t features = 0;
815 + uint64_t id_aa64isar0;
817 + id_aa64isar0 = READ_SPECIALREG(ID_AA64ISAR0_EL1);
818 + if (ID_AA64ISAR0_CRC32(id_aa64isar0) == ID_AA64ISAR0_CRC32_BASE) {
819 + features |= SkCpu::CRC32;
824 #elif defined(SK_CPU_ARM64) && __has_include(<sys/auxv.h>)
825 #include <sys/auxv.h>
829 [FILE:316:patches/patch-ipc_chromium_src_base_platform__thread__posix.cc]
830 --- ipc/chromium/src/base/platform_thread_posix.cc.orig 2019-05-17 00:33:26 UTC
831 +++ ipc/chromium/src/base/platform_thread_posix.cc
833 #elif defined(OS_LINUX)
834 # include <sys/syscall.h>
835 # include <sys/prctl.h>
836 +#elif defined(OS_DRAGONFLY)
837 +# include <sys/lwp.h>
840 #if !defined(OS_MACOSX)
843 [FILE:613:patches/patch-ipc_chromium_src_base_shared__memory__posix.cc]
844 --- ipc/chromium/src/base/shared_memory_posix.cc.orig 2019-05-17 00:33:26 UTC
845 +++ ipc/chromium/src/base/shared_memory_posix.cc
846 @@ -83,6 +83,11 @@ bool SharedMemory::AppendPosixShmPrefix(
847 StringAppendF(str, "snap.%s.", kSnap);
850 +# ifdef OS_DRAGONFLY
851 + // DragonFly BSD has a userland IPC implementation, we need to prefix the
852 + // path to shm_open(3), preferably with '/tmp'
853 + StringAppendF(str, "tmp/");
855 // Hopefully the "implementation defined" name length limit is long
857 StringAppendF(str, "org.mozilla.ipc.%d.", static_cast<int>(pid));
860 [FILE:575:patches/patch-js_src_old-configure.in]
861 --- js/src/old-configure.in.orig 2019-05-17 00:34:24 UTC
862 +++ js/src/old-configure.in
863 @@ -816,7 +816,7 @@ dnl Checks for header files.
864 dnl ========================================================
868 +freebsd*|dragonfly*)
869 # for stuff like -lXshm
870 CPPFLAGS="${CPPFLAGS} ${X_CFLAGS}"
872 @@ -935,7 +935,7 @@ then
877 + *-*-freebsd*|*-*-dragonfly*)
878 AC_DEFINE(_REENTRANT)
879 AC_DEFINE(_THREAD_SAFE)
880 dnl -pthread links in -lpthread, so don't specify it explicitly.
883 [FILE:297:patches/patch-media_libcubeb_src_cubeb__jack.cpp]
884 --- media/libcubeb/src/cubeb_jack.cpp.orig 2019-05-17 00:34:35 UTC
885 +++ media/libcubeb/src/cubeb_jack.cpp
888 #define _DEFAULT_SOURCE
891 +#if !(defined __FreeBSD__ || defined __DragonFly__)
892 #define _POSIX_SOURCE
897 [FILE:231:files/pkg-message-single]
898 ==========================================================================
900 If Firefox segfaults, try setting MOZ_FORCE_DISABLE_E10S=1 in
903 ==========================================================================