logo

overlay

My own overlay for experimentations, use with caution, no support is provided git clone https://hacktivis.me/git/overlay.git

obs-studio-9999.ebuild (3700B)


  1. # Copyright 1999-2021 Gentoo Authors
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=7
  4. CMAKE_REMOVE_MODULES_LIST=( FindFreetype )
  5. LUA_COMPAT=( luajit )
  6. PYTHON_COMPAT=( python3_{7..9} )
  7. inherit cmake lua-single python-single-r1 xdg-utils
  8. if [[ ${PV} == *9999 ]]; then
  9. inherit git-r3
  10. EGIT_REPO_URI="https://github.com/lanodan/obs-studio.git"
  11. EGIT_BRANCH="wayland"
  12. EGIT_SUBMODULES=()
  13. fi
  14. DESCRIPTION="Software for Recording and Streaming Live Video Content (wayland branch)"
  15. HOMEPAGE="https://obsproject.com"
  16. LICENSE="GPL-2"
  17. SLOT="0"
  18. IUSE="+alsa decklink fdk imagemagick jack lua nvenc pipewire pulseaudio python speex +ssl truetype v4l vlc wayland X"
  19. REQUIRED_USE="
  20. lua? ( ${LUA_REQUIRED_USE} )
  21. python? ( ${PYTHON_REQUIRED_USE} )
  22. "
  23. BDEPEND="
  24. lua? ( dev-lang/swig )
  25. python? ( dev-lang/swig )
  26. "
  27. DEPEND="
  28. >=dev-libs/jansson-2.5
  29. dev-qt/qtcore:5
  30. dev-qt/qtdeclarative:5
  31. dev-qt/qtgui:5
  32. dev-qt/qtmultimedia:5
  33. dev-qt/qtnetwork:5
  34. dev-qt/qtquickcontrols:5
  35. dev-qt/qtsql:5
  36. dev-qt/qtsvg:5
  37. dev-qt/qtwidgets:5
  38. X? (
  39. dev-qt/qtx11extras:5
  40. x11-libs/libX11
  41. x11-libs/libXcomposite
  42. x11-libs/libXfixes
  43. x11-libs/libXinerama
  44. x11-libs/libXrandr
  45. x11-libs/libxcb
  46. )
  47. dev-qt/qtxml:5
  48. media-libs/x264:=
  49. media-video/ffmpeg:=[x264]
  50. net-misc/curl
  51. sys-libs/zlib
  52. virtual/udev
  53. alsa? ( media-libs/alsa-lib )
  54. fdk? ( media-libs/fdk-aac:= )
  55. imagemagick? ( media-gfx/imagemagick:= )
  56. jack? ( virtual/jack )
  57. lua? ( ${LUA_DEPS} )
  58. nvenc? ( >=media-video/ffmpeg-4[video_cards_nvidia] )
  59. pipewire? ( media-video/pipewire )
  60. pulseaudio? ( media-sound/pulseaudio )
  61. python? ( ${PYTHON_DEPS} )
  62. speex? ( media-libs/speexdsp )
  63. ssl? ( net-libs/mbedtls:= )
  64. truetype? (
  65. media-libs/fontconfig
  66. media-libs/freetype
  67. )
  68. v4l? ( media-libs/libv4l )
  69. vlc? ( media-video/vlc:= )
  70. "
  71. RDEPEND="${DEPEND}"
  72. pkg_setup() {
  73. use lua && lua-single_pkg_setup
  74. use python && python-single-r1_pkg_setup
  75. }
  76. src_configure() {
  77. local libdir=$(get_libdir)
  78. local mycmakeargs=(
  79. -DBUILD_BROWSER=no
  80. -DBUILD_VST=no
  81. -DENABLE_WAYLAND=$(usex wayland)
  82. -DENABLE_X11=$(usex X)
  83. -DDISABLE_ALSA=$(usex !alsa)
  84. -DDISABLE_DECKLINK=$(usex !decklink)
  85. -DDISABLE_FREETYPE=$(usex !truetype)
  86. -DDISABLE_JACK=$(usex !jack)
  87. -DDISABLE_LIBFDK=$(usex !fdk)
  88. -DENABLE_PIPEWIRE=$(usex pipewire)
  89. -DDISABLE_PULSEAUDIO=$(usex !pulseaudio)
  90. -DDISABLE_SPEEXDSP=$(usex !speex)
  91. -DDISABLE_V4L2=$(usex !v4l)
  92. -DDISABLE_VLC=$(usex !vlc)
  93. -DLIBOBS_PREFER_IMAGEMAGICK=$(usex imagemagick)
  94. -DOBS_MULTIARCH_SUFFIX=${libdir#lib}
  95. -DUNIX_STRUCTURE=1
  96. -DWITH_RTMPS=$(usex ssl)
  97. )
  98. if [ ${PV} != *9999 ]; then
  99. mycmakeargs+=(
  100. -DOBS_VERSION_OVERRIDE=${PV}
  101. )
  102. fi
  103. if use lua || use python; then
  104. mycmakeargs+=(
  105. -DDISABLE_LUA=$(usex !lua)
  106. -DDISABLE_PYTHON=$(usex !python)
  107. -DENABLE_SCRIPTING=yes
  108. )
  109. else
  110. mycmakeargs+=( -DENABLE_SCRIPTING=no )
  111. fi
  112. cmake_src_configure
  113. }
  114. src_install() {
  115. cmake_src_install
  116. #external plugins may need some things not installed by default, install them here
  117. insinto /usr/include/obs/UI/obs-frontend-api
  118. doins UI/obs-frontend-api/obs-frontend-api.h
  119. }
  120. pkg_postinst() {
  121. xdg_icon_cache_update
  122. if ! use alsa && ! use pulseaudio; then
  123. elog
  124. elog "For the audio capture features to be available,"
  125. elog "either the 'alsa' or the 'pulseaudio' USE-flag needs to"
  126. elog "be enabled."
  127. elog
  128. fi
  129. if ! has_version "sys-apps/dbus"; then
  130. elog
  131. elog "The 'sys-apps/dbus' package is not installed, but"
  132. elog "could be used for disabling hibernating, screensaving,"
  133. elog "and sleeping. Where it is not installed,"
  134. elog "'xdg-screensaver reset' is used instead"
  135. elog "(if 'x11-misc/xdg-utils' is installed)."
  136. elog
  137. fi
  138. }
  139. pkg_postrm() {
  140. xdg_icon_cache_update
  141. }