diff --git a/setup/extensions.py b/setup/extensions.py index 5f45349c93..7682c73cba 100644 --- a/setup/extensions.py +++ b/setup/extensions.py @@ -186,8 +186,13 @@ class Build(Command): parser.add_option('-1', '--only', choices=choices, default='all', help=('Build only the named extension. Available: '+ ', '.join(choices)+'. Default:%default')) + parser.add_option('--no-compile', default=False, action='store_true', + help='Skip compiling all C/C++ extensions.') def run(self, opts): + if opts.no_compile: + self.info('--no-compile specified, skipping compilation') + return self.obj_dir = os.path.join(os.path.dirname(SRC), 'build', 'objects') if not os.path.exists(self.obj_dir): os.makedirs(self.obj_dir) diff --git a/setup/install.py b/setup/install.py index 76ac277e32..3e90e35104 100644 --- a/setup/install.py +++ b/setup/install.py @@ -91,7 +91,9 @@ class Develop(Command): pass def run_postinstall(self): - subprocess.check_call(['calibre_postinstall']) + env = dict(**os.environ) + env['DESTDIR'] = self.prefix + subprocess.check_call(['calibre_postinstall', '--use-destdir'], env=env) def success(self): self.info('\nDevelopment environment successfully setup')