Page 1 of 1

OSX Tiles Trunk Love?

PostPosted: Wednesday, 26th June 2013, 01:45
by aprilia4life
I hate apple as much as the next guy, but unfortunately no hardware company has stepped up and manufactured a laptop as small and light as the Mac Book Air, so I am stuck with it. ;)

Just wondering when the next update for Mac OSX Tiles Build will be available? I am always hearing about exciting developments in the world of Crawl and can't try them out (on the train with no internet connection)

Take pity on this poor Mac user :ugeek:

Re: OSX Tiles Trunk Love?

PostPosted: Wednesday, 26th June 2013, 19:44
by reaver
The developers can't constantly babysit the Trunk builds. I think it's generally assumed most people who care about Trunk play online. Have you tried to compile Trunk yourself? You can update as soon as a new feature you like appears. It's really not as hard as it looks, and you can use the Technical Support forum for help:

The first time you do this, it will take a while, showing a bunch of text. Later, it will take less time, because your computer will store stuff so it doesn't need to be recompiled.
(Mod note: I edited this post to update the repo URL to the current one on github.com, since we no longer use gitorious --gammafunk)

To start playing:

    Open Finder
    Go to Macintosh HD
    Go in "Users"
    There is a folder with your username on it. Click it.
    Go into the folder named "Crawl"
    Go into the folder "crawl-ref"
    Go into the folder "source"
    Find the executable file. It's the only executable in the folder.
    Run the executable. It's the newest version of Crawl Trunk. You can move it to Applications if you want.
When you want to update:

    Delete the last executable, so you don't get confused. This will not affect your saves.
    Start terminal
    type: "cd Crawl"
    type: "git pull"
    type: "cd crawl-ref/source"
    type: "make APPLE_GCC=y NO_PKGCONFIG=y CONTRIB_SDL=y TILES=y"
You might need to hunt down older versions of git and Xcode if you have an older mac, but that should be easy enough. You can get older versions of Xcode by registering as a Apple Developer. Terminal is in Applications/Utilities on your mac.

It might look like a lot of steps, but most of them are pretty easy. If you need help, you can go to Technical Support.

Re: OSX Tiles Trunk Love?

PostPosted: Thursday, 27th June 2013, 01:22
by aprilia4life
Thanks heaps reaver for detailing what's required for getting this working on mac, I really appreciate the effort.

I have had a crack of it and got through most of the list, but have encountered some errors. I will see if I can get through it, I might have to post up some questions at a later date.

Thanks again, you and the rest of the Crawlers are awesome!

Re: OSX Tiles Trunk Love?

PostPosted: Wednesday, 24th July 2013, 21:11
by delarado
I tired this too but cannot get it working..

Will have a read through install to see if it has anything relating to this:

  Code:

 make APPLE_GCC=y NO_PKGCONFIG=y CONTRIB_SDL=y TILES=y
  * If you experience any problems building Crawl, please take a second look
  * at INSTALL.txt: the solution to your problem just might be in there!
    * rebuilding crawl: new build flags or prefix
TRACK_CFLAGS = gcc -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk -mmacosx-version-min=10.7 g++ -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk -mmacosx-version-min=10.7 -O1 -pipe -Wall -Wformat-security -DUSE_TILE -DUSE_TILE_LOCAL -DUSE_SDL -DUSE_GL -DUSE_FT -Wundef -Wno-parentheses -Wno-unused-parameter -Wwrite-strings -Wshadow -Wuninitialized -Icontrib/install/x86_64-apple-darwin12.4.0/include -Iutil -I. -Irltiles -Icontrib/install/x86_64-apple-darwin12.4.0/include/SDL -Icontrib/install/x86_64-apple-darwin12.4.0/include/freetype2 -I/usr/include/ncurses -DWIZARD -DASSERTS -DPROPORTIONAL_FONT=\"contrib/fonts/DejaVuSans.ttf\" -DMONOSPACED_FONT=\"contrib/fonts/DejaVuSansMono.ttf\" -DCLUA_BINDINGS #EOL
OLD_CFLAGS   =  #EOL
    * Need to build contribs: freetype sdl-image sdl libpng zlib lua/src sqlite
**********************************************************

The 'zlib' directory exists, but the Makefile is missing!
Did 'git submodule update' work properly?
(It's probably better to install all native dependencies instead.)

**********************************************************

Re: OSX Tiles Trunk Love?

PostPosted: Wednesday, 24th July 2013, 22:10
by reaver
delarado wrote:I tired this too but cannot get it working..
The dump is definitely trying to tell you what's wrong. The only bit which is unusual is
  Code:
**********************************************************

The 'zlib' directory exists, but the Makefile is missing!
Did 'git submodule update' work properly?
(It's probably better to install all native dependencies instead.)

**********************************************************

First, try this:
    start terminal
    type "cd Crawl"
    type "git submodule update"
This should give the following response:
  Code:
Skipping submodule 'crawl-ref/source/contrib/sdl-android'

If it doesn't that probably means you computer was missing something it need to create a Crawl executable, and it just found it and downloaded it.

Either way, try compiling again:
    type "cd crawl/source"
    type "make APPLE_GCC=y NO_PKGCONFIG=y CONTRIB_SDL=y TILES=y".
and see if that works.

If that fails try typing "pwd" (do this imediately after typing "make APPLE_GCC=y NO_PKGCONFIG=y CONTRIB_SDL=y TILES=y".) You should get:
/Users/YOUR USERNAME/crawl/crawl-ref/source

If you don't get that, you aren't trying to compile in the correct folder. Try completely redoing the steps (except, of course, downloading the tools. Make sure you restart terminal.) except replace "mkdir Crawl" and "cd Crawl" with "mkdir Crawl2" and "cd Crawl2". If it works, the executable will be in a second folder called "Crawl2" (As opposed to the "Crawl" folder. Just follow the instructions to get the executable replacing the "Crawl" folder with the "Crawl2" folder.

Re: OSX Tiles Trunk Love?

PostPosted: Wednesday, 24th July 2013, 22:26
by delarado
Removing useless info

Re: OSX Tiles Trunk Love?

PostPosted: Wednesday, 24th July 2013, 23:03
by delarado
To compile crawl;

Carls-MacBook-Air:~ carlnewton$ mkdir crawl
Carls-MacBook-Air:~ carlnewton$ cd crawl
Carls-MacBook-Air:crawl carlnewton$ git clone git://gitorious.org/crawl/crawl.git
Cloning into 'crawl'...
remote: Counting objects: 302942, done.
remote: Compressing objects: 100% (89218/89218), done.
remote: Total 302942 (delta 212496), reused 296635 (delta 208082)
Receiving objects: 100% (302942/302942), 73.38 MiB | 570 KiB/s, done.
Resolving deltas: 100% (212496/212496), done.

This will make a subdirectory under "Crawl" Called "Crawl"
CD Into it and run git submodule update. Lots of stuff will come up, and download, this will take a while.

Carls-MacBook-Air:crawl carlnewton$ cd crawl/
Carls-MacBook-Air:crawl carlnewton$ sudo git submodule update --init

then

cd crawl-ref/source
make APPLE_GCC=y NO_PKGCONFIG=y CONTRIB_SDL=y TILES=y

and it will compile. In the end you will be left with a file just called "crawl" in the source directory.

You can run by typing ./crawl and pressing enter, or by double clicking from the finder.

Re: OSX Tiles Trunk Love?

PostPosted: Thursday, 25th July 2013, 09:35
by delarado
Ok its compiled ok now, but Im getting an opelGL error. Seems to relate to this:

https://crawl.develz.org/mantis/view.php?id=5604

To change the init file to make it work, go into ~/crawl/crawl/crawl-ref/settings, open init.txt and change the following line:

# tile_full_screen = true

So it instead says:

tile_full_screen = false

(Take note of removing the hash! Very important)

You should now have a version of crawl youve compiled that works just fine.

Re: OSX Tiles Trunk Love?

PostPosted: Saturday, 10th August 2013, 13:36
by aprilia4life
OK, so things are tracking along, had an issue with the 'make' command, because XCODE didn't automatically activate terminal commands when it's installed.

Now when attempting to compile, I am getting the following result

---------------------------
Sarahs-MacBook-Air:source Scary$ make APPLE_GCC=y NO_PKGCONFIG=y CONTRIB_SDL=y TILES=y
* If you experience any problems building Crawl, please take a second look
* at INSTALL.txt: the solution to your problem just might be in there!
* Need to build contribs: freetype sdl-image sdl libpng zlib lua/src sqlite
CC src/base/ftbase.o
{standard input}:unknown:FATAL:can't create output file: src/base/ftbase.o
make[2]: *** [src/base/ftbase.o] Error 1
make[1]: *** [freetype] Error 2
make: *** [.contrib-libs] Error 2
-----------------------------

The first time I compiled it completed a few more lines before failing, but when trying to recompile it's failing like this. I have no clue when it comes to macs, so any help would be greatly appreciated.

Also, I tried the tests reaver suggested, and they all appeared to be working OK, not sure if his suggestions/tests are relevant to the issue I am having though.

Re: OSX Tiles Trunk Love?

PostPosted: Saturday, 10th August 2013, 17:47
by aprilia4life
I did a make clean and recompiled with the full output, unfortunately having the same error

Sarahs-MacBook-Air:source Scary$ make APPLE_GCC=y NO_PKGCONFIG=y CONTRIB_SDL=y TILES=y
* If you experience any problems building Crawl, please take a second look
* at INSTALL.txt: the solution to your problem just might be in there!
* rebuilding crawl: new build flags or prefix
TRACK_CFLAGS = gcc -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk -mmacosx-version-min=10.7 g++ -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk -mmacosx-version-min=10.7 -O1 -pipe -Wall -Wformat-security -DUSE_TILE -DUSE_TILE_LOCAL -DUSE_SDL -DUSE_GL -DUSE_FT -Wundef -Wno-parentheses -Wno-unused-parameter -Wwrite-strings -Wshadow -Wuninitialized -Icontrib/install/x86_64-apple-darwin12.3.0/include -Iutil -I. -Irltiles -Icontrib/install/x86_64-apple-darwin12.3.0/include/SDL -Icontrib/install/x86_64-apple-darwin12.3.0/include/freetype2 -I/usr/include/ncurses -DWIZARD -DASSERTS -DPROPORTIONAL_FONT=\"contrib/fonts/DejaVuSans.ttf\" -DMONOSPACED_FONT=\"contrib/fonts/DejaVuSansMono.ttf\" -DCLUA_BINDINGS #EOL
OLD_CFLAGS = #EOL
* Need to build contribs: freetype sdl-image sdl libpng zlib lua/src sqlite
CC src/base/ftbase.o
{standard input}:unknown:FATAL:can't create output file: src/base/ftbase.o
make[2]: *** [src/base/ftbase.o] Error 1
make[1]: *** [freetype] Error 2
make: *** [.contrib-libs] Error 2

Re: OSX Tiles Trunk Love?

PostPosted: Saturday, 10th August 2013, 18:37
by Siegurt
That looks like you're having trouble writing to the directory where it wants to put the .o files is it possible you don't have your permissions set correctly?

Re: OSX Tiles Trunk Love?

PostPosted: Saturday, 10th August 2013, 20:32
by aprilia4life
Siegurt wrote:That looks like you're having trouble writing to the directory where it wants to put the .o files is it possible you don't have your permissions set correctly?


Spot on, thanks Siegurt. I couldn't be bothered trying to learn the intricacies of macs and just logged in as root and it worked. So, compiled and ran OK.

Thanks for the help everyone, I now have the latest -dev- version :D

Re: OSX Tiles Trunk Love?

PostPosted: Monday, 19th August 2013, 19:51
by tiktok
I was able to follow the above instructions and compile a version on my Mac.

But when I try compiling it as the typical mac application package, I run into the problems.

I use this command:
  Code:
make NO_AUTO_SDK=y SDK_VER=10.8 SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk NO_PKGCONFIG=y CONTRIB_SDL=y TILES=y mac-app-tiles


It builds "Dungeon Crawl Stone Soup - Tiles.app" but doesn't seem to run. While I'm good at following instructions, actual debugging is beyond me.

Can anyone give the correct command line?

Re: OSX Tiles Trunk Love?

PostPosted: Friday, 30th August 2013, 10:58
by delarado
I don't know what the command is to make a .app but I noticed crawl would not run in tiles mode for me unless I changed the full screen parameter in the init file (as per my post above) have you done this?

Ok its compiled ok now, but Im getting an opelGL error. Seems to relate to this:

https://crawl.develz.org/mantis/view.php?id=5604

To change the init file to make it work, go into ~/crawl/crawl/crawl-ref/settings, open init.txt and change the following line:

# tile_full_screen = true

So it instead says:

tile_full_screen = false

(Take note of removing the hash! Very important)

You should now have a version of crawl youve compiled that works just fine.


If you alt-click the app bundle you should be able to open the package and get into the directory structure I mention.

Re: OSX Tiles Trunk Love?

PostPosted: Thursday, 5th September 2013, 01:08
by tiktok
delarado wrote:I don't know what the command is to make a .app but I noticed crawl would not run in tiles mode for me unless I changed the full screen parameter in the init file (as per my post above) have you done this?


I tried it but it it didn't work. Oh well, I have a working game; it's just not in a tidy mac application.

Re: OSX Tiles Trunk Love?

PostPosted: Sunday, 20th July 2014, 10:38
by archaeo
tiktok wrote:I tried it but it it didn't work. Oh well, I have a working game; it's just not in a tidy mac application.


Because I use this thread when I need to remember how to compile crawl, I'll add what gammafunk said on reddit:

"make mac-app-tiles APPLE_GCC=y NO_PKGCONFIG=y CONTRIB_SDL=y TILES=y

The "mac-app-tiles" target is the one that makes the App bundle as opposed to a plain executable. It will make a zip in the folder crawl-ref/source/mac-app-zips that contains the DCSS application."

Re: OSX Tiles Trunk Love?

PostPosted: Thursday, 9th October 2014, 09:11
by xaff
Is anyone else having issues compiling after the recent XCode update? Mind this issue occurs only for tiles.

  Code:
In file included from src/events/SDL_events.c:28:
In file included from src/events/SDL_sysevents.h:24:
In file included from src/events/../video/SDL_sysvideo.h:37:
include/SDL_opengl.h:3124:22: error: typedef redefinition with different types
      ('unsigned int' vs 'void *')
typedef unsigned int GLhandleARB;       /* shader object handle */
                     ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/OpenGL.framework/Headers/gltypes.h:65:15: note:
      previous definition is here
typedef void *GLhandleARB;
              ^
1 error generated.
make[2]: *** [src/events/SDL_events.o] Error 1
make[1]: *** [sdl] Error 2
make: *** [.contrib-libs] Error 2

Re: OSX Tiles Trunk Love?

PostPosted: Wednesday, 15th October 2014, 11:11
by archaeo
Yeah, I just had this happen as well. Any way to work around this?

Re: OSX Tiles Trunk Love?

PostPosted: Tuesday, 21st October 2014, 21:30
by xaff
I've tried changing the typedef, but that caused other compilation errors. I've also tried replacing contrib/sdl with version 1.2.5, but the compilation fails too.

As far as I see there's a new XCode update. I hope that now with Yosemite and new XCode out, maybe more people will stumble upon this issue and try to fix it...

Re: OSX Tiles Trunk Love?

PostPosted: Friday, 24th October 2014, 20:24
by lobf
also having an issue compiling. Gammafunk said it was an SDK problem, but I don't think he's had time to address it yet. :'(

Re: OSX Tiles Trunk Love?

PostPosted: Tuesday, 28th October 2014, 23:33
by lobf
I don't suppose anybody has a newer-than-May version they can share, do they?

Re: OSX Tiles Trunk Love?

PostPosted: Sunday, 16th November 2014, 23:34
by archaeo
So after this commit I was told to try compiling again, but I still seem to be running into a ton of errors:

  Code:
In file included from src/video/quartz/SDL_QuartzEvents.m:24:
src/video/quartz/SDL_QuartzVideo.h:95:5: error: unknown type name
      'CGDirectPaletteRef'
    CGDirectPaletteRef palette;            /* palette of an 8-bit display */
    ^
src/video/quartz/SDL_QuartzEvents.m:216:23: warning: 'GetScriptManagerVariable'
      is deprecated: first deprecated in OS X 10.5 [-Wdeprecated-declarations]
    KCHRPtr = (void *)GetScriptManagerVariable(smKCHRCache);
                      ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Script.h:986:1: note:
      'GetScriptManagerVariable' has been explicitly marked deprecated here
GetScriptManagerVariable(short selector)                      __OSX_AVAI...
^
src/video/quartz/SDL_QuartzEvents.m:226:21: warning: implicit declaration of
      function 'KeyTranslate' is invalid in C99
      [-Wimplicit-function-declaration]
            value = KeyTranslate(KCHRPtr, i, &state) & 0xff;
                    ^
src/video/quartz/SDL_QuartzEvents.m:733:5: error: use of undeclared identifier
      'CGMouseDelta'
    CGMouseDelta dx, dy;
    ^
src/video/quartz/SDL_QuartzEvents.m:749:13: warning: 'UpdateSystemActivity' is
      deprecated: first deprecated in OS X 10.8 [-Wdeprecated-declarations]
            UpdateSystemActivity(UsrActivity);
            ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/Power.h:367:1: note:
      'UpdateSystemActivity' has been explicitly marked deprecated here
UpdateSystemActivity(UInt8 activity)                          __OSX_AVAI...
^
src/video/quartz/SDL_QuartzEvents.m:760:5: error: use of undeclared identifier
      'dx'
    dx = 0;
    ^
src/video/quartz/SDL_QuartzEvents.m:761:5: error: use of undeclared identifier
      'dy'
    dy = 0;
    ^
src/video/quartz/SDL_QuartzEvents.m:856:25: error: use of undeclared identifier
      'CGMouseDelta'
                        CGMouseDelta dx1, dy1;
                        ^
src/video/quartz/SDL_QuartzEvents.m:857:47: error: use of undeclared identifier
      'dx1'
                        CGGetLastMouseDelta (&dx1, &dy1);
                                              ^
src/video/quartz/SDL_QuartzEvents.m:858:25: error: use of undeclared identifier
      'dx'
                        dx += dx1;
                        ^
src/video/quartz/SDL_QuartzEvents.m:858:31: error: use of undeclared identifier
      'dx1'
                        dx += dx1;
                              ^
src/video/quartz/SDL_QuartzEvents.m:859:25: error: use of undeclared identifier
      'dy'
                        dy += dy1;
                        ^
src/video/quartz/SDL_QuartzEvents.m:859:31: error: use of undeclared identifier
      'dy1'
                        dy += dy1;
                              ^
src/video/quartz/SDL_QuartzEvents.m:984:9: error: use of undeclared identifier
      'dx'
    if (dx != 0 || dy != 0)
        ^
src/video/quartz/SDL_QuartzEvents.m:984:20: error: use of undeclared identifier
      'dy'
    if (dx != 0 || dy != 0)
                   ^
src/video/quartz/SDL_QuartzEvents.m:985:39: error: use of undeclared identifier
      'dx'
        SDL_PrivateMouseMotion (0, 1, dx, dy);
                                      ^
3 warnings and 13 errors generated.
make[2]: *** [src/video/quartz/SDL_QuartzEvents.o] Error 1
make[1]: *** [sdl] Error 2
make: *** [.contrib-libs] Error 2


Any suggestions?

Edit: make clean seems to be working fine tho

Edit 2: Never mind, gamma helped me figure out what was wrong with my stupid files.

Re: OSX Tiles Trunk Love?

PostPosted: Wednesday, 26th November 2014, 22:05
by tiktok
Just wanted to put in a 2nd confirmation that compiling does work again for OS X. :lol:

I still don't know how to compile a nice little os x .app bundle like the official releases, but happy to have a chance playing the latest version.

Edit : Ok, I do know how to make a os x app bundle. Archaeo & Gammafunk were right and "make mac-app-tiles APPLE_GCC=y NO_PKGCONFIG=y CONTRIB_SDL=y TILES=y" works. It didn't work for me previously, but things are fine now because I have a clean os x system to work on.