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:46:44 +0200
committersterni <sternenseemann@systemli.org>2021-08-06 14:39:22 +0200
commit0e0fbc6760179ce6834d1fd9a50af2c7a8b73533 (patch)
treea727bf8568c1e5d9c6e3d9016814a1e00e4e3533 /pkgs/development/haskell-modules/configuration-darwin.nix
parente41518821d0a7e97ae4b47fbe71887221b0c2380 (diff)
haskellPackages.SDL-image: fix build on darwin
Interestingly SDL-image exhibits both the problems of SDL-mixer and SDL-ttf
have. How the respective fixes we apply here as well work is explained in
1a68ebf98573291fc4a8d8e7b35ea2e74a0d6665 and
2a8105fc58644307007f326de25b357d216d3ad7.
Diffstat (limited to 'pkgs/development/haskell-modules/configuration-darwin.nix')
-rw-r--r--pkgs/development/haskell-modules/configuration-darwin.nix12
1 files changed, 12 insertions, 0 deletions
diff --git a/pkgs/development/haskell-modules/configuration-darwin.nix b/pkgs/development/haskell-modules/configuration-darwin.nix
index 6cf569c5c417a..9ce12f7ff9c44 100644
--- a/pkgs/development/haskell-modules/configuration-darwin.nix
+++ b/pkgs/development/haskell-modules/configuration-darwin.nix
@@ -206,6 +206,18 @@ self: super: {
     '' + (drv.postPatch or "");
   });
 
+  SDL-image = overrideCabal super.SDL-image (drv: {
+    # Prevent darwin-specific configuration code path being taken
+    # which doesn't work with nixpkgs' SDL libraries
+    postPatch = ''
+      substituteInPlace configure --replace xDarwin noDarwinSpecialCasing
+    '' + (drv.postPatch or "");
+    patches = [
+      # Work around SDL_main.h redefining main to SDL_main
+      ./patches/SDL-image-darwin-hsc.patch
+    ];
+  });
+
   # Prevent darwin-specific configuration code path being taken which
   # doesn't work with nixpkgs' SDL libraries
   SDL-mixer = overrideCabal super.SDL-mixer (drv: {