From 9a32fd5c495a57b540c1293543f945ffcbc411c6 Mon Sep 17 00:00:00 2001 From: sternenseemann Date: Fri, 6 Aug 2021 01:40:03 +0200 Subject: 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 --- .../development/haskell-modules/patches/SDL-ttf-darwin-hsc.patch | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 pkgs/development/haskell-modules/patches/SDL-ttf-darwin-hsc.patch (limited to 'pkgs/development/haskell-modules/patches') diff --git a/pkgs/development/haskell-modules/patches/SDL-ttf-darwin-hsc.patch b/pkgs/development/haskell-modules/patches/SDL-ttf-darwin-hsc.patch new file mode 100644 index 0000000000000..3cc5c54f065b9 --- /dev/null +++ b/pkgs/development/haskell-modules/patches/SDL-ttf-darwin-hsc.patch @@ -0,0 +1,9 @@ +--- SDL-ttf-0.6.3.0/Graphics/UI/SDL/TTF/Version.hsc.orig 2021-08-06 01:31:39.000000000 +0200 ++++ SDL-ttf-0.6.3.0/Graphics/UI/SDL/TTF/Version.hsc 2021-08-06 01:32:03.000000000 +0200 +@@ -1,4 +1,6 @@ + #include "SDL_ttf.h" ++-- override SDL_main.h redefining main to SDL_main on darwin ++#define main main + module Graphics.UI.SDL.TTF.Version + ( compiledFor + , linkedWith -- cgit 1.4.1