Merge 'staging' into closure-size
- there were many easy merge conflicts - cc-wrapper needed nontrivial changes Many other problems might've been created by interaction of the branches, but stdenv and a few other packages build fine now.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
{ stdenv, fetchurl, pkgconfig, intltool, flex, bison, autoreconfHook, substituteAll
|
||||
, python, libxml2Python, file, expat, makedepend
|
||||
, libdrm, xorg, wayland, udev, llvm, libffi
|
||||
, libvdpau, libelf
|
||||
{ stdenv, fetchurl, fetchpatch, pkgconfig, intltool, flex, bison, autoreconfHook, substituteAll
|
||||
, python, libxml2Python, file, expat, makedepend, pythonPackages
|
||||
, libdrm, xorg, wayland, udev, llvmPackages, libffi, libomxil-bellagio
|
||||
, libvdpau, libelf, libva, libclc
|
||||
, grsecEnabled
|
||||
, enableTextureFloats ? false # Texture floats are patented, see docs/patents.txt
|
||||
, enableExtraFeatures ? false # not maintained
|
||||
@@ -15,18 +15,18 @@ else
|
||||
- The basic mesa ($out) contains headers and libraries (GLU is in mesa_glu now).
|
||||
This or the mesa attribute (which also contains GLU) are small (~ 2 MB, mostly headers)
|
||||
and are designed to be the buildInput of other packages.
|
||||
- DRI and EGL drivers are compiled into $drivers output,
|
||||
which is much bigger and depends on LLVM.
|
||||
These should be searched at runtime in "/run/opengl-driver{,-32}/lib/*"
|
||||
and so are kind-of impure (given by NixOS).
|
||||
- DRI drivers are compiled into $drivers output, which is much bigger and
|
||||
depends on LLVM. These should be searched at runtime in
|
||||
"/run/opengl-driver{,-32}/lib/*" and so are kind-of impure (given by NixOS).
|
||||
(I suppose on non-NixOS one would create the appropriate symlinks from there.)
|
||||
- libOSMesa is in $osmesa (~4 MB)
|
||||
*/
|
||||
|
||||
let
|
||||
version = "10.2.6";
|
||||
version = "10.5.3";
|
||||
# this is the default search path for DRI drivers
|
||||
driverLink = "/run/opengl-driver" + stdenv.lib.optionalString stdenv.isi686 "-32";
|
||||
clang = if llvmPackages ? clang-unwrapped then llvmPackages.clang-unwrapped else llvmPackages.clang;
|
||||
in
|
||||
with { inherit (stdenv.lib) optional optionals optionalString; };
|
||||
|
||||
@@ -34,14 +34,16 @@ stdenv.mkDerivation {
|
||||
name = "mesa-noglu-${version}";
|
||||
|
||||
src = fetchurl {
|
||||
url = "ftp://ftp.freedesktop.org/pub/mesa/${version}/MesaLib-${version}.tar.bz2";
|
||||
sha256 = "01n8ib190s12m8hiiyi4wfm9jhkbqjd769npjwvf965smp918cqr";
|
||||
urls = [
|
||||
"https://launchpad.net/mesa/trunk/${version}/+download/mesa-${version}.tar.xz"
|
||||
"ftp://ftp.freedesktop.org/pub/mesa/${version}/mesa-${version}.tar.xz"
|
||||
];
|
||||
sha256 = "18ibj4c8zmg738md8phmq3va40ycsjdilg76ylw35h7mwhdyw0c7";
|
||||
};
|
||||
|
||||
prePatch = "patchShebangs .";
|
||||
|
||||
patches = [
|
||||
./static-gallium.patch
|
||||
./glx_ro_text_segm.patch # fix for grsecurity/PaX
|
||||
# TODO: revive ./dricore-gallium.patch when it gets ported (from Ubuntu),
|
||||
# as it saved ~35 MB in $drivers; watch https://launchpad.net/ubuntu/+source/mesa/+changelog
|
||||
@@ -51,59 +53,75 @@ stdenv.mkDerivation {
|
||||
inherit udev;
|
||||
});
|
||||
|
||||
# Change the search path for EGL drivers from $drivers/* to driverLink
|
||||
postPatch = ''
|
||||
sed '/D_EGL_DRIVER_SEARCH_DIR=/s,EGL_DRIVER_INSTALL_DIR,${driverLink}/lib/egl,' \
|
||||
-i src/egl/main/Makefile.am
|
||||
'' + /* work around RTTI LLVM problems */ ''
|
||||
patch -R -p1 < ${./rtti.patch}
|
||||
substituteInPlace src/egl/main/egldriver.c \
|
||||
--replace _EGL_DRIVER_SEARCH_DIR '"${driverLink}"'
|
||||
'';
|
||||
|
||||
outputs = [ "dev" "out" "drivers" "osmesa" ];
|
||||
|
||||
configureFlags = [
|
||||
"--sysconfdir=/etc"
|
||||
"--localstatedir=/var"
|
||||
"--with-clang-libdir=${clang}/lib"
|
||||
"--with-dri-driverdir=$(drivers)/lib/dri"
|
||||
"--with-egl-driver-dir=$(drivers)/lib/egl"
|
||||
"--with-dri-searchpath=${driverLink}/lib/dri"
|
||||
|
||||
"--enable-gles1"
|
||||
"--enable-gles2"
|
||||
"--enable-dri"
|
||||
"--enable-glx-tls"
|
||||
"--enable-shared-glapi" "--enable-shared-gallium"
|
||||
"--enable-driglx-direct" # seems enabled anyway
|
||||
"--enable-gallium-llvm" "--enable-llvm-shared-libs"
|
||||
] ++ optional stdenv.isLinux "--enable-dri3"
|
||||
++ [
|
||||
"--enable-glx"
|
||||
"--enable-gallium-osmesa" # used by wine
|
||||
"--enable-egl"
|
||||
"--enable-xa" # used in vmware driver
|
||||
"--enable-gles1" "--enable-gles2"
|
||||
"--enable-gbm"
|
||||
] ++ optional stdenv.isLinux "--enable-nine" # Direct3D in Wine
|
||||
++ [
|
||||
"--enable-xvmc"
|
||||
"--enable-vdpau"
|
||||
"--enable-osmesa" # used by wine
|
||||
"--enable-omx"
|
||||
"--enable-va"
|
||||
|
||||
"--with-dri-drivers=i965,r200,radeon"
|
||||
"--with-gallium-drivers=i915,nouveau,r300,r600,svga,swrast,radeonsi"
|
||||
"--with-egl-platforms=x11,wayland,drm" "--enable-gbm"
|
||||
]
|
||||
++ optional enableTextureFloats "--enable-texture-float"
|
||||
++ optionals enableExtraFeatures [
|
||||
"--enable-openvg" "--enable-gallium-egl" # not needed for EGL in Gallium, but OpenVG might be useful
|
||||
#"--enable-xvmc" # tests segfault with 9.1.{1,2,3}
|
||||
#"--enable-opencl" # ToDo: opencl seems to need libclc for clover
|
||||
]
|
||||
# TODO: Figure out how to enable opencl without having a runtime dependency on clang
|
||||
"--disable-opencl"
|
||||
#"--enable-opencl"
|
||||
#"--enable-opencl-icd"
|
||||
|
||||
"--with-gallium-drivers=svga,i915,ilo,r300,r600,radeonsi,nouveau,freedreno,swrast"
|
||||
"--enable-shared-glapi"
|
||||
"--enable-sysfs"
|
||||
"--enable-driglx-direct" # seems enabled anyway
|
||||
"--enable-glx-tls"
|
||||
"--with-dri-drivers=i915,i965,nouveau,radeon,r200,swrast"
|
||||
"--with-egl-platforms=x11,wayland,drm"
|
||||
|
||||
"--enable-gallium-llvm"
|
||||
"--enable-llvm-shared-libs"
|
||||
] ++ optional enableTextureFloats "--enable-texture-float"
|
||||
++ optional grsecEnabled "--enable-glx-rts"; # slight performance degradation, enable only for grsec
|
||||
|
||||
nativeBuildInputs = [ pkgconfig python makedepend file flex bison ];
|
||||
nativeBuildInputs = [ pkgconfig python makedepend file flex bison pythonPackages.Mako ];
|
||||
|
||||
propagatedBuildInputs = with xorg; [ libXdamage libXxf86vm ]
|
||||
++ optionals stdenv.isLinux [libdrm]
|
||||
;
|
||||
++ optionals stdenv.isLinux [ libdrm ];
|
||||
|
||||
buildInputs = with xorg; [
|
||||
autoreconfHook intltool expat libxml2Python llvm
|
||||
autoreconfHook intltool expat libxml2Python llvmPackages.llvm
|
||||
glproto dri2proto dri3proto presentproto
|
||||
libX11 libXext libxcb libXt libXfixes libxshmfence
|
||||
libffi wayland libvdpau libelf
|
||||
] ++ optionals enableExtraFeatures [ /*libXvMC*/ ]
|
||||
++ optional stdenv.isLinux udev
|
||||
;
|
||||
libffi wayland libvdpau libelf libXvMC libomxil-bellagio libva
|
||||
libclc clang
|
||||
] ++ optional stdenv.isLinux udev;
|
||||
|
||||
enableParallelBuilding = true;
|
||||
#doCheck = true; # https://bugs.freedesktop.org/show_bug.cgi?id=67672
|
||||
doCheck = false;
|
||||
|
||||
installFlags = [
|
||||
"sysconfdir=\${out}/etc"
|
||||
"localstatedir=\${TMPDIR}"
|
||||
];
|
||||
|
||||
# move gallium-related stuff to $drivers, so $out doesn't depend on LLVM;
|
||||
# also move libOSMesa to $osmesa, as it's relatively big
|
||||
@@ -169,6 +187,6 @@ stdenv.mkDerivation {
|
||||
homepage = http://www.mesa3d.org/;
|
||||
license = "bsd";
|
||||
platforms = stdenv.lib.platforms.mesaPlatforms;
|
||||
maintainers = with stdenv.lib.maintainers; [ simons vcunat ];
|
||||
maintainers = with stdenv.lib.maintainers; [ eduarrrd simons vcunat ];
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user