Commits

Virgil Dupras committed 39a474d

Removed pluginbuilder usage in build script and replaced it with hscommon functions.

Comments (0)

Files changed (4)

 507a587c1f7c705d5632917c524adec644b54a8a cocoalib
-ad05ff48a5acfbeedc40c7f4e06dc2fb851d0d5b hscommon
+6266a54e9c8764502e4b0277c0fa4e3be392dbdb hscommon
 cb9818c35c5fe04c4366f0ad6cbfebea971a0310 qtlib
 
 - XCode's command line tools
 - objp 1.1.0 (http://bitbucket.org/hsoft/objp)
-- pluginbuilder 1.1.0 (http://bitbucket.org/hsoft/pluginbuilder)
 - appscript 1.0.0 for ME and PE (http://appscript.sourceforge.net/)
 - xibless 0.4.0 (https://bitbucket.org/hsoft/xibless)
 
 import shutil
 import json
 import importlib
+import compileall
 
 from setuptools import setup, Extension
 
 from hscommon import sphinxgen
 from hscommon.build import (add_to_pythonpath, print_and_do, copy_packages, filereplace,
-    get_module_version, move_all, copy_sysconfig_files_for_embed, copy_all, copy, OSXAppStructure,
-    build_cocoalib_xibless, fix_qt_resource_file, build_cocoa_ext)
+    get_module_version, move_all, copy_sysconfig_files_for_embed, copy_all, OSXAppStructure,
+    build_cocoalib_xibless, fix_qt_resource_file, build_cocoa_ext, copy_embeddable_python_dylib,
+    collect_stdlib_dependencies)
 from hscommon import loc
 from hscommon.plat import ISOSX
-from hscommon.util import ensure_folder
+from hscommon.util import ensure_folder, delete_files_with_pattern
 
 def parse_args():
     usage = "usage: %prog [options]"
     build_cocoa_proxy_module()
     build_cocoa_bridging_interfaces(edition)
     print("Building the cocoa layer")
-    from pluginbuilder import copy_embeddable_python_dylib, collect_dependencies
     copy_embeddable_python_dylib('build')
     pydep_folder = op.join(app.resources, 'py')
     if not op.exists(pydep_folder):
         'me': ['core_me'],
         'pe': ['core_pe'],
     }[edition]
-    tocopy = ['core', 'hscommon', 'cocoa/inter', 'cocoalib/cocoa'] + specific_packages
-    copy_packages(tocopy, 'build')
+    tocopy = ['core', 'hscommon', 'cocoa/inter', 'cocoalib/cocoa', 'jobprogress', 'objp',
+        'send2trash'] + specific_packages
+    copy_packages(tocopy, pydep_folder)
     sys.path.insert(0, 'build')
-    collect_dependencies('build/dg_cocoa.py', pydep_folder, excludes=['PyQt4'])
+    collect_stdlib_dependencies('build/dg_cocoa.py', pydep_folder)
     del sys.path[0]
     if dev:
         copy_packages(tocopy, pydep_folder, create_links=True)
     # Views are not referenced by python code, so they're not found by the collector.
     copy_all('build/inter/*.so', op.join(pydep_folder, 'inter'))
     copy_sysconfig_files_for_embed(pydep_folder)
+    compileall.compile_dir(pydep_folder, force=True, legacy=True)
+    delete_files_with_pattern(pydep_folder, '*.py')
+    delete_files_with_pattern(pydep_folder, '__pycache__')
     print("Compiling with WAF")
     os.chdir('cocoa')
     print_and_do(cocoa_compile_command(edition))
 -r requirements.txt
 objp>=1.2.0
-pluginbuilder>=1.1.0
 appscript>=1.0.0
 xibless>=0.4.1