forked from FemboyOS/fempkg_recipes
42 lines
2.5 KiB
Python
42 lines
2.5 KiB
Python
pkgname = "obs-studio"
|
|
pkgver = "31.1.2"
|
|
source = f"https://github.com/obsproject/obs-studio/releases/download/{pkgver}/OBS-Studio-{pkgver}-Sources.tar.gz"
|
|
builddir = f"/tmp/fempkg/build/{pkgname}/{pkgname}-{pkgver}-sources"
|
|
fembuilddir = f"/tmp/fempkg/build/{pkgname}"
|
|
outputdir = "/home/gabry/lfs-repo/binpkg"
|
|
manifestdir = "/home/gabry/lfs-repo/manifests"
|
|
destdir = f"{fembuilddir}/DESTDIR"
|
|
deps = ["alsa-plugins" ,"cmake", "curl", "ffmpeg", "freetype", "fontconfig", "glib", "jansson", "libdrm", "libva", "libxkbcommon", "mbedtls",
|
|
"mesa", "libglvnd", "pciutils", "qt6", "uthash", "vulkan-loader", "xorg-libs", "x264", "atspi2core", "cups", "ffnv-codec",
|
|
"libdatachannel", "pipewire", "xdg-desktop-portal", "pulseaudio", "swig", "luajit", "v4l-utils", "nlohmann-json"]
|
|
|
|
build = [
|
|
# Extract
|
|
f"mkdir /tmp/fempkg/build {fembuilddir} || true && cd {fembuilddir} && tar -xvf /var/lib/fempkg/pkgs/OBS-Studio-{pkgver}-Sources.tar.gz && "
|
|
f"wget https://glfs-book.github.io/slfs/patches/obs/obs-studio-{pkgver}-qt6.10-1.patch https://cdn-fastly.obsproject.com/downloads/"
|
|
f"cef_binary_6533_linux_x86_64.tar.xz",
|
|
|
|
# apply qt6.10.x,ffmpeg 8.x patch and add CEF
|
|
f"cd {builddir} && patch -Np1 -i ../obs-studio-{pkgver}-qt6.10-1.patch && sed -i 's/FF_/AV_/g' plugins/obs-ffmpeg/obs-ffmpeg-vaapi.c && "
|
|
f"tar -xf ../cef_binary_6533_linux_x86_64.tar.xz && mv cef_binary_6533_linux_x86_64 cef-6533",
|
|
|
|
f"cd {builddir} && mkdir -pv build && cd build && cmake -D CMAKE_INSTALL_PREFIX=/usr -D CMAKE_BUILD_TYPE=Release "
|
|
f"-D CMAKE_SKIP_INSTALL_RPATH=ON -D ENABLE_BROWSER=ON -D CEF_ROOT_DIR=../cef-6533 -D ENABLE_AJA=OFF -D ENABLE_JACK=OFF "
|
|
f"-D ENABLE_WEBSOCKET=OFF -D ENABLE_SPEEXDSP=OFF -D ENABLE_VLC=OFF -D ENABLE_NEW_MPEGTS_OUTPUT=OFF -D OBS_COMPILE_DEPRECATION_AS_WARNING=ON "
|
|
f"-G Ninja -Wno-dev .. ", # WHO is gonna win atp
|
|
|
|
f"cd {builddir}/build && ninja",
|
|
f"cd {builddir}/build && DESTDIR={destdir} ninja install",
|
|
|
|
f"install -v -d -m755 {destdir}/usr/share/licenses/{pkgname}/",
|
|
f"install -v -m644 {builddir}/COPYING {destdir}/usr/share/licenses/{pkgname}/LICENSE",
|
|
f"install -v -m644 {builddir}/cef-6533/LICENSE.txt {destdir}/usr/share/licenses/{pkgname}/LICENSE.CEF",
|
|
|
|
# Make tarball + manifests
|
|
f"mkdir -p {outputdir} && cd {destdir} && tar --transform 's|^\\.||' -I zstd -cf {outputdir}/{pkgname}-{pkgver}.tar.zst .",
|
|
f"mkdir -p {manifestdir} && tar -tf {outputdir}/{pkgname}-{pkgver}.tar.zst | grep -v '/$' > {manifestdir}/{pkgname}.txt",
|
|
|
|
# Cleanup
|
|
f"rm -rf {builddir} {fembuilddir}"
|
|
]
|