From 0b8ed5444e6bd243222170139ae4a8dfffef797b Mon Sep 17 00:00:00 2001 From: Tasos Sahanidis Date: Sat, 11 May 2024 09:49:44 +0300 Subject: extra/python-xcffib: Fetch pregenerated py bindings from upstream --- extra/python-xcffib/PKGBUILD | 5 +++++ extra/python-xcffib/xcffibgen-custom | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 extra/python-xcffib/PKGBUILD create mode 100755 extra/python-xcffib/xcffibgen-custom diff --git a/extra/python-xcffib/PKGBUILD b/extra/python-xcffib/PKGBUILD new file mode 100644 index 00000000..60d54f90 --- /dev/null +++ b/extra/python-xcffib/PKGBUILD @@ -0,0 +1,5 @@ +source+=('xcffibgen-custom') +sha512sums+=('d86673c86ec0e0714cc6eb0247ec9f4e542cf0266cb5acfd6d650cf216fabf3c8d1d145636bd1bd8df39548460fcb95e3b120c0018cf4536b594756fa45cb7e5') +makedepends=(${makedepends[@]//haskell-xcffib/}) +makedepends+=('archlinux-keyring' 'pacman') +eval "$(declare -f build | sed 's@GEN=xcffibgen@GEN="../xcffibgen-custom $pkgver-$pkgrel"@')" diff --git a/extra/python-xcffib/xcffibgen-custom b/extra/python-xcffib/xcffibgen-custom new file mode 100755 index 00000000..69f70760 --- /dev/null +++ b/extra/python-xcffib/xcffibgen-custom @@ -0,0 +1,32 @@ +#!/usr/bin/env -S bash -x +mirror='http://ftp.otenet.gr/linux/archlinux' + +version="$1" +shift + +while [[ $# -gt 0 ]]; do + if [[ $1 == '--output' ]]; then + output="$2" + shift + shift + elif [[ $1 == '--input' ]]; then + input="$2" + shift + shift + fi +done + +curl -O "${mirror}/extra/os/x86_64/python-xcffib-${version}-any.pkg.tar.zst" +curl -O "${mirror}/extra/os/x86_64/python-xcffib-${version}-any.pkg.tar.zst.sig" + +if pacman-key -v "python-xcffib-${version}-any.pkg.tar.zst.sig" "python-xcffib-${version}-any.pkg.tar.zst"; then + tar -xf "python-xcffib-${version}-any.pkg.tar.zst" + + pyver=$(python -c 'import sys; print(".".join(map(str, sys.version_info[:2])))') + tarpath="usr/lib/python${pyver}/site-packages/xcffib/" + + mapfile -t files < <(find "$input" -type f -name '*.xml' -printf "${tarpath}%f\n" | sed 's/xml$/py/') + + mkdir -p "$output" + cp "${files[@]}" "$output" || true +fi -- cgit v1.2.3-54-g00ecf