aboutsummaryrefslogtreecommitdiffstats
path: root/netexec/netexec.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'netexec/netexec.SlackBuild')
-rw-r--r--netexec/netexec.SlackBuild10
1 files changed, 7 insertions, 3 deletions
diff --git a/netexec/netexec.SlackBuild b/netexec/netexec.SlackBuild
index 2594169..6b2d3ad 100644
--- a/netexec/netexec.SlackBuild
+++ b/netexec/netexec.SlackBuild
@@ -96,12 +96,16 @@ python3 -m venv $PKG$VENVDIR
$PKG$VENVDIR/bin/pip install --no-index --no-deps --find-links=$TMP/wheels \
$TMP/wheels/*.whl
+# Drop bytecode: it bakes in the build path and is non-reproducible; the
+# interpreter regenerates it on first run.
+find $PKG$VENVDIR -depth -type d -name __pycache__ -exec rm -rf {} +
+
# venvs are not relocatable: the absolute build path ($PKG$VENVDIR) is baked
# into bin/* script shebangs and pyvenv.cfg. Rewrite it to the installed
# prefix so the venv resolves at $VENVDIR after the package is installed.
-sed -i "s|$PKG$VENVDIR|$VENVDIR|g" \
- $PKG$VENVDIR/pyvenv.cfg \
- $PKG$VENVDIR/bin/*
+# Only rewrite regular files (bin/ also holds symlinks like python3).
+sed -i "s|$PKG$VENVDIR|$VENVDIR|g" $PKG$VENVDIR/pyvenv.cfg
+find $PKG$VENVDIR/bin -type f -exec sed -i "s|$PKG$VENVDIR|$VENVDIR|g" {} +
# pip leaves the venv's own python as a symlink to the build host's python3;
# that resolves fine on the target since it points at the system interpreter.