Author Topic: Mac "build script" question  (Read 4461 times)

Offline edwin

  • Multiple posting newcomer
  • *
  • Posts: 38
Mac "build script" question
« on: April 09, 2010, 09:09:50 pm »
Hello,

If I may, I would like to give the Code Blocks dev team a big “thumbs up”. I really like what you have done. I had no problems using the IDE and poking around all its features – event without reading any manuals. Its pretty nice.

Ok….

Question 1:
Is there a current C::B Mac build script somewhere?

Hopefully a script that gets the code from SVN, builds everything and then makes the Mac “CodeBLocks.app” image.


More Info:
I have been working with code blocks over the past few weeks – trying to evaluate if it will fit a cross platform dev project I have to complete. I started out using the v8.02 pre-built images on Windows (XP) , Linux (Ubuntu 9.10) and Max OS X (Snow Leopard 10.6.3). Everything looked promising on the Windows and Linux platforms but I had a few problems when using the v8.02 code on the Mac. No big deal…

I ended up checking out the source code from the SVN repository. I built the latest images on Windows XP and Linux Ubuntu. All is OK. I was able to determine that C::B will be a good fit on these two platforms.

On Mac Snow Leopard 10.6.3 however, I have hit a bit of a snag regarding how to package the “CodeBLocks.app” image. I have searched this support forum for the answer so forgive me if I have missed something.

Here is what I did:

1)
As a starting point, I grabbed the shell script that roxlu posted earlier this year:

http://forums.codeblocks.org/index.php/topic,11920.0.html

I would not have gotten as far as I did without this script. Thanks roxlu!

I had a few minor issues with the script, my Mac dev environment and the SVN checkout but I think all is OK now and I have what looks like a completed “build all” for C::B on the Mac.

I am using C::B SVN rev 6202 and wxWidgets SVN 63917 (v2.8.11)

2)
Roxlu’s original script tried to make the “CodeBLocks.app” image but it is not working properly. I am comparing what roxlu’s script has generated to the “CodeBLocks.app” image from the original v8.02 app image. I am also comparing what the script is creating relative to roxlu’s app image that was referenced in another post.

I diffed the different images and I started to update the build script to properly create the structure in the app’s “CodeBlocks.app/Resources/share/codeblocks” directory by copying the needed “stuff” from the source tree and the build tree:

codeblocks_svn\src\src\resources…
codeblocks_svn\custom_build\src…

The more I got into it, the more something did not seem right.

Question 2:
Is it OK for me to build the app image this way?

I would like to use C::B for my dev project. If I can contribute back or help, I can do that too.


Thanks,

edwin



Offline afb

  • Developer
  • Lives here!
  • *****
  • Posts: 884
Re: Mac "build script" question
« Reply #1 on: April 11, 2010, 10:53:54 am »
Question 1:
Is there a current C::B Mac build script somewhere?

Hopefully a script that gets the code from SVN, builds everything and then makes the Mac “CodeBLocks.app” image.


More Info:
I have been working with code blocks over the past few weeks – trying to evaluate if it will fit a cross platform dev project I have to complete. I started out using the v8.02 pre-built images on Windows (XP) , Linux (Ubuntu 9.10) and Max OS X (Snow Leopard 10.6.3). Everything looked promising on the Windows and Linux platforms but I had a few problems when using the v8.02 code on the Mac. No big deal…

What were the "few problems" with the 8.02 image for Mac OS X ?

Are they something that could be fixed for next release perhaps ?

Quote
On Mac Snow Leopard 10.6.3 however, I have hit a bit of a snag regarding how to package the “CodeBLocks.app” image. I have searched this support forum for the answer so forgive me if I have missed something.

Did you see wiki:Installing_Code::Blocks_from_source_on_Mac_OS_X ?

BTW, I think you have a typo ("L") in your spelling of CodeBlocks.app...

Quote
Here is what I did:

1)
As a starting point, I grabbed the shell script that roxlu posted earlier this year:

http://forums.codeblocks.org/index.php/topic,11920.0.html

I would not have gotten as far as I did without this script. Thanks roxlu!

I had a few minor issues with the script, my Mac dev environment and the SVN checkout but I think all is OK now and I have what looks like a completed “build all” for C::B on the Mac.

I am using C::B SVN rev 6202 and wxWidgets SVN 63917 (v2.8.11)

Most likely you want to use a released version of wxWidgets, i.e. 2.8.10 ?

2.8.11 is in RC2 so should be out shortly, meanwhile I used 2.8.10 + patch.

Quote
Question 2:
Is it OK for me to build the app image this way?

I would like to use C::B for my dev project. If I can contribute back or help, I can do that too.

It is perfectly OK, just that the build instructions and the build script have not been updated in a while... Currently it just uses Mac OS X 10.4 to compile, while it should use the SDK to work from newer releases. It also needs a newer version of the app bundler included, so you can do something like "make app". Or at least an updated version of the shell script that I use, with the install_name_tool cleanup calls.

Offline afb

  • Developer
  • Lives here!
  • *****
  • Posts: 884
Re: Mac "build script" question
« Reply #2 on: April 11, 2010, 10:57:52 am »
Quote
What were the "few problems" with the 8.02 image for Mac OS X ?
http://prdownload.berlios.de/codeblocks/codeblocks-8.02-p2-mac.zip

Also, are they also present in the latest "nightly build" image for Mac OS X:
http://prdownload.berlios.de/codeblocks/CB_20100227_rev6181_mac2810.zip

Offline edwin

  • Multiple posting newcomer
  • *
  • Posts: 38
Re: Mac "build script" question
« Reply #3 on: April 14, 2010, 06:17:24 pm »
Hi afb,

Thanks very much for your responses. For some reason I had email support forum notifications turned off so I did not see your post until just now.


Quote
What were the "few problems" with the 8.02 image for Mac OS X ?

The “few problems” I noticed were related to keyboard navigation and what looked like GUI display issues (also the wxWidgets font dialog patch). Nothing earth shattering. I was using the v8.02 (patch 2) image and thought it might be better to get to the latest SVN code base in order to properly perform an evaluation. I saw so many changes since the v8.02 release that it made sense to me to perform a SVN build of the latest code.


Quote
Are they something that could be fixed for next release perhaps ?

Not sure at this point. I have started a log for any issues that I see as I continue to evaluate C::B on Snow Leopard 10.6.3. I will certainly post back with further info. I will start using the nightly rev6181 you suggested (see more below). I want to make sure that I am not doing something dumb and wasting our time. One thing I have already done is to turn OFF a subset of Snow Leopard’s default hot key mappings. Some of these clashed with C::B which causes grief. So there explains some of the keyboard navigation issues I saw.

Quote
Did you see wiki:Installing_Code::Blocks_from_source_on_Mac_OS_X?

I did see this – but for some reason I do not remember seeing the “Bundle library for Mac” section and the example shell script that calls the install_name_tool app. Arrgh…. Thanks for pointing this out… I will read it again and try to get further with my Mac build and app bundling.


Quote
BTW, I think you have a typo ("L") in your spelling of CodeBlocks.app...

Doh!     :)


Quote
Most likely you want to use a released version of wxWidgets, i.e. 2.8.10 ?

2.8.11 is in RC2 so should be out shortly, meanwhile I used 2.8.10 + patch.

Ahh, yes – I understand. I am aware of the font dialog patch. Thank you.


Quote
Regarding this image:
http://prdownload.berlios.de/codeblocks/codeblocks-8.02-p2-mac.zip

Yes - I used this image for initial testing before convincing myself to perform a build from the SVN trunk.


Quote
Also, are they also present in the latest "nightly build" image for Mac OS X:
http://prdownload.berlios.de/codeblocks/CB_20100227_rev6181_mac2810.zip

I must be too tired. I completely missed that download. My mistake. I will start using this rev6181 image immediately and then get back to building the SVN image.


Thanks for all your information. I will repost again later.

Thank you,


edwin




Offline afb

  • Developer
  • Lives here!
  • *****
  • Posts: 884
Re: Mac "build script" question
« Reply #4 on: April 14, 2010, 11:10:27 pm »
Quote
What were the "few problems" with the 8.02 image for Mac OS X ?

The “few problems” I noticed were related to keyboard navigation and what looked like GUI display issues (also the wxWidgets font dialog patch). Nothing earth shattering. I was using the v8.02 (patch 2) image and thought it might be better to get to the latest SVN code base in order to properly perform an evaluation. I saw so many changes since the v8.02 release that it made sense to me to perform a SVN build of the latest code.

Ah, OK. Those we know about (I think), there's some other annoying ones listed at BerliOS and on wiki:Installing_Code::Blocks_nightly_build_on_Mac_OS_X

Quote
Thanks for all your information. I will repost again later.

No problem, those Wiki pages could need some updating. And we should fix the example wxWidgets project to do bundle directories instead of Rez...

Code: wxwidgets/wizard.script
        if (PLATFORM == PLATFORM_MAC)
        {
            // still need the resource fork hack to run unbundled wxWidgets applications:
            local rezflags = _T("/Developer/Tools/Rez -d __DARWIN__ -t APPL Carbon.r -o");

            if (!IsNull(target))
            {
                target.AddCommandsAfterBuild(rezflags + _T(" $(TARGET_OUTPUT_FILE)"));
            }
        }

There's some other parts that are broken too, such as building .dylib or adding frameworks.