Skip to content
Snippets Groups Projects
Commit b1ce282a authored by Ilias Tsitsimpis's avatar Ilias Tsitsimpis
Browse files

Support Haskell packages without a Setup.hs file

parent 57fe7663
No related branches found
Tags 0.16.0
No related merge requests found
......@@ -477,9 +477,25 @@ make_setup_recipe(){
if test -e $setup
then
run ghc --make $setup -o ${DEB_SETUP_BIN_NAME}
exit 0
exit 0
fi
done
# Having a Setup.hs is considered good practice, but there are a few
# Haskell packages that don't, since cabal does not use it for build types
# other than 'Custom'. Find out the build type and use the corresponding
# standardized Setup.hs file. For more information, see
# https://www.haskell.org/cabal/users-guide/developing-packages.html#pkg-field-build-type
if grep -q '^build-type: \+Simple' ${CABAL_PACKAGE}.cabal; then
setup="/usr/share/haskell-devscripts/Setup-Simple.hs"
elif grep -q 'build-type: \+Configure' ${CABAL_PACKAGE}.cabal; then
setup="/usr/share/haskell-devscripts/Setup-Configure.hs"
elif grep -q 'build-type: \+Make' ${CABAL_PACKAGE}.cabal; then
setup="/usr/share/haskell-devscripts/Setup-Make.hs"
else
echo "Could not find a suitable Setup.hs file" >&2
exit 1
fi
run ghc --make $setup -o ${DEB_SETUP_BIN_NAME} -outputdir debian/tmp-setup-hs
# PS4=$PS5
}
......
import Distribution.Simple
main = defaultMainWithHooks autoconfUserHooks
import Distribution.Make
main = defaultMain
import Distribution.Simple
main = defaultMain
haskell-devscripts (0.16.0) unstable; urgency=medium
* Support Haskell packages without a Setup.hs file
-- Ilias Tsitsimpis <iliastsi@debian.org> Sat, 20 Jun 2020 13:17:44 +0300
haskell-devscripts (0.15.3) unstable; urgency=medium
* Fix bug in install_doc_recipe() which wrongly assumed that
......
......@@ -45,7 +45,7 @@ Package: haskell-devscripts
Architecture: all
Depends: ${misc:Depends}
, ghc (>= 8.2)
, haskell-devscripts-minimal
, haskell-devscripts-minimal (= ${source:Version})
, hscolour
Description: Tools to help Debian developers build Haskell packages
This package provides a collection of scripts to help build Haskell
......
......@@ -5,3 +5,6 @@ dh_haskell_extra_depends usr/bin/
dh_haskell_blurbs usr/bin/
Dh_Haskell.sh usr/share/haskell-devscripts/
hlibrary.mk usr/share/cdbs/1/class
Setup-Make.hs usr/share/haskell-devscripts/
Setup-Simple.hs usr/share/haskell-devscripts/
Setup-Configure.hs usr/share/haskell-devscripts/
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment