aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorclassabbyamp <void@placeviolette.net>2024-04-18 01:51:01 +0000
committerclassabbyamp <5366828+classabbyamp@users.noreply.github.com>2024-04-24 03:51:01 +0000
commit58705ffcbf2cfd62a9627c781b04613b2faea153 (patch)
tree1cd78f8e93c284e58849d66567fd9f6805684f31
parent5b210379b4f06941285dc906521a2f77aeada5ec (diff)
downloadvoid-packages-58705ffcbf2cfd62a9627c781b04613b2faea153.tar
void-packages-58705ffcbf2cfd62a9627c781b04613b2faea153.tar.gz
void-packages-58705ffcbf2cfd62a9627c781b04613b2faea153.tar.bz2
void-packages-58705ffcbf2cfd62a9627c781b04613b2faea153.tar.lz
void-packages-58705ffcbf2cfd62a9627c781b04613b2faea153.tar.xz
void-packages-58705ffcbf2cfd62a9627c781b04613b2faea153.tar.zst
void-packages-58705ffcbf2cfd62a9627c781b04613b2faea153.zip
common: support disabling python shebang rewriting
useful if there are special python-containing shebangs that should not be rewritten, for example with Ghidra's embedded jython.
Diffstat (limited to '')
-rw-r--r--Manual.md4
-rw-r--r--common/hooks/post-install/04-create-xbps-metadata-scripts.sh2
-rw-r--r--common/hooks/pre-pkg/03-rewrite-python-shebang.sh4
3 files changed, 8 insertions, 2 deletions
diff --git a/Manual.md b/Manual.md
index 34c737e6df4..53a2cc8a151 100644
--- a/Manual.md
+++ b/Manual.md
@@ -1250,7 +1250,7 @@ package accordingly. Additionally, the following functions are available:
- *vopt_feature()* `vopt_feature <option> <property>`
Same as `vopt_bool`, but uses `-D<property=enabled` and
- `-D<property>=disabled` respectively.
+ `-D<property>=disabled` respectively.
The following example shows how to change a source package that uses GNU
configure to enable a new build option to support PNG images:
@@ -1630,6 +1630,8 @@ In most cases version is inferred from shebang, install path or build style.
Only required for some multi-language
applications (e.g., the application is written in C while the command is
written in Python) or just single Python file ones that live in `/usr/bin`.
+If `python_version` is set to `ignore`, python-containing shebangs will not be rewritten.
+Use this only if a package should not be using a system version of python.
Also, a set of useful variables are defined to use in the templates:
diff --git a/common/hooks/post-install/04-create-xbps-metadata-scripts.sh b/common/hooks/post-install/04-create-xbps-metadata-scripts.sh
index 69e318a5608..f21017f8361 100644
--- a/common/hooks/post-install/04-create-xbps-metadata-scripts.sh
+++ b/common/hooks/post-install/04-create-xbps-metadata-scripts.sh
@@ -272,7 +272,7 @@ _EOF
fi
fi
- if [ -n "$python_version" ]; then
+ if [ -n "$python_version" ] && [ "$python_version" != ignore ]; then
pycompile_version=${python_version}
fi
diff --git a/common/hooks/pre-pkg/03-rewrite-python-shebang.sh b/common/hooks/pre-pkg/03-rewrite-python-shebang.sh
index 07162ad2c69..47c7a996a50 100644
--- a/common/hooks/pre-pkg/03-rewrite-python-shebang.sh
+++ b/common/hooks/pre-pkg/03-rewrite-python-shebang.sh
@@ -12,6 +12,10 @@ hook() {
pyver="$python_version"
fi
+ if [ "$python_version" = ignore ]; then
+ return
+ fi
+
if [ -n "$pyver" ]; then
default_shebang="#!/usr/bin/python${pyver%.*}"
fi