3 |
# default includes |
# default includes |
4 |
sminclude mtools |
sminclude mtools |
5 |
|
|
6 |
|
# upstream package name |
7 |
|
: ${HASKELL_PACKAGE="${PNAME/#haskell-/}"} |
8 |
|
|
9 |
# some sane default values |
# some sane default values |
10 |
: ${PCATEGORIE="dev-haskell"} |
: ${PCAT="dev-haskell"} |
11 |
: ${DESCRIPTION="${PNAME}"} |
: ${DESCRIPTION="${PNAME}"} |
12 |
: ${HOMEPAGE="http://hackage.haskell.org/package/${PNAME/#haskell-/}"} |
: ${HOMEPAGE="http://hackage.haskell.org/package/${HASKELL_PACKAGE}"} |
13 |
|
|
14 |
# some sane default dependencies |
# some sane default dependencies |
15 |
|
# all packages with haskell in the name needs ghc as runtime |
16 |
|
if [[ ${PNAME/#haskell-/} != ${PNAME} ]] |
17 |
|
then |
18 |
|
DEPEND="${DEPEND} |
19 |
|
>= dev-lang/ghc-6.12" |
20 |
|
fi |
21 |
|
# all other only as SDEPEND |
22 |
SDEPEND="${SDEPEND} |
SDEPEND="${SDEPEND} |
23 |
>= dev-lang/ghc-6.12" |
>= dev-lang/ghc-6.12" |
24 |
|
|
25 |
# default SRCFILE SRCDIR and SRC_URI |
# default SRCFILE SRCDIR and SRC_URI |
26 |
: ${SRCFILE="${PNAME/#haskell-/}-${PVER}.tar.gz"} |
: ${SRCFILE="${HASKELL_PACKAGE}-${PVER}.tar.gz"} |
27 |
: ${SRCDIR="${BUILDDIR}/${PNAME/#haskell-/}-${PVER}"} |
: ${SRCDIR="${BUILDDIR}/${HASKELL_PACKAGE}-${PVER}"} |
28 |
SRC_URI=( |
SRC_URI=( |
29 |
${SRC_URI[*]} |
${SRC_URI[*]} |
30 |
http://hackage.haskell.org/packages/archive/${PNAME/#haskell-/}/${PVER}/${SRCFILE} |
http://hackage.haskell.org/packages/archive/${HASKELL_PACKAGE}/${PVER}/${SRCFILE} |
31 |
mirror://${PNAME}/${SRCFILE} |
mirror://${PNAME}/${SRCFILE} |
32 |
) |
) |
33 |
|
|
71 |
haskell_disable_feature() |
haskell_disable_feature() |
72 |
{ |
{ |
73 |
local feature="$1" |
local feature="$1" |
74 |
haskell_feature_is_supported || die "haskell feature '${feature}' not supported!" |
haskell_feature_is_supported "${feature}" || die "haskell feature '${feature}' not supported!" |
75 |
|
echo -e "${COLBLUE}--- ${COLRED}disabled haskell feature '${feature}'${COLDEFAULT}" |
76 |
export HASKELL_FEATURES="${HASKELL_FEATURES/${feature}/}" |
export HASKELL_FEATURES="${HASKELL_FEATURES/${feature}/}" |
77 |
} |
} |
78 |
|
|
79 |
haskell_enable_feature() |
haskell_enable_feature() |
80 |
{ |
{ |
81 |
local feature="$1" |
local feature="$1" |
82 |
haskell_feature_is_supported || die "haskell feature '${feature}' not supported!" |
haskell_feature_is_supported "${feature}" || die "haskell feature '${feature}' not supported!" |
83 |
|
echo -e "${COLBLUE}+++ ${COLGREEN}enabled haskell feature '${feature}'${COLDEFAULT}" |
84 |
export HASKELL_FEATURES+=" ${feature}" |
export HASKELL_FEATURES+=" ${feature}" |
85 |
} |
} |
86 |
|
|
133 |
--ghc \ |
--ghc \ |
134 |
--prefix=/usr \ |
--prefix=/usr \ |
135 |
--libdir=/usr/$(mlibdir) \ |
--libdir=/usr/$(mlibdir) \ |
136 |
--libsubdir=ghc-$(haskell_ghc_version)/${PNAME/#haskell-/}-${PVER} \ |
--libsubdir=ghc-$(haskell_ghc_version)/${HASKELL_PACKAGE}-${PVER} \ |
137 |
--datadir=/usr/share \ |
--datadir=/usr/share \ |
138 |
--datasubdir=ghc-$(haskell_ghc_version)/${PNAME/#haskell-/}-${PVER} \ |
--datasubdir=ghc-$(haskell_ghc_version)/${HASKELL_PACKAGE}-${PVER} \ |
139 |
${configure_opts} \ |
${configure_opts} \ |
140 |
|| die |
|| die |
141 |
} |
} |
158 |
runhaskell $(haskell_ghc_setup_script) copy --destdir=${BINDIR} || die |
runhaskell $(haskell_ghc_setup_script) copy --destdir=${BINDIR} || die |
159 |
|
|
160 |
# create register scripts |
# create register scripts |
161 |
haskell_feature register && haskell_install_register || die |
if haskell_feature register |
162 |
|
then |
163 |
|
haskell_install_register || die |
164 |
|
fi |
165 |
|
|
166 |
# install docs |
# install docs |
167 |
local i |
local i |