Annotation of /branches/magellan-next/include/haskell.sminc
Parent Directory | Revision Log
Revision 5489 -
(hide annotations)
(download)
Wed Jun 30 16:30:59 2010 UTC (14 years, 4 months ago) by niro
Original Path: trunk/core/include/haskell.sminc
File size: 2872 byte(s)
Wed Jun 30 16:30:59 2010 UTC (14 years, 4 months ago) by niro
Original Path: trunk/core/include/haskell.sminc
File size: 2872 byte(s)
- added haskell minclude
1 | niro | 5489 | # $Id$ |
2 | |||
3 | # default includes | ||
4 | sminclude mtools | ||
5 | |||
6 | # some sane default values | ||
7 | : ${PCATEGORIE="dev-haskell"} | ||
8 | : ${DESCRIPTION="${PNAME}"} | ||
9 | : ${HOMEPAGE="http://hackage.haskell.org/package/${PNAME/#haskell-/}"} | ||
10 | |||
11 | # some sane default dependencies | ||
12 | DEPEND="${DEPEND} | ||
13 | >= dev-lang/ghc-6.12" | ||
14 | |||
15 | # default SRCFILE SRCDIR and SRC_URI | ||
16 | : ${SRCFILE="${PNAME/#haskell-/}-${PVER}.tar.gz"} | ||
17 | : ${SRCDIR="${BUILDDIR}/${PNAME/#haskell-/}-${PVER}"} | ||
18 | : ${SRC_URI=( "http://hackage.haskell.org/packages/archive/${PNAME/#haskell-/}/${PVER}/${SRCFILE}" "mirror://${PNAME}/${SRCFILE}" )} | ||
19 | |||
20 | HASKELL_PNAME="${PNAME}" | ||
21 | SPECIAL_VARS="HASKELL_PNAME" | ||
22 | |||
23 | haskell_ghc_version() | ||
24 | { | ||
25 | local ver | ||
26 | ver=$(ghc --numeric-version) | ||
27 | echo "${ver}" | ||
28 | } | ||
29 | |||
30 | haskell_ghc_setup_script() | ||
31 | { | ||
32 | local setup | ||
33 | if [[ -e Setup.lhs ]] | ||
34 | then | ||
35 | setup="Setup.lhs" | ||
36 | elif [[ -e Setup.hs ]] | ||
37 | then | ||
38 | setup="Setup.hs" | ||
39 | else | ||
40 | die "unkown setup script" | ||
41 | fi | ||
42 | |||
43 | echo "${setup}" | ||
44 | } | ||
45 | |||
46 | haskell_install_register() | ||
47 | { | ||
48 | runhaskell $(haskell_ghc_setup_script) register --gen-script || die | ||
49 | runhaskell $(haskell_ghc_setup_script) unregister --gen-script || die | ||
50 | |||
51 | minstalldir /usr/share/haskell/${PNAME} || die | ||
52 | minstallexec register.sh /usr/share/haskell/${PNAME} || die | ||
53 | minstallexec unregister.sh /usr/share/haskell/${PNAME} || die | ||
54 | } | ||
55 | |||
56 | haskell_src_prepare() | ||
57 | { | ||
58 | munpack ${SRCFILE} || die | ||
59 | } | ||
60 | |||
61 | haskell_src_configure() | ||
62 | { | ||
63 | local configure_opts="$@" | ||
64 | |||
65 | runhaskell $(haskell_ghc_setup_script) configure \ | ||
66 | --ghc \ | ||
67 | --prefix=/usr \ | ||
68 | --libdir=/usr/$(mlibdir) \ | ||
69 | --libsubdir=ghc-$(haskell_ghc_version)/${PNAME/#haskell-/}-${PVER} \ | ||
70 | --datadir=/usr/share \ | ||
71 | --datasubdir=ghc-$(haskell_ghc_version)/${PNAME/#haskell-/}-${PVER} \ | ||
72 | ${configure_opts} \ | ||
73 | || die | ||
74 | } | ||
75 | |||
76 | haskell_src_compile() | ||
77 | { | ||
78 | cd ${SRCDIR} | ||
79 | haskell_src_configure || die | ||
80 | runhaskell $(haskell_ghc_setup_script) build || die | ||
81 | } | ||
82 | |||
83 | haskell_src_install() | ||
84 | { | ||
85 | cd ${SRCDIR} | ||
86 | |||
87 | runhaskell $(haskell_ghc_setup_script) copy --destdir=${BINDIR} || die | ||
88 | |||
89 | # install docs | ||
90 | local i | ||
91 | for i in ABOUT-NLS AUTHORS BUGS CHANGES ChangeLog COPYING \ | ||
92 | FAQ LICENSE NEWS README TODO prologue.txt | ||
93 | do | ||
94 | if [ -f ${SRCDIR}/${i} ] | ||
95 | then | ||
96 | minstalldocs ${i} || die | ||
97 | fi | ||
98 | done | ||
99 | } | ||
100 | |||
101 | haskell_preinstall() | ||
102 | { | ||
103 | if [[ -x ${MROOT}/usr/share/haskell/${HASKELL_PNAME}/unregister.sh ]] | ||
104 | then | ||
105 | echo "unregister haskell module ${HASKELL_PNAME} ..." | ||
106 | ${MROOT}/usr/share/haskell/${HASKELL_PNAME}/unregister.sh | ||
107 | fi | ||
108 | } | ||
109 | |||
110 | haskell_postinstall() | ||
111 | { | ||
112 | if [[ -x ${MROOT}/usr/share/haskell/${HASKELL_PNAME}/register.sh ]] | ||
113 | then | ||
114 | echo "register haskell module ${HASKELL_PNAME} ..." | ||
115 | ${MROOT}/usr/share/haskell/${HASKELL_PNAME}/register.sh | ||
116 | fi | ||
117 | } | ||
118 | |||
119 | # haskell_preremove() | ||
120 | # { | ||
121 | # if [[ -x ${MROOT}/usr/share/haskell/${HASKELL_PNAME}/unregister.sh ]] | ||
122 | # then | ||
123 | # echo "unregister haskell module ${HASKELL_PNAME} ..." | ||
124 | # ${MROOT}/usr/share/haskell/${HASKELL_PNAME}/unregister.sh | ||
125 | # fi | ||
126 | # } | ||
127 | |||
128 | export_inherits haskell src_prepare src_compile src_install preinstall postinstall #preremove |