Received: from matrix.chaos.earth.li ([127.0.0.1] helo=localhost ident=ian)
	by matrix.chaos.earth.li with esmtp (Exim 3.36 #1 (Debian))
	id 1EZ2Ry-0003fA-00
	for <ian@localhost>; Mon, 07 Nov 2005 08:33:58 +0000
Received: from the.earth.li [193.201.200.66]
	by localhost with POP3 (fetchmail-6.2.5)
	for ian@localhost (single-drop); Mon, 07 Nov 2005 08:33:58 +0000 (GMT)
Received: from spohr.debian.org ([140.211.166.43])
	by the.earth.li with esmtp (Exim 4.50) id 1EZ2R7-0008Ut-Do
	for igloo@earth.li; Mon, 07 Nov 2005 08:33:05 +0000
Received: from debbugs by spohr.debian.org with local (Exim 3.36 1 (Debian))
	id 1EZ2R6-000452-00; Mon, 07 Nov 2005 00:33:04 -0800
X-Loop: owner@bugs.debian.org
Subject: Bug#337909: ghc6: regression in Cabal
Reply-To: Matej Vela <vela@debian.org>, 337909@bugs.debian.org
Resent-From: Matej Vela <vela@debian.org>
Resent-To: debian-bugs-dist@lists.debian.org
Resent-CC: Ian Lynagh (wibble) <igloo@debian.org>
Resent-Date: Mon, 07 Nov 2005 08:33:01 UTC
Resent-Message-ID: <handler.337909.B.11313515891287@bugs.debian.org>
X-Debian-PR-Message: report 337909
X-Debian-PR-Package: ghc6
X-Debian-PR-Keywords: patch upstream
Received: via spool by submit@bugs.debian.org id=B.11313515891287
	(code B ref -1); Mon, 07 Nov 2005 08:33:01 UTC
Received: (at submit) by bugs.debian.org; 7 Nov 2005 08:19:49 +0000
Received: from mail.irb.hr [161.53.22.8] (UNKNOWN)
	by spohr.debian.org with esmtp (Exim 3.36 1 (Debian))
	id 1EZ2EG-0000KD-00; Mon, 07 Nov 2005 00:19:48 -0800
Received: from diziet.irb.hr (diziet.irb.hr [161.53.22.31])
	by mail.irb.hr (8.13.3/8.13.3/Debian-6) with ESMTP id jA78JVUK030236
	for <submit@bugs.debian.org>; Mon, 7 Nov 2005 09:19:31 +0100
Received: from diziet.irb.hr (localhost [127.0.0.1])
	by diziet.irb.hr (8.13.5/8.13.5/Debian-3) with ESMTP id jA78JgZF015194
	for <submit@bugs.debian.org>; Mon, 7 Nov 2005 09:19:42 +0100
Received: (from mvela@localhost)
	by diziet.irb.hr (8.13.5/8.13.5/Submit) id jA78JfRC015192;
	Mon, 7 Nov 2005 09:19:41 +0100
From: Matej Vela <vela@debian.org>
To: submit@bugs.debian.org
Date: Mon, 07 Nov 2005 09:19:41 +0100
Message-ID: <8764r4dg4i.fsf@diziet.irb.hr>
User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/21.4 (gnu/linux)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Scanned-By: MIMEDefang 2.51 on 161.53.22.8
Delivered-To: submit@bugs.debian.org
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02
	(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Level: 
X-Spam-Status: No, hits=-8.0 required=4.0 tests=BAYES_00,HAS_PACKAGE
	autolearn=no version=2.60-bugs.debian.org_2005_01_02
Resent-Sender: Debian BTS <debbugs@bugs.debian.org>
X-Delivered-To: <igloo@earth.li>
X-UID: 105053
X-Keywords: 

--=-=-=

Package: ghc6
Version: 6.4.1-1
Severity: serious
Justification: causes an FTBFS for haskelldb, washngo
Tags: upstream patch

The following upstream change in 6.4.1 breaks packages that build
executables with HS-Source-Dir:

--- ghc6-6.4/libraries/Cabal/Distribution/Simple/Install.hs
+++ ghc6-6.4.1/libraries/Cabal/Distribution/Simple/Install.hs
@@ -107,8 +107,9 @@
               -> PackageDescription -> IO ()
 installExeGhc verbose pref buildPref pkg_descr
     = do createDirectoryIfMissing True pref
-         withExe pkg_descr $ \ (Executable e _ b) ->
-             copyFileVerbose verbose (buildPref `joinFileName` (hsSourceDir b) `joinFileName` e) (pref `joinFileName` e)
+         withExe pkg_descr $ \ (Executable e _ b) -> do
+             let exeName = e `joinFileExt` exeExtension
+             copyFileVerbose verbose (buildPref `joinFileName` exeName) (pref `joinFileName` exeName)
 
 -- |Install for ghc, .hi and .a
 installLibGHC :: Int      -- ^verbose

The new code looks for executables in dist/build/<exeName> rather than
dist/build/<HS-Source-Dir>/<exeName> where they are built, and the
installation phase breaks.  Patch attached.

Thanks,

Matej

--=-=-=
Content-Disposition: inline; filename=cabal-install.diff

--- ghc6-6.4.1.dist/libraries/Cabal/Distribution/Simple/Install.hs
+++ ghc6-6.4.1/libraries/Cabal/Distribution/Simple/Install.hs
@@ -109,7 +109,7 @@
     = do createDirectoryIfMissing True pref
          withExe pkg_descr $ \ (Executable e _ b) -> do
              let exeName = e `joinFileExt` exeExtension
-             copyFileVerbose verbose (buildPref `joinFileName` exeName) (pref `joinFileName` exeName)
+             copyFileVerbose verbose (buildPref `joinFileName` (hsSourceDir b) `joinFileName` exeName) (pref `joinFileName` exeName)
 
 -- |Install for ghc, .hi and .a
 installLibGHC :: Int      -- ^verbose

--=-=-=--

