summaryrefslogtreecommitdiffstats
path: root/modules/cabal.py
diff options
context:
space:
mode:
Diffstat (limited to 'modules/cabal.py')
-rw-r--r--modules/cabal.py16
1 files changed, 13 insertions, 3 deletions
diff --git a/modules/cabal.py b/modules/cabal.py
index 4ddea87..a993326 100644
--- a/modules/cabal.py
+++ b/modules/cabal.py
@@ -94,7 +94,7 @@ class Cabal(BuildSystem):
+ (['--user', '--prefix=' + expanduser('~')] if user else [])
p = Popen(cmd, stdout=cabal_out, stderr=cabal_out)
log.info('Configuring %s, please wait...' % self.name)
- p.wait()
+ p.communicate()
def build(self, *args):
'''runs the build stage of cabal
@@ -111,7 +111,7 @@ class Cabal(BuildSystem):
cmd = [abspath('Setup'), 'build']
p = Popen(cmd, stdout=cabal_out, stderr=cabal_out)
log.info('Building %s, please wait...' % self.name)
- p.wait()
+ p.communicate()
def install(self, *args):
'''runs the install stage of cabal
@@ -128,7 +128,7 @@ class Cabal(BuildSystem):
cmd = [abspath('Setup'), 'install']
p = Popen(cmd, stdout=cabal_out, stderr=cabal_out)
log.info('Building %s, please wait...' % self.name)
- p.wait()
+ p.communicate()
def install_source(self, target='home', *args):
'''perform configure, build, and install steps in one
@@ -138,6 +138,16 @@ class Cabal(BuildSystem):
self.build(orig)
self.install(orig)
+ def gen_spec(self):
+ cabal_file = self.pkg_src.hackage_name + '.spec'
+ with pwd(self.pkg_src.pkg_src_dir):
+ with log_file('cabal2spec.log') as c2s_log:
+ with pwd(self.pkg_src.dir):
+ cmd = ['cabal2spec', cabal_file]
+ p = Popen(cmd, stdout=c2s_log, stderr=c2s_log)
+ log.info('Generating spec file for %s' % cabal_file)
+ p.communicate()
+
def close(self):
self.pkg_src.close()