qt58.qtbase: Fix path to fallback libGL

This commit is contained in:
Thomas Tuegel 2017-04-16 09:45:27 -05:00
parent 8e2b6a90c0
commit 1f62bf01d3
No known key found for this signature in database
GPG Key ID: 22CBF5249D4B4D59
3 changed files with 13 additions and 11 deletions

View File

@ -40,7 +40,7 @@ stdenv.mkDerivation {
copyPathsToStore (lib.readPathsFromFile ./. ./series) copyPathsToStore (lib.readPathsFromFile ./. ./series)
++ [(if stdenv.isDarwin then ./cmake-paths-darwin.patch else ./cmake-paths.patch)] ++ [(if stdenv.isDarwin then ./cmake-paths-darwin.patch else ./cmake-paths.patch)]
++ lib.optional decryptSslTraffic ./decrypt-ssl-traffic.patch ++ lib.optional decryptSslTraffic ./decrypt-ssl-traffic.patch
++ lib.optionals mesaSupported [ ./dlopen-gl.patch ./mkspecs-libgl.patch ]; ++ lib.optionals mesaSupported [ ./mkspecs-libgl.patch ];
postPatch = postPatch =
'' ''
@ -54,9 +54,6 @@ stdenv.mkDerivation {
sed -i 's/PATHS.*NO_DEFAULT_PATH//' "mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in" sed -i 's/PATHS.*NO_DEFAULT_PATH//' "mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in"
'' ''
+ lib.optionalString mesaSupported '' + lib.optionalString mesaSupported ''
substituteInPlace \
src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp \
--replace "@mesa_lib@" "${mesa.out}"
substituteInPlace mkspecs/common/linux.conf \ substituteInPlace mkspecs/common/linux.conf \
--replace "@mesa_lib@" "${mesa.out}" \ --replace "@mesa_lib@" "${mesa.out}" \
--replace "@mesa_inc@" "${mesa.dev or mesa}" --replace "@mesa_inc@" "${mesa.dev or mesa}"
@ -223,6 +220,8 @@ stdenv.mkDerivation {
then ''-DNIXPKGS_LIBDBUS="${dbus.lib}/lib/libdbus-1"'' then ''-DNIXPKGS_LIBDBUS="${dbus.lib}/lib/libdbus-1"''
else ''-DNIXPKGS_LIBDBUS=""'') else ''-DNIXPKGS_LIBDBUS=""'')
] ]
++ lib.optional mesaSupported
''-DNIXPKGS_MESA_GL="${mesa.out}/lib/libGL"''
++ lib.optionals stdenv.isDarwin ++ lib.optionals stdenv.isDarwin
[ [
"-D__MAC_OS_X_VERSION_MAX_ALLOWED=1090" "-D__MAC_OS_X_VERSION_MAX_ALLOWED=1090"

View File

@ -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.8.0.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 +++ qtbase-opensource-src-5.8.0/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp
@@ -563,7 +563,12 @@ void (*QGLXContext::getProcAddress(const @@ -576,7 +576,14 @@ QFunctionPointer QGLXContext::getProcAdd
{ #ifndef QT_NO_LIBRARY
extern const QString qt_gl_library_name(); extern const QString qt_gl_library_name();
// QLibrary lib(qt_gl_library_name()); // QLibrary lib(qt_gl_library_name());
+ // Check system library paths first + // Check system library paths first
QLibrary lib(QLatin1String("GL")); QLibrary lib(QLatin1String("GL"));
+#ifdef NIXPKGS_MESA_GL
+ if (!lib.load()) { + if (!lib.load()) {
+ // Fallback to Mesa driver + // 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"); glXGetProcAddressARB = (qt_glXGetProcAddressARB) lib.resolve("glXGetProcAddressARB");
#endif
} }
}

View File

@ -7,3 +7,4 @@ xdg-config-dirs.patch
compose-search-path.patch compose-search-path.patch
libressl.patch libressl.patch
qpa-plugin-path.patch qpa-plugin-path.patch
dlopen-gl.patch