Opened 13 years ago

Closed 12 years ago

#947 closed defect (fixed)

[PATCH] Fix OS X app bundle

Reported by: historic_bruno Owned by: Yves
Priority: Should Have Milestone: Alpha 9
Component: Build & Packages Keywords: osx, build, app
Cc: pbernery, Yves, Echelon9 Patch:

Description

The new build system with Premake4 creates an app bundle for GCC and Xcode. It's incomplete, only generating the binary, and won't run properly. It seems all the game data and libraries should be copied into the bundle using the appropriate structure, which would be a nice official distribution method for OS X. It doesn't seem practical for SVN users because they want the structure of the SVN, not an app bundle. So perhaps the default compile on OS X should be a plain binary, but using a new flag an app bundle gets generated (once we work out the technical details).

Also worth investigating is how Xcode3 manages to compile and run an incomplete bundle (it works for me).

Change History (10)

in reply to:  description comment:1 by historic_bruno, 12 years ago

Component: Non-game systemsBuild system
Milestone: BacklogAlpha 9

comment:2 by Echelon9, 12 years ago

Cc: pbernery added
Keywords: review added
Owner: set to Echelon9
Summary: Fix OS X app bundle[PATCH] Fix OS X app bundle

The following will work for the standard engine and Atlas, based on r10867:

(1) Xcode project file + precompiled libraries (to be unzipped into build/), and
(2) Patch to fix a few spots in the source code as well as permit loading data from ~/Library/Application Support/0AD/data rather than inside the .app bundle

Links:
(1) http://members.iinet.net.au/~tjkidd/0ad/xcode-project-file-r10867.zip
(2) http://members.iinet.net.au/~tjkidd/0ad/clean-build-mac-r10867.diff

Has been tested to compile with Xcode 3.2.6 and Xcode 4.2.1. These files should also resolve #1073.

comment:3 by Echelon9, 12 years ago

Note this builds upon cc_julian's work here: http://www.wildfiregames.com/forum/index.php?showtopic=15145&st=0

comment:4 by Yves, 12 years ago

Cc: Yves added

Thank you for your work on that important problem. :) We really need to support building and deployment on the Mac much better.

I'll do the review and give feedback in the next few days if that's fine. From what I can tell now I see a few things you apparently didn't take into consideration, but I would like to have a closer look until I elaborate on this.

in reply to:  4 ; comment:5 by historic_bruno, 12 years ago

Replying to Echelon9:

Note this builds upon cc_julian's work here: http://www.wildfiregames.com/forum/index.php?showtopic=15145&st=0

Please see the comments in that topic, especially regarding the patch and Xcode project. Have the libraries been tested on OS X 10.5-7, which seem to be the most commonly used versions now? Are they only 64-bit?

I wonder if we could build "universal" 32/64-bit binaries to support both architectures, I know Mac Ports can do this with the universal variant.

Replying to Yves:

I'll do the review and give feedback in the next few days if that's fine. From what I can tell now I see a few things you apparently didn't take into consideration, but I would like to have a closer look until I elaborate on this.

What are the chances of tweaking premake so it can generate a single Xcode4-compatible project? :)

in reply to:  5 comment:6 by Yves, 12 years ago

Replying to historic_bruno:

What are the chances of tweaking premake so it can generate a single Xcode4-compatible project?

I don't know if premake 4.4 beta3 (most current version) generates Xcode4 projects well or if it's more or less the same as the XCode3 projects with all the problems like multiple project-files etc... I'm also not sure if using it before the final 4.4 release is a good idea. Maybe I can make a few tests about that in the next days too, but I'll need help for testing because I don't have XCode4. It's not free anymore and I didn't want to buy it because I don't even own a "real" Mac ;)

comment:7 by Echelon9, 12 years ago

I was able to do away with some of the changes within clean-build-mac-r10867.diff. Patch file has been reloaded at the same address for those who want the latest.

comment:8 by Yves, 12 years ago

Cc: Echelon9 added
Keywords: review removed
Owner: changed from Echelon9 to Yves

You have seen my thread in the forums about this topic. http://www.wildfiregames.com/forum/index.php?showtopic=15511

The main problem with your patch is that it uses a manually created XCode project. It's important for us to use premake or another viable alternative to create all the different project-files on the supported platforms to avoid having to change it manually when we e.g. add or remove files.

I'm taking this ticket now, because I already know premake and the build-system quite well, but I would appreciate you help once It's ready for testing or if I need help. :) I'll try to keep this ticket an the thread up-to-date.

comment:9 by historic_bruno, 12 years ago

BTW, I've been working on a script to automatically download and build the game's dependencies, in place of Mac Ports. See #1112.

comment:10 by Yves, 12 years ago

Resolution: fixed
Status: newclosed

(In [10946]) Fixes #947 by generating a plain executable instead of an app bundle for development-builds. The plan is to create a bundle later as a separate deployment-step after building. NVTT build is also changed because the installnames were not correct when doubleclickig the executable.

Note: See TracTickets for help on using tickets.