diff options
author | Dmitry Kalinkin <dmitry.kalinkin@gmail.com> | 2016-10-29 14:47:32 -0400 |
---|---|---|
committer | Dmitry Kalinkin <dmitry.kalinkin@gmail.com> | 2016-10-29 14:47:32 -0400 |
commit | 9434ec54414c6cbfd3be6e6f8d3b7fec74e75aae (patch) | |
tree | 3811974edb6870595d81d5643ef421c29ad6f45c | |
parent | fa4167c0a13cbe0d97b9c88d91b86845a8c4e740 (diff) | |
download | nixlib-9434ec54414c6cbfd3be6e6f8d3b7fec74e75aae.tar nixlib-9434ec54414c6cbfd3be6e6f8d3b7fec74e75aae.tar.gz nixlib-9434ec54414c6cbfd3be6e6f8d3b7fec74e75aae.tar.bz2 nixlib-9434ec54414c6cbfd3be6e6f8d3b7fec74e75aae.tar.lz nixlib-9434ec54414c6cbfd3be6e6f8d3b7fec74e75aae.tar.xz nixlib-9434ec54414c6cbfd3be6e6f8d3b7fec74e75aae.tar.zst nixlib-9434ec54414c6cbfd3be6e6f8d3b7fec74e75aae.zip |
root: fix environment setup
1) s/envHook/postHook/ 2) patch to not set $p that fixes nested ```nix-shell -p root``` calls
-rw-r--r-- | pkgs/applications/science/misc/root/default.nix | 3 | ||||
-rw-r--r-- | pkgs/applications/science/misc/root/setup-hook.sh | 2 | ||||
-rw-r--r-- | pkgs/applications/science/misc/root/thisroot.patch | 15 |
3 files changed, 19 insertions, 1 deletions
diff --git a/pkgs/applications/science/misc/root/default.nix b/pkgs/applications/science/misc/root/default.nix index 45d7686b3e52..d1106a758473 100644 --- a/pkgs/applications/science/misc/root/default.nix +++ b/pkgs/applications/science/misc/root/default.nix @@ -21,6 +21,9 @@ stdenv.mkDerivation rec { sha256 = "186i7ni75yvjydy6lpmaplqxfb5z2019bgpbhff1n6zn2qlrff2r"; }) ./sw_vers.patch + + # this prevents thisroot.sh from setting $p, which interferes with stdenv setup + ./thisroot.patch ]; preConfigure = '' diff --git a/pkgs/applications/science/misc/root/setup-hook.sh b/pkgs/applications/science/misc/root/setup-hook.sh index 197dc78c3c2c..fc2b697d8a82 100644 --- a/pkgs/applications/science/misc/root/setup-hook.sh +++ b/pkgs/applications/science/misc/root/setup-hook.sh @@ -6,4 +6,4 @@ thisroot () { source @out@/bin/thisroot.sh } -envHooks+=(thisroot) +postHooks+=(thisroot) diff --git a/pkgs/applications/science/misc/root/thisroot.patch b/pkgs/applications/science/misc/root/thisroot.patch new file mode 100644 index 000000000000..57cd5838e64a --- /dev/null +++ b/pkgs/applications/science/misc/root/thisroot.patch @@ -0,0 +1,15 @@ +diff --git a/config/thisroot.sh b/config/thisroot.sh +index 85dee20..532cb28 100644 +--- a/config/thisroot.sh ++++ b/config/thisroot.sh +@@ -15,8 +15,8 @@ drop_from_path() + return 1 + fi + +- p=$1 +- drop=$2 ++ local p=$1 ++ local drop=$2 + + newpath=`echo $p | sed -e "s;:${drop}:;:;g" \ + -e "s;:${drop};;g" \ |