aboutsummaryrefslogtreecommitdiffstats
path: root/community/ghc/0003-do-not-use-SHELL.patch
blob: 540efa92b1654cf0277191c444fd436c83db8128 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
Description: Do not use $SHELL
 as $SHELL is the user's preferred interactive shell. We do not want this to
 leak into the wrapper scripts.
Author: Joachim Breitner <nomeata@debian.org>

Index: ghc/driver/ghci/ghc.mk
===================================================================
--- ghc.orig/driver/ghci/ghc.mk	2016-07-07 12:40:40.690866042 +0200
+++ ghc/driver/ghci/ghc.mk	2016-07-07 12:40:40.686863966 +0200
@@ -21,7 +21,7 @@
 	$(INSTALL_DIR) "$(DESTDIR)$(bindir)"
 	$(call removeFiles,                                "$(WRAPPER)")
 	$(CREATE_SCRIPT)                                   "$(WRAPPER)"
-	echo '#!$(SHELL)'                               >> "$(WRAPPER)"
+	echo '#!/bin/sh'                                >> "$(WRAPPER)"
 	echo 'exec "$(bindir)/ghc-$(ProjectVersion)" --interactive "$$@"' >> "$(WRAPPER)"
 	$(EXECUTABLE_FILE)                                 "$(WRAPPER)"
 	$(call removeFiles,"$(DESTDIR)$(bindir)/ghci")
@@ -56,7 +56,7 @@
 install_driver_ghcii:
 	$(INSTALL_DIR) "$(DESTDIR)$(bindir)"
 	$(call removeFiles,"$(GHCII_SCRIPT)")
-	echo "#!$(SHELL)"                                  >> $(GHCII_SCRIPT)
+	echo "#!/bin/sh"                                        >> $(GHCII_SCRIPT)
 	echo 'exec "$$(dirname "$$0")"/ghc --interactive "$$@"' >> $(GHCII_SCRIPT)
 	$(EXECUTABLE_FILE) $(GHCII_SCRIPT)
 	cp $(GHCII_SCRIPT) $(GHCII_SCRIPT_VERSIONED)
Index: ghc/rules/shell-wrapper.mk
===================================================================
--- ghc.orig/rules/shell-wrapper.mk	2016-07-07 12:40:40.690866042 +0200
+++ ghc/rules/shell-wrapper.mk	2016-07-07 12:40:40.686863966 +0200
@@ -41,7 +41,7 @@
 endif
 $$($1_$2_INPLACE_WRAPPER): $$($1_$2_INPLACE)
 	$$(call removeFiles,                                                    $$@)
-	echo '#!$$(SHELL)'                                                   >> $$@
+	echo '#!/bin/sh'                                                     >> $$@
 	echo 'executablename="$$(TOP)/$$<"'                                  >> $$@
 	echo 'datadir="$$(TOP)/$$(INPLACE_LIB)"'                             >> $$@
 	echo 'bindir="$$(TOP)/$$(INPLACE_BIN)"'                              >> $$@
@@ -80,7 +80,7 @@
 	$$(INSTALL_DIR) "$$(DESTDIR)$$(bindir)"
 	$$(call removeFiles,                                        "$$(WRAPPER)")
 	$$(CREATE_SCRIPT)                                           "$$(WRAPPER)"
-	echo '#!$$(SHELL)'                                       >> "$$(WRAPPER)"
+	echo '#!/bin/sh'                                         >> "$$(WRAPPER)"
 	echo 'exedir="$$(ghclibexecdir)/bin"'                    >> "$$(WRAPPER)"
 	echo 'exeprog="$$($1_$2_PROG)"'                          >> "$$(WRAPPER)"
 	echo 'executablename="$$$$exedir/$$$$exeprog"'           >> "$$(WRAPPER)"
@@ -106,7 +106,7 @@
 
 $$($1_$2_BINDIST_WRAPPER): $1/$2/build/tmp/$$($1_$2_PROG)
 	$$(call removeFiles,                                                  $$@)
-	echo '#!$$(SHELL)'                                                 >> $$@
+	echo '#!/bin/sh'                                                    >> $$@
 ifeq "$$(DYNAMIC_GHC_PROGRAMS)" "YES"
 	echo '$$(call prependLibraryPath,$$($1_$2_DEP_LIB_REL_DIRS_SEARCHPATH))' >> $$@
 endif
Index: ghc/utils/mkdirhier/ghc.mk
===================================================================
--- ghc.orig/utils/mkdirhier/ghc.mk	2016-07-07 12:40:40.690866042 +0200
+++ ghc/utils/mkdirhier/ghc.mk	2016-07-07 12:40:40.686863966 +0200
@@ -14,7 +14,7 @@
 	mkdir -p $(INPLACE_BIN)
 	mkdir -p $(INPLACE_LIB)
 	$(call removeFiles,$@)
-	echo '#!$(SHELL)'  		 >> $@
+	echo '#!/bin/sh'		 >> $@
 	cat utils/mkdirhier/mkdirhier.sh >> $@
 	$(EXECUTABLE_FILE) $@