User forums > Help
Can't succeed to compile CB SVN against wxWidgets 2.8 under OSX 10.6.8 (solved)
eranon:
Thanks a lot for your point of view on my roadmovie, afb :) Some points are more clear in my mind, now (like the version numbering).
--- Quote from: afb on December 02, 2012, 10:22:17 pm ---Seems like you succeeded! The old bundle docs should be on the Wiki, basically relocates everything to use @executable_path.
http://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Mac_OS_X
--- End quote ---
Today, I've read a lot of things about bundle, including the URL you give me here. At this time, after some trials and fails (like crash or not any plugin), I have a working bundle (not seen in depth, I'll be sure during real use), but, since I didn't relocated everyhing I think main executables use the dylib from /usr/local.
In fact, at the beginning I've used the install_name_tool. It worked, but beside of this, my inner tree - inside bundle - was wrong and I didn't had any plugin... So, I've fixed the tree looking in your yearly build and started to search for a workaround about the "manual" part with install_name_tool, and I found another one, a layer above, called dylibbundler by Auria which check the dependencies, copy the dylib and fix the reference in the executable. In the spirit, it sounds magic, but when you don't know the organization of a project (my case about C::B), it becomes quickly complicated to decide what and when to manage things...
So, here is my last script, giving me a "working bundle", but without full relocation (and if you uncomment the commented lines about dylibbundler, Codeblocks crashes during start-up) :
--- Code: ---#!/bin/sh
prefix="/usr/local"
echo Build an OSX CodeBlock bundle in current directory
echo --------------------------------------------------
echo SVN copy must be in subdir called Source
rm -rf codeblocks.app
echo Build bundle tree
mkdir codeblocks.app
mkdir codeblocks.app/Contents
mkdir codeblocks.app/Contents/MacOS
mkdir codeblocks.app/Contents/MacOS/wxContribItems
mkdir codeblocks.app/Contents/Resources
mkdir codeblocks.app/Contents/Resources/share
mkdir codeblocks.app/Contents/Resources/share/codeblocks
mkdir codeblocks.app/Contents/Resources/English.lproj
echo Set metadata
echo -n 'APPL????' > codeblocks.app/Contents/PkgInfo
cp ./Source/codeblocks.plist codeblocks.app/Contents/Info.plist
# cp version.plist codeblocks.app/Contents/
# cp InfoPlist.strings codeblocks.app/Contents/Resources/English.lproj/
echo Set main executables
cp ${prefix}/bin/codeblocks ./codeblocks.app/Contents/MacOS/CodeBlocks
cp ${prefix}/bin/codesnippets ./codeblocks.app/Contents/MacOS/
cp ${prefix}/bin/cb_share_config ./codeblocks.app/Contents/MacOS/
cp ${prefix}/bin/cb_console_runner ./codeblocks.app/Contents/MacOS/
cp ${prefix}/lib/libcodeblocks.0.dylib ./codeblocks.app/Contents/MacOS/
cp ${prefix}/lib/libwxsmithlib.0.dylib ./codeblocks.app/Contents/MacOS/
cp ${prefix}/lib/libwx_macu-2.8.0.dylib ./codeblocks.app/Contents/MacOS/
echo Add contrib plugins
cp ${prefix}/lib/codeblocks/wxContribItems/libwxchartctrl.0.dylib ./codeblocks.app/Contents/MacOS/wxContribItems/
cp ${prefix}/lib/codeblocks/wxContribItems/libwxcustombutton.0.dylib ./codeblocks.app/Contents/MacOS/wxContribItems/
cp ${prefix}/lib/codeblocks/wxContribItems/libwxflatnotebook.0.dylib ./codeblocks.app/Contents/MacOS/wxContribItems/
cp ${prefix}/lib/codeblocks/wxContribItems/libwximagepanel.0.dylib ./codeblocks.app/Contents/MacOS/wxContribItems/
cp ${prefix}/lib/codeblocks/wxContribItems/libwxkwic.0.dylib ./codeblocks.app/Contents/MacOS/wxContribItems/
cp ${prefix}/lib/codeblocks/wxContribItems/libwxled.0.dylib ./codeblocks.app/Contents/MacOS/wxContribItems/
cp ${prefix}/lib/codeblocks/wxContribItems/libwxspeedbutton.0.dylib ./codeblocks.app/Contents/MacOS/wxContribItems/
cp ${prefix}/lib/codeblocks/wxContribItems/libwxtreelist.0.dylib ./codeblocks.app/Contents/MacOS/wxContribItems/
echo Resolve dependencies
#dylibbundler -of -b -x ./codeblocks.app/Contents/MacOS/wxContribItems/libwxchartctrl.0.dylib -x ./codeblocks.app/Contents/MacOS/wxContribItems/libwxcustombutton.0.dylib -x ./codeblocks.app/Contents/MacOS/wxContribItems/libwxflatnotebook.0.dylib -x ./codeblocks.app/Contents/MacOS/wxContribItems/libwximagepanel.0.dylib -x ./codeblocks.app/Contents/MacOS/wxContribItems/libwxkwic.0.dylib -x ./codeblocks.app/Contents/MacOS/wxContribItems/libwxled.0.dylib -x ./codeblocks.app/Contents/MacOS/wxContribItems/libwxspeedbutton.0.dylib -x ./codeblocks.app/Contents/MacOS/wxContribItems/libwxtreelist.0.dylib -d ./codeblocks.app/Contents/MacOS/wxContribItems/
#dylibbundler -of -b -x ./codeblocks.app/Contents/MacOS/CodeBlocks -x ./codeblocks.app/Contents/MacOS/codesnippets -x ./codeblocks.app/Contents/MacOS/cb_share_config -x ./codeblocks.app/Contents/MacOS/cb_console_runner -x ./codeblocks.app/Contents/MacOS/libcodeblocks.0.dylib -x ./codeblocks.app/Contents/MacOS/libwxsmithlib.0.dylib -x ./codeblocks.app/Contents/MacOS/libwx_macu-2.8.0.dylib -d ./codeblocks.app/Contents/MacOS/
echo Add resources
cp ./Source/src/src/resources/icons/*.icns codeblocks.app/Contents/Resources/
cp -R ${prefix}/share/codeblocks/ ./codeblocks.app/Contents/Resources/share/codeblocks/
cp -R ${prefix}/lib/codeblocks/plugins/*.so ./codeblocks.app/Contents/Resources/share/codeblocks/
for dotso in ./codeblocks.app/Contents/Resources/share/codeblocks/*.so
do
echo $dotso
install_name_tool -change ${prefix}/lib/libcodeblocks.0.dylib @executable_path/libcodeblocks.0.dylib $dotso
install_name_tool -change ${prefix}/lib/libwx_macu-2.8.0.dylib @executable_path/libwx_macu-2.8.0.dylib $dotso
install_name_tool -change ${prefix}/lib/libwxsmithlib.0.dylib @executable_path/libwxsmithlib.0.dylib $dotso
install_name_tool -change ${prefix}/lib/codeblocks/wxContribItems/libwxchartctrl.0.dylib @executable_path/wxContribItems/libwxchartctrl.0.dylib $dotso
install_name_tool -change ${prefix}/lib/codeblocks/wxContribItems/libwxcustombutton.0.dylib @executable_path/wxContribItems/libwxcustombutton.0.dylib $dotso
install_name_tool -change ${prefix}/lib/codeblocks/wxContribItems/libwxflatnotebook.0.dylib @executable_path/wxContribItems/libwxflatnotebook.0.dylib $dotso
install_name_tool -change ${prefix}/lib/codeblocks/wxContribItems/libwximagepanel.0.dylib @executable_path/wxContribItems/libwximagepanel.0.dylib $dotso
install_name_tool -change ${prefix}/lib/codeblocks/wxContribItems/libwxkwic.0.dylib @executable_path/wxContribItems/libwxkwic.0.dylib $dotso
install_name_tool -change ${prefix}/lib/codeblocks/wxContribItems/libwxled.0.dylib @executable_path/wxContribItems/libwxled.0.dylib $dotso
install_name_tool -change ${prefix}/lib/codeblocks/wxContribItems/libwxspeedbutton.0.dylib @executable_path/wxContribItems/libwxspeedbutton.0.dylib $dotso
install_name_tool -change ${prefix}/lib/codeblocks/wxContribItems/libwxtreelist.0.dylib @executable_path/wxContribItems/libwxtreelist.0.dylib $dotso
done
unset prefix
echo Done !
echo codeblocks.app created beside $0
--- End code ---
What do you think about this ? Next step is, of course, to obtain a real standalone bundle (independent of my own system context), succeeding to use dylibbundler or being back with install_name_tool...
MortenMacFly:
Guys, that's nice to read. The last time I was on a Mac I basically gave up when trying to create an app bundle.
Could you please transfer this into the WiKi to the right place? I would like to give it a try next time I get my hand on a Mac... It was kind of frustrating last time that I were able to compile, but not package.
eranon:
Yep, for sure, we're happy when it runs under OSX, Morten :o) Not that it's less well or more difficult than Windows, but what I discover since some days is that there're a lot less information around Mac than others OS'es. For example, I'm currently on an attempt (well, in fact I've the obligation to achieve the task - lol) to build a first minimal project, coming from C::B wizard... And I've a (I hope) last blocking point I express here : http://forums.codeblocks.org/index.php/topic,17193.0.html.
Well, so, in two steps :) :
1) At this time, my bundle is not strictly correct since I didn't solved relocations in full (I mean about core C::B and contrib plugins). So, it remains to fix the dylibbundler/install_name_tool stage, taking care of all.
2) About a guideline in wiki, why not (it would be an honor), but the real fact is that I'm more than late on my projects (I'm currently working on a 1.0 of a commercial software on a side and an open-source (not in C++, so not easy to switch several times per day) I've promised to a community for... this month, oops ; quite ready but I've to comment full source and add multilingual feature). Well, here is what I can do : once I've published this repo and reached 1.0 alpha on my current development, I write do something for the wiki from zero to first OSX minimal project built (so, build wxWidgets, build C::B SVN, create first project) ;o) But awaiting, of course, I can send you binaries or material you need/wish...
afb:
--- Quote from: MortenMacFly on December 03, 2012, 08:31:00 pm ---Guys, that's nice to read. The last time I was on a Mac I basically gave up when trying to create an app bundle.
Could you please transfer this into the WiKi to the right place? I would like to give it a try next time I get my hand on a Mac... It was kind of frustrating last time that I were able to compile, but not package.
--- End quote ---
I don't think the information on the wiki is that outdated, it's what I did for the CodeBlocks.app myself...
But one might emphasis how to do it with llvm-gcc-4.2 and 10.6.sdk in addition to gcc-4.0 and 10.4u.sdk.
Since I built wxWidgets as one "monolithic" library, including all the dependencies that it needs, I don't think
there's any need for something like dylibbundler. Just need to copy the files and run install_name_tool ?
Martin K.:
Hi,
Has anyone any experience on OS-X 10.8?
I have build wxWidgets 2.8.12 with the 10.6 SDK, that works, even the samples are running. But i fail while compiling Code::Blocks. It seems to use the 10.8 SDK which is not compatible with wxWidgets. Any hints so i can try this again this evening?
Martin
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version