Merge pull request #118479 from gebner/glvndheaders

libGL: use headers from glvnd

Changed files
+134 -38
pkgs
applications
editors
atom
graphics
drawio
networking
browsers
chromium
firefox
instant-messengers
signal-desktop
mailreaders
thunderbird
mullvad-vpn
office
onlyoffice-bin
video
byzanz
kodi
streamlink-twitch-gui
window-managers
cage
cagebreak
hikari
waybox
wayfire
wio
desktops
pantheon
desktop
wingpanel
development
misc
emulators
pcsxr
servers
x11
tools
inputmethods
+2 -1
pkgs/applications/editors/atom/env.nix
···
{ stdenv, lib, zlib, glib, alsaLib, dbus, gtk3, atk, pango, freetype, fontconfig
, libgnome-keyring3, gdk-pixbuf, cairo, cups, expat, libgpgerror, nspr
, gconf, nss, xorg, libcap, systemd, libnotify, libsecret, libuuid, at-spi2-atk
-
, at-spi2-core, libdbusmenu
+
, at-spi2-core, libdbusmenu, mesa
}:
let
···
xorg.libXcomposite xorg.libXi xorg.libXfixes xorg.libXrandr
xorg.libXcursor xorg.libxkbfile xorg.libXScrnSaver libcap systemd libnotify
xorg.libxcb libsecret libuuid at-spi2-atk at-spi2-core libdbusmenu
+
mesa # required for libgbm
];
libPathNative = lib.makeLibraryPath packages;
+2 -1
pkgs/applications/graphics/drawio/default.nix
···
, alsaLib, atk, at-spi2-atk, at-spi2-core, cairo, dbus, cups, expat
, gdk-pixbuf, glib, gtk3, libX11, libXScrnSaver, libXcomposite, libXcursor
, libXdamage, libXext, libXfixes, libXi, libXrandr, libXrender, libXtst
-
, libxcb, libuuid, libxshmfence, nspr, nss, pango
+
, libxcb, libuuid, libxshmfence, nspr, nss, pango, mesa
, systemd
}:
···
libXtst
libxcb
libuuid
+
mesa # for libgbm
nspr
nss
pango
+1
pkgs/applications/networking/browsers/chromium/common.nix
···
bison gperf libkrb5
glib gtk3 dbus-glib
libXScrnSaver libXcursor libXtst libxshmfence libGLU libGL
+
mesa # required for libgbm
pciutils protobuf speechd libXdamage at-spi2-core
jre
pipewire
+4 -3
pkgs/applications/networking/browsers/firefox/common.nix
···
, libjpeg, zlib, dbus, dbus-glib, bzip2, xorg
, freetype, fontconfig, file, nspr, nss, nss_3_53
, yasm, libGLU, libGL, sqlite, unzip, makeWrapper
-
, hunspell, libXdamage, libevent, libstartup_notification
+
, hunspell, libevent, libstartup_notification
, libvpx_1_8
, icu67, libpng, jemalloc, glib, pciutils
, autoconf213, which, gnused, rustPackages, rustPackages_1_45
···
, pulseaudioSupport ? stdenv.isLinux, libpulseaudio
, ffmpegSupport ? true
, gtk3Support ? true, gtk2, gtk3, wrapGAppsHook
-
, waylandSupport ? true, libxkbcommon
+
, waylandSupport ? true, libxkbcommon, libdrm
, ltoSupport ? (stdenv.isLinux && stdenv.is64bit), overrideCC, buildPackages
, gssSupport ? true, libkrb5
, pipewireSupport ? waylandSupport && webrtcSupport, pipewire
···
xorg.libX11 xorg.libXrender xorg.libXft xorg.libXt file
xorg.pixman yasm libGLU libGL
xorg.xorgproto
+
xorg.libXdamage
xorg.libXext makeWrapper
libevent libstartup_notification /* cairo */
libpng jemalloc glib
···
++ lib.optional pulseaudioSupport libpulseaudio # only headers are needed
++ lib.optional gtk3Support gtk3
++ lib.optional gssSupport libkrb5
-
++ lib.optional waylandSupport libxkbcommon
+
++ lib.optionals waylandSupport [ libxkbcommon libdrm ]
++ lib.optional pipewireSupport pipewire
++ lib.optional (lib.versionAtLeast ffversion "82") gnum4
++ lib.optionals buildStdenv.isDarwin [ CoreMedia ExceptionHandling Kerberos
+2 -1
pkgs/applications/networking/instant-messengers/signal-desktop/default.nix
···
, gnome2, gtk3, atk, at-spi2-atk, cairo, pango, gdk-pixbuf, glib, freetype, fontconfig
, dbus, libX11, xorg, libXi, libXcursor, libXdamage, libXrandr, libXcomposite
, libXext, libXfixes, libXrender, libXtst, libXScrnSaver, nss, nspr, alsaLib
-
, cups, expat, libuuid, at-spi2-core, libappindicator-gtk3
+
, cups, expat, libuuid, at-spi2-core, libappindicator-gtk3, mesa
# Runtime dependencies:
, systemd, libnotify, libdbusmenu, libpulseaudio
# Unfortunately this also overwrites the UI language (not just the spell
···
libappindicator-gtk3
libnotify
libuuid
+
mesa # for libgbm
nspr
nss
pango
+3 -2
pkgs/applications/networking/mailreaders/thunderbird/default.nix
···
, alsaSupport ? stdenv.isLinux, alsaLib
, pulseaudioSupport ? stdenv.isLinux, libpulseaudio
, gtk3Support ? true, gtk2, gtk3, wrapGAppsHook
-
, waylandSupport ? true
+
, waylandSupport ? true, libdrm
, libxkbcommon, calendarSupport ? true
# Use official trademarked branding. Permission obtained at:
···
xorg.libXt
xorg.pixman
xorg.xorgproto
+
xorg.libXdamage
zip
zlib
] ++ lib.optional alsaSupport alsaLib
++ lib.optional gtk3Support gtk3
++ lib.optional pulseaudioSupport libpulseaudio
-
++ lib.optional waylandSupport libxkbcommon;
+
++ lib.optionals waylandSupport [ libxkbcommon libdrm ];
NIX_CFLAGS_COMPILE =[
"-I${glib.dev}/include/gio-unix-2.0"
+2 -1
pkgs/applications/networking/mullvad-vpn/default.nix
···
{ stdenv, lib, fetchurl, dpkg
, alsaLib, atk, cairo, cups, dbus, expat, fontconfig, freetype
-
, gdk-pixbuf, glib, gnome2, pango, nspr, nss, gtk3
+
, gdk-pixbuf, glib, gnome2, pango, nspr, nss, gtk3, mesa
, xorg, autoPatchelfHook, systemd, libnotify, libappindicator
}:
···
gtk3
libappindicator
libnotify
+
mesa
xorg.libX11
xorg.libXScrnSaver
xorg.libXcomposite
+2
pkgs/applications/office/onlyoffice-bin/default.nix
···
, gtk3
, libpulseaudio
, libudev0-shim
+
, libdrm
, makeWrapper
, nspr
, nss
···
gtk2
gtk3
libpulseaudio
+
libdrm
nspr
nss
qt5.qtbase
+1 -1
pkgs/applications/video/byzanz/default.nix
···
NIX_CFLAGS_COMPILE = "-Wno-error=deprecated-declarations";
nativeBuildInputs = [ pkg-config ];
-
buildInputs = [ which gnome3.gnome-common glib intltool libtool cairo gtk3 xorg.xwininfo ]
+
buildInputs = [ which gnome3.gnome-common glib intltool libtool cairo gtk3 xorg.xwininfo xorg.libXdamage ]
++ (with gst_all_1; [ gstreamer gst-plugins-base gst-plugins-bad gst-plugins-good gst-plugins-ugly gst-libav wrapGAppsHook ]);
meta = with lib; {
+1
pkgs/applications/video/kodi/unwrapped.nix
···
bluez giflib glib harfbuzz lcms2 libpthreadstubs
ffmpeg flatbuffers fmt fstrcmp rapidjson
lirc
+
mesa # for libEGL
]
++ lib.optional x11Support [
libX11 xorgproto libXt libXmu libXext.dev libXdmcp
+2 -1
pkgs/applications/window-managers/cage/default.nix
···
{ lib, stdenv, fetchFromGitHub
, meson, ninja, pkg-config, wayland, scdoc, makeWrapper
, wlroots, wayland-protocols, pixman, libxkbcommon
-
, systemd, libGL, libX11
+
, systemd, libGL, libX11, mesa
, xwayland ? null
, nixosTests
}:
···
buildInputs = [
wlroots wayland wayland-protocols pixman libxkbcommon
+
mesa # for libEGL headers
systemd libGL libX11
];
+2 -1
pkgs/applications/window-managers/cagebreak/default.nix
···
{ lib, stdenv, fetchFromGitHub
, meson, ninja, pkg-config, wayland, scdoc, makeWrapper
, wlroots, wayland-protocols, pixman, libxkbcommon
-
, cairo , pango, fontconfig, pandoc, systemd
+
, cairo , pango, fontconfig, pandoc, systemd, mesa
, withXwayland ? true, xwayland
, nixosTests
}:
···
buildInputs = [
wlroots wayland wayland-protocols pixman libxkbcommon cairo
pango fontconfig pandoc systemd
+
mesa # for libEGL headers
];
outputs = [ "out" "contrib" ];
+2 -1
pkgs/applications/window-managers/hikari/default.nix
···
{ lib, stdenv, fetchzip,
pkg-config, bmake,
cairo, glib, libevdev, libinput, libxkbcommon, linux-pam, pango, pixman,
-
libucl, wayland, wayland-protocols, wlroots,
+
libucl, wayland, wayland-protocols, wlroots, mesa,
features ? {
gammacontrol = true;
layershell = true;
···
pango
pixman
libucl
+
mesa # for libEGL
wayland
wayland-protocols
wlroots
+2
pkgs/applications/window-managers/waybox/default.nix
···
, pixman
, udev
, libGL
+
, mesa
}:
stdenv.mkDerivation rec {
···
pixman
udev
libGL
+
mesa # for libEGL
];
meta = with lib; {
+2 -2
pkgs/applications/window-managers/wayfire/default.nix
···
{ stdenv, lib, fetchurl, meson, ninja, pkg-config, git
, cairo, libdrm, libexecinfo, libinput, libjpeg, libxkbcommon, wayland
-
, wayland-protocols, wf-config, wlroots
+
, wayland-protocols, wf-config, wlroots, mesa
}:
stdenv.mkDerivation rec {
···
nativeBuildInputs = [ meson ninja pkg-config wayland ];
buildInputs = [
cairo libdrm libexecinfo libinput libjpeg libxkbcommon wayland
-
wayland-protocols wf-config wlroots
+
wayland-protocols wf-config wlroots mesa
];
mesonFlags = [ "--sysconfdir" "/etc" ];
+2
pkgs/applications/window-managers/wio/default.nix
···
, wayland
, wayland-protocols
, wlroots
+
, mesa
, xwayland
, makeWrapper
}:
···
wayland
wayland-protocols
wlroots
+
mesa # for libEGL
xwayland
];
+2
pkgs/desktops/pantheon/desktop/wingpanel/default.nix
···
, granite
, gettext
, mutter
+
, mesa
, json-glib
, python3
, elementary-gtk-theme
···
json-glib
libgee
mutter
+
mesa # for libEGL
];
patches = [
+2 -2
pkgs/development/libraries/gtk/3.x.nix
···
, tracker
, x11Support ? stdenv.isLinux
, waylandSupport ? stdenv.isLinux
-
, mesa
+
, libGL
, wayland
, wayland-protocols
, xineramaSupport ? stdenv.isLinux
···
# explicitly propagated, always needed
Cocoa
] ++ lib.optionals waylandSupport [
-
mesa
+
libGL
wayland
wayland-protocols
] ++ lib.optionals xineramaSupport [
+2 -2
pkgs/development/libraries/gtk/4.x.nix
···
, tracker
, x11Support ? stdenv.isLinux
, waylandSupport ? stdenv.isLinux
-
, mesa
+
, libGL
, vulkan-loader
, vulkan-headers
, wayland
···
] ++ lib.optionals trackerSupport [
tracker
] ++ lib.optionals waylandSupport [
-
mesa
+
libGL
wayland
wayland-protocols
] ++ lib.optionals xineramaSupport [
+24 -11
pkgs/development/libraries/mesa/default.nix
···
# Release frequency: https://www.mesa3d.org/releasing.html#schedule
version = "21.0.2";
branch = versions.major version;
-
in
-
stdenv.mkDerivation {
+
self = stdenv.mkDerivation {
pname = "mesa";
inherit version;
···
"find_program('${stdenv.cc.targetPrefix}nm')"
'';
-
outputs = [ "out" "dev" "drivers" ] ++ lib.optional enableOSMesa "osmesa";
+
outputs = [ "out" "dev" "drivers" ]
+
++ lib.optional enableOSMesa "osmesa"
+
++ lib.optional stdenv.isLinux "driversdev";
# TODO: Figure out how to enable opencl without having a runtime dependency on clang
mesonFlags = [
···
mv -t $osmesa/lib/ $out/lib/libOSMesa*
'';
-
# TODO:
-
# check $out doesn't depend on llvm: builder failures are ignored
-
# for some reason grep -qv '${llvmPackages.llvm}' -R "$out";
postFixup = optionalString stdenv.isLinux ''
# set the default search path for DRI drivers; used e.g. by X server
substituteInPlace "$dev/lib/pkgconfig/dri.pc" --replace "$drivers" "${libglvnd.driverLink}"
+
substituteInPlace "$dev/lib/pkgconfig/d3d.pc" --replace "$drivers" "${libglvnd.driverLink}"
# remove pkgconfig files for GL/EGL; they are provided by libGL.
rm -f $dev/lib/pkgconfig/{gl,egl}.pc
-
# Update search path used by pkg-config
-
for pc in $dev/lib/pkgconfig/{d3d,dri,xatracker}.pc; do
-
if [ -f "$pc" ]; then
-
substituteInPlace "$pc" --replace $out $drivers
+
# Move development files for libraries in $drivers to $driversdev
+
mkdir -p $driversdev/include
+
mv $dev/include/xa_* $dev/include/d3d* $driversdev/include
+
mkdir -p $driversdev/lib/pkgconfig
+
for pc in lib/pkgconfig/{xatracker,d3d}.pc; do
+
if [ -f "$dev/$pc" ]; then
+
substituteInPlace "$dev/$pc" --replace $out $drivers
+
mv $dev/$pc $driversdev/$pc
fi
done
···
passthru = {
inherit libdrm;
inherit (libglvnd) driverLink;
+
+
tests.devDoesNotDependOnLLVM = stdenv.mkDerivation {
+
name = "mesa-dev-does-not-depend-on-llvm";
+
buildCommand = ''
+
echo ${self.dev} >>$out
+
'';
+
disallowedRequisites = [ llvmPackages.llvm self.drivers ];
+
};
};
meta = {
···
platforms = platforms.mesaPlatforms;
maintainers = with maintainers; [ primeos vcunat ]; # Help is welcome :)
};
-
}
+
};
+
+
in self
+3 -3
pkgs/development/libraries/mesa/stubs.nix
···
mkdir -p $dev/{,lib/pkgconfig,nix-support}
echo "$out ${libglvnd} ${libglvnd.dev}" > $dev/nix-support/propagated-build-inputs
-
ln -s ${mesa.dev}/include $dev/include
+
ln -s ${libglvnd.dev}/include $dev/include
genPkgConfig() {
local name="$1"
···
cat <<EOF >$dev/lib/pkgconfig/$name.pc
Name: $name
Description: $lib library
-
Version: ${mesa.version}
+
Version: ${libglvnd.version}
Libs: -L${libglvnd.out}/lib -l$lib
-
Cflags: -I${mesa.dev}/include -I${libglvnd.dev}/include
+
Cflags: -I${libglvnd.dev}/include
EOF
}
+1
pkgs/development/libraries/qt-5/5.14/default.nix
···
./qtwebkit-darwin-no-qos-classes.patch
];
qttools = [ ./qttools.patch ];
+
qtwayland = [ ./qtwayland-libdrm-build.patch ];
};
qtModule =
+56
pkgs/development/libraries/qt-5/5.14/qtwayland-libdrm-build.patch
···
+
commit 7217ea9cf297e664be876eb82b66a1b4f157ca80
+
Author: Peter Seiderer <ps.report@gmx.net>
+
Date: Fri Apr 3 21:52:30 2020 +0200
+
+
fix libdrm related configure test failure
+
+
Fixes:
+
+
Project ERROR: Test config.qtwayland_client.tests.dmabuf-server-buffer tries to use undeclared library 'drm'
+
Project ERROR: Test config.qtwayland_compositor.tests.dmabuf-server-buffer tries to use undeclared library 'drm'
+
Project ERROR: Test config.qtwayland_compositor.tests.dmabuf-client-buffer tries to use undeclared library 'drm'
+
+
Task-number: QTBUG-83303
+
Change-Id: I3970f4e3855fcfa760493631a14adb6a16950aa9
+
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
+
Reviewed-by: Heikki Halmet <heikki.halmet@qt.io>
+
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
+
(cherry picked from commit ca63fe81df8ac910f43539719566ed6745700c2b)
+
(cherry picked from commit 1344ca6b5a8fbc1b28727feea6d856af8bf3bc93)
+
+
diff --git a/src/client/configure.json b/src/client/configure.json
+
index 06213968..27c73f89 100644
+
--- a/src/client/configure.json
+
+++ b/src/client/configure.json
+
@@ -74,7 +74,8 @@
+
"label": "Linux dma-buf Buffer Sharing",
+
"type": "compile",
+
"test": "dmabuf_server_buffer",
+
- "use": "egl drm"
+
+ "libs": "-ldrm",
+
+ "use": "egl"
+
},
+
"vulkan-server-buffer": {
+
"label": "Vulkan Buffer Sharing",
+
diff --git a/src/compositor/configure.json b/src/compositor/configure.json
+
index 0dbb3364..73e4c1a8 100644
+
--- a/src/compositor/configure.json
+
+++ b/src/compositor/configure.json
+
@@ -80,13 +80,15 @@
+
"label": "Linux dma-buf Buffer Sharing",
+
"type": "compile",
+
"test": "dmabuf_server_buffer",
+
- "use": "egl drm"
+
+ "libs": "-ldrm",
+
+ "use": "egl"
+
},
+
"dmabuf-client-buffer": {
+
"label": "Linux Client dma-buf Buffer Sharing",
+
"type": "compile",
+
"test": "dmabuf_client_buffer",
+
- "use": "egl drm"
+
+ "libs": "-ldrm",
+
+ "use": "egl"
+
},
+
"vulkan-server-buffer": {
+
"label": "Vulkan Buffer Sharing",
+2
pkgs/development/libraries/webkitgtk/default.nix
···
, readline
, libGL
, libGLU
+
, mesa
, libintl
, libmanette
, openjpeg
···
harfbuzz
libGL
libGLU
+
mesa # for libEGL headers
libgcrypt
libidn
libintl
+2 -1
pkgs/development/web/cypress/default.nix
···
-
{ stdenv, lib, fetchzip, autoPatchelfHook, xorg, gtk2, gnome2, gtk3, nss, alsaLib, udev, unzip, wrapGAppsHook }:
+
{ stdenv, lib, fetchzip, autoPatchelfHook, xorg, gtk2, gnome2, gtk3, nss, alsaLib, udev, unzip, wrapGAppsHook, mesa }:
stdenv.mkDerivation rec {
pname = "cypress";
···
libXScrnSaver libXdamage libXtst
] ++ [
nss gtk2 alsaLib gnome2.GConf gtk3 unzip
+
mesa # for libgbm
];
runtimeDependencies = [ (lib.getLib udev) ];
+2 -1
pkgs/development/web/insomnia/default.nix
···
{ lib, stdenv, makeWrapper, fetchurl, dpkg, alsaLib, atk, cairo, cups, dbus, expat
-
, fontconfig, freetype, gdk-pixbuf, glib, gnome2, pango, nspr, nss, gtk3, gtk2
+
, fontconfig, freetype, gdk-pixbuf, glib, gnome2, pango, mesa, nspr, nss, gtk3, gtk2
, at-spi2-atk, gsettings-desktop-schemas, gobject-introspection, wrapGAppsHook
, libX11, libXScrnSaver, libXcomposite, libXcursor, libXdamage, libXext
, libXfixes, libXi, libXrandr, libXrender, libXtst, libxcb, nghttp2
···
libXrender
libXtst
libxcb
+
mesa # for libgbm
nspr
nss
stdenv.cc.cc
+1
pkgs/misc/emulators/pcsxr/default.nix
···
nativeBuildInputs = [ autoreconfHook intltool pkg-config wrapGAppsHook ];
buildInputs = [
gtk3 SDL2 xorg.libXv xorg.libXtst libcdio nasm ffmpeg file
+
xorg.libXxf86vm
];
dynarecTarget =
+1 -1
pkgs/servers/x11/xorg/overrides.nix
···
});
xf86videovmware = super.xf86videovmware.overrideAttrs (attrs: {
-
buildInputs = attrs.buildInputs ++ [ mesa llvm ]; # for libxatracker
+
buildInputs = attrs.buildInputs ++ [ mesa mesa.driversdev llvm ]; # for libxatracker
meta = attrs.meta // {
platforms = ["i686-linux" "x86_64-linux"];
};
+2 -2
pkgs/tools/inputmethods/fcitx5/fcitx5-mozc.nix
···
{ lib, clangStdenv, fetchFromGitHub, fetchurl, fetchpatch, fetchgit
-
, python3Packages, mesa, ninja, pkg-config, protobuf, zinnia, qt5, fcitx5
+
, python3Packages, ninja, pkg-config, protobuf, zinnia, qt5, fcitx5
, jsoncpp, gtest, which, gtk2, unzip, abseil-cpp, breakpad }:
let
inherit (python3Packages) python gyp six;
···
sha256 = "R+w0slVFpqtt7PIr1pyupJjRoQsABVZiMdZ9fKGKAqw=";
};
-
nativeBuildInputs = [ gyp ninja mesa python pkg-config qt5.wrapQtAppsHook six which unzip ];
+
nativeBuildInputs = [ gyp ninja python pkg-config qt5.wrapQtAppsHook six which unzip ];
buildInputs = [ protobuf zinnia qt5.qtbase fcitx5 abseil-cpp jsoncpp gtest gtk2 ];