Index: www/qt5-webengine/Makefile =================================================================== --- www/qt5-webengine/Makefile +++ www/qt5-webengine/Makefile @@ -52,15 +52,20 @@ QT5_VERSION= 5.9.5 OPTIONS_SINGLE= AUDIO -OPTIONS_SINGLE_AUDIO= ALSA PULSEAUDIO +OPTIONS_SINGLE_AUDIO= ALSA PULSEAUDIO SNDIO OPTIONS_DEFAULT= ALSA AUDIO_DESC= Audio backend ALSA_LIB_DEPENDS= libasound.so:audio/alsa-lib -ALSA_QMAKE_ON= QT_CONFIG+=alsa +ALSA_VARS= QMAKE_CONFIGURE_ARGS+=-alsa +ALSA_VARS_OFF= QMAKE_CONFIGURE_ARGS+=-no-alsa PULSEAUDIO_LIB_DEPENDS= libpulse.so:audio/pulseaudio -PULSEAUDIO_QMAKE_ON= QT_CONFIG+=pulseaudio +PULSEAUDIO_VARS= QMAKE_CONFIGURE_ARGS+=-pulseaudio +PULSEAUDIO_VARS_OFF= QMAKE_CONFIGURE_ARGS+=-no-pulseaudio +SNDIO_LIB_DEPENDS= libsndio.so:audio/sndio +SNDIO_VARS= QMAKE_CONFIGURE_ARGS+=-sndio +SNDIO_VARS_OFF= QMAKE_CONFIGURE_ARGS+=-no-sndio # We pass `norecursive' to USES=qmake because src/plugins/plugins.pro checks # whether webenginewidgets is available, which fails when qmake processes all @@ -120,6 +125,13 @@ post-extract: # Install FreeBSD's freebsd.pri file. ${CP} ${FILESDIR}/freebsd.pri ${WRKSRC}/src/core/config/freebsd.pri + +post-extract-SNDIO-on: + @cd ${WRKSRC}/src/3rdparty/chromium/media/audio && ${MKDIR} sndio openbsd + @${CP} ${FILESDIR}/sndio_*put.* \ + ${WRKSRC}/src/3rdparty/chromium/media/audio/sndio + @${CP} ${FILESDIR}/audio_manager_openbsd.* \ + ${WRKSRC}/src/3rdparty/chromium/media/audio/openbsd pre-configure: # Link in ${PYTHON_CMD} to ${CONFIGURE_WRKSRC}/bin -- the scripts hardcode 'python' Index: www/qt5-webengine/files/audio_manager_openbsd.h =================================================================== --- www/qt5-webengine/files/audio_manager_openbsd.h +++ www/qt5-webengine/files/audio_manager_openbsd.h @@ -30,7 +30,6 @@ void GetAudioOutputDeviceNames(AudioDeviceNames* device_names) override; AudioParameters GetInputStreamParameters( const std::string& device_id) override; - const char* GetName() override; // Implementation of AudioManagerBase. AudioOutputStream* MakeLinearOutputStream( Index: www/qt5-webengine/files/audio_manager_openbsd.cc =================================================================== --- www/qt5-webengine/files/audio_manager_openbsd.cc +++ www/qt5-webengine/files/audio_manager_openbsd.cc @@ -63,12 +63,6 @@ AddDefaultDevice(device_names); } -#if defined(USE_SNDIO) -const char* AudioManagerOpenBSD::GetName() { - return "SNDIO"; -} -#endif - AudioParameters AudioManagerOpenBSD::GetInputStreamParameters( const std::string& device_id) { static const int kDefaultInputBufferSize = 1024; Index: www/qt5-webengine/files/freebsd.pri =================================================================== --- www/qt5-webengine/files/freebsd.pri +++ www/qt5-webengine/files/freebsd.pri @@ -4,8 +4,7 @@ enable_basic_printing=false \ enable_webrtc=false \ enable_hidpi=true \ - use_dbus=true \ - use_pulseaudio=false + use_dbus=true # Once the port works better, we can think about readding the diverse `use_system_` # for bundled libraries. Index: www/qt5-webengine/files/patch-configure.json =================================================================== --- /dev/null +++ www/qt5-webengine/files/patch-configure.json @@ -0,0 +1,33 @@ +--- configure.json.orig 2018-04-10 14:50:39 UTC ++++ configure.json +@@ -16,6 +16,7 @@ + "printing-and-pdf": "boolean", + "proprietary-codecs": "boolean", + "pulseaudio": "boolean", ++ "sndio": "boolean", + "spellchecker": "boolean", + "webrtc": "boolean" + } +@@ -113,6 +114,10 @@ + "condition": "libs.pulseaudio", + "output": [ "privateFeature" ] + }, ++ "sndio": { ++ "label": "sndio", ++ "output": [ "privateFeature" ] ++ }, + "pepper-plugins": { + "label": "Pepper Plugins", + "purpose": "Enables use of Pepper Flash and Widevine plugins.", +@@ -218,6 +223,11 @@ + { + "type": "feature", + "args": "pulseaudio", ++ "condition": "config.unix" ++ }, ++ { ++ "type": "feature", ++ "args": "sndio", + "condition": "config.unix" + }, + { Index: www/qt5-webengine/files/patch-src_3rdparty_chromium_media_BUILD.gn =================================================================== --- /dev/null +++ www/qt5-webengine/files/patch-src_3rdparty_chromium_media_BUILD.gn @@ -0,0 +1,12 @@ +--- src/3rdparty/chromium/media/BUILD.gn.orig 2018-06-21 14:13:32 UTC ++++ src/3rdparty/chromium/media/BUILD.gn +@@ -53,6 +53,9 @@ config("media_config") { + if (use_cras) { + defines += [ "USE_CRAS" ] + } ++ if (use_sndio) { ++ defines += [ "USE_SNDIO" ] ++ } + } + + config("media_implementation") { Index: www/qt5-webengine/files/patch-src_3rdparty_chromium_media_audio_BUILD.gn =================================================================== --- www/qt5-webengine/files/patch-src_3rdparty_chromium_media_audio_BUILD.gn +++ www/qt5-webengine/files/patch-src_3rdparty_chromium_media_audio_BUILD.gn @@ -1,15 +1,15 @@ ---- src/3rdparty/chromium/media/audio/BUILD.gn.orig 2017-01-26 00:49:15 UTC +--- src/3rdparty/chromium/media/audio/BUILD.gn.orig 2018-04-10 14:05:55 UTC +++ src/3rdparty/chromium/media/audio/BUILD.gn @@ -206,7 +206,7 @@ source_set("audio") { deps += [ "//media/base/android:media_jni_headers" ] } - if (is_linux) { -+ if (is_linux || is_bsd) { ++ if (is_linux || (is_bsd && !use_sndio)) { sources += [ "linux/audio_manager_linux.cc" ] } -@@ -255,10 +255,12 @@ source_set("audio") { +@@ -255,10 +255,24 @@ source_set("audio") { configs += [ ":libpulse" ] } else { # TODO(ajwong): Technically, this dl should go in the action. @@ -20,6 +20,18 @@ + if (is_linux) { + libs += [ "dl" ] + } ++ } ++ ++ if (use_sndio) { ++ libs += [ "sndio" ] ++ sources += [ ++ "openbsd/audio_manager_openbsd.cc", ++ "openbsd/audio_manager_openbsd.h", ++ "sndio/sndio_input.cc", ++ "sndio/sndio_input.h", ++ "sndio/sndio_output.cc", ++ "sndio/sndio_output.h", ++ ] } configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] Index: www/qt5-webengine/files/patch-src_3rdparty_chromium_media_media__options.gni =================================================================== --- /dev/null +++ www/qt5-webengine/files/patch-src_3rdparty_chromium_media_media__options.gni @@ -0,0 +1,12 @@ +--- src/3rdparty/chromium/media/media_options.gni.orig 2018-06-21 14:06:20 UTC ++++ src/3rdparty/chromium/media/media_options.gni +@@ -53,6 +53,9 @@ declare_args() { + + # Enables runtime selection of ALSA library for audio. + use_alsa = false ++ ++ # Enables runtime selection of sndio library for audio. ++ use_sndio = false + + # Alsa should be used on non-Android, non-Mac POSIX systems. + # Alsa should be used on desktop Chromecast and audio-only Chromecast builds. Index: www/qt5-webengine/files/patch-src_core_config_linux.pri =================================================================== --- /dev/null +++ www/qt5-webengine/files/patch-src_core_config_linux.pri @@ -0,0 +1,14 @@ +--- src/core/config/linux.pri.orig 2018-06-21 17:19:26 UTC ++++ src/core/config/linux.pri +@@ -136,6 +136,11 @@ host_build { + } else { + gn_args += use_alsa=false + } ++ qtConfig(sndio) { ++ gn_args += use_sndio=true ++ } else { ++ gn_args += use_sndio=false ++ } + packagesExist(libffi): gn_args += use_system_libffi=true + else: gn_args += use_system_libffi=false + !packagesExist(libpci): gn_args += use_libpci=false