forked from FemboyOS/fempkg_recipes
68 lines
2.4 KiB
Python
68 lines
2.4 KiB
Python
pkgname = "ffmpeg"
|
|
pkgver = "8.0.1"
|
|
source = f"https://ffmpeg.org/releases/ffmpeg-{pkgver}.tar.xz"
|
|
builddir = f"/tmp/fempkg/build/{pkgname}/{pkgname}-{pkgver}"
|
|
fembuilddir = f"/tmp/fempkg/build/{pkgname}"
|
|
outputdir = "/home/gabry/lfs-repo/binpkg"
|
|
manifestdir = "/home/gabry/lfs-repo/manifests"
|
|
destdir = f"{fembuilddir}/DESTDIR"
|
|
|
|
deps = [
|
|
"libaom", "libass", "dav1d", "SVT-AV1", "x264", "x265",
|
|
"nasm", "freetype", "libvorbis", "libwebp"
|
|
]
|
|
|
|
build = [
|
|
# --- Extract source ---
|
|
f"mkdir -p {fembuilddir} && cd {fembuilddir} && "
|
|
f"tar -xvf /var/lib/fempkg/pkgs/{pkgname}-{pkgver}.tar.xz && "
|
|
f"wget -q https://www.linuxfromscratch.org/patches/blfs/svn/ffmpeg-{pkgver}-chromium_method-1.patch",
|
|
|
|
# --- Configure ---
|
|
f"cd {builddir} && patch -Np1 -i ../ffmpeg-{pkgver}-chromium_method-1.patch && "
|
|
"./configure "
|
|
"--prefix=/usr "
|
|
"--disable-debug "
|
|
"--disable-static "
|
|
"--enable-shared "
|
|
"--enable-gpl "
|
|
"--enable-version3 "
|
|
"--enable-libaom "
|
|
"--enable-libass "
|
|
"--enable-libdav1d "
|
|
"--enable-libfreetype "
|
|
"--enable-libmp3lame "
|
|
"--enable-libopus "
|
|
"--enable-libvorbis "
|
|
"--enable-libvpx "
|
|
"--enable-libx264 "
|
|
"--enable-libx265 "
|
|
"--enable-libsvtav1 "
|
|
"--enable-libwebp "
|
|
"--enable-libdrm "
|
|
"--enable-gnutls "
|
|
"--enable-nvdec "
|
|
"--enable-nvenc "
|
|
"--ignore-tests=enhanced-flv-av1,enhanced-flv-multitrack "
|
|
f"--docdir=/usr/share/doc/{pkgname}-{pkgver}",
|
|
|
|
# --- Build ---
|
|
f"cd {builddir} && make -j$(nproc) && gcc tools/qt-faststart.c -o tools/qt-faststart",
|
|
|
|
# --- Install (staged with DESTDIR) ---
|
|
f"cd {builddir} && make install DESTDIR={destdir} && "
|
|
f"install -v -m755 tools/qt-faststart {destdir}/usr/bin && "
|
|
f"install -v -m755 -d {destdir}/usr/share/doc/{pkgname}-{pkgver} && "
|
|
f"install -v -m644 doc/*.txt {destdir}/usr/share/doc/{pkgname}-{pkgver}",
|
|
|
|
f"install -v -d -m755 {destdir}/usr/share/licenses/{pkgname}/",
|
|
f"cp -pv {builddir}/COPYING* {destdir}/usr/share/licenses/{pkgname}/",
|
|
|
|
# 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} /tmp/fempkgbuild"
|
|
]
|