mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-26 04:43:09 +03:00
qt58.qtbase: Fix path to fallback libGL
This commit is contained in:
parent
8e2b6a90c0
commit
1f62bf01d3
@ -40,7 +40,7 @@ stdenv.mkDerivation {
|
||||
copyPathsToStore (lib.readPathsFromFile ./. ./series)
|
||||
++ [(if stdenv.isDarwin then ./cmake-paths-darwin.patch else ./cmake-paths.patch)]
|
||||
++ lib.optional decryptSslTraffic ./decrypt-ssl-traffic.patch
|
||||
++ lib.optionals mesaSupported [ ./dlopen-gl.patch ./mkspecs-libgl.patch ];
|
||||
++ lib.optionals mesaSupported [ ./mkspecs-libgl.patch ];
|
||||
|
||||
postPatch =
|
||||
''
|
||||
@ -54,9 +54,6 @@ stdenv.mkDerivation {
|
||||
sed -i 's/PATHS.*NO_DEFAULT_PATH//' "mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in"
|
||||
''
|
||||
+ lib.optionalString mesaSupported ''
|
||||
substituteInPlace \
|
||||
src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp \
|
||||
--replace "@mesa_lib@" "${mesa.out}"
|
||||
substituteInPlace mkspecs/common/linux.conf \
|
||||
--replace "@mesa_lib@" "${mesa.out}" \
|
||||
--replace "@mesa_inc@" "${mesa.dev or mesa}"
|
||||
@ -223,6 +220,8 @@ stdenv.mkDerivation {
|
||||
then ''-DNIXPKGS_LIBDBUS="${dbus.lib}/lib/libdbus-1"''
|
||||
else ''-DNIXPKGS_LIBDBUS=""'')
|
||||
]
|
||||
++ lib.optional mesaSupported
|
||||
''-DNIXPKGS_MESA_GL="${mesa.out}/lib/libGL"''
|
||||
++ lib.optionals stdenv.isDarwin
|
||||
[
|
||||
"-D__MAC_OS_X_VERSION_MAX_ALLOWED=1090"
|
||||
|
@ -1,17 +1,19 @@
|
||||
Index: qtbase-opensource-src-5.5.1/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp
|
||||
Index: qtbase-opensource-src-5.8.0/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp
|
||||
===================================================================
|
||||
--- qtbase-opensource-src-5.5.1.orig/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp
|
||||
+++ qtbase-opensource-src-5.5.1/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp
|
||||
@@ -563,7 +563,12 @@ void (*QGLXContext::getProcAddress(const
|
||||
{
|
||||
--- qtbase-opensource-src-5.8.0.orig/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp
|
||||
+++ qtbase-opensource-src-5.8.0/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp
|
||||
@@ -576,7 +576,14 @@ QFunctionPointer QGLXContext::getProcAdd
|
||||
#ifndef QT_NO_LIBRARY
|
||||
extern const QString qt_gl_library_name();
|
||||
// QLibrary lib(qt_gl_library_name());
|
||||
+ // Check system library paths first
|
||||
QLibrary lib(QLatin1String("GL"));
|
||||
+#ifdef NIXPKGS_MESA_GL
|
||||
+ if (!lib.load()) {
|
||||
+ // Fallback to Mesa driver
|
||||
+ lib.setFileName(QLatin1String("@mesa_lib@/lib/libGL"));
|
||||
+ lib.setFileName(QLatin1String(NIXPKGS_MESA_GL));
|
||||
+ }
|
||||
+#endif // NIXPKGS_MESA_GL
|
||||
glXGetProcAddressARB = (qt_glXGetProcAddressARB) lib.resolve("glXGetProcAddressARB");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@ -7,3 +7,4 @@ xdg-config-dirs.patch
|
||||
compose-search-path.patch
|
||||
libressl.patch
|
||||
qpa-plugin-path.patch
|
||||
dlopen-gl.patch
|
||||
|
Loading…
Reference in New Issue
Block a user