From: Steven P. <n9...@n9...> - 2003-12-09 14:01:58
|
On Dec 9, 2003, at 1:02 AM, Roger Binns wrote: >> myapp.includePackages.append("sha") > > What does that do? It should automatically pick up the usage > of the sha module. The sha module is being imported by one of the com_*.py modules. Since they are dynamically loaded at runtime, the bundle procedure cannot find the dependancy. It is only looking at import statements for the main script and anything imported below that via import statements. >> for file in glob.glob(os.path.join(packageroot, 'com_*.py')): >> myapp.resources.append(file) > > Why do those end up as resources? Wouldn't they be part > of includePackages? When I did that, they ended up inside a "Modules.zip" file, and they could not be found when needed. I will play around with this a little bit more, but at least it works "as is" and can be used for now with tweaks later. >> myapp.libs.append("/usr/local/lib/libwx_mac-2.4.0.dylib") >> myapp.libs.append("/usr/local/lib/libwx_mac-2.4.0.rsrc") >> myapp.libs.append("/usr/local/lib/libwx_mac_gl-2.4.0.dylib") > > Is there anyway to automate finding those libraries? From the bundlebuilder.py notes: # bundlebuilder does not yet have the capability to detect what shared libraries # are needed by your app - so in this case I am adding the wxPython libs manually > Also how do you direct where output goes. For Linux and Windows, > your cwd needs to be the top of the bitpim tree and you run > makedist.py. The output goes to a directory named dist. I > would prefer to do the same thing for the Mac. Ahhh... It goes to a directory called 'build' by default. Easily changed. > You will be assimilated :-) I would also appreciate a directory > listing of the results. [uibook:~...bitpim/dist] n9yty% ls -R -l total 0 drwxr-xr-x 3 n9yty admin 102 9 Dec 07:53 BitPim.app ./BitPim.app: total 0 drwxr-xr-x 7 n9yty admin 238 9 Dec 07:53 Contents ./BitPim.app/Contents: total 16 drwxr-xr-x 6 n9yty admin 204 9 Dec 07:53 Frameworks -rw-r--r-- 1 n9yty admin 595 9 Dec 07:53 Info.plist drwxr-xr-x 4 n9yty admin 136 9 Dec 07:53 MacOS -rw-r--r-- 1 n9yty admin 8 9 Dec 07:53 PkgInfo drwxr-xr-x 16 n9yty admin 544 9 Dec 07:53 Resources ./BitPim.app/Contents/Frameworks: total 11488 drwxr-xr-x 3 n9yty admin 102 9 Dec 07:53 Python.framework -rwxr-xr-x 1 n9yty admin 5776396 9 Dec 07:53 libwx_mac-2.4.0.dylib -rw-r--r-- 1 n9yty admin 2903 5 Nov 00:19 libwx_mac-2.4.0.rsrc -rw-r--r-- 1 n9yty admin 94820 5 Nov 00:19 libwx_mac_gl-2.4.0.dylib ./BitPim.app/Contents/Frameworks/Python.framework: total 0 drwxr-xr-x 3 n9yty admin 102 9 Dec 07:53 Versions ./BitPim.app/Contents/Frameworks/Python.framework/Versions: total 0 drwxr-xr-x 4 n9yty admin 136 9 Dec 07:53 2.3 ./BitPim.app/Contents/Frameworks/Python.framework/Versions/2.3: total 2128 -rwxr-xr-x 1 n9yty admin 1088276 9 Dec 07:53 Python drwxr-xr-x 5 n9yty admin 170 9 Dec 07:53 Resources ./BitPim.app/Contents/Frameworks/Python.framework/Versions/2.3/ Resources: total 16 drwxr-xr-x 3 n9yty admin 102 9 Dec 07:53 English.lproj -rw-r--r-- 1 n9yty admin 774 13 Sep 03:05 Info.plist -rw-r--r-- 1 n9yty admin 453 27 Sep 04:39 version.plist ./BitPim.app/Contents/Frameworks/Python.framework/Versions/2.3/ Resources/English.lproj: total 8 -rw-r--r-- 1 n9yty admin 350 13 Sep 03:05 InfoPlist.strings ./BitPim.app/Contents/MacOS: total 56 -rwxr-xr-x 1 n9yty admin 730 9 Dec 07:53 BitPim -rwxr-xr-x 1 n9yty admin 22100 9 Dec 07:53 python ./BitPim.app/Contents/Resources: total 2408 drwxr-xr-x 37 n9yty admin 1258 9 Dec 07:53 ExtensionModules -rw-r--r-- 1 n9yty admin 1093458 9 Dec 07:53 Modules.zip -rw-r--r-- 1 n9yty admin 521 15 Nov 06:16 bp.py -rw-r--r-- 1 n9yty admin 15059 8 Dec 09:07 com_brew.py -rw-r--r-- 1 n9yty admin 4390 15 Nov 06:16 com_lg.py -rw-r--r-- 1 n9yty admin 4791 6 Dec 20:52 com_lgtm520.py -rw-r--r-- 1 n9yty admin 30153 7 Dec 00:12 com_lgvx4400.py -rw-r--r-- 1 n9yty admin 1794 6 Dec 20:53 com_lgvx6000.py -rw-r--r-- 1 n9yty admin 3738 15 Nov 06:16 com_phone.py -rw-r--r-- 1 n9yty admin 5934 15 Nov 06:16 com_sanyo.py -rw-r--r-- 1 n9yty admin 25724 6 Dec 23:17 com_sanyo4900.py drwxr-xr-x 13 n9yty admin 442 9 Dec 07:53 resources -rw-r--r-- 1 n9yty admin 227 9 Dec 07:53 site.pyc -rwxr-xr-x 1 n9yty admin 18260 9 Dec 07:53 zlib.so ./BitPim.app/Contents/Resources/ExtensionModules: total 2304 -rwxr-xr-x 1 n9yty admin 14748 9 Dec 07:53 MacOS.so -rwxr-xr-x 1 n9yty admin 23984 9 Dec 07:53 Nav.so -rwxr-xr-x 1 n9yty admin 30136 9 Dec 07:53 _AE.so -rwxr-xr-x 1 n9yty admin 106664 9 Dec 07:53 _Ctl.so -rwxr-xr-x 1 n9yty admin 35012 9 Dec 07:53 _Dlg.so -rwxr-xr-x 1 n9yty admin 14808 9 Dec 07:53 _Evt.so -rwxr-xr-x 1 n9yty admin 50372 9 Dec 07:53 _File.so -rwxr-xr-x 1 n9yty admin 13664 9 Dec 07:53 _Folder.so -rwxr-xr-x 1 n9yty admin 61288 9 Dec 07:53 _Menu.so -rwxr-xr-x 1 n9yty admin 113276 9 Dec 07:53 _Qd.so -rwxr-xr-x 1 n9yty admin 35304 9 Dec 07:53 _Res.so -rwxr-xr-x 1 n9yty admin 61852 9 Dec 07:53 _Win.so -rwxr-xr-x 1 n9yty admin 27740 9 Dec 07:53 _hotshot.so -rwxr-xr-x 1 n9yty admin 18848 9 Dec 07:53 _locale.so -rwxr-xr-x 1 n9yty admin 13896 9 Dec 07:53 _random.so -rwxr-xr-x 1 n9yty admin 45872 9 Dec 07:53 _socket.so -rwxr-xr-x 1 n9yty admin 19280 9 Dec 07:53 _ssl.so -rwxr-xr-x 1 n9yty admin 8820 9 Dec 07:53 _weakref.so -rwxr-xr-x 1 n9yty admin 32744 9 Dec 07:53 array.so -rwxr-xr-x 1 n9yty admin 17812 9 Dec 07:53 binascii.so -rwxr-xr-x 1 n9yty admin 14620 9 Dec 07:53 cStringIO.so -rwxr-xr-x 1 n9yty admin 58668 9 Dec 07:53 datetime.so -rwxr-xr-x 1 n9yty admin 13488 9 Dec 07:53 fcntl.so -rwxr-xr-x 1 n9yty admin 14120 9 Dec 07:53 icglue.so -rwxr-xr-x 1 n9yty admin 14236 9 Dec 07:53 math.so -rwxr-xr-x 1 n9yty admin 20228 9 Dec 07:53 operator.so -rwxr-xr-x 1 n9yty admin 109228 9 Dec 07:53 parser.so -rwxr-xr-x 1 n9yty admin 9196 9 Dec 07:53 pwd.so -rwxr-xr-x 1 n9yty admin 14276 9 Dec 07:53 select.so -rwxr-xr-x 1 n9yty admin 13188 9 Dec 07:53 sha.so -rwxr-xr-x 1 n9yty admin 26756 9 Dec 07:53 strop.so -rwxr-xr-x 1 n9yty admin 23172 9 Dec 07:53 struct.so -rwxr-xr-x 1 n9yty admin 15104 9 Dec 07:53 termios.so -rwxr-xr-x 1 n9yty admin 18900 9 Dec 07:53 time.so drwxr-xr-x 8 n9yty admin 272 9 Dec 07:53 wxPython ./BitPim.app/Contents/Resources/ExtensionModules/wxPython: total 8048 -rwxr-xr-x 1 n9yty admin 101444 9 Dec 07:53 calendarc.so -rwxr-xr-x 1 n9yty admin 473156 9 Dec 07:53 gizmosc.so -rwxr-xr-x 1 n9yty admin 407344 9 Dec 07:53 gridc.so -rwxr-xr-x 1 n9yty admin 74348 9 Dec 07:53 helpc.so -rwxr-xr-x 1 n9yty admin 283980 9 Dec 07:53 htmlc.so -rwxr-xr-x 1 n9yty admin 2768264 9 Dec 07:53 wxc.so ./BitPim.app/Contents/Resources/resources: total 1528 -rw-r--r-- 1 n9yty admin 418855 5 Dec 05:13 bitpim.htb -rw-r--r-- 1 n9yty admin 274091 9 Mar 2003 group.png -rw-r--r-- 1 n9yty admin 456 4 Nov 03:46 mozilla.pdc -rw-r--r-- 1 n9yty admin 241 4 Nov 03:46 palm.pdc -rw-r--r-- 1 n9yty admin 3640 7 Dec 00:23 pblayout.xy -rw-r--r-- 1 n9yty admin 1044 13 Nov 23:16 private.png -rw-r--r-- 1 n9yty admin 831 15 Aug 13:46 ringer.png -rw-r--r-- 1 n9yty admin 48958 8 Sep 21:32 splashscreen.jpg -rw-r--r-- 1 n9yty admin 2913 8 Dec 09:07 styles.xy -rw-r--r-- 1 n9yty admin 1773 5 Mar 2003 unknown.png -rw-r--r-- 1 n9yty admin 4507 13 Nov 23:16 wallpaper.png [uibook:~...bitpim/bitpim] n9yty% du -h dist 4.0K dist/BitPim.app/Contents/Frameworks/Python.framework/Versions/2.3/ Resources/English.lproj 12K dist/BitPim.app/Contents/Frameworks/Python.framework/Versions/2.3/ Resources 1.1M dist/BitPim.app/Contents/Frameworks/Python.framework/Versions/2.3 1.1M dist/BitPim.app/Contents/Frameworks/Python.framework/Versions 1.1M dist/BitPim.app/Contents/Frameworks/Python.framework 6.7M dist/BitPim.app/Contents/Frameworks 28K dist/BitPim.app/Contents/MacOS 3.9M dist/BitPim.app/Contents/Resources/ExtensionModules/wxPython 5.1M dist/BitPim.app/Contents/Resources/ExtensionModules 764K dist/BitPim.app/Contents/Resources/resources 7.0M dist/BitPim.app/Contents/Resources 14M dist/BitPim.app/Contents 14M dist/BitPim.app 14M dist When I mentioned 16.6MB before, I was including some extra files which I later realized and removed. > I very much like your last statement. BTW does it include the Python > interpretter as well? Below is what it looks like on Windows and > Linux. Yes, it does. It shouldn't depend on any Python version/installation on the host machine. So here, again, are the needed statements to make it work (output goes in 'dist') (FWIW: packageroot can be set to '.' for current dir and will work fine) import bundlebuilder, os, glob packageroot = "/Users/n9yty/my_cvs/bitpim/bitpim" myapp = bundlebuilder.AppBuilder(verbosity=1) myapp.mainprogram = os.path.join(packageroot, "bp.py") myapp.standalone = 1 myapp.name = "BitPim" myapp.strip = 1 myapp.builddir = "dist" myapp.includePackages.append("sha") exts=[ '*.xy', '*.png', '*.ttf', '*.wav', '*.jpg', '*.css', '*.htb', '*.pdc' ] for wildcard in exts: for file in glob.glob(os.path.join(packageroot, 'resources', wildcard)): myapp.files.append( (file, os.path.join("Contents", "Resources", 'resources', os.path.basename(file))) ) for file in glob.glob(os.path.join(packageroot, 'com_*.py')): myapp.resources.append(file) myapp.libs.append("/usr/local/lib/libwx_mac-2.4.0.dylib") myapp.libs.append("/usr/local/lib/libwx_mac-2.4.0.rsrc") myapp.libs.append("/usr/local/lib/libwx_mac_gl-2.4.0.dylib") myapp.setup() myapp.build() The only remaining issue is to test this on a Jaguar (MacOS X 10.2) system. I have a few left at work that have not been upgraded, I'll give it a go and let you know what I find. -. ----. -.-- - -.-- Steve Palm - n9...@n9... -. ----. -.-- - -.-- |