From 104b3c4262fa3cb6b24ed0e1cd5402b14f4eab8f Mon Sep 17 00:00:00 2001 From: "Yaakov M. Nemoy" Date: Sun, 18 Jan 2009 21:12:09 -0500 Subject: Fixes up HaskellPort to work with the new refactoring. Also adds some close code for ports Also mistakenly stuck some code in HaskellPort that really belongs to the build system --- modules/cabal.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'modules/cabal.py') diff --git a/modules/cabal.py b/modules/cabal.py index 4b118d6..4ddea87 100644 --- a/modules/cabal.py +++ b/modules/cabal.py @@ -47,8 +47,12 @@ class Cabal(BuildSystem): name is a Package (Directory) that uses cabal for its build system ''' - self.name = name - self.pkg_src = DirFactory(name) + if type(name) is string: + self.pkg_src = DirFactory(name) + self.name = name + else: + self.pkg_src = name + self.name = name.name self.compiler = haskell_compiler def find_setup(self): @@ -126,6 +130,14 @@ class Cabal(BuildSystem): log.info('Building %s, please wait...' % self.name) p.wait() + def install_source(self, target='home', *args): + '''perform configure, build, and install steps in one + ''' + with self.pkg_src.src(*args): + self.configure(target, orig) + self.build(orig) + self.install(orig) + def close(self): self.pkg_src.close() -- cgit