From 3f845da22a9ae804b8bc244ac38e3efa5060a1f8 Mon Sep 17 00:00:00 2001 From: Anthony Cowley Date: Mon, 11 Apr 2016 16:39:15 -0400 Subject: [PATCH] haskell-modules: darwin configuration-common - Reconfigure OpenGL/CL related packages to propagate the necessary framework dependencies. - Disable tests on all versions of c2hs so package sets such as LTS releases work. Closes https://github.com/NixOS/nixpkgs/pull/14609. --- .../haskell-modules/configuration-common.nix | 51 ++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) diff --git a/pkgs/development/haskell-modules/configuration-common.nix b/pkgs/development/haskell-modules/configuration-common.nix index 89c839d49df..b824a06bd68 100644 --- a/pkgs/development/haskell-modules/configuration-common.nix +++ b/pkgs/development/haskell-modules/configuration-common.nix @@ -360,7 +360,6 @@ self: super: { aws = dontCheck super.aws; # needs aws credentials aws-kinesis = dontCheck super.aws-kinesis; # needs aws credentials for testing binary-protocol = dontCheck super.binary-protocol; # http://hydra.cryp.to/build/499749/log/raw - bindings-GLFW = dontCheck super.bindings-GLFW; # requires an active X11 display bits = dontCheck super.bits; # http://hydra.cryp.to/build/500239/log/raw bloodhound = dontCheck super.bloodhound; buildwrapper = dontCheck super.buildwrapper; @@ -967,4 +966,54 @@ self: super: { haste-Cabal = self.callPackage ../tools/haskell/haste/haste-Cabal.nix {}; haste-cabal-install = self.callPackage ../tools/haskell/haste/haste-cabal-install.nix { Cabal = self.haste-Cabal; HTTP = self.HTTP_4000_2_23; }; haste-compiler = self.callPackage ../tools/haskell/haste/haste-compiler.nix { inherit overrideCabal; super-haste-compiler = super.haste-compiler; }; + + # Ensure the necessary frameworks are propagatedBuildInputs on darwin + OpenGLRaw = overrideCabal super.OpenGLRaw (drv: { + librarySystemDepends = + pkgs.lib.optionals (!pkgs.stdenv.isDarwin) drv.librarySystemDepends; + libraryHaskellDepends = drv.libraryHaskellDepends + ++ pkgs.lib.optionals pkgs.stdenv.isDarwin + [ pkgs.darwin.apple_sdk.frameworks.OpenGL ]; + preConfigure = pkgs.lib.optionalString pkgs.stdenv.isDarwin '' + frameworkPaths=($(for i in $nativeBuildInputs; do if [ -d "$i"/Library/Frameworks ]; then echo "-F$i/Library/Frameworks"; fi done)) + frameworkPaths=$(IFS=, ; echo "''${frameworkPaths[@]}") + configureFlags+=$(if [ -n "$frameworkPaths" ]; then echo -n "--ghc-options=-optl=$frameworkPaths"; fi) + ''; + }); + GLURaw = overrideCabal super.GLURaw (drv: { + librarySystemDepends = + pkgs.lib.optionals (!pkgs.stdenv.isDarwin) drv.librarySystemDepends; + libraryHaskellDepends = drv.libraryHaskellDepends + ++ pkgs.lib.optionals pkgs.stdenv.isDarwin + [ pkgs.darwin.apple_sdk.frameworks.OpenGL ]; + }); + bindings-GLFW = overrideCabal super.bindings-GLFW (drv: { + doCheck = false; # requires an active X11 display + librarySystemDepends = + pkgs.lib.optionals (!pkgs.stdenv.isDarwin) drv.librarySystemDepends; + libraryHaskellDepends = drv.libraryHaskellDepends + ++ pkgs.lib.optionals pkgs.stdenv.isDarwin + (with pkgs.darwin.apple_sdk.frameworks; + [ AGL Cocoa OpenGL IOKit Kernel CoreVideo + pkgs.darwin.CF ]); + }); + OpenCL = overrideCabal super.OpenCL (drv: { + librarySystemDepends = + pkgs.lib.optionals (!pkgs.stdenv.isDarwin) drv.librarySystemDepends; + libraryHaskellDepends = drv.libraryHaskellDepends + ++ pkgs.lib.optionals pkgs.stdenv.isDarwin + [ pkgs.darwin.apple_sdk.frameworks.OpenCL ]; + }); + + # Tests must be disabled on darwin for all versions of c2hs + # (e.g. Stackage LTS releases). + c2hs_0_20_1 = if pkgs.stdenv.isDarwin + then dontCheck super.c2hs_0_20_1 + else super.c2hs_0_20_1; + c2hs_0_25_2 = if pkgs.stdenv.isDarwin + then dontCheck super.c2hs_0_25_2 + else super.c2hs_0_25_2; + c2hs_0_27_1 = if pkgs.stdenv.isDarwin + then dontCheck super.c2hs_0_27_1 + else super.c2hs_0_27_1; }