Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better OSX installation experience #3249

Closed
dbackeus opened this issue Sep 25, 2013 · 15 comments

Comments

Projects
None yet
6 participants
@dbackeus
Copy link

commented Sep 25, 2013

Heard about this project for the first time yesterday. Downloaded 0.8 SDL for OSX and tried to run it but had quite a few stumbling blocks on the way.

First of all libintl.8.dylib was not found. Running locate I stumbled upon that very file inside my Adobe Flash CS6 application and managed to symlink it to the expected location. If I had not found it in Flash I would have had no idea how to proceed.

Next up were cryptic messages about not finding SDL packages (main, image and ttf) which I first tried to install through brew which didn't help. Then googled the packages and did manual downloads finding out in the readme where to copy the files.

In the end I got it running but I'm still not seeing any tiles graphics so not sure what's up with that.

Had I not been an experienced mac user with development experience I would probably have never got it running.

I would love to help out with this experience. At least adding some helpful error messages to the launcher script if anything is missing. Best case scenario would be to automatically download and install the missing files or bundle them with the download.

Who can I talk to about helping out with this? I didn't find the OSX specific files inside the repo...

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@i2amroy

This comment has been minimized.

Copy link
Member

commented Sep 25, 2013

Anything you want to do to help is welcomed. I've been the one working off and on on the mac version (being the only main dev who owns one) but I don't really have any real experience developing for mac and as such, have pretty much hit a brick wall at getting the game running for other mac users then myself (I mean it runs fine for me, both tiles and non-tiles, COMPILING_osx.md has basic instructions for that). If you can figure out any way to hardlink those missing dependencies into the compilation so that new users don't have to download them we would be very much obliged to you (even more so if you tell us how you did it!).

@dbackeus

This comment has been minimized.

Copy link
Author

commented Sep 25, 2013

Did some research and it seems that both SDL and libintl (part of the gettext project) are released under the LGPL license which should allow us to redistribute the required files in the Cataclysm download.

Compressed that would be around 1.5MB so size should not be an issue.

So statically compiling the libraries might not be necessary (I haven't yet looked into compiling Cataclysm at all at this point).

I'll see about creating a simple installer script that would put the files in the proper places. Probably tomorrow I'll have time to actually get it done.

Regarding getting the tiles graphics to work. Do you have any idea why I'm getting ascii graphics only even though running the SDL version? Is there any configuration I might have to do or do you expect that it is related to your compiled version being incompatible with my system somehow?

@i2amroy

This comment has been minimized.

Copy link
Member

commented Sep 25, 2013

Make sure that when you compile it you use the "TILES=1" argument, which should generate a "cataclysm-tiles" file that you can run for tiles.

@dbackeus

This comment has been minimized.

Copy link
Author

commented Sep 27, 2013

When compiling the git code with TILES=1 and running cataclysm-tiles I did get tiles graphics to work. No idea why your version did not work.

I didn't manage to compile the code with LOCALIZE=1 though. Somehow it did not manage to find gettext even though I have it installed via homebrew.

In the end I managed to create a .app file which should work without manually installing SDL. Please try it out and see if the tiles graphics run on your end:
https://dl.dropboxusercontent.com/u/134414/Cataclysm%20Dark%20Days%20Ahead.zip

Note that I've included the SDL frameworks in the .app container and made the runner script copy the frameworks to ~/Library/Frameworks in case the user did not have them installed already.

Before a proper release we should probably have the runner script put the game files under "~/Library/Application Support/Cataclysm Dark Days Ahead" since that's the convention for OSX apps and makes it intuitive for users where to find configuration and save-files etc.

@SiGhTfOrbACQ

This comment has been minimized.

Copy link

commented Sep 28, 2013

dbackeus,

This is an interesting solution... copy the frameworks to the users ~/Library. :-)

However, I would personally like the libraries to be found by the binary in the application bundle! One way I accomplished this was to recompile the SDL's as static libraries, and then I include all required libraries in the Resources folder. I then hand build the Application bundle. This works great - but is a time consuming process.

So, I tried to make an xcode project so everything happens automatically. I can now compile without any errors! However, what I have not been successful doing is getting the application bundle to launch when double clicked. However, it will successfully run from the command line. :(

I have also attempted to use the SDL2, SDL2_image, and SDL2_ttf and include them as frameworks. However, SDL2_image has 3 errors all identical "Semantic Issue: No member named 'a' in 'struct SDL_Color' that cause the compile to fail.

I would love to make significant progress on this, however, I am not a developer. So my efforts are purely brute force... Any help would be greatly appreciated.

Dennis

@dbackeus

This comment has been minimized.

Copy link
Author

commented Sep 30, 2013

@dennisgroves I agree that including the libraries in the binary would be preferable. I'm actually not an OSX-app developer myself so I'm not familiar with xcode etc and did not manage to make a static build with the makefile provided.

Why would you need to include the libraries in the resources folder if they are statically included in the binary?

Yeah it seems Cataclysm in built on SDL rather than SDL2. No idea why.

Also I reached the conclusion that optimally we should have some argument for the binary for passing in a location for save games / config files etc since we want to have users update Cataclysm by overwriting the .app file. Which should overwrite the binary but not the user-files.

Is there something like that in place already or do we need to patch it?

@i2amroy

This comment has been minimized.

Copy link
Member

commented Sep 30, 2013

Yeah it seems Cataclysm in built on SDL rather than SDL2. No idea why

Mainly because we started before SDL2 existed and nobody has gotten around to updating yet. If somebody wants to update it and make a PR that works on all the various builds, then we'd be happy to merge it in.

@SiGhTfOrbACQ

This comment has been minimized.

Copy link

commented Oct 1, 2013

I have had one successful build, and it was when I complied all dependancies as shared libraries and then put them into the resources folder in the application bundle. This allows anybody anywhere to run it, without modifying their system. It also allows for remove or upgrade by tossing said app into the trash, or replacing it in the applications folder.

At this stage I am just getting things to run. So the data and gfx files are in the MacOS directory, when they should be in the Resources folder. Additionally, the save and other 'world' folders should be in the ~/Library/Application Support/Cataclysm-DDA. This is mostly a bunch of simple ifdef OSX changes, however I have not been spending much time on this when I can't get it to run.

Frustratingly, all the binaries I generate in xcode will run when double clicked or executed from the terminal from inside their bundle. However, the application bundle itself fails to launch anything at all when double clicked. :/

@SiGhTfOrbACQ

This comment has been minimized.

Copy link

commented Oct 2, 2013

I have put the whole project here (71mb):

https://dl.dropboxusercontent.com/u/186600/cdda.zip

Any help would be greatly appreciated. This is a very 'stripped-down' version of the problem I am encountering.
This binary links with only system libraries. It is a command line application. You can run it from the command line as long as the binary is in the same directory as a valid cataclysm data directory. When I try and stuff this into an application bundle it stops working. On reason is because the application must be launched by a shell script; hence the cataclysm-launcher script. Again if you double click cataclysm-launcher (or run cataclysm-launcher from the command line.) everything runs as expected. Put it into a application bundle and it stops working. :(

I have looked at Angband and Dungeon Crawl Stone Soup to see what they are doing differently, but I am unable to identify that difference.

@dbackeus

This comment has been minimized.

Copy link
Author

commented Oct 3, 2013

Wow looks like you've been making quite a bit of progress anyway.

I'm going on vacation and will probably not have time in the next two weeks to look into this further.

The .app not running sounds weird. Maybe it will help to look at my zip file above which has a working .app file. I made it without any previous knowledge of .app files through "appify" - https://gist.github.com/mathiasbynens/674099 and it basically just runs a bash-script in Contents/MacOS.

The Info.plist file I copied from Dungeon Crawl Stone Soup and changed to reflect the new game environment.

@SiGhTfOrbACQ

This comment has been minimized.

Copy link

commented Nov 10, 2013

Here are my preliminary notes on building osx, which I posted to the wiki.
http://www.wiki.cataclysmdda.com/index.php?title=User:Degroves

@qbradq

This comment has been minimized.

Copy link
Contributor

commented May 19, 2015

Since there still isn't a downloadable MacOS SDL bundle can we apply the label "Enhancement"?

@narc0tiq

This comment has been minimized.

Copy link
Contributor

commented May 20, 2015

@qbradq Sounds good to me. Thank you 👍

@dbackeus

This comment has been minimized.

Copy link
Author

commented Mar 17, 2016

There is a homebrew formula for compiling Cataclysm these days.

Stable release is easy to install, however compiling from HEAD fails as it's unable to locate SDL.h.

Anyone have any clue regarding this?
https://github.com/Homebrew/homebrew-games/issues/496

@illi-kun illi-kun added the OS: macOS label Apr 13, 2016

@illi-kun

This comment has been minimized.

Copy link
Member

commented Nov 6, 2016

This issue was closed as it appears inactive.

Reducing open issues to those which are (or will) be actively worked upon helps us focus our efforts. This issue has not been deleted - it still appears in searches and if it contains relevant information you are encouraged to continue to link to it.

If this issue was a bug

It should be reopened if it can be reproduced in the current build. You can obtain the most recent copy here. Please check there is not a more recent report of this bug before doing so. If no more recent report exists you should continue the discussion in this issue.

If this was a feature request

If the consensus was that the idea was good you could consider submitting an implementation via a PR. If you want to comment further please do so here as opposed to opening a new issue. Before posting check nobody has already made the same point and consider whether your comments are likely to lead to an implementation. If you have doubts about either consider instead voting for the issue

If you want to work on this issue

Then either assign it to yourself or if you are unable to do so claim it via adding a comment. Please don't assign others or make a general request for action.

@illi-kun illi-kun closed this Nov 6, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.