Re: [Pyobjc-dev] Copying files into a bundle while changing their names
Brought to you by:
ronaldoussoren
From: Bob I. <bo...@re...> - 2005-03-31 17:00:15
|
On Mar 31, 2005, at 11:33 AM, Geoff Schmidt wrote: > I am working on building a Python binding of the VLC media player into > an application bundle with py2app. As part of this, I have a bunch of > files (dependent shared libraries, loadable modules) that need to get > copied out of the VLC build tree into Contents/MacOS/lib and > Contents/MacOS/modules. The only trouble is, some of the files need to > have their names mangled in the process by prepending "vlc_". > > So far I am using some code that after calling setup(), guesses the > root directory of the build bundle, guesses whether we are doing a -A > style build or a normal build, and then creates any necessary > directories, removes previously existing files with the same name, and > makes symlinks or copies as appropriate. It works fine, but before I > distribute this, I'd like to clean it up. Is there any way to pass a > list of files that should go into the bundle as a list of tuples > (sourceFileInFilesystem, targetFileRelativeToBundle) so that each one > can be renamed as appropriate? No. You should do this stuff *before* calling setup() though. > Second question: rather than limiting the usefulness of the binding to > my own application (a combined RSS feed reader, Bittorrent client, and > media player) I would like to distribute a Python extension that > anyone can use and build into their bundles. So when the extension is > built, all of the VLC libraries and modules would need to get stashed > away inside of it, and when a bundle is built using that extension, > the libraries and modules are added to it as above. Any pointers on > how to get this together? There's no facility that allows a particular 3rd party package to claim that it needs resources, and most certainly no facility that allows them to specify where they want their dependencies to go in a resultant app bundle. It's something I've been thinking about for a while (the first bit, anyway), but have not decided on a method or implementation. You could write a py2app recipe that does it, but that's beyond the scope of what I'm willing to document/support at this time. I reserve the right to change that API on any release... -bob |