File: install_script.sh

package info (click to toggle)
ghc 9.10.3-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 169,076 kB
  • sloc: haskell: 713,554; ansic: 84,184; cpp: 30,255; javascript: 9,003; sh: 7,870; fortran: 3,527; python: 3,228; asm: 2,523; makefile: 2,324; yacc: 1,570; lisp: 532; xml: 196; perl: 111; csh: 2
file content (34 lines) | stat: -rwxr-xr-x 1,016 bytes parent folder | download | duplicates (2)
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
#!/bin/sh

# $1 = executable name
# $2 = wrapper path
# $3 = bindir
# $4 = ghcbindir
# $5 = Executable binary path
# $6 = Library Directory
# $7 = Docs Directory
# $8 = Includes Directory
# We are installing wrappers to programs by searching corresponding
# wrappers. If wrapper is not found, we are attaching the common wrapper
# 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.

echo "Installing $1 -> $2"
if [ -L "wrappers/$1" ]; then
    cp -RP "wrappers/$1" "$2"
else
    rm -f "$2" &&
    touch "$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"  &&
    chmod 755 "$2"
fi