mesa_noglu: build with libglvnd
This commit is contained in:
parent
6467c94c8d
commit
03a6766a6d
@ -3,6 +3,7 @@
|
|||||||
, file, expat, libdrm, xorg, wayland, wayland-protocols, openssl
|
, file, expat, libdrm, xorg, wayland, wayland-protocols, openssl
|
||||||
, llvmPackages, libffi, libomxil-bellagio, libva
|
, llvmPackages, libffi, libomxil-bellagio, libva
|
||||||
, libelf, libvdpau, valgrind-light, python2
|
, libelf, libvdpau, valgrind-light, python2
|
||||||
|
, libglvnd
|
||||||
, grsecEnabled ? false
|
, grsecEnabled ? false
|
||||||
, enableRadv ? true
|
, enableRadv ? true
|
||||||
# Texture floats are patented, see docs/patents.txt, so we don't enable them for full Mesa.
|
# Texture floats are patented, see docs/patents.txt, so we don't enable them for full Mesa.
|
||||||
@ -68,7 +69,6 @@ in
|
|||||||
let
|
let
|
||||||
version = "17.3.6";
|
version = "17.3.6";
|
||||||
branch = head (splitString "." version);
|
branch = head (splitString "." version);
|
||||||
driverLink = "/run/opengl-driver" + optionalString stdenv.isi686 "-32";
|
|
||||||
in
|
in
|
||||||
|
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
@ -98,10 +98,10 @@ stdenv.mkDerivation {
|
|||||||
|
|
||||||
# TODO: Figure out how to enable opencl without having a runtime dependency on clang
|
# TODO: Figure out how to enable opencl without having a runtime dependency on clang
|
||||||
configureFlags = [
|
configureFlags = [
|
||||||
"--sysconfdir=${driverLink}/etc"
|
"--sysconfdir=${libglvnd.driverLink}/etc"
|
||||||
"--localstatedir=/var"
|
"--localstatedir=/var"
|
||||||
"--with-dri-driverdir=$(drivers)/lib/dri"
|
"--with-dri-driverdir=$(drivers)/lib/dri"
|
||||||
"--with-dri-searchpath=${driverLink}/lib/dri"
|
"--with-dri-searchpath=${libglvnd.driverLink}/lib/dri"
|
||||||
"--with-platforms=x11,wayland,drm"
|
"--with-platforms=x11,wayland,drm"
|
||||||
]
|
]
|
||||||
++ (optional (galliumDrivers != [])
|
++ (optional (galliumDrivers != [])
|
||||||
@ -118,6 +118,7 @@ stdenv.mkDerivation {
|
|||||||
(enableFeature grsecEnabled "glx-rts")
|
(enableFeature grsecEnabled "glx-rts")
|
||||||
(enableFeature stdenv.isLinux "dri3")
|
(enableFeature stdenv.isLinux "dri3")
|
||||||
(enableFeature stdenv.isLinux "nine") # Direct3D in Wine
|
(enableFeature stdenv.isLinux "nine") # Direct3D in Wine
|
||||||
|
"--enable-libglvnd"
|
||||||
"--enable-dri"
|
"--enable-dri"
|
||||||
"--enable-driglx-direct"
|
"--enable-driglx-direct"
|
||||||
"--enable-gles1"
|
"--enable-gles1"
|
||||||
@ -146,7 +147,7 @@ stdenv.mkDerivation {
|
|||||||
++ optional stdenv.isLinux libdrm;
|
++ optional stdenv.isLinux libdrm;
|
||||||
|
|
||||||
buildInputs = with xorg; [
|
buildInputs = with xorg; [
|
||||||
expat llvmPackages.llvm
|
expat llvmPackages.llvm libglvnd
|
||||||
glproto dri2proto dri3proto presentproto
|
glproto dri2proto dri3proto presentproto
|
||||||
libX11 libXext libxcb libXt libXfixes libxshmfence
|
libX11 libXext libxcb libXt libXfixes libxshmfence
|
||||||
libffi wayland wayland-protocols libvdpau libelf libXvMC
|
libffi wayland wayland-protocols libvdpau libelf libXvMC
|
||||||
@ -154,13 +155,13 @@ stdenv.mkDerivation {
|
|||||||
valgrind-light python2
|
valgrind-light python2
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
enableParallelBuilding = true;
|
enableParallelBuilding = true;
|
||||||
doCheck = false;
|
doCheck = false;
|
||||||
|
|
||||||
installFlags = [
|
installFlags = [
|
||||||
"sysconfdir=\${out}/etc"
|
"sysconfdir=\${out}/etc"
|
||||||
"localstatedir=\${TMPDIR}"
|
"localstatedir=\${TMPDIR}"
|
||||||
|
"vendorjsondir=\${out}/share/glvnd/egl_vendor.d"
|
||||||
];
|
];
|
||||||
|
|
||||||
# TODO: probably not all .la files are completely fixed, but it shouldn't matter;
|
# TODO: probably not all .la files are completely fixed, but it shouldn't matter;
|
||||||
@ -174,8 +175,10 @@ stdenv.mkDerivation {
|
|||||||
$out/lib/libxatracker* \
|
$out/lib/libxatracker* \
|
||||||
$out/lib/libvulkan_*
|
$out/lib/libvulkan_*
|
||||||
|
|
||||||
|
# Move other drivers to a separate output
|
||||||
mv $out/lib/dri/* $drivers/lib/dri # */
|
mv $out/lib/dri/* $drivers/lib/dri # */
|
||||||
rmdir "$out/lib/dri"
|
rmdir "$out/lib/dri"
|
||||||
|
mv $out/lib/lib*_mesa* $drivers/lib
|
||||||
|
|
||||||
# move libOSMesa to $osmesa, as it's relatively big
|
# move libOSMesa to $osmesa, as it's relatively big
|
||||||
mkdir -p {$osmesa,$drivers}/lib/
|
mkdir -p {$osmesa,$drivers}/lib/
|
||||||
@ -185,10 +188,22 @@ stdenv.mkDerivation {
|
|||||||
sed "/^libdir=/s,$out,$osmesa," -i $osmesa/lib/libOSMesa*.la
|
sed "/^libdir=/s,$out,$osmesa," -i $osmesa/lib/libOSMesa*.la
|
||||||
|
|
||||||
# set the default search path for DRI drivers; used e.g. by X server
|
# set the default search path for DRI drivers; used e.g. by X server
|
||||||
substituteInPlace "$dev/lib/pkgconfig/dri.pc" --replace '$(drivers)' "${driverLink}"
|
substituteInPlace "$dev/lib/pkgconfig/dri.pc" --replace '$(drivers)' "${libglvnd.driverLink}"
|
||||||
'' + optionalString (vulkanDrivers != []) ''
|
|
||||||
# move share/vulkan/icd.d/
|
# remove GLES libraries; they are provided by libglvnd
|
||||||
|
rm $out/lib/lib{GLESv1_CM,GLESv2}.*
|
||||||
|
|
||||||
|
# remove pkgconfig files for GL/GLES/EGL; they are provided by libGL.
|
||||||
|
rm $dev/lib/pkgconfig/{gl,egl,glesv1_cm,glesv2}.pc
|
||||||
|
|
||||||
|
# move vendor files
|
||||||
mv $out/share/ $drivers/
|
mv $out/share/ $drivers/
|
||||||
|
|
||||||
|
# Update search path used by glvnd
|
||||||
|
for js in $drivers/share/glvnd/egl_vendor.d/*.json; do
|
||||||
|
substituteInPlace "$js" --replace '"libEGL_' '"'"$drivers/lib/libEGL_"
|
||||||
|
done
|
||||||
|
'' + optionalString (vulkanDrivers != []) ''
|
||||||
# Update search path used by Vulkan (it's pointing to $out but
|
# Update search path used by Vulkan (it's pointing to $out but
|
||||||
# drivers are in $drivers)
|
# drivers are in $drivers)
|
||||||
for js in $drivers/share/vulkan/icd.d/*.json; do
|
for js in $drivers/share/vulkan/icd.d/*.json; do
|
||||||
@ -209,13 +224,16 @@ stdenv.mkDerivation {
|
|||||||
done
|
done
|
||||||
'';
|
'';
|
||||||
|
|
||||||
passthru = { inherit libdrm version driverLink; };
|
passthru = {
|
||||||
|
inherit libdrm version;
|
||||||
|
inherit (libglvnd) driverLink;
|
||||||
|
};
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
description = "An open source implementation of OpenGL";
|
description = "An open source implementation of OpenGL";
|
||||||
homepage = https://www.mesa3d.org/;
|
homepage = https://www.mesa3d.org/;
|
||||||
license = licenses.mit; # X11 variant, in most files
|
license = licenses.mit; # X11 variant, in most files
|
||||||
platforms = platforms.mesaPlatforms;
|
platforms = platforms.linux;
|
||||||
maintainers = with maintainers; [ eduarrrd vcunat ];
|
maintainers = with maintainers; [ eduarrrd vcunat ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user