Magellan Linux

Diff of /trunk/include/haskell.sminc

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 5502 by niro, Wed Jun 30 23:02:55 2010 UTC revision 5571 by niro, Fri Jul 2 08:18:49 2010 UTC
# Line 9  sminclude mtools Line 9  sminclude mtools
9  : ${HOMEPAGE="http://hackage.haskell.org/package/${PNAME/#haskell-/}"}  : ${HOMEPAGE="http://hackage.haskell.org/package/${PNAME/#haskell-/}"}
10    
11  # some sane default dependencies  # some sane default dependencies
12    # all packages with haskell in the name needs ghc as runtime
13    if [[ ${PNAME/#haskell-/} != ${PNAME} ]]
14    then
15     DEPEND="${DEPEND}
16     >= dev-lang/ghc-6.12"
17    fi
18    # all other only as SDEPEND
19  SDEPEND="${SDEPEND}  SDEPEND="${SDEPEND}
20   >= dev-lang/ghc-6.12"   >= dev-lang/ghc-6.12"
21    
# Line 21  SRC_URI=( Line 28  SRC_URI=(
28   mirror://${PNAME}/${SRCFILE}   mirror://${PNAME}/${SRCFILE}
29  )  )
30    
31    # possible features which are supported atm
32    HASKELL_POSSIBLE_FEATURES="split-objs shared register haddock"
33    # default haskell features
34    HASKELL_FEATURES="split-objs shared register"
35    
36  HASKELL_PNAME="${PNAME}"  HASKELL_PNAME="${PNAME}"
37  SPECIAL_VARS="HASKELL_PNAME"  SPECIAL_VARS="${SPECIAL_VARS} HASKELL_PNAME"
38  SPECIAL_FUNCTIONS="${SPECIAL_FUNCTIONS} haskell_preinstall haskell_postinstall haskell_preremove haskell_postremove"  SPECIAL_FUNCTIONS="${SPECIAL_FUNCTIONS} haskell_preinstall haskell_postinstall haskell_preremove haskell_postremove"
39    
40    haskell_feature()
41    {
42     local search="$1"
43     local feature
44     for feature in ${HASKELL_FEATURES}
45     do
46     # feature was found
47     [[ ${search} = ${feature} ]] && return 0
48     done
49    
50     # feature was *not* found
51     return 1
52    }
53    
54    haskell_feature_is_supported()
55    {
56     local search="$1"
57     local feature
58     for feature in ${HASKELL_POSSIBLE_FEATURES}
59     do
60     # feature was found
61     [[ ${search} = ${feature} ]] && return 0
62     done
63    
64     # feature was *not* found
65     return 1
66    }
67    
68    haskell_disable_feature()
69    {
70     local feature="$1"
71     haskell_feature_is_supported "${feature}" || die "haskell feature '${feature}' not supported!"
72     echo -e "${COLBLUE}--- ${COLRED}disabled haskell feature '${feature}'${COLDEFAULT}"
73     export HASKELL_FEATURES="${HASKELL_FEATURES/${feature}/}"
74    }
75    
76    haskell_enable_feature()
77    {
78     local feature="$1"
79     haskell_feature_is_supported "${feature}" || die "haskell feature '${feature}' not supported!"
80     echo -e "${COLBLUE}+++ ${COLGREEN}enabled haskell feature '${feature}'${COLDEFAULT}"
81     export HASKELL_FEATURES+=" ${feature}"
82    }
83    
84  haskell_ghc_version()  haskell_ghc_version()
85  {  {
86   local ver   local ver
# Line 67  haskell_src_configure() Line 123  haskell_src_configure()
123  {  {
124   local configure_opts="$@"   local configure_opts="$@"
125    
126   configure_opts+=" --enable-split-objs"   haskell_feature split-objs && configure_opts+=" --enable-split-objs"
127   configure_opts+=" --enable-shared"   haskell_feature shared && configure_opts+=" --enable-shared"
128    
129   runhaskell $(haskell_ghc_setup_script) configure \   runhaskell $(haskell_ghc_setup_script) configure \
130   --ghc \   --ghc \
# Line 81  haskell_src_configure() Line 137  haskell_src_configure()
137   || die   || die
138  }  }
139    
140    haskell_src_build()
141    {
142     runhaskell $(haskell_ghc_setup_script) build || die
143    }
144    
145  haskell_src_compile()  haskell_src_compile()
146  {  {
147   cd ${SRCDIR}   cd ${SRCDIR}
148   haskell_src_configure || die   haskell_src_configure || die
149   runhaskell $(haskell_ghc_setup_script) build || die   haskell_src_build || die
150  }  }
151    
152  haskell_src_install()  haskell_src_install()
153  {  {
154   cd ${SRCDIR}   cd ${SRCDIR}
   
155   runhaskell $(haskell_ghc_setup_script) copy --destdir=${BINDIR} || die   runhaskell $(haskell_ghc_setup_script) copy --destdir=${BINDIR} || die
156    
157   # create register scripts   # create register scripts
158   haskell_install_register || die   if haskell_feature register
159     then
160     haskell_install_register || die
161     fi
162    
163   # install docs   # install docs
164   local i   local i

Legend:
Removed from v.5502  
changed lines
  Added in v.5571