From 8e0702140236e302211259a8ae4b47893ebe4b33 Mon Sep 17 00:00:00 2001 From: Duncaen Date: Thu, 16 Nov 2017 04:42:48 +0100 Subject: [PATCH] firefox: add sndio build option --- srcpkgs/firefox/patches/sndio.patch | 85 +++++++++++++++++++++++++++++ srcpkgs/firefox/template | 9 ++- 2 files changed, 91 insertions(+), 3 deletions(-) create mode 100644 srcpkgs/firefox/patches/sndio.patch diff --git a/srcpkgs/firefox/patches/sndio.patch b/srcpkgs/firefox/patches/sndio.patch new file mode 100644 index 00000000000..f687c0bd6f6 --- /dev/null +++ b/srcpkgs/firefox/patches/sndio.patch @@ -0,0 +1,85 @@ +--- old-configure.in.orig ++++ old-configure.in +@@ -2839,6 +2839,22 @@ + + AC_SUBST(MOZ_ALSA) + ++dnl ================================== ++dnl = Check sndio availability ++dnl ================================== ++ ++MOZ_ARG_ENABLE_BOOL(sndio, ++[ --enable-sndio Enable sndio support], ++ MOZ_SNDIO=1, ++ MOZ_SNDIO=) ++ ++if test -n "$MOZ_SNDIO"; then ++ MOZ_SNDIO_LIBS="-lsndio" ++ AC_SUBST_LIST(MOZ_SNDIO_LIBS) ++fi ++ ++AC_SUBST(MOZ_SNDIO) ++ + dnl ======================================================== + dnl = Disable PulseAudio + dnl ======================================================== +--- toolkit/library/moz.build.orig ++++ toolkit/library/moz.build +@@ -235,10 +235,8 @@ + if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('cocoa', 'uikit'): + OS_LIBS += CONFIG['TK_LIBS'] + +-if CONFIG['OS_ARCH'] == 'OpenBSD': +- OS_LIBS += [ +- 'sndio', +- ] ++if CONFIG['MOZ_SNDIO']: ++ OS_LIBS += CONFIG['MOZ_SNDIO_LIBS'] + + if CONFIG['MOZ_ENABLE_DBUS']: + OS_LIBS += CONFIG['MOZ_DBUS_GLIB_LIBS'] +--- media/libcubeb/src/moz.build.orig ++++ media/libcubeb/src/moz.build +@@ -43,7 +43,7 @@ + ] + DEFINES['USE_JACK'] = True + +-if CONFIG['OS_ARCH'] == 'OpenBSD': ++if CONFIG['MOZ_SNDIO']: + SOURCES += [ + 'cubeb_sndio.c', + ] +--- build/moz.configure/old.configure.orig ++++ build/moz.configure/old.configure +@@ -159,6 +159,7 @@ + '--enable-accessibility', + '--enable-address-sanitizer', + '--enable-alsa', ++ '--enable-sndio', + '--enable-bundled-fonts', + '--enable-clang-plugin', + '--enable-content-sandbox', +--- security/sandbox/linux/broker/SandboxBrokerPolicyFactory.cpp.orig ++++ security/sandbox/linux/broker/SandboxBrokerPolicyFactory.cpp +@@ -349,6 +349,21 @@ + } + } + } ++ ++#ifdef MOZ_SNDIO ++ // ~/.aucat_cookie (sndio) ++ rv = homeDir->Clone(getter_AddRefs(confDir)); ++ if (NS_SUCCEEDED(rv)) { ++ rv = confDir->AppendNative(NS_LITERAL_CSTRING(".aucat_cookie")); ++ if (NS_SUCCEEDED(rv)) { ++ nsAutoCString tmpPath; ++ rv = confDir->GetNativePath(tmpPath); ++ if (NS_SUCCEEDED(rv)) { ++ policy->AddPath(rdwrcr, tmpPath.get()); ++ } ++ } ++ } ++#endif + } + + // Firefox binary dir. diff --git a/srcpkgs/firefox/template b/srcpkgs/firefox/template index a103dde70e8..cbaf4753f94 100644 --- a/srcpkgs/firefox/template +++ b/srcpkgs/firefox/template @@ -20,12 +20,13 @@ makedepends="nss-devel libjpeg-turbo-devel gtk+-devel gtk+3-devel icu-devel libXdamage-devel $(vopt_if alsa alsa-lib-devel) $(vopt_if dbus dbus-glib-devel) $(vopt_if pulseaudio pulseaudio-devel) $(vopt_if startup_notification startup-notification-devel) - $(vopt_if xscreensaver libXScrnSaver-devel)" + $(vopt_if xscreensaver libXScrnSaver-devel) + $(vopt_if sndio sndio-devel)" depends="nss>=3.33 desktop-file-utils hicolor-icon-theme" conflicts="firefox-esr>=0" -build_options="alsa dbus pulseaudio startup_notification xscreensaver" -build_options_default="alsa dbus pulseaudio startup_notification xscreensaver" +build_options="alsa dbus pulseaudio startup_notification xscreensaver sndio" +build_options_default="alsa dbus pulseaudio startup_notification xscreensaver sndio" post_extract() { case "$XBPS_TARGET_MACHINE" in @@ -90,12 +91,14 @@ do_build() { ac_add_options --with-google-api-keyfile="${wrksrc}/google-api-key" ac_add_options --with-mozilla-api-keyfile="${wrksrc}/mozilla-api-key" ac_add_options $(vopt_enable alsa) +ac_add_options $(vopt_enable sndio) ac_add_options $(vopt_enable dbus) ac_add_options $(vopt_enable dbus necko-wifi) ac_add_options $(vopt_enable pulseaudio) ac_add_options $(vopt_enable startup_notification startup-notification) ! + rm -f old-configure ./mach build } do_install() {