Skip to content

Commit

Permalink
Merge remote-tracking branch 'ruester/haskell'
Browse files Browse the repository at this point in the history
* ruester/haskell:
  buildtypes: add haskell module support
  • Loading branch information
mariux committed Jul 31, 2013
2 parents 40aa4e4 + 2384fe7 commit 1a51691
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 0 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ BUILDTYPES+=perl-module
BUILDTYPES+=perl-module-makemaker
BUILDTYPES+=python-module
BUILDTYPES+=r-package
BUILDTYPES+=haskell-module

HELPER_HOOKS_SHELL+=update-mime-database
HELPER_HOOKS_SHELL+=glib-compile-schemas
Expand Down
75 changes: 75 additions & 0 deletions buildtypes/haskell-module.sh.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
#
# bee magic for haskell modules
#
# Copyright (C) 2009-2012
# Marius Tolzmann <tolzmann@molgen.mpg.de>
# Tobias Dreyer <dreyer@molgen.mpg.de>
# and other bee developers
#
# This file is part of bee.
#
# bee is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#

if [ ! -x ${S}/Setup -a ! -r ${S}/Setup.hs -a ! -r ${S}/Setup.lhs ]; then
return
fi

BEE_BUILDTYPE_DETECTED="haskell-module"

: ${GHC:=ghc}

build_in_sourcedir

#### bee_configure() ##########################################################

bee_configure() {
if [ ! -x Setup ]; then
# compile Setup with ghc
if [ -r Setup.hs ]; then
${GHC} Setup.hs -o Setup
else
# instead of a Setup.hs file there is
# sometimes a 'literate haskell' file Setup.lhs
${GHC} Setup.lhs -o Setup
fi
fi

start_cmd ./Setup \
configure \
--prefix="${PREFIX}" \
--bindir="${BINDIR}" \
--libdir="${LIBDIR}" \
--libexecdir="${LIBEXECDIR}" \
--datadir="${DATADIR}" \
--docdir="${DOCDIR}" \
"${@}"
}

#### bee_build() ##############################################################

bee_build() {
start_cmd ./Setup \
build \
"${@}"
}

#### bee_install() ############################################################

bee_install() {
start_cmd ./Setup \
copy \
--destdir="${D}" \
"${@}"
}
1 change: 1 addition & 0 deletions src/beesh.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -1022,6 +1022,7 @@ bee_buildmagic=$(${BEE_BINDIR}/beeuniq ${BEE_BUILDTYPE[@]} \
python-module \
make \
jb \
haskell-module \
)

BEE_BUILDTYPE_DETECTED=""
Expand Down

0 comments on commit 1a51691

Please sign in to comment.