summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorPedroHLC2021-08-13 11:13:38 -0300
committerPedroHLC2021-08-13 11:13:38 -0300
commitafa8ee041be82e68945143b2a9fa0e871bd9ccd3 (patch)
treefa54052f4aa4d7aac6d10a47730b9cd9c6d9309c
downloadaur-afa8ee041be82e68945143b2a9fa0e871bd9ccd3.tar.gz
Submit PKGBUILD origanlly from author's repo
Source: https://github.com/royshil/obs-backgroundremoval
-rw-r--r--.SRCINFO17
-rw-r--r--PKGBUILD44
2 files changed, 61 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..530930d7d747
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,17 @@
+pkgbase = obs-backgroundremoval
+ pkgdesc = Background removal plugin for OBS studio (precomopiled onnxruntime)
+ pkgver = 0.2.5_beta
+ pkgrel = 1
+ url = https://github.com/royshil/obs-backgroundremoval
+ arch = x86_64
+ license = MIT
+ license = custom
+ makedepends = cmake
+ depends = obs-studio
+ depends = opencv
+ source = obs-backgroundremoval-0.2.5-beta.tar.gz::https://github.com/royshil/obs-backgroundremoval/archive/refs/tags/v0.2.5-beta.tar.gz
+ source = https://github.com/microsoft/onnxruntime/releases/download/v1.7.0/onnxruntime-linux-x64-1.7.0.tgz
+ sha256sums = c22280bfa5341e371c4d095717063fe04b15a2f529a531205e8df860d70aacb0
+ sha256sums = 0345f45f222208344406d79a6db3280ed2ccc884dc1e064ce6e6951ed4c70606
+
+pkgname = obs-backgroundremoval
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..b71b9717ba5d
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,44 @@
+pkgname=obs-backgroundremoval
+pkgver=0.2.5_beta
+_ONNXRUNTIME_FILE=onnxruntime-linux-x64-1.7.0.tgz
+_onnxdir=onnxruntime-linux-x64-1.7.0
+_bgdir=$pkgname-${pkgver//_/-}
+pkgrel=1
+arch=(x86_64)
+url='https://github.com/royshil/obs-backgroundremoval'
+pkgdesc="Background removal plugin for OBS studio (precomopiled onnxruntime)"
+license=(MIT custom)
+depends=(obs-studio opencv)
+makedepends=(cmake)
+source=("${_bgdir}.tar.gz::https://github.com/royshil/$pkgname/archive/refs/tags/v${pkgver//_/-}.tar.gz"
+ "https://github.com/microsoft/onnxruntime/releases/download/v1.7.0/$_ONNXRUNTIME_FILE")
+sha256sums=('c22280bfa5341e371c4d095717063fe04b15a2f529a531205e8df860d70aacb0'
+ '0345f45f222208344406d79a6db3280ed2ccc884dc1e064ce6e6951ed4c70606')
+
+prepare() {
+ # build from archive, not git. Version set during build()
+ sed -i "s/^version_from_git/#&/" $_bgdir/CMakeLists.txt
+}
+
+build() {
+ cd "$_bgdir"
+ # set rpath to avoid installing onnxruntime globally
+ cmake -B build -DVERSION="${pkgver//_*/.0}" -DobsIncludePath=/usr/include/obs/ \
+ -DCMAKE_INSTALL_PREFIX:PATH=/usr \
+ -DOnnxruntime_INCLUDE_DIRS="$srcdir/$_onnxdir/include/" -DOnnxruntime_LIBRARIES="$srcdir/$_onnxdir/lib/libonnxruntime.so" \
+ -DOnnxruntime_INCLUDE_DIR="$srcdir/$_onnxdir/include/" \
+ -DCMAKE_INSTALL_RPATH="/usr/lib/obs-backgroundremoval"
+ cd build
+ make
+}
+
+package() {
+ make -C "$_bgdir/build" DESTDIR="$pkgdir" install
+ install -Dt "$pkgdir/usr/share/licenses/obs-backgroundremoval" "$_bgdir/LICENSE"
+
+ # install onnxruntime
+ cd "$_onnxdir"
+ install -Dt "$pkgdir/usr/share/licenses/obs-backgroundremoval/onnxruntime" \
+ LICENSE Privacy.md README.md ThirdPartyNotices.txt
+ install -Dt "$pkgdir/usr/lib/obs-backgroundremoval" lib/*
+}