This commit is contained in:
Kovid Goyal 2013-04-24 09:56:42 +05:30
parent 3bb7e0c23f
commit 6fe7c2c662
2 changed files with 7 additions and 13 deletions

View File

@ -112,7 +112,6 @@ class LinuxFreeze(Command):
else: else:
ffi = glob.glob('/usr/lib/libffi.so.?')[-1] ffi = glob.glob('/usr/lib/libffi.so.?')[-1]
for x in binary_includes + [stdcpp, ffi]: for x in binary_includes + [stdcpp, ffi]:
dest = self.bin_dir if '/bin/' in x else self.lib_dir dest = self.bin_dir if '/bin/' in x else self.lib_dir
shutil.copy2(x, dest) shutil.copy2(x, dest)
@ -226,7 +225,6 @@ class LinuxFreeze(Command):
except: except:
self.warn('Failed to byte-compile', y) self.warn('Failed to byte-compile', y)
def run_builder(self, cmd, verbose=True): def run_builder(self, cmd, verbose=True):
p = subprocess.Popen(cmd, stdout=subprocess.PIPE, p = subprocess.Popen(cmd, stdout=subprocess.PIPE,
stderr=subprocess.PIPE) stderr=subprocess.PIPE)
@ -256,7 +254,6 @@ class LinuxFreeze(Command):
self.info('Archive %s created: %.2f MB'%(dist, self.info('Archive %s created: %.2f MB'%(dist,
os.stat(dist).st_size/(1024.**2))) os.stat(dist).st_size/(1024.**2)))
def build_launchers(self): def build_launchers(self):
self.obj_dir = self.j(self.src_root, 'build', 'launcher') self.obj_dir = self.j(self.src_root, 'build', 'launcher')
if not os.path.exists(self.obj_dir): if not os.path.exists(self.obj_dir):
@ -268,7 +265,8 @@ class LinuxFreeze(Command):
cflags = '-fno-strict-aliasing -W -Wall -c -O2 -pipe -DPYTHON_VER="python%s"'%self.py_ver cflags = '-fno-strict-aliasing -W -Wall -c -O2 -pipe -DPYTHON_VER="python%s"'%self.py_ver
cflags = cflags.split() + ['-I/usr/include/python'+self.py_ver] cflags = cflags.split() + ['-I/usr/include/python'+self.py_ver]
for src, obj in zip(sources, objects): for src, obj in zip(sources, objects):
if not self.newer(obj, headers+[src, __file__]): continue if not self.newer(obj, headers+[src, __file__]):
continue
cmd = ['gcc'] + cflags + ['-fPIC', '-o', obj, src] cmd = ['gcc'] + cflags + ['-fPIC', '-o', obj, src]
self.run_builder(cmd) self.run_builder(cmd)
@ -330,7 +328,6 @@ class LinuxFreeze(Command):
self.run_builder(cmd, verbose=False) self.run_builder(cmd, verbose=False)
def create_site_py(self): # {{{ def create_site_py(self): # {{{
with open(self.j(self.py_dir, 'site.py'), 'wb') as f: with open(self.j(self.py_dir, 'site.py'), 'wb') as f:
f.write(textwrap.dedent('''\ f.write(textwrap.dedent('''\

View File

@ -37,7 +37,6 @@ class OSX32_Freeze(Command):
action='store_true', action='store_true',
help='Only build launchers') help='Only build launchers')
def run(self, opts): def run(self, opts):
global info, warn global info, warn
info, warn = self.info, self.warn info, warn = self.info, self.warn
@ -332,7 +331,7 @@ class Py2App(object):
def create_plist(self): def create_plist(self):
from calibre.ebooks import BOOK_EXTENSIONS from calibre.ebooks import BOOK_EXTENSIONS
env = dict(**ENV) env = dict(**ENV)
env['CALIBRE_LAUNCHED_FROM_BUNDLE']='1'; env['CALIBRE_LAUNCHED_FROM_BUNDLE']='1'
docs = [{'CFBundleTypeName':'E-book', docs = [{'CFBundleTypeName':'E-book',
'CFBundleTypeExtensions':list(BOOK_EXTENSIONS), 'CFBundleTypeExtensions':list(BOOK_EXTENSIONS),
'CFBundleTypeRole':'Viewer', 'CFBundleTypeRole':'Viewer',
@ -395,7 +394,6 @@ class Py2App(object):
self.install_dylib(os.path.join(SW, 'lib', 'libpng12.0.dylib')) self.install_dylib(os.path.join(SW, 'lib', 'libpng12.0.dylib'))
self.install_dylib(os.path.join(SW, 'lib', 'libpng.3.dylib')) self.install_dylib(os.path.join(SW, 'lib', 'libpng.3.dylib'))
@flush @flush
def add_fontconfig(self): def add_fontconfig(self):
info('\nAdding fontconfig') info('\nAdding fontconfig')
@ -568,7 +566,7 @@ class Py2App(object):
@flush @flush
def compile_py_modules(self): def compile_py_modules(self):
info( '\nCompiling Python modules') info('\nCompiling Python modules')
base = join(self.resources_dir, 'Python') base = join(self.resources_dir, 'Python')
for x in os.walk(base): for x in os.walk(base):
root = x[0] root = x[0]
@ -584,7 +582,7 @@ class Py2App(object):
@flush @flush
def create_console_app(self): def create_console_app(self):
info( '\nCreating console.app') info('\nCreating console.app')
cc_dir = os.path.join(self.contents_dir, 'console.app', 'Contents') cc_dir = os.path.join(self.contents_dir, 'console.app', 'Contents')
os.makedirs(cc_dir) os.makedirs(cc_dir)
for x in os.listdir(self.contents_dir): for x in os.listdir(self.contents_dir):
@ -607,7 +605,6 @@ class Py2App(object):
shutil.copy2(join(base, 'site.py'), join(self.resources_dir, 'Python', shutil.copy2(join(base, 'site.py'), join(self.resources_dir, 'Python',
'lib', 'python'+self.version_info)) 'lib', 'python'+self.version_info))
@flush @flush
def makedmg(self, d, volname, def makedmg(self, d, volname,
destdir='dist', destdir='dist',