Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100755 65 lines (58 sloc) 1.73 kB
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
1 #!/bin/sh
35f9000 [wxhaskell-from-cvs @ 2003-07-21 19:29:38 by dleijen]
dleijen authored
2
6cc4431 [wxhaskell-from-cvs @ 2003-10-15 18:26:40 by dleijen]
dleijen authored
3 # guess installation directory
4 if test -e "/usr/local/wxhaskell/bin/wx.pkg"; then
5 installdir="/usr/local/wxhaskell"
6 else if test -e "./wx.pkg"; then
7 installdir=".."
8 else
9 installdir="/usr/local"
10 fi
11 fi
35f9000 [wxhaskell-from-cvs @ 2003-07-21 19:29:38 by dleijen]
dleijen authored
12
13 # parse command-line arguments
14 while : ; do
15 # put optional argument in the $arg variable
16 case "$1" in
17 -*=*) arg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
18 *) arg= ;;
19 esac
20
21 # match on the arguments
22 case "$1" in
23 "") break;;
24 -installdir=*|--installdir=*)
25 installdir="$arg";;
26 -?|--help)
27 echo "usage:"
28 echo " wxhaskell-register [--installdir=<dir>]"
29 exit 1;;
30 *) echo "error:" 1>&2
31 echo " Unknown option \"$1\"." 1>&2
32 echo "" 1>&2
33 echo "usage:" 1>&2
34 echo " wxhaskell-register [--installdir=<dir>]" 1>&2
35 echo "" 1>&2
36 exit 2;;
37 esac
38 shift
39 done
40
0ffff70 [wxhaskell-from-cvs @ 2003-10-17 12:33:13 by dleijen]
dleijen authored
41 # set libdir/bindir
42 libdir="${installdir}/lib"
43 bindir="${installdir}/bin"
35f9000 [wxhaskell-from-cvs @ 2003-07-21 19:29:38 by dleijen]
dleijen authored
44
45 # test if package files are found.
0ffff70 [wxhaskell-from-cvs @ 2003-10-17 12:33:13 by dleijen]
dleijen authored
46 if test ! -e "${bindir}/wx.pkg"; then
35f9000 [wxhaskell-from-cvs @ 2003-07-21 19:29:38 by dleijen]
dleijen authored
47 echo "error: " 1>&2
0ffff70 [wxhaskell-from-cvs @ 2003-10-17 12:33:13 by dleijen]
dleijen authored
48 echo " Unable to find wxhaskell packages: ${bindir}/wx.pkg" 1>&2
ebf61ef [wxhaskell-from-cvs @ 2003-07-22 14:24:39 by dleijen]
dleijen authored
49 echo " Please specify the installation directory on the command line." 1>&2
0ffff70 [wxhaskell-from-cvs @ 2003-10-17 12:33:13 by dleijen]
dleijen authored
50 echo " For example: wxhaskell-register --installdir=/usr/local/wxhaskell" 1>&2
35f9000 [wxhaskell-from-cvs @ 2003-07-21 19:29:38 by dleijen]
dleijen authored
51 echo "" 1>&2
52 exit 2
53 fi
54
55 # register the packages.
229b531 [wxhaskell-from-cvs @ 2005-04-29 10:00:26 by dleijen]
dleijen authored
56 if ghc-pkg list > /dev/null 2> /dev/null; then
57 # ghc-pkg 6.4 +
58 cat ${bindir}/wxcore.pkg | sed -e "s|\${wxhlibdir}|${libdir}|" | ghc-pkg update -
59 cat ${bindir}/wx.pkg | sed -e "s|\${wxhlibdir}|${libdir}|" | ghc-pkg update -
60 else
61 # pre ghc-pkg 6.4
62 env wxhlibdir=%{wxhlibdir} %{hcpkg}-%{hcversion} -u -i %{wxhlibdir}/wxcore.pkg
63 env wxhlibdir=%{wxhlibdir} %{hcpkg}-%{hcversion} -u -i %{wxhlibdir}/wx.pkg
64 fi
Something went wrong with that request. Please try again.