From a4dd30cea593db44fe581102529f674f81fa5d2c Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 12 Sep 2009 14:58:15 -0600 Subject: [PATCH] IGN:Fix calibre_postinstall not respecting the --prefix option and add a --no-compile option to the build command --- setup/extensions.py | 5 +++++ setup/install.py | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) 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')