summary refs log tree commit diff
path: root/pkgs/development/libraries/mesa/default.nix
blob: c871c8d30c49d27cea90b01404170090ecf72f67 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
{ stdenv, fetchurl, flex, bison, pkgconfig, libdrm, file, expat, makedepend
, libXxf86vm, libXfixes, libXdamage, glproto, dri2proto, libX11, libxcb, libXext
, libXt, udev, enableTextureFloats ? false
, python, libxml2Python, lipo ? null }:

if ! stdenv.lib.lists.elem stdenv.system stdenv.lib.platforms.mesaPlatforms then
  throw "unsupported platform for Mesa"
else

let version = "7.11.2"; in

stdenv.mkDerivation {
  name = "mesa-${version}";

  src = fetchurl {
    url = "ftp://ftp.freedesktop.org/pub/mesa/${version}/MesaLib-${version}.tar.bz2";
    sha256 = "0msk1fh4yw4yi7z37v75vhpa23z49lkwgin6drczbihbqsl6lx2p";
  };

  patches = [ ./swrast-settexbuffer.patch ] ++ stdenv.lib.optional
    (stdenv.system == "mips64el-linux") ./mips_wmb.patch;

  prePatch = "patchShebangs .";

# r300
  configureFlags =
      " --with-driver=dri --enable-gl-osmesa --enable-gles1"
    + " --with-gallium-drivers=i915,i965,nouveau,r600,svga,swrast"
    + " --enable-gles2 --enable-gallium-egl --disable-glx-tls"
    + " --enable-xcb --enable-egl --disable-glut"
    # Texture floats are patented, see docs/patents.txt
    + stdenv.lib.optionalString enableTextureFloats " --enable-texture-float";

  buildInputs = [ expat libdrm libXxf86vm libXfixes libXdamage glproto dri2proto
    libxml2Python libX11 libXext libxcb lipo libXt udev ];

  buildNativeInputs = [ pkgconfig python makedepend file flex bison ];

  enableParallelBuilding = true;

  passthru = { inherit libdrm; };

  meta = {
    description = "An open source implementation of OpenGL";
    homepage = http://www.mesa3d.org/;
    license = "bsd";

    platforms = stdenv.lib.platforms.mesaPlatforms;
    maintainers = [ stdenv.lib.maintainers.simons ];
  };
}