[wx-dev] Making a Mac PKG for wxWidgets

Anders F Björklund afb at algonet.se
Wed Oct 11 16:21:45 PDT 2006


Vadim Zeitlin wrote:

> AFB> I am using wxWidgets in a couple of different projects
> AFB> and got pretty tired of bundling the dynamic library,
> AFB> or even linking everything statically, so I did a wx
> AFB> framework for Mac OS X - and an Installer PKG for it...
>
>  Wow, this is great news! How exactly did you do it?

By hand, using the configure scripts and Apple PackageMaker.
That is, I took the /usr/local install and rebundled it...

I've been doing the same thing for Code::Blocks Mac builds,
only there I didn't bother with the wx.framework / Headers -
but just took the .dylib file and put it in @executable_path
(I also used the ANSI build there and UNICODE build here, but)

>  I'm especially curious about how does this work, I thought you had to 
> run
> otool to tweak the relative paths of the libraries included in the 
> private
> framework. Did you manage to make it work without this somehow?

I ran the Apple "install_name_tool" on the library, to rename it to 
framework:
install_name_tool -id 
@executable_path/../Frameworks/wx.framework/Version/A/wx

Probably is cheating, but Apple doesn't have a good alternative that 
doesn't
involve using Xcode and I didn't feel like relying on another 
proprietary tool.

> AFB> Is this pre-compiled binary something wxWidgets would host ?
>
>  Personally I think we should. But then I also think we should host 
> Win32
> binaries and various Linux packages and anything else that makes wx 
> easier
> to use for the developers. But the final decision in this particular
> instance belongs to Stefan, of course, and if I understand him 
> correctly
> he'd prefer to wait until 2.8.0 (although I admit I don't quite 
> understand
> what would be the problem with asking people to test 2.7.1 framework?)

That is OK, I will do 2.6.3p2 for now (maybe 2.6.4, when that comes out)
since that is what I have for some other projects like wxD for instance.

I can host the packages at wxD / SourceForge in the meantime, no 
problem.
http://sourceforge.net/project/showfiles.php?group_id=133831 (not yet)

>  But in any case we do want to have your build files or whatever you 
> used
> to make these packages (under wxWindows licence please), could you 
> please
> submit them?

I don't have the ready scripts yet, but snippets and such are on:
http://www.algonet.se/~afb/wx/ if you want to have a look at it ?
(build scripts and packagemaker files coming there too, further on)

> AFB> The wxMac package does require admin authentication.
>
>  Even if you install it in ~/Library?

Apparently the silly thing wanted to write to /Library/Receipts ?
I've downgraded my user account to a non-admin, so that failed...
It used to be OK to fall back to ~/Library with "relocatable"
on Panther, but the Tiger installer is totally rewritten now.

So maybe the wx.framework should just go in a TGZ or DMG wrapper,
and we can save the PKG for installing the libs to /usr ? (=root)

> AFB> I'm not sure to handle add-ons like GL or STC, but
> AFB> they could probably go in the Libraries dir perhaps ?
> AFB> (or maybe even be merged into the main dynamic library,
> AFB> since OpenGL is always available on a Mac OS X platform)
>
>  I think OpenGL should always be included. I'm not/less sure about STC.

That's probably a good idea. Any idea how one can add it there ?
I fiddled a bit with the Bakefile and configures, but in the end
the easiest was just to add the few GL objects to the Makefile...

The only downside to adding it is that I think you need to add the
AGL and OpenGL frameworks to your apps, or risk that pesky error
about "indirectly included" libraries ? (but I might be wrong...)

--anders





More information about the wx-dev mailing list