-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5feab67
commit 0b7f444
Showing
3 changed files
with
82 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
build | ||
obs-plugin-backgroundremoval* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
ARG PACKAGE_NAME=obs-backgroundremoval | ||
ARG PACKAGE_VERSION=1.1.13 | ||
|
||
ENV CPU_ARCH=x86_64 | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
|
||
FROM debian:bookworm | ||
|
||
RUN set -eux \ | ||
&& apt-get --yes update \ | ||
&& apt-get --yes install --no-install-recommends \ | ||
build-essential \ | ||
ca-certificates \ | ||
cmake \ | ||
curl \ | ||
libcurl4-openssl-dev \ | ||
git \ | ||
libobs-dev \ | ||
libonnx-dev \ | ||
libopencv-dev \ | ||
libsimde-dev \ | ||
wget \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
RUN git clone https://github.com/locaal-ai/obs-backgroundremoval.git \ | ||
&& cd obs-backgroundremoval \ | ||
&& git checkout ${PACKAGE_VERSION} \ | ||
&& mkdir build \ | ||
&& cd build \ | ||
&& cmake .. \ | ||
&& cmake --build . \ | ||
&& cmake --install . \ | ||
&& mkdir --parents /build | ||
|
||
VOLUME [ "/build" ] | ||
|
||
CMD set -eux \ | ||
&& mkdir --parents /build/usr/lib/${CPU_ARCH}-linux-gnu/obs-plugins/ \ | ||
&& cp --force /usr/local/lib/obs-plugins/obs-backgroundremoval.so /build/usr/lib/${CPU_ARCH}-linux-gnu/obs-plugins/ \ | ||
&& cp --force /usr/local/lib/obs-plugins/obs-backgroundremoval/libonnxruntime.so* /build/usr/lib/${CPU_ARCH}-linux-gnu/ \ | ||
&& mkdir --parents /build/usr/share/obs/obs-plugins/obs-backgroundremoval/ \ | ||
&& cp --force --recursive /usr/local/share/obs/obs-plugins/obs-backgroundremoval/* /build/usr/share/obs/obs-plugins/obs-backgroundremoval/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/sh | ||
|
||
DEB_NAME=obs-plugin-backgroundremoval | ||
DEB_VERSION=${1:-1.1.13} | ||
DEB_ARCH=`dpkg --print-architecture` | ||
|
||
dpkg -s podman 2>/dev/null >/dev/null | ||
if [ $? -ne 0 ]; then | ||
echo "ERROR: 'podman' not installed, please install like so and re-run this script:" | ||
echo " sudo apt install -y podman" | ||
exit 1 | ||
fi | ||
|
||
if [ -d ./build ]; then | ||
rm -rf "./build" | ||
fi | ||
mkdir ./build | ||
|
||
podman build --build-arg PACKAGE_VERSION="${DEB_VERSION}" --tag "${DEB_NAME}:${DEB_VERSION}" . | ||
podman run --env CPU_ARCH=`uname -m` --interactive --tty --rm --volume "${PWD}/build:/build" "${DEB_NAME}:${DEB_VERSION}" | ||
|
||
if [ -d "./${DEB_NAME}_${DEB_VERSION}" ]; then | ||
rm -rf "./${DEB_NAME}_${DEB_VERSION}/" | ||
fi | ||
mkdir --parents "./${DEB_NAME}_${DEB_VERSION}/DEBIAN" | ||
cat << EOF > "./${DEB_NAME}_${DEB_VERSION}/DEBIAN/control" | ||
Package: ${DEB_NAME} | ||
Version: ${DEB_VERSION} | ||
Architecture: ${DEB_ARCH} | ||
Depends: obs-studio | ||
Maintainer: Juergen Pabel <[email protected]> | ||
Description: OBS Studio plugin backgroundremoval | ||
EOF | ||
|
||
(cd ./build ; tar cf - .) | (cd "./${DEB_NAME}_${DEB_VERSION}" ; tar xf -) | ||
dpkg-deb --root-owner-group --build "${DEB_NAME}_${DEB_VERSION}" && dpkg-name -o -s . "./${DEB_NAME}_${DEB_VERSION}.deb" |