hooks/pre-pkg/05-rename-python3-c-bindings.sh: introduce
This commit is contained in:
parent
cddaf60127
commit
1a0ce0e066
1 changed files with 16 additions and 0 deletions
16
common/hooks/pre-pkg/05-rename-python3-c-bindings.sh
Normal file
16
common/hooks/pre-pkg/05-rename-python3-c-bindings.sh
Normal file
|
@ -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
|
||||||
|
}
|
Loading…
Reference in a new issue