From 1a0ce0e066e3b6e1c57e36538a5799d1e226d7bb Mon Sep 17 00:00:00 2001 From: maxice8 Date: Wed, 30 Jan 2019 18:39:26 -0200 Subject: hooks/pre-pkg/05-rename-python3-c-bindings.sh: introduce --- common/hooks/pre-pkg/05-rename-python3-c-bindings.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 common/hooks/pre-pkg/05-rename-python3-c-bindings.sh 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 +} -- cgit v1.2.3