I’m trying to run a pure nix-shell on osx and then build a haskell project with Stack. The project uses using OpenGL via
gloss and i can successfully build it outside of nix-shell but in the shell, i consistently get the following error:
Building all executables for `haskell-game' once. After a successful build of all of them, only specified executables will be rebuilt. haskell-game-0.1.0.0: configure (lib + exe) Configuring haskell-game-0.1.0.0... haskell-game-0.1.0.0: build (lib + exe) Preprocessing library for haskell-game-0.1.0.0.. Building library for haskell-game-0.1.0.0.. [1 of 3] Compiling Paths_haskell_game ( .stack-work/dist/x86_64-osx/Cabal-220.127.116.11/build/autogen/Paths_haskell_game.hs, .stack-work/dist/x86_ 64-osx/Cabal-18.104.22.168/build/Paths_haskell_game.o ) [2 of 3] Compiling WithWindow ( src/WithWindow.hs, .stack-work/dist/x86_64-osx/Cabal-22.214.171.124/build/WithWindow.o ) [3 of 3] Compiling Lib ( src/Lib.hs, .stack-work/dist/x86_64-osx/Cabal-126.96.36.199/build/Lib.o ) ld: framework not found OpenGL collect2: error: ld returned 1 exit status `gcc' failed in phase `Linker'. (Exit code: 1) -- While building package haskell-game-0.1.0.0 using: /Users/willisplummer/.stack/setup-exe-cache/x86_64-osx/Cabal-simple_mPHDZzAJ_188.8.131.52_ghc-8.6.5 --builddir=.stack-work/dist/x86_64-osx/ Cabal-184.108.40.206 build lib:haskell-game exe:haskell-game-exe --ghc-options " -ddump-hi -ddump-to-file -fdiagnostics-color=always"
I’ve been poking around a bit and it seems like this may be related to xcode stuff being unavailable to the shell. Curious if there’s a solution or workaround?
here’s the github project for reference: https://github.com/willisplummer/haskell-game