Merge branch 'qt-unsetenv' into staging

This commit is contained in:
Thomas Tuegel 2016-04-01 06:31:29 -05:00
commit d681d580ae
10 changed files with 14 additions and 83 deletions

View file

@ -3,8 +3,8 @@
, xlibs, libX11, libxcb, libXcursor, libXext, libXrender, libXi
, xcbutil, xcbutilimage, xcbutilkeysyms, xcbutilwm, libxkbcommon
, fontconfig, freetype, openssl, dbus, glib, udev, libxml2, libxslt, pcre
, zlib, libjpeg, libpng, libtiff, sqlite, icu
, fontconfig, freetype, openssl, dbus, glib, udev, libxml2, libxslt, pcre16
, zlib, libjpeg, libpng, libtiff, sqlite, icu, harfbuzz
, coreutils, bison, flex, gdb, gperf, lndir, ruby
, python, perl, pkgconfig
@ -164,8 +164,10 @@ stdenv.mkDerivation {
-system-zlib
-system-libpng
-system-libjpeg
-system-harfbuzz
-system-xcb
-system-xkbcommon
-system-pcre
-openssl-linked
-dbus-linked
@ -186,8 +188,8 @@ stdenv.mkDerivation {
propagatedBuildInputs = [
xlibs.libXcomposite libX11 libxcb libXext libXrender libXi
fontconfig freetype openssl dbus.libs glib udev libxml2 libxslt pcre
zlib libjpeg libpng libtiff sqlite icu
fontconfig freetype openssl dbus.libs glib udev libxml2 libxslt pcre16
zlib libjpeg libpng libtiff sqlite icu harfbuzz
xcbutil xcbutilimage xcbutilkeysyms xcbutilwm libxkbcommon
]
# Qt doesn't directly need GLU (just GL), but many apps use, it's small and

View file

@ -2,10 +2,11 @@ Index: qt-everywhere-opensource-src-5.5.1/qtbase/src/corelib/kernel/qcoreapplica
===================================================================
--- qt-everywhere-opensource-src-5.5.1.orig/qtbase/src/corelib/kernel/qcoreapplication.cpp
+++ qt-everywhere-opensource-src-5.5.1/qtbase/src/corelib/kernel/qcoreapplication.cpp
@@ -2498,6 +2498,21 @@ QStringList QCoreApplication::libraryPat
@@ -2498,6 +2498,22 @@ QStringList QCoreApplication::libraryPat
}
}
}
+ qunsetenv("QT_PLUGIN_PATH"); // do not propagate to child processes
+
+ // Add library paths derived from NIX_PROFILES.
+ const QByteArray nixProfilesEnv = qgetenv("NIX_PROFILES");

View file

@ -1,37 +0,0 @@
From 3f6fa74067aacd0e595e45b4ef7ce754514cb205 Mon Sep 17 00:00:00 2001
From: Thomas Tuegel <ttuegel@gmail.com>
Date: Sat, 17 Oct 2015 09:28:18 -0500
Subject: [PATCH] nix profiles import paths
---
src/qml/qml/qqmlimport.cpp | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/src/qml/qml/qqmlimport.cpp b/src/qml/qml/qqmlimport.cpp
index 5a54609..f33c2f9 100644
--- a/src/qml/qml/qqmlimport.cpp
+++ b/src/qml/qml/qqmlimport.cpp
@@ -1549,6 +1549,20 @@ QQmlImportDatabase::QQmlImportDatabase(QQmlEngine *e)
QString installImportsPath = QLibraryInfo::location(QLibraryInfo::Qml2ImportsPath);
addImportPath(installImportsPath);
+ // Add import paths derived from NIX_PROFILES.
+ const QByteArray nixProfilesEnv = qgetenv("NIX_PROFILES");
+ if (!nixProfilesEnv.isEmpty()) {
+ QLatin1Char pathSep(' ');
+ QStringList paths = QFile::decodeName(nixProfilesEnv).split(pathSep, QString::SkipEmptyParts);
+ for (QStringList::iterator it = paths.begin(); it != paths.end(); ++it) {
+ it->append("/lib/qt5/qml");
+ QString canonicalPath = QDir(*it).canonicalPath();
+ if (!canonicalPath.isEmpty()) {
+ addImportPath(canonicalPath);
+ }
+ }
+ }
+
// env import paths
QByteArray envImportPath = qgetenv("QML2_IMPORT_PATH");
if (!envImportPath.isEmpty()) {
--
2.5.2

View file

@ -1,8 +1,8 @@
{ qtSubmodule, python, qtbase, qtsvg, qtxmlpatterns }:
{ qtSubmodule, lib, copyPathsToStore, python, qtbase, qtsvg, qtxmlpatterns }:
qtSubmodule {
name = "qtdeclarative";
patches = [ ./0001-nix-profiles-import-paths.patch ];
patches = copyPathsToStore (lib.readPathsFromFile ./. ./series);
qtInputs = [ qtbase qtsvg qtxmlpatterns ];
nativeBuildInputs = [ python ];
}

View file

@ -0,0 +1 @@
nix-profiles-import-paths.patch

View file

@ -1,37 +0,0 @@
From bbc706b3fcb90ca3b2b51d5e3434145572152711 Mon Sep 17 00:00:00 2001
From: Thomas Tuegel <ttuegel@gmail.com>
Date: Sat, 17 Oct 2015 09:29:51 -0500
Subject: [PATCH] nix profiles import paths
---
src/declarative/qml/qdeclarativeimport.cpp | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/src/declarative/qml/qdeclarativeimport.cpp b/src/declarative/qml/qdeclarativeimport.cpp
index 9404834..d185ed5 100644
--- a/src/declarative/qml/qdeclarativeimport.cpp
+++ b/src/declarative/qml/qdeclarativeimport.cpp
@@ -725,6 +725,20 @@ QDeclarativeImportDatabase::QDeclarativeImportDatabase(QDeclarativeEngine *e)
addImportPath(installImportsPath);
+ // Add import paths derived from NIX_PROFILES.
+ const QByteArray nixProfilesEnv = qgetenv("NIX_PROFILES");
+ if (!nixProfilesEnv.isEmpty()) {
+ QLatin1Char pathSep(' ');
+ QStringList paths = QFile::decodeName(nixProfilesEnv).split(pathSep, QString::SkipEmptyParts);
+ for (QStringList::iterator it = paths.begin(); it != paths.end(); ++it) {
+ it->append("/lib/qt5/imports");
+ QString canonicalPath = QDir(*it).canonicalPath();
+ if (!canonicalPath.isEmpty()) {
+ addImportPath(canonicalPath);
+ }
+ }
+ }
+
// env import paths
QByteArray envImportPath = qgetenv("QML_IMPORT_PATH");
if (!envImportPath.isEmpty()) {
--
2.5.2

View file

@ -1,7 +1,7 @@
{ qtSubmodule, qtscript, qtsvg, qtwebkit, qtxmlpatterns }:
{ qtSubmodule, lib, copyPathsToStore, qtscript, qtsvg, qtwebkit, qtxmlpatterns }:
qtSubmodule {
name = "qtquick1";
patches = [ ./0001-nix-profiles-import-paths.patch ];
patches = copyPathsToStore (lib.readPathsFromFile ./. ./series);
qtInputs = [ qtscript qtsvg qtwebkit qtxmlpatterns ];
}

View file

@ -0,0 +1 @@
nix-profiles-import-paths.patch