summaryrefslogtreecommitdiff
path: root/hadrian/bindist
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2021-08-12 10:46:33 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-08-13 21:48:03 -0400
commita975583c70e57434340d9a20c976c8f06fde9beb (patch)
tree69981dcd7fe395fd5dfd13d5a49002cbc626dfb6 /hadrian/bindist
parent9700b9a878640747f9460e2d681b6dd08cd7da54 (diff)
downloadhaskell-a975583c70e57434340d9a20c976c8f06fde9beb.tar.gz
hadrian: Also produce versioned wrapper scripts
Since !6133 we are more consistent about producing versioned executables but we still didn't produce versioned wrappers. This patch adds the corresponding versioned wrappers to match the versioned executables in the relocatable bindist. I also fixed the ghci wrapper so that it wasn't overwritten during installation. The final bindir looks like: ``` lrwxrwxrwx 1 matt users 16 Aug 12 11:56 ghc -> ghc-9.3.20210809 -rwxr-xr-x 1 matt users 674 Aug 12 11:56 ghc-9.3.20210809 lrwxrwxrwx 1 matt users 17 Aug 12 11:56 ghci -> ghci-9.3.20210809 -rwxr-xr-x 1 matt users 708 Aug 12 11:56 ghci-9.3.20210809 lrwxrwxrwx 1 matt users 20 Aug 12 11:56 ghc-pkg -> ghc-pkg-9.3.20210809 -rwxr-xr-x 1 matt users 734 Aug 12 11:56 ghc-pkg-9.3.20210809 lrwxrwxrwx 1 matt users 14 Aug 12 11:56 haddock -> haddock-2.24.0 -rwxr-xr-x 1 matt users 682 Aug 12 11:56 haddock-2.24.0 lrwxrwxrwx 1 matt users 9 Aug 12 11:56 hp2ps -> hp2ps-0.1 -rwxr-xr-x 1 matt users 648 Aug 12 11:56 hp2ps-0.1 lrwxrwxrwx 1 matt users 8 Aug 12 11:56 hpc -> hpc-0.68 -rwxr-xr-x 1 matt users 646 Aug 12 11:56 hpc-0.68 lrwxrwxrwx 1 matt users 13 Aug 12 11:56 hsc2hs -> hsc2hs-0.68.8 -rwxr-xr-x 1 matt users 1.4K Aug 12 11:56 hsc2hs-0.68.8 lrwxrwxrwx 1 matt users 19 Aug 12 11:56 runghc -> runghc-9.3.20210809 -rwxr-xr-x 1 matt users 685 Aug 12 11:56 runghc-9.3.20210809 ``` Fixes #20225
Diffstat (limited to 'hadrian/bindist')
-rw-r--r--hadrian/bindist/Makefile41
1 files changed, 20 insertions, 21 deletions
diff --git a/hadrian/bindist/Makefile b/hadrian/bindist/Makefile
index d043cf2425..892bbb4f64 100644
--- a/hadrian/bindist/Makefile
+++ b/hadrian/bindist/Makefile
@@ -30,19 +30,25 @@ define installscript
# to it. This implementation is a bit hacky and depends on consistency
# of program names. For hadrian build this will work as programs have a
# consistent naming procedure.
- rm -f '$2'
- $(CREATE_SCRIPT) '$2'
- @echo "#!$(SHELL)" >> '$2'
- @echo "exedir=\"$4\"" >> '$2'
- @echo "exeprog=\"$1\"" >> '$2'
- @echo "executablename=\"$5\"" >> '$2'
- @echo "bindir=\"$3\"" >> '$2'
- @echo "libdir=\"$6\"" >> '$2'
- @echo "docdir=\"$7\"" >> '$2'
- @echo "includedir=\"$8\"" >> '$2'
- @echo "" >> '$2'
- cat wrappers/$1 >> '$2'
- $(EXECUTABLE_FILE) '$2' ;
+ if [ -L wrappers/$1 ]; then echo "$1 is a symlink"; fi
+ @if [ -L wrappers/$1 ]; then \
+ cp -P wrappers/$1 $2; \
+ else \
+ rm -f '$2' && \
+ $(CREATE_SCRIPT) '$2' && \
+ echo "#!$(SHELL)" >> '$2' && \
+ echo "exedir=\"$4\"" >> '$2' && \
+ echo "exeprog=\"$1\"" >> '$2' && \
+ echo "executablename=\"$5\"" >> '$2' && \
+ echo "bindir=\"$3\"" >> '$2' && \
+ echo "libdir=\"$6\"" >> '$2' && \
+ echo "docdir=\"$7\"" >> '$2' && \
+ echo "includedir=\"$8\"" >> '$2' && \
+ echo "" >> '$2' && \
+ cat wrappers/$1 >> '$2' && \
+ $(EXECUTABLE_FILE) '$2' ; \
+ fi
+ @echo "$1 installed to $2"
endef
# Hacky function to patch up the 'haddock-interfaces' and 'haddock-html'
@@ -79,7 +85,7 @@ install_bin: install_bin_libdir install_wrappers
endif
install: install_bin install_lib install_includes
-install: install_docs install_ghci update_package_db
+install: install_docs update_package_db
ActualBinsDir=${ghclibdir}/bin
ifeq "$(TargetOS_CPP)" "mingw32"
@@ -103,13 +109,6 @@ install_bin_direct:
$(INSTALL_DIR) "$(WrapperBinsDir)"
cp ./bin/* "$(WrapperBinsDir)/"
-install_ghci:
- @echo "Copying and installing ghci"
- $(CREATE_SCRIPT) '$(WrapperBinsDir)/ghci'
- @echo "#!$(SHELL)" >> '$(WrapperBinsDir)/ghci'
- cat wrappers/ghci-script >> '$(WrapperBinsDir)/ghci'
- $(EXECUTABLE_FILE) '$(WrapperBinsDir)/ghci'
-
LIBRARIES = $(wildcard ./lib/*)
install_lib:
@echo "Copying libraries to $(ActualLibsDir)"