From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 250DA138334 for ; Fri, 13 Jul 2018 09:36:40 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 596EEE0970; Fri, 13 Jul 2018 09:36:39 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 0811FE0970 for ; Fri, 13 Jul 2018 09:36:39 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id D616733BF11 for ; Fri, 13 Jul 2018 09:36:36 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 5FC9C300 for ; Fri, 13 Jul 2018 09:36:34 +0000 (UTC) From: "Tony Vroon" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Tony Vroon" Message-ID: <1531474575.56c84c9c9473e7651089b5d1fd0e64a542f71e69.chainsaw@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: media-video/obs-studio/files/, media-video/obs-studio/ X-VCS-Repository: repo/gentoo X-VCS-Files: media-video/obs-studio/files/obs-studio-21.1.2-use-less-automagic.patch media-video/obs-studio/metadata.xml media-video/obs-studio/obs-studio-9999.ebuild X-VCS-Directories: media-video/obs-studio/files/ media-video/obs-studio/ X-VCS-Committer: chainsaw X-VCS-Committer-Name: Tony Vroon X-VCS-Revision: 56c84c9c9473e7651089b5d1fd0e64a542f71e69 X-VCS-Branch: master Date: Fri, 13 Jul 2018 09:36:34 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 519d794b-5b72-43b7-818e-e4c77c8a6113 X-Archives-Hash: 63b3754c778ceb41da816c16ed6b3ef6 commit: 56c84c9c9473e7651089b5d1fd0e64a542f71e69 Author: Jimi Huotari gentoo org> AuthorDate: Sat Mar 17 22:29:00 2018 +0000 Commit: Tony Vroon gentoo org> CommitDate: Fri Jul 13 09:36:15 2018 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=56c84c9c media-video/obs-studio: add support for scripting Scripting support for Lua and Python 3 is enabled by automagic, if the required libraries are found. This commit adds USE-flags and a patch that give the user control on whether or not to do so. Closes: https://bugs.gentoo.org/656956 Package-Manager: Portage-2.3.41, Repoman-2.3.9 Closes: https://github.com/gentoo/gentoo/pull/9151 Closes: https://bugs.gentoo.org/656956 .../obs-studio-21.1.2-use-less-automagic.patch | 167 +++++++++++++++++++++ media-video/obs-studio/metadata.xml | 4 +- media-video/obs-studio/obs-studio-9999.ebuild | 26 +++- 3 files changed, 193 insertions(+), 4 deletions(-) diff --git a/media-video/obs-studio/files/obs-studio-21.1.2-use-less-automagic.patch b/media-video/obs-studio/files/obs-studio-21.1.2-use-less-automagic.patch new file mode 100644 index 00000000000..2c28c8e080d --- /dev/null +++ b/media-video/obs-studio/files/obs-studio-21.1.2-use-less-automagic.patch @@ -0,0 +1,167 @@ +From eee6541153cfb6788ee088181781793de100e54c Mon Sep 17 00:00:00 2001 +From: Jimi Huotari +Date: Mon, 9 Jul 2018 02:20:10 +0300 +Subject: [PATCH 1/2] deps/obs-scripting: Use less automagic for Lua/Python + detection + +This adds build-time options for disabling the Lua and/or Python +scripting support in cases where users do not wish to build +it, but have the required libraries installed. +--- + deps/obs-scripting/CMakeLists.txt | 73 +++++++++++++++++++------------ + 1 file changed, 45 insertions(+), 28 deletions(-) + +diff --git a/deps/obs-scripting/CMakeLists.txt b/deps/obs-scripting/CMakeLists.txt +index 835c1b30..46412779 100644 +--- a/deps/obs-scripting/CMakeLists.txt ++++ b/deps/obs-scripting/CMakeLists.txt +@@ -1,6 +1,7 @@ + cmake_minimum_required(VERSION 2.8) + + if(NOT ENABLE_SCRIPTING) ++ message(STATUS "Scripting plugin disabled") + return() + endif() + +@@ -11,44 +12,60 @@ if(MSVC) + w32-pthreads) + endif() + +-find_package(Luajit QUIET) +-find_package(PythonDeps QUIET) +-find_package(SwigDeps QUIET 2) ++option(DISABLE_LUA "Disable Lua scripting support" OFF) ++option(DISABLE_PYTHON "Disable Python scripting support" OFF) + + set(COMPILE_PYTHON FALSE CACHE BOOL "" FORCE) + set(COMPILE_LUA FALSE CACHE BOOL "" FORCE) + +-if(NOT SWIG_FOUND) +- message(STATUS "Scripting: SWIG not found; scripting disabled") +- return() +-endif() ++if(NOT DISABLE_LUA) ++ find_package(Luajit QUIET) + +-if(NOT PYTHONLIBS_FOUND AND NOT LUAJIT_FOUND) +- message(STATUS "Scripting: Neither Python 3 nor Luajit was found; scripting plugin disabled") +- return() +-endif() +- +-if(NOT LUAJIT_FOUND) +- message(STATUS "Scripting: Luajit not found; Luajit support disabled") ++ if(NOT DISABLE_LUA AND NOT LUAJIT_FOUND) ++ message(STATUS "Luajit support not found.") ++ set(LUAJIT_FOUND FALSE) ++ else() ++ message(STATUS "Scripting: Luajit supported") ++ set(COMPILE_LUA TRUE CACHE BOOL "" FORCE) ++ endif() + else() +- message(STATUS "Scripting: Luajit supported") +- set(COMPILE_LUA TRUE CACHE BOOL "" FORCE) ++ message(STATUS "Scripting: Luajit support disabled") ++ set(LUAJIT_FOUND FALSE) + endif() + +-if(NOT PYTHONLIBS_FOUND) +- message(STATUS "Scripting: Python 3 not found; Python support disabled") ++if(NOT DISABLE_PYTHON) ++ find_package(PythonDeps QUIET) ++ ++ if(NOT DISABLE_PYTHON AND NOT PYTHONLIBS_FOUND) ++ message(STATUS "Python support not found.") ++ set(PYTHON_FOUND FALSE) ++ set(PYTHONLIBS_FOUND FALSE) ++ else() ++ message(STATUS "Scripting: Python 3 supported") ++ set(PYTHON_FOUND TRUE) ++ set(COMPILE_PYTHON TRUE CACHE BOOL "" FORCE) ++ ++ get_filename_component(PYTHON_LIB "${PYTHON_LIBRARIES}" NAME) ++ string(REGEX REPLACE "\\.[^.]*$" "" PYTHON_LIB ${PYTHON_LIB}) ++ ++ if(WIN32) ++ string(REGEX REPLACE "_d" "" PYTHON_LIB "${PYTHON_LIB}") ++ endif() ++ endif() ++else() ++ message(STATUS "Scripting: Python 3 support disabled") + set(PYTHON_FOUND FALSE) + set(PYTHONLIBS_FOUND FALSE) +-else() +- message(STATUS "Scripting: Python 3 supported") +- set(PYTHON_FOUND TRUE) +- set(COMPILE_PYTHON TRUE CACHE BOOL "" FORCE) +- +- get_filename_component(PYTHON_LIB "${PYTHON_LIBRARIES}" NAME) +- string(REGEX REPLACE "\\.[^.]*$" "" PYTHON_LIB ${PYTHON_LIB}) +- if(WIN32) +- string(REGEX REPLACE "_d" "" PYTHON_LIB "${PYTHON_LIB}") +- endif() ++endif() ++ ++find_package(SwigDeps QUIET 2) ++ ++if(NOT SWIG_FOUND) ++ message(STATUS "Scripting: SWIG not found; scripting disabled") ++endif() ++ ++if(NOT PYTHONLIBS_FOUND AND NOT LUAJIT_FOUND) ++ message(STATUS "Scripting: Neither Python 3 nor Luajit was found; scripting plugin disabled") + endif() + + set(SCRIPTING_ENABLED ON CACHE BOOL "Interal global cmake variable" FORCE) +-- +2.18.0 + +From 79006adaf2b93ed4ddc07ff236a9ed1fcd09e47f Mon Sep 17 00:00:00 2001 +From: Jimi Huotari +Date: Wed, 11 Jul 2018 02:08:51 +0300 +Subject: [PATCH 2/2] obs-filters: Use less automagic for SpeexDSP detection + +This adds a build-time option for disabling the SpeexDSP-based +Noise Suppression filter support in cases where users do not +wish to build it, but have the required library installed. +--- + plugins/obs-filters/CMakeLists.txt | 24 +++++++++++++++++------- + 1 file changed, 17 insertions(+), 7 deletions(-) + +diff --git a/plugins/obs-filters/CMakeLists.txt b/plugins/obs-filters/CMakeLists.txt +index ec4289cc..4d862b0a 100644 +--- a/plugins/obs-filters/CMakeLists.txt ++++ b/plugins/obs-filters/CMakeLists.txt +@@ -1,13 +1,23 @@ + project(obs-filters) + +-find_package(Libspeexdsp QUIET) +-if(LIBSPEEXDSP_FOUND) +- set(obs-filters_LIBSPEEXDSP_SOURCES +- noise-suppress-filter.c) +- set(obs-filters_LIBSPEEXDSP_LIBRARIES +- ${LIBSPEEXDSP_LIBRARIES}) ++option(DISABLE_SPEEXDSP "Disable building of the SpeexDSP-based Noise Suppression filter" OFF) ++ ++if(DISABLE_SPEEXDSP) ++ message(STATUS "SpeexDSP support disabled") ++ set(LIBSPEEXDSP_FOUND FALSE) + else() +- message(STATUS "Speexdsp library not found, speexdsp filters disabled") ++ find_package(Libspeexdsp QUIET) ++ ++ if(NOT LIBSPEEXDSP_FOUND) ++ message(STATUS "SpeexDSP support not found") ++ set(LIBSPEEXDSP_FOUND FALSE) ++ else() ++ message(STATUS "SpeexDSP supported") ++ set(obs-filters_LIBSPEEXDSP_SOURCES ++ noise-suppress-filter.c) ++ set(obs-filters_LIBSPEEXDSP_LIBRARIES ++ ${LIBSPEEXDSP_LIBRARIES}) ++ endif() + endif() + + configure_file("${CMAKE_CURRENT_SOURCE_DIR}/obs-filters-config.h.in" +-- +2.18.0 + diff --git a/media-video/obs-studio/metadata.xml b/media-video/obs-studio/metadata.xml index 27ed2bccb4c..20792bdd8ba 100644 --- a/media-video/obs-studio/metadata.xml +++ b/media-video/obs-studio/metadata.xml @@ -14,7 +14,9 @@ Enable libfdk support for AAC encoding. Use ImageMagick for image loading instead of FFmpeg. - Enable NVENC encoding for nVidia video cards + Build support for scripting via Luajit. + Enable NVENC encoding for nVidia video cards. + Build support for scripting via Python 3. jp9000/obs-studio diff --git a/media-video/obs-studio/obs-studio-9999.ebuild b/media-video/obs-studio/obs-studio-9999.ebuild index e030ae7b1d7..b1dee2913b2 100644 --- a/media-video/obs-studio/obs-studio-9999.ebuild +++ b/media-video/obs-studio/obs-studio-9999.ebuild @@ -3,9 +3,10 @@ EAPI=6 +PYTHON_COMPAT=( python{3_4,3_5,3_6} ) CMAKE_MIN_VERSION=3.9.6 -inherit cmake-utils gnome2-utils +inherit cmake-utils gnome2-utils python-any-r1 if [[ ${PV} == *9999 ]]; then inherit git-r3 @@ -21,7 +22,7 @@ HOMEPAGE="https://obsproject.com" LICENSE="GPL-2" SLOT="0" -IUSE="+alsa fdk imagemagick jack pulseaudio truetype v4l" +IUSE="+alsa fdk imagemagick jack luajit nvenc pulseaudio python truetype v4l" COMMON_DEPEND=" >=dev-libs/jansson-2.5 @@ -44,16 +45,24 @@ COMMON_DEPEND=" fdk? ( media-libs/fdk-aac:= ) imagemagick? ( media-gfx/imagemagick:= ) jack? ( virtual/jack ) + luajit? ( dev-lang/luajit:2 ) + nvenc? ( media-video/ffmpeg:=[nvenc] ) pulseaudio? ( media-sound/pulseaudio ) + python? ( ${PYTHON_DEPS} ) truetype? ( media-libs/fontconfig media-libs/freetype ) v4l? ( media-libs/libv4l ) " -DEPEND="${COMMON_DEPEND}" +DEPEND="${COMMON_DEPEND} + luajit? ( dev-lang/swig ) + python? ( dev-lang/swig ) +" RDEPEND="${COMMON_DEPEND}" +PATCHES="${FILESDIR}/${PN}-21.1.2-use-less-automagic.patch" + CMAKE_REMOVE_MODULES_LIST=( FindFreetype ) src_configure() { @@ -69,6 +78,17 @@ src_configure() { -DOBS_MULTIARCH_SUFFIX=${libdir#lib} -DUNIX_STRUCTURE=1 ) + + if use luajit || use python; then + mycmakeargs+=( + -DDISABLE_LUA=$(usex !luajit) + -DDISABLE_PYTHON=$(usex !python) + -DENABLE_SCRIPTING=yes + ) + else + mycmakeargs+=( -DENABLE_SCRIPTING=no ) + fi + cmake-utils_src_configure }