Commits

Ronald Oussoren committed 8ce8749 Merge

Merge, addresses #99

Comments (0)

Files changed (3)

doc/changelog.rst

 - Issue #96: py2app should work with python 2.6 again (previous releases didn't
   work due to using the sysconfig module introduced in python 2.7)
 
+- Issue #99: appstore requires a number of symlinks in embedded frameworks.
+
+  (Version 0.7 already added a link Python.frameworks/Versions/Current, this
+  versions also adds Python.framework/Python and Python.framework/Resources with
+  the value required by the appstore upload tool).
+
 py2app 0.7.3
 ------------
 

py2app/build_app.py

                 os.path.basename(outdir),
                 os.path.join(os.path.dirname(outdir), "Current"))
 
+        # Likewise for two links in the root of the framework:
+        os.symlink(
+            'Versions/Current/Resources',
+            os.path.join(os.path.dirname(os.path.dirname(outdir)), 'Resources'))
+        os.symlink(
+            os.path.join('Versions/Current', PYTHONFRAMEWORK),
+            os.path.join(os.path.dirname(os.path.dirname(outdir)), PYTHONFRAMEWORK))
+
+
         # Experiment for issue 57
         if not os.path.exists(os.path.join(indir, 'include')):
             alt = os.path.join(indir, 'Versions/Current')

py2app_tests/test_basic_app.py

 import signal
 import py2app
 import hashlib
+from distutils.sysconfig import get_config_var
 
 DIR_NAME=os.path.dirname(os.path.abspath(__file__))
 
             p.stdout.close()
         self.assertChecksumsSame()
 
+
+    def test_framework_versions(self):
+        fwk = get_config_var('PYTHONFRAMEWORK')
+        path = os.path.join(
+                self.app_dir,
+            'dist/BasicApp.app/Contents/Frameworks/%s.framework'%(fwk,))
+        if not os.path.exists(path):
+            return
+
+        names = set(os.listdir(os.path.join(path, 'Versions')))
+        ver_str = '%d.%d' % sys.version_info[:2]
+        self.assertEqual(names, { 'Current', ver_str })
+        self.assertEqual(os.readlink(os.path.join(path, 'Versions', 'Current')), ver_str)
+
+        self.assertEquals(os.readlink(os.path.join(path, fwk)), os.path.join('Versions', 'Current', fwk))
+        self.assertEquals(os.readlink(os.path.join(path, 'Resources')), os.path.join('Versions', 'Current', 'Resources'))
+
 class TestBasicAliasApp (TestBasicApp):
     py2app_args = [ '--alias', ]