3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/applications/science/math/sage/shebangs.patch
Timo Kaufmann b223662ad1 sage: 8.0 -> 8.1, fix sandbox build
The sandboxed build was failing, because it relied heavily on
/usr/bin/env. This is fixed with a lot of shebang patching (both
to system packages and to sage-internal packages).
2018-01-26 14:42:24 +01:00

37 lines
1,020 B
Diff

diff --git a/build/bin/sage-spkg b/build/bin/sage-spkg
index 83e61a7e0d..942ba206c7 100755
--- a/build/bin/sage-spkg
+++ b/build/bin/sage-spkg
@@ -648,8 +648,12 @@ if ! sage-apply-patches; then
error_msg "Error applying patches"
exit 1
fi
+
+@bash@/bin/bash @patchSageShebangs@ .
+
cd ..
+
##################################################################
# The package has been extracted, prepare for installation
##################################################################
@@ -671,7 +675,7 @@ write_script_wrapper() {
local tmpscript="$(dirname "$script")/.tmp-${script##*/}"
cat > "$tmpscript" <<__EOF__
-#!/usr/bin/env bash
+#! @bash@/bin/bash
export SAGE_ROOT="$SAGE_ROOT"
export SAGE_SRC="$SAGE_SRC"
@@ -833,6 +837,9 @@ if [ "$UNAME" = "CYGWIN" ]; then
sage-rebase.sh "$SAGE_LOCAL" 2>/dev/null
fi
+@bash@/bin/bash @patchSageShebangs@ .
+@bash@/bin/bash @patchSageShebangs@ "$out/bin"
+
echo "Successfully installed $PKG_NAME"
if [ "$SAGE_CHECK" = "yes" ]; then