* added xmonad (runtime reconfiguration does not yet work)

* added Haskell X11 bindings (required for xmonad)
* added missing entry for alex in all-packages.nix

svn path=/nixpkgs/trunk/; revision=10171
This commit is contained in:
Andres Löh 2008-01-16 10:35:49 +00:00
parent 5dd65bbfad
commit c08a54cb66
3 changed files with 113 additions and 0 deletions

View file

@ -0,0 +1,42 @@
{stdenv, fetchurl, ghc, X11, xmessage}:
stdenv.mkDerivation (rec {
pname = "xmonad";
version = "0.5";
name = "${pname}-${version}";
src = fetchurl {
url = "http://hackage.haskell.org/packages/archive/${pname}/${version}/${name}.tar.gz";
sha256 = "cfcc4501b000fa740ed35a5be87dc01216e036219551630dcf71d9c3cf57e4c4";
};
buildInputs = [ghc X11];
meta = {
description = "xmonad is a tiling window manager for X";
};
configurePhase = ''
sed -i 's|"xmessage"|"${xmessage}/bin/xmessage"|' XMonad/Core.hs
ghc --make Setup.lhs
./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 -p $out/bin
cp register.sh $out/bin/register-ghclib-${name}.sh
'';
})

View file

@ -0,0 +1,49 @@
{stdenv, fetchurl, ghc, libX11, xineramaSupport ? true, libXinerama ? null, libXext ? null}:
assert xineramaSupport -> (libXinerama != null && libXext != null);
stdenv.mkDerivation (rec {
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 []);
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
'';
})

View file

@ -1355,6 +1355,10 @@ rec {
### DEVELOPMENT / TOOLS
alex = import ../development/tools/parsing/alex {
inherit fetchurl stdenv ghc perl;
};
antlr = import ../development/tools/parsing/antlr/antlr-2.7.6.nix {
inherit fetchurl stdenv jre;
};
@ -2618,6 +2622,18 @@ rec {
inherit stdenv fetchurl unzip ghc wxGTK;
};
# wxHaskell68 = lowPrio (appendToName "ghc68" (import ../development/libraries/haskell/wxHaskell {
# inherit stdenv fetchurl unzip wxGTK;
# ghc = ghc68;
# }));
X11 = import ../development/libraries/haskell/X11 {
inherit stdenv fetchurl;
ghc = ghc68;
inherit (xlibs) libX11 libXinerama libXext;
xineramaSupport = true;
};
### DEVELOPMENT / PERL MODULES
@ -4686,6 +4702,12 @@ rec {
stdenv = overrideGCC stdenv gcc34; # due to problems with gcc 4.x
};
xmonad = import ../applications/window-managers/xmonad {
inherit stdenv fetchurl X11;
inherit (xlibs) xmessage;
ghc=ghc68;
};
xpdf = import ../applications/misc/xpdf {
inherit fetchurl stdenv x11 freetype t1lib;
motif = lesstif;