From c68e6ccd67c95b55f12dfc4539cf10d85eb34317 Mon Sep 17 00:00:00 2001 From: juandmcr Date: Thu, 19 Nov 2026 22:37:00 +0100 Subject: [PATCH] new package: python3-libloot (because it's a dependency of amethyst-mod-manager) --- srcpkgs/python3-libloot/template | 36 ++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 srcpkgs/python3-libloot/template diff --git a/srcpkgs/python3-libloot/template b/srcpkgs/python3-libloot/template new file mode 100644 index 0000000..1748e2d --- /dev/null +++ b/srcpkgs/python3-libloot/template @@ -0,0 +1,36 @@ +# Template file for 'python3-libloot' +pkgname=python3-libloot +version=0.29.7 +revision=1 +archs="~*-musl" +build_helper="rust python3" +hostmakedepends="python3-devel maturin rust cargo rust-src patchelf python3-packaging-bootstrap" +makedepends="python3-devel" +depends="python3" +short_desc="Experimental Python wrapper around libloot" +maintainer="Juan Rojas " +license="GPL-3.0-only" +homepage="https://github.com/loot/libloot" +distfiles="https://github.com/loot/libloot/archive/refs/tags/${version}.tar.gz" +checksum=ed168a13ba42b353e6bb863f0b85f14295a951ec210b19ae8893b27c4681c7a6 + +do_build() { + cd "${wrksrc}/python" + if [ -n "$CROSS_BUILD" ]; then + export PYO3_CROSS_LIB_DIR="${XBPS_CROSS_BASE}/usr/lib/python3.14" + export CARGO_UNSTABLE_BUILD_STD="std,panic_abort" + export RUSTC_BOOTSTRAP=1 + fi + maturin build --release +} + +do_install() { + PY_TAG="$(python3 -c 'import sys; print(f"cpython-{sys.version_info.major}{sys.version_info.minor}")')" + ARCH="$(xbps-uhelper arch)" + SO_NAME="loot.${PY_TAG}-${ARCH}-linux-gnu.so" + + LOOT_SO="$(find "${wrksrc}/target" -name 'libloot*.so' -o -name 'loot*.so' | head -1)" + + vmkdir "${py3_sitelib}" + vcopy "$LOOT_SO" "${py3_sitelib}/${SO_NAME}" +}