Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/extra/python-xcffib/xcffibgen-custom
diff options
context:
space:
mode:
authorTasos Sahanidis <tasos@tasossah.com>2024-05-11 09:49:44 +0300
committerTasos Sahanidis <tasos@tasossah.com>2024-05-11 09:49:44 +0300
commit0b8ed5444e6bd243222170139ae4a8dfffef797b (patch)
treeea6018b7014562e0faa16b588f55debc55e76296 /extra/python-xcffib/xcffibgen-custom
parent1dca0c4baa251b389bf429a3f249febc701f4781 (diff)
extra/python-xcffib: Fetch pregenerated py bindings from upstream
Diffstat (limited to 'extra/python-xcffib/xcffibgen-custom')
-rwxr-xr-xextra/python-xcffib/xcffibgen-custom32
1 files changed, 32 insertions, 0 deletions
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