about summary refs log tree commit diff
path: root/pkgs/development/haskell-modules/configuration-darwin.nix
diff options
context:
space:
mode:
authorsternenseemann <sternenseemann@systemli.org>2021-08-06 01:40:03 +0200
committersterni <sternenseemann@systemli.org>2021-08-06 14:39:22 +0200
commit9a32fd5c495a57b540c1293543f945ffcbc411c6 (patch)
tree4a25c3f2b842588c433490ea81ecadd5f64372d0 /pkgs/development/haskell-modules/configuration-darwin.nix
parent9a39115172986f55f3eeabab452ecb79709a6a09 (diff)
haskellPackages.SDL-ttf: fix build on darwin
SDL_main.h which is included from SDL_ttf.h contains a #define which redefines
main to SDL_main. This has to do with the way SDL binaries are linked and
executed on darwin which is explained here [1]. However this is bad news for
hsc2hs intermediate C sources which in this case only to gather version
information from the headers and not to run a full SDL application.

Thus compilation would fail due to this issue which we can avoid by redefining
main to main again after including the header.

[1]: http://www.ariis.it/link/repos/sdl-bindings/hssdl-image/MACOSX
Diffstat (limited to 'pkgs/development/haskell-modules/configuration-darwin.nix')
-rw-r--r--pkgs/development/haskell-modules/configuration-darwin.nix3
1 files changed, 3 insertions, 0 deletions
diff --git a/pkgs/development/haskell-modules/configuration-darwin.nix b/pkgs/development/haskell-modules/configuration-darwin.nix
index 50d627376dd44..27f75ca998386 100644
--- a/pkgs/development/haskell-modules/configuration-darwin.nix
+++ b/pkgs/development/haskell-modules/configuration-darwin.nix
@@ -206,4 +206,7 @@ self: super: {
     '' + (drv.postPatch or "");
   });
 
+  # Work around SDL_main.h redefining main to SDL_main
+  SDL-ttf = appendPatch super.SDL-ttf ./patches/SDL-ttf-darwin-hsc.patch;
+
 }