bnordli / rftg

Race for the Galaxy AI
173 stars 32 forks source link

Build files and binaries for OS X #39

Open bnordli opened 7 years ago

bnordli commented 7 years ago

There have been several requests for binaries for OS X.

I don't have the ability to make one, but will happily take any pull request with build files and/or instructions.

joeskeen commented 7 years ago

I gave it a shot, but so far I'm not able to get it to build on my MacBook (something about GTK+ isn't getting installed or linked correctly). I'll try it again later on my home computer.

tcwan commented 7 years ago

I've created a Macports port file that build for X11 (w/o Quartz). I have not pulled the github repo to my system, so I'm just enclosing the files here. I'm not sure how to easily solve the src subdirectory issue with the configure command, feel free to fix it if necessary.

This was built on macOS Sierra. I think if you want a native OS X port, you'll need to either build using XCode or else build gtk+ with +XQuartz (I'm not sure if it is a working variant for MacPorts on Sierra).

rftg-port.zip

tcwan commented 7 years ago

One more thing. I've pointed the Portfile to the latest master branch (as of 10 Dec 2016). It says 0.9.6 but it is actually prerelease. Feel free to change the git branch to a suitable release.

bnordli commented 7 years ago

I have now built MacPorts for my Ubuntu (16.04), but when trying to build rftg, it cannot find gtk2:

--->  Computing dependencies for rftg
Error: Dependency 'gtk2' not found.

This is the output from port lint:

--->  Verifying Portfile for rftg
Error: Missing required variable: platforms
Error: Unknown dependency: git
Error: Unknown dependency: gtk2
Error: Unknown dependency: libpng
Warning: no license set
Error: Portfile parent directory macports does not match primary category games
--->  5 errors and 1 warnings found.

If this should be added to src/macports, is there a way to point it to the local directory ../../src instead of referencing the remote git repository?

Also, wouldn't it be better to remove the __APPLE__ directive from the command line instead of applying a patch file?

tcwan commented 7 years ago

Hmm. I've never tried MacPorts on non-MacOS platforms before.

The first error on missing platforms, I deleted it accidentally from the Portfile, you can insert "platforms XXXX", not sure what is relevant for Ubuntu as one of the statements near the top of the file. What happens when do you a 'port list installed', do you have gtk2 installed? It sounds like you will need to do a port install of the missing dependencies.

As for the patch vs. #undef, I wasn't sure whether it is defined elsewhere in one of the header files, or if it is a system define, so I didn't try it. I guess I can try doing that and see if it works.

tcwan commented 7 years ago

Ok, I've managed to override the APPLE from the Portfile without requiring the use of patchfiles. Please use this version of the Portfile. The earlier version was mangled by TextEdit during last minute editing as well.

As for using local copy of the source TGZ, I don't think MacPorts support this type of usage. It will always refer to a remote site to download the source files.

By the way, information on how to configure MacPorts to use local Portfiles can be found here.

Portfile.zip

ycardon commented 7 years ago

Hi, I got it to build with brew:

brew install gtk-mac-integration
cd ~/rftg/src
./configure
make CFLAGS="-U __APPLE__"

Struggling with make install now, but it can be done manually. You have to copy:

rftg
images.data
cards.txt
campaign.txt
network/
bnordli commented 7 years ago

Thanks for this!

Let me know if you have a binary or installation for mac that I should host on the releases page.

ycardon commented 7 years ago

Well, I can upload the macOS binaries I've build but they are not packaged in an application bundle : meaning you have to run the program from the command line (otherwise it doesn't find its resources files).

I will try to inject the binaries in a previous application bundle.

ycardon commented 7 years ago

Well, I've tried to start from a previous app bundle (http://keldon.net/rftg/rftg-osx-0.9.4.zip), it does not work: I cannot find how to specify a start directory in the Info.plist file, the program cannot find its resource files.

I've temporarly put the binaries here : https://www.dropbox.com/sh/s76iiuam4ixsm2y/AAA2tNHRBTA7RpoqEvVxYCnCa?dl=0

kamronbatman commented 6 years ago

@ycardon, any luck on this?

ycardon commented 6 years ago

@kamronbatman: Well, it could have been better (you have to launch the program from the command line) but it works.

Can you try this : https://www.dropbox.com/sh/s76iiuam4ixsm2y/AAA2tNHRBTA7RpoqEvVxYCnCa?dl=0 ?

kamronbatman commented 6 years ago

I did, and it works minus the mac menu. Without the menu, I am not sure how to access all of the features such as network server?

I think we should separate out the source, or find a way to redo the code so it is compatible with the newest xcode and set up to just build without extra work. I don't have the skill to do it unfortunately.

ycardon commented 6 years ago

I guess some GTK libs are missing, I got them using brew. brew install gtk-mac-integration

I agree it's not the best option... fixing the Xcode build would be better but I cannot do it either.

Anyway, if you REALLY want the game, you can build and run it now

brew install gtk-mac-integration
cd ~/rftg/src
./configure
make CFLAGS="-U __APPLE__"