about summary refs log tree commit diff
path: root/pkgs/development/libraries/haskell/X11/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/libraries/haskell/X11/default.nix')
-rw-r--r--pkgs/development/libraries/haskell/X11/default.nix44
1 files changed, 4 insertions, 40 deletions
diff --git a/pkgs/development/libraries/haskell/X11/default.nix b/pkgs/development/libraries/haskell/X11/default.nix
index a0873e9793891..39fb562846785 100644
--- a/pkgs/development/libraries/haskell/X11/default.nix
+++ b/pkgs/development/libraries/haskell/X11/default.nix
@@ -1,49 +1,13 @@
-{stdenv, fetchurl, ghc, libX11, xineramaSupport ? true, libXinerama ? null, libXext ? null}:
+{cabal, libX11, xineramaSupport ? true, libXinerama ? null, libXext ? null}:
 
 assert xineramaSupport -> (libXinerama != null && libXext != null);
 
-stdenv.mkDerivation (rec {
-
+cabal.mkDerivation (self : {
   pname = "X11";
   version = "1.4.1";
-
-  name = "${pname}-${version}";
-
-  src = fetchurl {
-    url = "http://hackage.haskell.org/packages/archive/${pname}/${version}/${name}.tar.gz";
-    sha256 = "e51038541415686f0e278ccdbc0b2373cd11f212de99023b7b8f8e776aa09f79";
-  };
-
-  buildInputs = [ghc];
-
-  propagatedBuildInputs = [libX11] ++
-    (if xineramaSupport then [libXinerama libXext] else []);
-
+  sha256 = "e51038541415686f0e278ccdbc0b2373cd11f212de99023b7b8f8e776aa09f79";
+  propagatedBuildInputs = [libX11] ++ (if xineramaSupport then [libXinerama libXext] else []);
   meta = {
     description = "A Haskell binding to the X11 graphics library";
   };
-
-  extraLibDirs = "${libX11}/lib" + (if xineramaSupport then " ${libXinerama}/lib ${libXext}/lib" else "");
-
-  configurePhase = ''
-    echo "extra-lib-dirs: ${extraLibDirs}" >> X11.buildinfo.in
-    ghc --make Setup.hs
-    ./Setup configure --prefix="$out"
-  '';
-
-  buildPhase = ''
-    ./Setup build
-  '';
-
-  installPhase = ''
-    ./Setup copy
-    ./Setup register --gen-script
-    mkdir $out/nix-support
-    sed -i 's/|.*\(ghc-pkg update\)/| \1/' register.sh
-    cp register.sh $out/nix-support/register-ghclib.sh
-    sed -i 's/\(ghc-pkg update\)/\1 --user/' register.sh
-    mkdir $out/bin
-    cp register.sh $out/bin/register-ghclib-${name}.sh
-  '';
-
 })