Advertisement
Querzion

OBS-Studio-Browser

Aug 27th, 2022
1,582
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 5.65 KB | Software | 0 0
  1. # Maintainer: tytan652 <tytan652 at tytanium dot xyz>
  2. # Contributor: Alice Gaudon <alice at gaudon dot pro>
  3. # Contributor: Benjamin Klettbach <b dot klettbach at gmail dot com>
  4. # Contributor: Jonathan Steel <jsteel at archlinux.org>
  5. # Contributor: ArcticVanguard <LideEmily at gmail dot com>
  6. # Contributor: ledti <antergist at gmail dot com>
  7.  
  8. DISTRIB_ID=`lsb_release --id | cut -f2 -d$'\t'`
  9.  
  10. pkgname=obs-studio-browser
  11. pkgver=27.2.4
  12. pkgrel=2
  13. pkgdesc="Free and open source software for video recording and live streaming. With everything except service integration"
  14. arch=("x86_64")
  15. url="https://github.com/obsproject/obs-studio"
  16. license=("GPL3")
  17. _mbedtlsver=2.28
  18. _pythonver=3.10
  19. depends=(
  20.   "jack" "gtk-update-icon-cache" "x264" "rnnoise" "pciutils"
  21.  
  22.   # "libxinerama" "qt5-svg" provided by "vlc-luajit"
  23.   # "libxkbcommon-x11" provided by "qt5-base"
  24.   # "jansson" "curl" provided by "ftl-sdk"
  25.  
  26.   # Needed to use Qt on Wayland platform
  27.   "qt5-wayland"
  28.  
  29.   # Both needed to load linux-capture, so those two are no longer optional
  30.   "libxcomposite" "pipewire"
  31.  
  32.   # Needed to use PipeWire capture
  33.   "xdg-desktop-portal"
  34.  
  35.   # Needed by obs-browser
  36.   "libxss" "libxrandr" "nss" "at-spi2-atk"
  37.          
  38.   # AUR Packages
  39.   "ffmpeg-obs>=5" "vlc-luajit" "ftl-sdk"
  40. )
  41. # To manage mbedtls rebuild easily, this will prevent you to rebuild OBS on non-updated system
  42. # For Manjaro user this feature is disabled
  43. # Also OBS will need a patch when mbedtls 3 is on the repo
  44. if [[ $DISTRIB_ID == 'ManjaroLinux' ]]; then
  45.   depends+=('mbedtls')
  46. else
  47.   depends+=("mbedtls>=$_mbedtlsver")
  48. fi
  49. ## About vlc-luajit
  50. # The official VLC package will make OBS crash when a VLC source is used.
  51. # The issue is that VLC and OBS are compiled with different lua version.
  52. # So I also created vlc-luajit, a VLC package compiled with the same lua as OBS.
  53. # But to make people unable to install VLC official package with obs-studio-tytan652.
  54. # I decided to make vlc-luajit a dependency of OBS rather than an optional one.
  55. ## About ffmpeg-obs
  56. # Read ffmpeg-obs PKGBUILD for more info
  57. makedepends=(
  58.   "cmake" "git" "libfdk-aac" "swig" "luajit" "sndio" "lsb-release"
  59.  
  60.   # AUR Packages
  61.   "libajantv2"
  62.   "cef-minimal-obs=95.0.0_MediaHandler.2462+g95e19b8+chromium_95.0.4638.69_3"
  63. )
  64. # To manage python rebuild easily, this will prevent you to rebuild OBS on non-updated system
  65. # For Manjaro user this feature is disabled
  66. if [[ $DISTRIB_ID == 'ManjaroLinux' ]]; then
  67.   makedepends+=('python')
  68. else
  69.   makedepends+=("python>=$_pythonver")
  70. fi
  71. optdepends=(
  72.   "libfdk-aac: FDK AAC codec support"
  73.   "intel-media-driver: Hardware encoding (>= Broadwell)"
  74.   "libva-intel-driver: Hardware encoding (<= Haswell)"
  75.   "libva-mesa-driver: Hardware encoding"
  76.   "swig: Scripting"
  77.   "luajit: Lua scripting"
  78.   "sndio: Sndio input client"
  79.   "v4l2loopback-dkms: Virtual camera output"
  80.   "libajantv2: AJA NTV 2 support"
  81.   "decklink: Blackmagic Design DeckLink support"
  82. )
  83. # To manage python rebuild easily, this will prevent you to rebuild OBS on non-updated system
  84. # For Manjaro user this feature is disabled
  85. if [[ $DISTRIB_ID == 'ManjaroLinux' ]]; then
  86.   optdepends+=("python: Python scripting")
  87. else
  88.   optdepends+=("python>=$_pythonver: Python scripting")
  89. fi
  90. provides=("obs-studio=$pkgver" "obs-vst" "obs-browser")
  91. conflicts=("obs-studio" "obs-vst" "obs-browser" "obs-linuxbrowser")
  92. options=('debug')
  93. source=(
  94.   "obs-studio::git+https://github.com/obsproject/obs-studio.git#tag=$pkgver"
  95.   "git+https://github.com/obsproject/obs-browser.git"
  96.   "git+https://github.com/obsproject/obs-vst.git"
  97. )
  98. sha256sums=(
  99.   "SKIP"
  100.   "SKIP"
  101.   "SKIP"
  102. )
  103.  
  104. if [[ $DISTRIB_ID == 'ManjaroLinux' ]]; then
  105. source+=(
  106.   "$pkgname.hook"
  107.   "$pkgname.sh"
  108. )
  109. sha256sums+=(
  110.   "e65c155cb5c35160d44ae3117f1fc69a9300bf12bfcdd337b139197b48b86654"
  111.   "e5699cf7735c0d765b433d322917ae93238f26f5f332f2d351f1e85a3d1e2849"
  112. )
  113. fi
  114.  
  115. prepare() {
  116.   cd "$srcdir/obs-studio"
  117.   git config submodule.plugins/obs-vst.url $srcdir/obs-vst
  118.   git config submodule.plugins/obs-browser.url $srcdir/obs-browser
  119.   git submodule update
  120.  
  121.   ## linux-capture: Don't initialize format info if init_obs_pipewire fails (https://github.com/obsproject/obs-studio/commit/9903d73f36809c20795d5a918f2898fa6b8b88f8)
  122.   sed -i '1438 a return NULL; }' plugins/linux-capture/pipewire.c
  123.   sed -i '1437 a {' plugins/linux-capture/pipewire.c
  124.  
  125.   ## linux-pipewire: Version check call to pw_deinit (https://github.com/obsproject/obs-studio/commit/bf660b1d8dc1905527bb5919b1034c7b43c55dac)
  126.   sed -i '74,77d' plugins/linux-capture/linux-capture.c
  127.  
  128.   ## libobs,obs-outputs: Fix librtmp1 dependency interference on some linuxes (https://github.com/obsproject/obs-studio/pull/6377)
  129.   sed -i 's/#define EXPORT/#define EXPORT __attribute__((visibility("default")))/g' libobs/util/c99defs.h
  130.  
  131.   ## obs-ffmpeg: Several fixes allowing support of FFmpeg 5 (https://github.com/obsproject/obs-studio/pull/6423)
  132.   git cherry-pick -n e66542075d5d2cb51a14a0bdf3458ac10757de64
  133.   git cherry-pick -n 5b6cc73c2475abe6a85647604b9ce937dec09000
  134.   git cherry-pick -n 12d1f1c3358f7231244db0b971a333445e346f80
  135. }
  136.  
  137. build() {
  138.   cd obs-studio
  139.   mkdir -p build; cd build
  140.  
  141.   cmake \
  142.     -DCMAKE_BUILD_TYPE=RelWithDebInfo \
  143.     -DCMAKE_INSTALL_PREFIX=/usr \
  144.     -DCMAKE_INSTALL_LIBDIR=lib \
  145.     -DBUILD_BROWSER=ON \
  146.     -DCEF_ROOT_DIR="/opt/cef-obs" \
  147.     -DOBS_VERSION_OVERRIDE="$pkgver-browser-$pkgrel" ..
  148.  
  149.   make
  150. }
  151.  
  152. package() {
  153.   cd obs-studio/build
  154.  
  155.   make install DESTDIR="$pkgdir"
  156.  
  157.   if [[ $DISTRIB_ID == 'ManjaroLinux' ]]; then
  158.     install -D -m644 "$srcdir/$pkgname.hook" -t "${pkgdir}"/usr/share/libalpm/hooks/
  159.     install -D -m755 "$srcdir/$pkgname.sh" -t "${pkgdir}"/usr/share/libalpm/scripts/
  160.   fi
  161. }
  162.  
Tags: OBS
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement