blob: 945ecf1170f1a33c50955b338606130d063d330d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
|
# Maintainer: Benjamin Klettbach <b dot klettbach at gmail dot com >
# Contributor: Jonathan Steel <jsteel at archlinux.org>
# Contributor: ArcticVanguard <LideEmily at gmail dot com>
# Contributor: ledti <antergist at gmail dot com>
## options
: ${_plugin_aja:=false}
_pkgname="obs-studio"
pkgname="$_pkgname-git"
pkgver=32.0.4.r25.g407944a
pkgrel=1
pkgdesc="Free, open source software for live streaming and recording"
url="https://github.com/obsproject/obs-studio"
license=("GPL-2.0-or-later")
arch=("i686" "x86_64")
depends=(
'curl'
'ffmpeg'
'jack'
'jansson'
'libdatachannel'
'libpipewire'
'librist'
'libvpl'
'libxcomposite'
'mbedtls'
'pciutils'
'qrcodegencpp-cmake'
'qt6-svg'
'rnnoise'
'speexdsp'
)
makedepends=(
'asio'
'cmake'
'extra-cmake-modules'
'ffnvcodec-headers'
'git'
'libfdk-aac'
'luajit'
'ninja'
'nlohmann-json'
'python'
'qt6-wayland'
'simde'
'sndio'
'swig'
'uthash'
'vlc'
'wayland'
'websocketpp'
'x264'
'xdg-desktop-portal'
)
optdepends=(
'libfdk-aac: FDK AAC codec support'
'libva-intel-driver: hardware encoding'
'libva-mesa-driver: hardware encoding'
'luajit: scripting support'
'python: scripting support'
'sndio: sndio input client'
'v4l2loopback-dkms: virtual camera support'
'vlc: VLC Media Source'
)
if [ "${_plugin_aja::1}" == "t" ]; then
depends+=('libajantv2') # AUR
_plugin_aja='ON'
else
_plugin_aja='OFF'
fi
provides=("$_pkgname=${pkgver%%.g*}")
conflicts=("$_pkgname")
options=('!lto' '!strip')
_source_main() {
source=(
"$pkgname::git+https://github.com/obsproject/obs-studio.git#branch=master"
"git+https://github.com/obsproject/obs-browser.git"
"git+https://github.com/obsproject/obs-websocket.git"
)
sha256sums=(
'SKIP'
'SKIP'
'SKIP'
)
}
_source_cef() {
depends+=(
'at-spi2-core'
'libxdamage'
'libxrandr'
'nspr'
'nss'
)
local _response _response_cef _cef_dl_url _cef_hash _cef_filename
_response=$(curl -Ssf --follow --retry 3 "$url/raw/refs/heads/master/build-aux/com.obsproject.Studio.json")
_response_cef=$(grep -E -e '^\s*"(url|sha256)":' <<< "$_response" | grep -A1 cef_binary)
_cef_dl_url=$(grep -Pom1 '"url": "\K[^"]+' <<< "$_response_cef")
_cef_hash=$(grep -Pom1 '"sha256": "\K[0-9a-f]+' <<< "$_response_cef")
_cef_filename=$(basename "$_cef_dl_url")
_cef_src=$(sed -E 's&(_v[0-9]+)?\..*$&&' <<< "$_cef_filename")
source+=("$_cef_filename"::"$_cef_dl_url")
sha256sums+=("$_cef_hash")
}
_source_main
_source_cef
pkgver() {
cd "$pkgname"
local _version=$(git tag | grep -Ev '.*[a-z]{2}.*' | sort -rV | head -1)
local _revision=$(git rev-list --count --cherry-pick "$_version"...HEAD)
local _hash=$(git rev-parse --short=7 HEAD)
printf '%s.r%s.g%s' "${_version:?}" "${_revision:?}" "${_hash:?}"
}
prepare() {
cd "$pkgname"
local gitconf="protocol.file.allow=always"
git rm -r deps/libdshowcapture/src
git config submodule.plugins/obs-browser.url $srcdir/obs-browser
git config submodule.plugins/obs-websocket.url $srcdir/obs-websocket
git -c $gitconf submodule update
# fix for Qt 6.10
sed -e 's&Qt::GuiPrivate&&' \
-i frontend/cmake/os-freebsd.cmake frontend/cmake/os-linux.cmake
sed -e '/GuiPrivate/d' \
-i frontend/plugins/aja-output-ui/CMakeLists.txt \
frontend/plugins/decklink-output-ui/CMakeLists.txt \
frontend/plugins/frontend-tools/CMakeLists.txt
}
build() (
export CFLAGS CXXFLAGS
CFLAGS="${CFLAGS/_FORTIFY_SOURCE=?/_FORTIFY_SOURCE=2}"
CXXFLAGS="${CXXFLAGS/_FORTIFY_SOURCE=?/_FORTIFY_SOURCE=2}"
local _cmake_options=(
-B build
-S "$pkgname"
-G Ninja
-DCMAKE_BUILD_TYPE=None
-DCMAKE_INSTALL_PREFIX='/usr'
-DCMAKE_INSTALL_LIBDIR='lib'
-DCEF_ROOT_DIR="$srcdir/$_cef_src"
-DOBS_VERSION_OVERRIDE="${pkgver%%.r*}"
-DOBS_COMPILE_DEPRECATION_AS_WARNING=ON
-DENABLE_BROWSER=ON # qrcodegencpp-cmake
-DENABLE_LIBFDK=ON
-Wno-dev
-DENABLE_AJA="${_plugin_aja:?}"
-DENABLE_JACK=ON
-DENABLE_NEW_MPEGTS_OUTPUT=ON
-DENABLE_VLC=ON
-DENABLE_VST=ON
-DENABLE_WEBRTC=ON
)
cmake "${_cmake_options[@]}"
cmake --build build
)
package() {
DESTDIR="$pkgdir" cmake --install build
chmod -R u+rwX,go+rX,go-w "$pkgdir"
}
# vim: ts=2:sw=2:expandtab
|