Ticket #196: patch-scripts_install.sh

File patch-scripts_install.sh, 1.9 kB (added by AlainODea, 11 months ago)

PKGSRC patch for scripts/install.sh (works only for GHC 7.6.3)

Line 
1$NetBSD$
2 
3--- scripts/install.sh.orig 2013-05-04 20:56:20.000000000 +0000
4+++ scripts/install.sh
5@@ -21,25 +21,45 @@ install_pkg () {
6 
7   [ -x Setup ] || die "The ${PKG}/Setup script does not exist or cannot be run"
8 
9-  ./Setup copy ${VERBOSE} \
10-    || die "Installing the ${PKG} component failed"
11 
12-  ./Setup register ${VERBOSE} --gen-pkg-config="${PKG}.conf" \
13-    || die "Generating the registration information for the package ${PKG} failed"
14if [ -n "${DESTDIR}" ]; then
15 
16if [ -f ${PKG}.conf ]; then
17-    if test "${USER_INSTALL}" = "YES"; then
18-      GHC_PKG_DB="--user"
19-    else
20-      GHC_PKG_DB="--global"
21-    fi
22-    ${GHC_PKG} update ${GHC_PKG_DB} "${PKG}.conf" \
23-      || die "Registering the package ${PKG} failed"
24+      ./Setup copy ${VERBOSE} --destdir=${DESTDIR} \
25+        || die "Installing the ${PKG} component failed"
26
27+      ./Setup register ${VERBOSE} --gen-pkg-config="${DESTDIR}${PREFIX}/lib/ghc-7.6.3/package.conf.d/${PKG}.conf" \
28+        || die "Generating the registration information for the package ${PKG} failed"
29+       
30else
31+   
32+      ./Setup copy ${VERBOSE} \
33+        || die "Installing the ${PKG} component failed"
34+   
35+      ./Setup register ${VERBOSE} --gen-pkg-config="${PKG}.conf" \
36+        || die "Generating the registration information for the package ${PKG} failed"
37+       
38+      if [ -f ${PKG}.conf ]; then
39+        if test "${USER_INSTALL}" = "YES"; then
40+          GHC_PKG_DB="--user"
41+        else
42+          GHC_PKG_DB="--global"
43+        fi
44+        ${GHC_PKG} update ${GHC_PKG_DB} "${PKG}.conf" \
45+          || die "Registering the package ${PKG} failed"
46+      fi
47+   
48+      ./Setup copy ${VERBOSE} \
49+        || die "Installing the ${PKG} component failed"
50+   
51   fi
52 
53   cd ../..
54 }
55 
56+if [ -n "${DESTDIR}" ]; then
57+    mkdir -p ${DESTDIR}${PREFIX}/lib/ghc-7.6.3/package.conf.d
58+fi
59+
60 # Actually do something!
61 for pkg in `cat packages/platform.packages`; do
62   if is_pkg_installed "${pkg}"; then