[jhbuild] distutils: support DESTDIR install



commit 40c145954a8a7a8161adb8d051784cbbad5c48ab
Author: Colin Walters <walters verbum org>
Date:   Tue May 24 16:35:56 2011 -0400

    distutils: support DESTDIR install
    
    This follows from the similar autotools work.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=647231

 jhbuild/modtypes/distutils.py |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/jhbuild/modtypes/distutils.py b/jhbuild/modtypes/distutils.py
index bed6b47..d4d56a1 100644
--- a/jhbuild/modtypes/distutils.py
+++ b/jhbuild/modtypes/distutils.py
@@ -43,6 +43,7 @@ class DistutilsModule(Package, DownloadableModule):
         Package.__init__(self, name, dependencies, after, suggests)
         self.branch = branch
         self.supports_non_srcdir_builds = supports_non_srcdir_builds
+        self.supports_install_destdir = True
 
     def get_srcdir(self, buildscript):
         return self.branch.srcdir
@@ -71,13 +72,16 @@ class DistutilsModule(Package, DownloadableModule):
         buildscript.set_action(_('Installing'), self)
         srcdir = self.get_srcdir(buildscript)
         builddir = self.get_builddir(buildscript)
+        destdir = self.prepare_installroot(buildscript)
         python = os.environ.get('PYTHON', 'python')
         cmd = [python, 'setup.py']
         if srcdir != builddir:
             cmd.extend(['build', '--build-base', builddir])
-        cmd.extend(['install', '--prefix', buildscript.config.prefix])
+        cmd.extend(['install', 
+                    '--prefix', buildscript.config.prefix,
+                    '--root', destdir])
         buildscript.execute(cmd, cwd = srcdir, extra_env = self.extra_env)
-        buildscript.packagedb.add(self.name, self.get_revision() or '')
+        self.process_install(buildscript, self.get_revision())
     do_install.depends = [PHASE_BUILD]
 
     def xml_tag_and_attrs(self):



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]