aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormaxice8 <thinkabit.ukim@gmail.com>2019-01-30 20:39:26 +0000
committermaxice8 <30738253+maxice8@users.noreply.github.com>2019-01-31 17:08:13 +0000
commit1a0ce0e066e3b6e1c57e36538a5799d1e226d7bb (patch)
tree1e70858476b417f137b75fc705fd18c7a9def281
parentcddaf60127e0ecc861d6a7fc6bac4c0a1721af1f (diff)
downloadvoid-packages-1a0ce0e066e3b6e1c57e36538a5799d1e226d7bb.tar
void-packages-1a0ce0e066e3b6e1c57e36538a5799d1e226d7bb.tar.gz
void-packages-1a0ce0e066e3b6e1c57e36538a5799d1e226d7bb.tar.bz2
void-packages-1a0ce0e066e3b6e1c57e36538a5799d1e226d7bb.tar.lz
void-packages-1a0ce0e066e3b6e1c57e36538a5799d1e226d7bb.tar.xz
void-packages-1a0ce0e066e3b6e1c57e36538a5799d1e226d7bb.tar.zst
void-packages-1a0ce0e066e3b6e1c57e36538a5799d1e226d7bb.zip
hooks/pre-pkg/05-rename-python3-c-bindings.sh: introduce
-rw-r--r--common/hooks/pre-pkg/05-rename-python3-c-bindings.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/common/hooks/pre-pkg/05-rename-python3-c-bindings.sh b/common/hooks/pre-pkg/05-rename-python3-c-bindings.sh
new file mode 100644
index 00000000000..f3a90146b21
--- /dev/null
+++ b/common/hooks/pre-pkg/05-rename-python3-c-bindings.sh
@@ -0,0 +1,16 @@
+# This hook executes the following tasks:
+# - renames cpython binding files to not include the arch-specific extension suffix
+
+hook() {
+ if [ ! -d ${PKGDESTDIR}/${py3_sitelib} ]; then
+ return 0
+ fi
+
+ find "${PKGDESTDIR}/${py3_sitelib}" -type f -executable -iname '*.cpython*.so' \
+ | while read -r file; do
+ filename="${file##*/}"
+ modulename="${filename%%.*}"
+ msg_warn "${pkgver}: renamed '${filename}' to '${modulename}.so'.\n"
+ mv ${file} ${file%/*}${modulename}.so
+ done
+}