[Haskell-cafe] ANN: Silkworm game

Duane Johnson duane.johnson at gmail.com
Sun May 3 15:38:54 EDT 2009

So here's the thing.... to get it to run on Mac OS X, I have to build  
a "SilkwormGame.app" directory, with a "Resources" directory inside,  
along with a lot of other rubbish, just so that GLFW can create a Mac  
OS window that accepts mouse and keyboard input.  This is the purpose  
of the Makefile--it uses a script borrowed from wxWindows to assemble  
all the parts.

Obviously, this rigamarole is not necessary in Unix.  But am I correct  
in assuming that there is no facility in Cabal that prepares a Mac OS  
"app" in this way?  Any suggestions so that a cabal install will work  
for both Unix and Mac users?

Here is what I get (using Don's Silkworm.cabal):

> ~/Documents/Duane/BYU Semesters/2009-Winter/Graphics/ 
> Silkworm(master) $ cabal install
> Resolving dependencies...
> Configuring Silkworm-0.2...
> Preprocessing executables for Silkworm-0.2...
> Building Silkworm-0.2...
> [ 1 of 16] Compiling Silkworm.Action  ( Silkworm/Action.hs, dist/ 
> build/SilkwormGame/SilkwormGame-tmp/Silkworm/Action.o )
> ... <snip>...
> [16 of 16] Compiling Main             ( main.hs, dist/build/ 
> SilkwormGame/SilkwormGame-tmp/Main.o )
> Linking dist/build/SilkwormGame/SilkwormGame ...
> Installing executable(s) in /Users/duane/.cabal/bin
> ~/Silkworm(master) $ SilkwormGame
> Working in unbundled mode.  You should build a .app wrapper for your  
> Mac OS X applications.
> SilkwormGame: ~/Silkworm/background.png: openBinaryFile: does not  
> exist (No such file or directory)

Putting the binary files in the place it expects produces the same  
"working in unbundled mode" along with a window that will not capture  
ANY input from the mouse or keyboard.  In fact, it won't even rise to  
the top of the window stack--it remains behind the terminal window.

Thanks for you help,
-- Duane

On May 2, 2009, at 6:07 PM, Don Stewart wrote:

> Yes, it is quite fun.
> I think it should be using cabal's datadir from Paths_silkworm.hs to
> install (and find) the resources.
> Yell if you can't figure out how to do that. (xmonad has an example)
> -- Don

More information about the Haskell-Cafe mailing list