50 lines
1.9 KiB
Python
50 lines
1.9 KiB
Python
pkgname = "nvidia-egl-libraries"
|
|
pkgver = "1.0"
|
|
source = f"https://github.com/NVIDIA/eglexternalplatform/archive/1.2.1/eglexternalplatform-1.2.1.tar.gz" #dymmy url
|
|
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 = ["mesa", "libdrm", "libglvnd", "wayland", "wayland-protocols", "xorg-libs"]
|
|
|
|
build = [
|
|
# Extract (create directories only, sources will be fetched in the loop)
|
|
f"mkdir -pv /tmp/fempkg/build {fembuilddir} {builddir}",
|
|
|
|
# Prepare list
|
|
f"cd {builddir} && wget https://rocketleaguechatp.duckdns.org/nvidia-egl-list",
|
|
|
|
# Download, build, install
|
|
f"""cd {builddir} && mkdir -p nvidia-egl && cd nvidia-egl && \\
|
|
for package in $(grep -v '^#' ../nvidia-egl-list); do \\
|
|
url=https://github.com/NVIDIA/$package; \\
|
|
wget -c $url; \\
|
|
file=$(basename $package); \\
|
|
dir=${{file%.tar.?z*}}; \\
|
|
package_name="${{dir%-*}}"; \\
|
|
tar -xf $file; \\
|
|
pushd $dir; \\
|
|
mkdir -pv build; cd build; \\
|
|
meson setup --prefix=/usr --buildtype=release ..; \\
|
|
ninja; \\
|
|
DESTDIR={destdir} ninja install; \\
|
|
install -v -d -m755 {destdir}/usr/share/licenses/$package_name/; \\
|
|
install -v -m644 ../COPYING {destdir}/usr/share/licenses/$package_name/LICENSE || true; \\
|
|
install -v -m644 ../LICENSE {destdir}/usr/share/licenses/$package_name/LICENSE || true; \\
|
|
popd; \\
|
|
rm -rf $dir; \\
|
|
done && /sbin/ldconfig""",
|
|
|
|
# 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}"
|
|
]
|
|
|
|
triggers = [
|
|
f"cd /tmp && /sbin/ldconfig",
|
|
]
|