oops -- amended patch attached (didn't check for what happens if you don't supply a name)
On Sun, May 2, 2010 at 11:04 PM, Tim Diggins <[email protected]> wrote: > Two additional questions (not related to wx, only to mac): >>> >>> 1) The .app is getting made (it seems to me) in the wrong location: It >>> should be made in the "dist" directory (as it is a distributable); >>> however, it is being made one directory ABOVE the project directory so I >>> do the following after the build: >>> mv ../PROJECT.app dist/PROJECT.app >>> >> >> This is a bug of the BUNDLE() class in Build.py. More generically, all >> classes exported to the .spec usually allow the spec itself to specify the >> full path of the resulting file (or directory, in this case), so BUNDLE() >> should probably be modified to receive the directory name as argument, and >> the spec should then be generated so to use os.path.join("dist", >> "foobar.app"). > > > Ok -- changing the BUNDLE() class was very easy. (attached patch). > If you accept that it would mean (for now) that page > http://www.pyinstaller.org/wiki/MacOsCompatibility should change the code > at the bottom to: > > - > > import sysif sys.platform.startswith("darwin"): > app = BUNDLE(exe, > *name**=*os.path.join('dist', 'NAME.app'), > version=version) > > > I haven't made any attempt to adapt to previous use of the appname keyword > argument as specified currently on that page. > > > 2) I'm keen to use the onedir, as that makes some things easier (and >>> onefile brings no benefits that I can see). >>> At present I'm just moving dist/PROJECT/* to >>> dist/PROJECT.app/Contents/MacOS/ >>> but it would be better to try to fix the situation for MacOS - shall I >>> have a look and see if I can solve #155 in the source, following your >>> comments? >>> >> >> Sure! It really should not be difficult. Have a look at how COLLECT() >> copies files around, and do something like that for BUNDLE(). >> > > Ok... I can see how that works in the code. I'm wondering what the spec > file should look like... Won't the BUNDLE call end up looking almost > identical to the COLLECT call? > > Maybe it would be better to pass the result of the COLLECT call to the > BUNDLE call? Or perhaps make the BUNDLE function a superset of the COLLECT > functionality (but just degrading to COLLECT on other platforms). > > When I look at the spec file generated for the Mac at present there is some > platform specificity, like: > exe = EXE(pyz, > a.scripts, > exclude_binaries=1, > name=os.path.join('build*/pyi.darwin/small_app'*, 'small_app'), > ... > > and platform variability, like: > if *sys.platform.startswith("darwin")*: > app = BUNDLE(exe, > ... > > It seems to me it might be better to put as much of the platform > variability into the pyinstaller code itself... > > -T > -- You received this message because you are subscribed to the Google Groups "PyInstaller" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/pyinstaller?hl=en.
bundle_name_patch.patch
Description: Binary data
