[55446] trunk/dports/devel/hmake

ryandesign at macports.org ryandesign at macports.org
Mon Aug 10 14:24:23 PDT 2009


Revision: 55446
          http://trac.macports.org/changeset/55446
Author:   ryandesign at macports.org
Date:     2009-08-10 14:24:21 -0700 (Mon, 10 Aug 2009)
Log Message:
-----------
hmake: fix "hmake-config: compiler not known: 'ghc'" with latest ghc; see #17800

Modified Paths:
--------------
    trunk/dports/devel/hmake/Portfile

Added Paths:
-----------
    trunk/dports/devel/hmake/files/patch-ghc-pkg.diff

Modified: trunk/dports/devel/hmake/Portfile
===================================================================
--- trunk/dports/devel/hmake/Portfile	2009-08-10 19:53:37 UTC (rev 55445)
+++ trunk/dports/devel/hmake/Portfile	2009-08-10 21:24:21 UTC (rev 55446)
@@ -18,7 +18,8 @@
                         sha1 c88e61a86053c2e2f600e534d1c323131b925e12 \
                         rmd160 b9f88e2ee4ed4bb6cc2df3d644864eb5e60c4a60
 
-patchfiles              patch-configure.diff
+patchfiles              patch-configure.diff \
+                        patch-ghc-pkg.diff
 
 configure.args          --mandir=${prefix}/share/man/man1
 

Added: trunk/dports/devel/hmake/files/patch-ghc-pkg.diff
===================================================================
--- trunk/dports/devel/hmake/files/patch-ghc-pkg.diff	                        (rev 0)
+++ trunk/dports/devel/hmake/files/patch-ghc-pkg.diff	2009-08-10 21:24:21 UTC (rev 55446)
@@ -0,0 +1,64 @@
+--- src/hmake/Config.hs	2007-11-23 08:26:05.000000000 -0600
++++ src/hmake/Config.hs	2009-08-10 16:16:35.000000000 -0500
+@@ -271,15 +271,15 @@
+       let ghcpkg0 = dirname fullpath++"/ghc-pkg-"++ghcversion
+       ok <- doesFileExist ghcpkg0
+       let ghcpkg = if ok then ghcpkg0 else dirname fullpath++"/ghc-pkg"
+-   -- pkgs <- runAndReadStdout (ghcpkg++" --list-packages")
+-      pkgs <- runAndReadStdout (ghcpkg++" -l")
++      pkgs <- runAndReadStdout (ghcpkg++" list")
++      --pkgs <- runAndReadStdout (ghcpkg++" -l")
+       let pkgsOK = filter (\p-> any (`isPrefixOf` p)
+                                     ["std","base","haskell98"])
+                           (deComma pkgs)
+       idirs <- mapM (\p-> runAndReadStdout
+-                              (ghcpkg++" --show-package="
++                              (ghcpkg++" field "
+                                ++deVersion (ghcsym>=604) p
+-                               ++" --field=import_dirs"))
++                               ++" import_dirs"))
+                     pkgsOK
+       return config{ includePaths = pkgDirs libdir (nub idirs) }
+  where
+--- src/hmake/MkConfig.hs	2006-07-07 11:01:16.000000000 -0500
++++ src/hmake/MkConfig.hs	2009-08-10 16:17:11.000000000 -0500
+@@ -258,14 +258,14 @@
+           ok <- doesFileExist ghcpkg0
+           let ghcpkg = if ok then ghcpkg0 else dirname fullpath++"/ghc-pkg"
+        -- pkgs <- runAndReadStdout (ghcpkg++" --list-packages")
+-          pkgs <- runAndReadStdout (ghcpkg++" -l")
++          pkgs <- runAndReadStdout (ghcpkg++" list")
+           let pkgsOK = filter (\p-> any (`isPrefixOf` p)
+                                         ["std","base","haskell98"])
+                               (deComma pkgs)
+           idirs <- mapM (\p-> runAndReadStdout
+-                                  (ghcpkg++" --show-package="
++                                  (ghcpkg++" field "
+                                    ++deVersion (ghcsym>=604) p
+-                                   ++" --field=import_dirs"))
++                                   ++" import_dirs"))
+                         pkgsOK
+           return config{ includePaths = pkgDirs libdir (nub idirs) }
+         else do ioError (userError ("Can't find ghc includes at "++incdir1))
+--- src/hmake/PackageConfig.hs	2008-04-25 05:28:08.000000000 -0500
++++ src/hmake/PackageConfig.hs	2009-08-10 16:17:30.000000000 -0500
+@@ -55,7 +55,7 @@
+    -- ghcpkg <- runAndReadStdout
+    --                  ("echo `" ++ ghc ++ " --print-libdir`/bin/ghc-pkg")
+    -- pkgs <- runAndReadStdout (ghcpkg++" --list-packages")
+-      pkgs <- runAndReadStdout (ghcpkg++" -l")
++      pkgs <- runAndReadStdout (ghcpkg++" list")
+       let (ok,bad) = partition (\p-> elemBy versionMatch p (deComma pkgs))
+                                packages
+       when (not (null bad))
+@@ -63,8 +63,8 @@
+                              ++concat (intersperse ", " bad)
+                              ++" not available (according to ghc-pkg)"))
+       idirs <- mapM (\p-> runAndReadStdout
+-                              (ghcpkg++" --show-package="++p
+-                               ++" --field=import_dirs"))
++                              (ghcpkg++" field "++p
++                               ++" import_dirs"))
+                     ok
+       return (pkgDirs libdir idirs)
+  where
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090810/1c46f167/attachment.html>


More information about the macports-changes mailing list