Index: bin/MakeRecipe
===================================================================
--- bin/MakeRecipe	(revision 3176)
+++ bin/MakeRecipe	(working copy)
@@ -276,6 +276,10 @@
 then
    Log_Normal "$packagename $versionnumber build system seems to be based on CMake."
    echo "recipe_type=cmake" >> "$recipefile"
+elif egrep - q"Setup.l?hs" "$file_contents"
+then
+   # Note: check Haskell Cabal before regular configure because cabal
+   # will often invoke autoconf operations
 elif grep -q "configure.in$" "$file_contents" \
 || grep -q "configure.ac$" "$file_contents"
 then
Index: bin/Compile
===================================================================
--- bin/Compile	(revision 3176)
+++ bin/Compile	(working copy)
@@ -1429,5 +1429,51 @@
 
 ##################################################
 
+
+if [ "$recipe_type" = "cabal" ]
+then
+   Quiet ghc -V || Die "This is a cabal recipe and you don't seem to have GHC installed."
+   [ "$runhaskell" ] || runhaskell="runhaskell"
+   if [ ! "$override_default_options" = "yes" ]
+   then
+      cabal_variables=(
+         "${cabal_variables[@]}"
+         "--prefix=$target"
+      )
+   fi
+   for flag in "${useflags[@]}"
+   do
+      cabal_variables=("${cabal_variables[@]}" "`eval echo '$'with_$flag`")
+   done
+   if [ ! -z "$goboIndex" ]
+   then
+      cabal_variables=(`echo ${cabal_variables[@]} | sed "s,$target,$goboIndex,g"`)
+   fi
+   build_tree_if "true"
+   for f in Setup.lhs Setup.hs ; do
+      [ -e $f ] && cabal_setup="$f";
+   done
+   [ ! -z "$cabal_setup" ] || Die "Cabal Setup.hs or Setup.lhs not found"
+   if ! [ "$do_build" = "no" ]
+   then
+      $runhaskell "$cabal_setup" configure "${cabal_variables[@]}" || wrap_fail "Configure failed"
+      run_hooks pre_build
+      $runhaskell "$cabal_setup" build "${build_variables[@]}" || wrap_fail "Build failed."
+   fi
+   Boolean "no-install" && exit
+   run_hooks pre_install
+   if [ ! "$do_install" = "no" ]
+   then
+      pkg_dbloc=$(dirname `ghc-pkg list | head -n 1 | cut -f1 -d:`)
+      SandboxInstall $verbose ${sandboxopts[@]} -a $pkg_dbloc -c $runhaskell "$appname" "$versionnumber" -- "$cabal_setup" install "${install_variables[@]}" || wrap_fail "Installation failed."
+   fi
+   do_symlink --no-make "$appname" "$versionnumber" || wrap_fail "Installation failed."
+   check_direct_dependencies
+   run_hooks post_install
+   wrapup
+fi
+
+##################################################
+
 Die "Unsupported configuration in recipe '$recipe'."
 
