qt5: use distinct `lib/qt-5.x` prefix for each minor version
Using a distinct prefix for plugins and QML libraries allows multiple Qt 5 minor versions to coexist in the same environment.
This commit is contained in:
parent
08d25152b8
commit
3f3d33a078
|
@ -183,7 +183,6 @@ in
|
||||||
environment.variables = {
|
environment.variables = {
|
||||||
# Enable GTK applications to load SVG icons
|
# Enable GTK applications to load SVG icons
|
||||||
GDK_PIXBUF_MODULE_FILE = "${pkgs.librsvg.out}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache";
|
GDK_PIXBUF_MODULE_FILE = "${pkgs.librsvg.out}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache";
|
||||||
QT_PLUGIN_PATH = "/run/current-system/sw/lib/qt5/plugins";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
fonts.fonts = with pkgs; [ noto-fonts hack-font ];
|
fonts.fonts = with pkgs; [ noto-fonts hack-font ];
|
||||||
|
|
|
@ -53,7 +53,7 @@ let
|
||||||
];
|
];
|
||||||
|
|
||||||
preConfigure = ''
|
preConfigure = ''
|
||||||
export cmakeFlags="$cmakeFlags -DQT_IMPORTS_DIR=$out/lib/qt5/qml -DCMAKE_INSTALL_SYSCONFDIR=$out/etc -DSYSTEMD_SYSTEM_UNIT_DIR=$out/lib/systemd/system"
|
export cmakeFlags="$cmakeFlags -DQT_IMPORTS_DIR=$out/$qtQmlPrefix -DCMAKE_INSTALL_SYSCONFDIR=$out/etc -DSYSTEMD_SYSTEM_UNIT_DIR=$out/lib/systemd/system"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
enableParallelBuilding = true;
|
enableParallelBuilding = true;
|
||||||
|
|
|
@ -28,7 +28,7 @@ stdenv.mkDerivation {
|
||||||
cp -r * "$out"
|
cp -r * "$out"
|
||||||
# Hack around lack of libtinfo in NixOS
|
# Hack around lack of libtinfo in NixOS
|
||||||
ln -s ${ncurses.out}/lib/libncursesw.so.6 $out/lib/libtinfo.so.5
|
ln -s ${ncurses.out}/lib/libncursesw.so.6 $out/lib/libtinfo.so.5
|
||||||
ln -s ${qtbase.out}/lib/qt5/plugins $out/lib/qt_plugins
|
ln -s ${qtbase.out}/$qtPluginPrefix $out/lib/qt_plugins
|
||||||
ln -s ${zlib.out}/lib/libz.so.1 $out/lib/libz.so.1
|
ln -s ${zlib.out}/lib/libz.so.1 $out/lib/libz.so.1
|
||||||
|
|
||||||
for b in fdr4 _fdr4 refines _refines cspmprofiler cspmexplorerprof
|
for b in fdr4 _fdr4 refines _refines cspmprofiler cspmexplorerprof
|
||||||
|
|
|
@ -56,10 +56,10 @@ stdenv.mkDerivation rec {
|
||||||
|
|
||||||
# we need to link to our Qt deps in our own output if we want
|
# we need to link to our Qt deps in our own output if we want
|
||||||
# this package to work without being installed as a system pkg
|
# this package to work without being installed as a system pkg
|
||||||
mkdir -p $out/lib/qt5 $out/etc/xdg
|
mkdir -p $out/lib/qt-$qtCompatVersion $out/etc/xdg
|
||||||
for pkg in $qtInputs; do
|
for pkg in $qtInputs; do
|
||||||
if [[ -d $pkg/lib/qt5 ]]; then
|
if [[ -d $pkg/lib/qt-$qtCompatVersion ]]; then
|
||||||
for dir in lib/qt5 share etc/xdg; do
|
for dir in lib/qt-$qtCompatVersion share etc/xdg; do
|
||||||
if [[ -d $pkg/$dir ]]; then
|
if [[ -d $pkg/$dir ]]; then
|
||||||
${lndir}/bin/lndir "$pkg/$dir" "$out/$dir"
|
${lndir}/bin/lndir "$pkg/$dir" "$out/$dir"
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -13,7 +13,7 @@ let
|
||||||
--replace "DESTINATION \"\''${LXQT_ETC_XDG_DIR}" "DESTINATION \"etc/xdg" \
|
--replace "DESTINATION \"\''${LXQT_ETC_XDG_DIR}" "DESTINATION \"etc/xdg" \
|
||||||
--replace "DESTINATION \"\''${LXQT_SHARE_DIR}" "DESTINATION \"share/lxqt" \
|
--replace "DESTINATION \"\''${LXQT_SHARE_DIR}" "DESTINATION \"share/lxqt" \
|
||||||
--replace "DESTINATION \"\''${LXQT_GRAPHICS_DIR}" "DESTINATION \"share/lxqt/graphics" \
|
--replace "DESTINATION \"\''${LXQT_GRAPHICS_DIR}" "DESTINATION \"share/lxqt/graphics" \
|
||||||
--replace "DESTINATION \"\''${QT_PLUGINS_DIR}" "DESTINATION \"lib/qt5/plugins" \
|
--replace "DESTINATION \"\''${QT_PLUGINS_DIR}" "DESTINATION \"$qtPluginPrefix" \
|
||||||
--replace "\''${LXQT_TRANSLATIONS_DIR}" share/lxqt/translations
|
--replace "\''${LXQT_TRANSLATIONS_DIR}" share/lxqt/translations
|
||||||
echo ============================
|
echo ============================
|
||||||
echo $file
|
echo $file
|
||||||
|
|
|
@ -14,6 +14,6 @@ plasmaPackage {
|
||||||
];
|
];
|
||||||
patches = copyPathsToStore (lib.readPathsFromFile ./. ./series);
|
patches = copyPathsToStore (lib.readPathsFromFile ./. ./series);
|
||||||
preConfigure = ''
|
preConfigure = ''
|
||||||
NIX_CFLAGS_COMPILE+=" -DNIXPKGS_LIBKSCREEN_BACKENDS=\"''${!outputLib}/lib/qt5/plugins/kf5/kscreen\""
|
NIX_CFLAGS_COMPILE+=" -DNIXPKGS_LIBKSCREEN_BACKENDS=\"''${!outputLib}/$qtPluginPrefix/kf5/kscreen\""
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,21 +34,8 @@ in runCommand "startkde" env ''
|
||||||
addToSearchPath suffixPATH "$p/lib/libexec/kf5"
|
addToSearchPath suffixPATH "$p/lib/libexec/kf5"
|
||||||
done
|
done
|
||||||
|
|
||||||
# Configure Qt search paths
|
|
||||||
QT_PLUGIN_PATH=
|
|
||||||
QML_IMPORT_PATH=
|
|
||||||
QML2_IMPORT_PATH=
|
|
||||||
for p in $libs; do
|
|
||||||
addToSearchPath QT_PLUGIN_PATH "$p/lib/qt5/plugins"
|
|
||||||
addToSearchPath QML_IMPORT_PATH "$p/lib/qt5/imports"
|
|
||||||
addToSearchPath QML2_IMPORT_PATH "$p/lib/qt5/qml"
|
|
||||||
done
|
|
||||||
|
|
||||||
substitute ${./startkde.sh} "$out" \
|
substitute ${./startkde.sh} "$out" \
|
||||||
--subst-var shell \
|
--subst-var shell \
|
||||||
--subst-var suffixPATH \
|
--subst-var suffixPATH
|
||||||
--subst-var QT_PLUGIN_PATH \
|
|
||||||
--subst-var QML_IMPORT_PATH \
|
|
||||||
--subst-var QML2_IMPORT_PATH
|
|
||||||
chmod +x "$out"
|
chmod +x "$out"
|
||||||
''
|
''
|
||||||
|
|
|
@ -2,9 +2,7 @@
|
||||||
|
|
||||||
PATH="$PATH${PATH:+:}@suffixPATH@"
|
PATH="$PATH${PATH:+:}@suffixPATH@"
|
||||||
|
|
||||||
export QT_PLUGIN_PATH="$QT_PLUGIN_PATH${QT_PLUGIN_PATH:+:}@QT_PLUGIN_PATH@"
|
echo "NIX_PROFILES=\"$NIX_PROFILES\""
|
||||||
export QML_IMPORT_PATH="$QML_IMPORT_PATH${QML_IMPORT_PATH:+:}@QML_IMPORT_PATH@"
|
|
||||||
export QML2_IMPORT_PATH="$QML2_IMPORT_PATH${QML2_IMPORT_PATH:+:}@QML2_IMPORT_PATH@"
|
|
||||||
|
|
||||||
kbuildsycoca5
|
kbuildsycoca5
|
||||||
|
|
||||||
|
|
|
@ -13,10 +13,6 @@ _ecmConfig() {
|
||||||
cmakeFlags+=" -DKDE_INSTALL_LIBDIR=${!outputLib}/lib"
|
cmakeFlags+=" -DKDE_INSTALL_LIBDIR=${!outputLib}/lib"
|
||||||
cmakeFlags+=" -DKDE_INSTALL_LIBEXECDIR=${!outputBin}/lib/libexec"
|
cmakeFlags+=" -DKDE_INSTALL_LIBEXECDIR=${!outputBin}/lib/libexec"
|
||||||
cmakeFlags+=" -DKDE_INSTALL_CMAKEPACKAGEDIR=${!outputDev}/lib/cmake"
|
cmakeFlags+=" -DKDE_INSTALL_CMAKEPACKAGEDIR=${!outputDev}/lib/cmake"
|
||||||
cmakeFlags+=" -DKDE_INSTALL_QTPLUGINDIR=${!outputBin}/lib/qt5/plugins"
|
|
||||||
cmakeFlags+=" -DKDE_INSTALL_PLUGINDIR=${!outputBin}/lib/qt5/plugins"
|
|
||||||
cmakeFlags+=" -DKDE_INSTALL_QTQUICKIMPORTSDIR=${!outputBin}/lib/qt5/imports"
|
|
||||||
cmakeFlags+=" -DKDE_INSTALL_QMLDIR=${!outputBin}/lib/qt5/qml"
|
|
||||||
cmakeFlags+=" -DKDE_INSTALL_INCLUDEDIR=${!outputInclude}/include"
|
cmakeFlags+=" -DKDE_INSTALL_INCLUDEDIR=${!outputInclude}/include"
|
||||||
cmakeFlags+=" -DKDE_INSTALL_LOCALSTATEDIR=/var"
|
cmakeFlags+=" -DKDE_INSTALL_LOCALSTATEDIR=/var"
|
||||||
cmakeFlags+=" -DKDE_INSTALL_DATAROOTDIR=${!outputBin}/share"
|
cmakeFlags+=" -DKDE_INSTALL_DATAROOTDIR=${!outputBin}/share"
|
||||||
|
@ -46,6 +42,15 @@ _ecmConfig() {
|
||||||
cmakeFlags+=" -DKDE_INSTALL_SYSCONFDIR=${!outputBin}/etc"
|
cmakeFlags+=" -DKDE_INSTALL_SYSCONFDIR=${!outputBin}/etc"
|
||||||
cmakeFlags+=" -DKDE_INSTALL_CONFDIR=${!outputBin}/etc/xdg"
|
cmakeFlags+=" -DKDE_INSTALL_CONFDIR=${!outputBin}/etc/xdg"
|
||||||
cmakeFlags+=" -DKDE_INSTALL_AUTOSTARTDIR=${!outputBin}/etc/xdg/autostart"
|
cmakeFlags+=" -DKDE_INSTALL_AUTOSTARTDIR=${!outputBin}/etc/xdg/autostart"
|
||||||
|
|
||||||
|
if [ -n "$qtPluginPrefix" ]; then
|
||||||
|
cmakeFlags+=" -DKDE_INSTALL_QTPLUGINDIR=${!outputBin}/$qtPluginPrefix"
|
||||||
|
cmakeFlags+=" -DKDE_INSTALL_PLUGINDIR=${!outputBin}/$qtPluginPrefix"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -n "$qtQmlPrefix" ]; then
|
||||||
|
cmakeFlags+=" -DKDE_INSTALL_QMLDIR=${!outputBin}/$qtQmlPrefix"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
preConfigureHooks+=(_ecmConfig)
|
preConfigureHooks+=(_ecmConfig)
|
||||||
|
|
|
@ -14,6 +14,6 @@ kdeFramework {
|
||||||
propagatedBuildInputs = [ qtx11extras ];
|
propagatedBuildInputs = [ qtx11extras ];
|
||||||
patches = copyPathsToStore (lib.readPathsFromFile ./. ./series);
|
patches = copyPathsToStore (lib.readPathsFromFile ./. ./series);
|
||||||
preConfigure = ''
|
preConfigure = ''
|
||||||
NIX_CFLAGS_COMPILE+=" -DNIXPKGS_QT_PLUGIN_PATH=\"$out/lib/qt5/plugins\""
|
NIX_CFLAGS_COMPILE+=" -DNIXPKGS_QT_PLUGIN_PATH=\"$out/$qtPluginPrefix\""
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
|
||||||
|
|
||||||
patchPhase = ''
|
patchPhase = ''
|
||||||
substituteInPlace qmltermwidget.pro \
|
substituteInPlace qmltermwidget.pro \
|
||||||
--replace '$$[QT_INSTALL_QML]' "/lib/qt5/qml/"
|
--replace '$$[QT_INSTALL_QML]' "/$qtQmlPrefix/"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
installFlags = [ "INSTALL_ROOT=$(out)" ];
|
installFlags = [ "INSTALL_ROOT=$(out)" ];
|
||||||
|
|
|
@ -18,8 +18,9 @@ existing packages here and modify it as necessary.
|
||||||
1. Update the URL in `./fetch.sh`.
|
1. Update the URL in `./fetch.sh`.
|
||||||
2. Run `./maintainers/scripts/fetch-kde-qt.sh pkgs/development/libraries/qt-5/$VERSION/`
|
2. Run `./maintainers/scripts/fetch-kde-qt.sh pkgs/development/libraries/qt-5/$VERSION/`
|
||||||
from the top of the Nixpkgs tree.
|
from the top of the Nixpkgs tree.
|
||||||
3. Use `nox-review wip` to check that everything builds.
|
3. Update `qtCompatVersion` below if the minor version number changes.
|
||||||
4. Commit the changes and open a pull request.
|
4. Check that the new packages build correctly.
|
||||||
|
5. Commit the changes and open a pull request.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -38,6 +39,8 @@ with stdenv.lib;
|
||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
|
qtCompatVersion = "5.6";
|
||||||
|
|
||||||
mirror = "http://download.qt.io";
|
mirror = "http://download.qt.io";
|
||||||
srcs = import ./srcs.nix { inherit fetchurl; inherit mirror; };
|
srcs = import ./srcs.nix { inherit fetchurl; inherit mirror; };
|
||||||
|
|
||||||
|
@ -70,7 +73,7 @@ let
|
||||||
|
|
||||||
addPackages = self: with self;
|
addPackages = self: with self;
|
||||||
let
|
let
|
||||||
callPackage = self.newScope { inherit qtSubmodule srcs; };
|
callPackage = self.newScope { inherit qtCompatVersion qtSubmodule srcs; };
|
||||||
in {
|
in {
|
||||||
|
|
||||||
qtbase = callPackage ./qtbase {
|
qtbase = callPackage ./qtbase {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{ stdenv, lib, fetchgit, copyPathsToStore
|
{ stdenv, lib, fetchgit, copyPathsToStore
|
||||||
, srcs
|
, srcs, qtCompatVersion
|
||||||
|
|
||||||
, xlibs, libX11, libxcb, libXcursor, libXext, libXrender, libXi
|
, xlibs, libX11, libxcb, libXcursor, libXext, libXrender, libXi
|
||||||
, xcbutil, xcbutilimage, xcbutilkeysyms, xcbutilwm, libxkbcommon
|
, xcbutil, xcbutilimage, xcbutilkeysyms, xcbutilwm, libxkbcommon
|
||||||
|
@ -32,6 +32,7 @@ stdenv.mkDerivation {
|
||||||
|
|
||||||
name = "qtbase-${srcs.qtbase.version}";
|
name = "qtbase-${srcs.qtbase.version}";
|
||||||
inherit (srcs.qtbase) src version;
|
inherit (srcs.qtbase) src version;
|
||||||
|
inherit qtCompatVersion;
|
||||||
|
|
||||||
outputs = [ "out" "dev" ];
|
outputs = [ "out" "dev" ];
|
||||||
|
|
||||||
|
@ -94,18 +95,22 @@ stdenv.mkDerivation {
|
||||||
# Note on the above: \x27 is a way if including a single-quote
|
# Note on the above: \x27 is a way if including a single-quote
|
||||||
# character in the sed string arguments.
|
# character in the sed string arguments.
|
||||||
|
|
||||||
|
qtPluginPrefix = "lib/qt-${qtCompatVersion}/plugins";
|
||||||
|
qtQmlPrefix = "lib/qt-${qtCompatVersion}/qml";
|
||||||
|
qtDocPrefix = "share/doc/qt-${qtCompatVersion}";
|
||||||
|
|
||||||
setOutputFlags = false;
|
setOutputFlags = false;
|
||||||
preConfigure = ''
|
preConfigure = ''
|
||||||
export LD_LIBRARY_PATH="$PWD/lib:$PWD/plugins/platforms:$LD_LIBRARY_PATH"
|
export LD_LIBRARY_PATH="$PWD/lib:$PWD/plugins/platforms:$LD_LIBRARY_PATH"
|
||||||
export MAKEFLAGS=-j$NIX_BUILD_CORES
|
export MAKEFLAGS=-j$NIX_BUILD_CORES
|
||||||
|
|
||||||
configureFlags+="\
|
configureFlags+="\
|
||||||
-plugindir $out/lib/qt5/plugins \
|
-plugindir $out/$qtPluginPrefix \
|
||||||
-importdir $out/lib/qt5/imports \
|
-qmldir $out/$qtQmlPrefix \
|
||||||
-qmldir $out/lib/qt5/qml \
|
-docdir $out/$qtDocPrefix"
|
||||||
-docdir $out/share/doc/qt5"
|
|
||||||
|
|
||||||
NIX_CFLAGS_COMPILE+=" -DNIXPKGS_QPA_PLATFORM_PLUGIN_PATH=\"''${!outputLib}/lib/qt5/plugins/platforms\""
|
NIX_CFLAGS_COMPILE+=" -DNIXPKGS_QT_PLUGIN_PREFIX=\"$qtPluginPrefix\""
|
||||||
|
NIX_CFLAGS_COMPILE+=" -DNIXPKGS_QPA_PLATFORM_PLUGIN_PATH=\"''${!outputLib}/$qtPluginPrefix/platforms\""
|
||||||
'';
|
'';
|
||||||
|
|
||||||
prefixKey = "-prefix ";
|
prefixKey = "-prefix ";
|
||||||
|
|
|
@ -7,11 +7,11 @@ Index: qtbase-opensource-src-5.6.2/src/corelib/kernel/qcoreapplication.cpp
|
||||||
coreappdata()->app_libpaths.reset(app_libpaths);
|
coreappdata()->app_libpaths.reset(app_libpaths);
|
||||||
|
|
||||||
+ // Add library paths derived from NIX_PROFILES.
|
+ // Add library paths derived from NIX_PROFILES.
|
||||||
+ const QByteArrayList profiles = qgetenv("NIX_PROFILES").split(' ');
|
+ const QStringList profiles = QFile::decodeName(qgetenv("NIX_PROFILES")).split(' ');
|
||||||
+ const QString plugindir = QString::fromLatin1("/lib/qt5/plugins");
|
+ const QString plugindir = QStringLiteral(NIXPKGS_QT_PLUGIN_PREFIX);
|
||||||
+ for (const QByteArray &profile: profiles) {
|
+ for (const QString &profile: profiles) {
|
||||||
+ if (!profile.isEmpty()) {
|
+ if (!profile.isEmpty()) {
|
||||||
+ app_libpaths->append(QFile::decodeName(profile) + plugindir);
|
+ app_libpaths->append(profile + QDir::separator() + plugindir);
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
|
|
|
@ -5,4 +5,8 @@ qtSubmodule {
|
||||||
patches = copyPathsToStore (lib.readPathsFromFile ./. ./series);
|
patches = copyPathsToStore (lib.readPathsFromFile ./. ./series);
|
||||||
qtInputs = [ qtbase qtsvg qtxmlpatterns ];
|
qtInputs = [ qtbase qtsvg qtxmlpatterns ];
|
||||||
nativeBuildInputs = [ python2 ];
|
nativeBuildInputs = [ python2 ];
|
||||||
|
|
||||||
|
preConfigure = ''
|
||||||
|
NIX_CFLAGS_COMPILE+=" -DNIXPKGS_QML2_IMPORT_PREFIX=\"$qtQmlPrefix\""
|
||||||
|
'';
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,20 +1,20 @@
|
||||||
Index: qtdeclarative-opensource-src-5.5.1/src/qml/qml/qqmlimport.cpp
|
Index: qtdeclarative-opensource-src-5.6.2/src/qml/qml/qqmlimport.cpp
|
||||||
===================================================================
|
===================================================================
|
||||||
--- qtdeclarative-opensource-src-5.5.1.orig/src/qml/qml/qqmlimport.cpp
|
--- qtdeclarative-opensource-src-5.6.2.orig/src/qml/qml/qqmlimport.cpp
|
||||||
+++ qtdeclarative-opensource-src-5.5.1/src/qml/qml/qqmlimport.cpp
|
+++ qtdeclarative-opensource-src-5.6.2/src/qml/qml/qqmlimport.cpp
|
||||||
@@ -1549,6 +1549,15 @@ QQmlImportDatabase::QQmlImportDatabase(Q
|
@@ -1568,6 +1568,15 @@ QQmlImportDatabase::QQmlImportDatabase(Q
|
||||||
QString installImportsPath = QLibraryInfo::location(QLibraryInfo::Qml2ImportsPath);
|
QString installImportsPath = QLibraryInfo::location(QLibraryInfo::Qml2ImportsPath);
|
||||||
addImportPath(installImportsPath);
|
addImportPath(installImportsPath);
|
||||||
|
|
||||||
+ // Add library paths derived from NIX_PROFILES.
|
+ // Add library paths derived from NIX_PROFILES.
|
||||||
+ const QByteArrayList profiles = qgetenv("NIX_PROFILES").split(' ');
|
+ const QStringList profiles = QFile::decodeName(qgetenv("NIX_PROFILES")).split(' ');
|
||||||
+ const QString qmldir = QString::fromLatin1("/lib/qt5/qml");
|
+ const QString qmldir = QStringLiteral(NIXPKGS_QML2_IMPORT_PREFIX);
|
||||||
+ Q_FOREACH (const QByteArray &profile, profiles) {
|
+ for (const QString &profile: profiles) {
|
||||||
+ if (!profile.isEmpty()) {
|
+ if (!profile.isEmpty()) {
|
||||||
+ addImportPath(QFile::decodeName(profile) + qmldir);
|
+ addImportPath(profile + QDir::separator() + qmldir);
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
// env import paths
|
// env import paths
|
||||||
QByteArray envImportPath = qgetenv("QML2_IMPORT_PATH");
|
if (Q_UNLIKELY(!qEnvironmentVariableIsEmpty("QML2_IMPORT_PATH"))) {
|
||||||
if (!envImportPath.isEmpty()) {
|
const QByteArray envImportPath = qgetenv("QML2_IMPORT_PATH");
|
||||||
|
|
|
@ -42,10 +42,9 @@ qtSubmodule {
|
||||||
sed -i -e 's,/cert.pem,/certs/ca-bundle.crt,' src/3rdparty/chromium/third_party/boringssl/src/crypto/x509/x509_def.c
|
sed -i -e 's,/cert.pem,/certs/ca-bundle.crt,' src/3rdparty/chromium/third_party/boringssl/src/crypto/x509/x509_def.c
|
||||||
|
|
||||||
configureFlags+="\
|
configureFlags+="\
|
||||||
-plugindir $out/lib/qt5/plugins \
|
-plugindir $out/$qtPluginPrefix \
|
||||||
-importdir $out/lib/qt5/imports \
|
-qmldir $out/$qtQmlPrefix \
|
||||||
-qmldir $out/lib/qt5/qml \
|
-docdir $out/$qtDocPrefix"
|
||||||
-docdir $out/share/doc/qt5"
|
|
||||||
'';
|
'';
|
||||||
propagatedBuildInputs = [
|
propagatedBuildInputs = [
|
||||||
# Image formats
|
# Image formats
|
||||||
|
|
|
@ -9,8 +9,9 @@ top-level attribute to `top-level/all-packages.nix`.
|
||||||
1. Update the URL in `maintainers/scripts/generate-qt.sh`.
|
1. Update the URL in `maintainers/scripts/generate-qt.sh`.
|
||||||
2. From the top of the Nixpkgs tree, run
|
2. From the top of the Nixpkgs tree, run
|
||||||
`./maintainers/scripts/generate-qt.sh > pkgs/development/libraries/qt-5/$VERSION/srcs.nix`.
|
`./maintainers/scripts/generate-qt.sh > pkgs/development/libraries/qt-5/$VERSION/srcs.nix`.
|
||||||
3. Check that the new packages build correctly.
|
3. Update `qtCompatVersion` below if the minor version number changes.
|
||||||
4. Commit the changes and open a pull request.
|
4. Check that the new packages build correctly.
|
||||||
|
5. Commit the changes and open a pull request.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -29,6 +30,8 @@ with stdenv.lib;
|
||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
|
qtCompatVersion = "5.8";
|
||||||
|
|
||||||
mirror = "http://download.qt.io";
|
mirror = "http://download.qt.io";
|
||||||
srcs = import ./srcs.nix { inherit fetchurl; inherit mirror; };
|
srcs = import ./srcs.nix { inherit fetchurl; inherit mirror; };
|
||||||
|
|
||||||
|
@ -61,7 +64,7 @@ let
|
||||||
|
|
||||||
addPackages = self: with self;
|
addPackages = self: with self;
|
||||||
let
|
let
|
||||||
callPackage = self.newScope { inherit qtSubmodule srcs; };
|
callPackage = self.newScope { inherit qtCompatVersion qtSubmodule srcs; };
|
||||||
in {
|
in {
|
||||||
|
|
||||||
qtbase = callPackage ./qtbase {
|
qtbase = callPackage ./qtbase {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
stdenv, lib, copyPathsToStore,
|
stdenv, lib, copyPathsToStore,
|
||||||
src, version,
|
src, version, qtCompatVersion,
|
||||||
|
|
||||||
coreutils, bison, flex, gdb, gperf, lndir, patchelf, perl, pkgconfig, python2,
|
coreutils, bison, flex, gdb, gperf, lndir, patchelf, perl, pkgconfig, python2,
|
||||||
ruby,
|
ruby,
|
||||||
|
@ -32,7 +32,7 @@ in
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
|
|
||||||
name = "qtbase-${version}";
|
name = "qtbase-${version}";
|
||||||
inherit src version;
|
inherit qtCompatVersion src version;
|
||||||
|
|
||||||
propagatedBuildInputs =
|
propagatedBuildInputs =
|
||||||
[
|
[
|
||||||
|
@ -117,18 +117,22 @@ stdenv.mkDerivation {
|
||||||
# Note on the above: \x27 is a way if including a single-quote
|
# Note on the above: \x27 is a way if including a single-quote
|
||||||
# character in the sed string arguments.
|
# character in the sed string arguments.
|
||||||
|
|
||||||
|
qtPluginPrefix = "lib/qt-${qtCompatVersion}/plugins";
|
||||||
|
qtQmlPrefix = "lib/qt-${qtCompatVersion}/qml";
|
||||||
|
qtDocPrefix = "share/doc/qt-${qtCompatVersion}";
|
||||||
|
|
||||||
setOutputFlags = false;
|
setOutputFlags = false;
|
||||||
preConfigure = ''
|
preConfigure = ''
|
||||||
export LD_LIBRARY_PATH="$PWD/lib:$PWD/plugins/platforms:$LD_LIBRARY_PATH"
|
export LD_LIBRARY_PATH="$PWD/lib:$PWD/plugins/platforms:$LD_LIBRARY_PATH"
|
||||||
export MAKEFLAGS=-j$NIX_BUILD_CORES
|
export MAKEFLAGS=-j$NIX_BUILD_CORES
|
||||||
|
|
||||||
configureFlags+="\
|
configureFlags+="\
|
||||||
-plugindir $out/lib/qt5/plugins \
|
-plugindir $out/$qtPluginPrefix \
|
||||||
-importdir $out/lib/qt5/imports \
|
-qmldir $out/$qtQmlPrefix \
|
||||||
-qmldir $out/lib/qt5/qml \
|
-docdir $out/$qtDocPrefix"
|
||||||
-docdir $out/share/doc/qt5"
|
|
||||||
|
|
||||||
NIX_CFLAGS_COMPILE+=" -DNIXPKGS_QPA_PLATFORM_PLUGIN_PATH=\"''${!outputLib}/lib/qt5/plugins/platforms\""
|
NIX_CFLAGS_COMPILE+=" -DNIXPKGS_QT_PLUGIN_PREFIX=\"$qtPluginPrefix\""
|
||||||
|
NIX_CFLAGS_COMPILE+=" -DNIXPKGS_QPA_PLATFORM_PLUGIN_PATH=\"''${!outputLib}/$qtPluginPrefix/platforms\""
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -7,11 +7,11 @@ Index: qtbase-opensource-src-5.8.0/src/corelib/kernel/qcoreapplication.cpp
|
||||||
coreappdata()->app_libpaths.reset(app_libpaths);
|
coreappdata()->app_libpaths.reset(app_libpaths);
|
||||||
|
|
||||||
+ // Add library paths derived from NIX_PROFILES.
|
+ // Add library paths derived from NIX_PROFILES.
|
||||||
+ const QByteArrayList profiles = qgetenv("NIX_PROFILES").split(' ');
|
+ const QStringList profiles = QFile::decodeName(qgetenv("NIX_PROFILES")).split(' ');
|
||||||
+ const QString plugindir = QString::fromLatin1("/lib/qt5/plugins");
|
+ const QString plugindir = QStringLiteral(NIXPKGS_QT_PLUGIN_PREFIX);
|
||||||
+ for (const QByteArray &profile: profiles) {
|
+ for (const QString &profile: profiles) {
|
||||||
+ if (!profile.isEmpty()) {
|
+ if (!profile.isEmpty()) {
|
||||||
+ app_libpaths->append(QFile::decodeName(profile) + plugindir);
|
+ app_libpaths->append(profile + QDir::separator() + plugindir);
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
|
|
|
@ -8,6 +8,10 @@ qtSubmodule {
|
||||||
qtInputs = [ qtbase qtsvg qtxmlpatterns ];
|
qtInputs = [ qtbase qtsvg qtxmlpatterns ];
|
||||||
nativeBuildInputs = [ python2 makeQtWrapper ];
|
nativeBuildInputs = [ python2 makeQtWrapper ];
|
||||||
|
|
||||||
|
preConfigure = ''
|
||||||
|
NIX_CFLAGS_COMPILE+=" -DNIXPKGS_QML2_IMPORT_PREFIX=\"$qtQmlPrefix\""
|
||||||
|
'';
|
||||||
|
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
wrapQtProgram $out/bin/qmleasing
|
wrapQtProgram $out/bin/qmleasing
|
||||||
wrapQtProgram $out/bin/qmlscene
|
wrapQtProgram $out/bin/qmlscene
|
||||||
|
|
|
@ -1,20 +1,20 @@
|
||||||
Index: qtdeclarative-opensource-src-5.5.1/src/qml/qml/qqmlimport.cpp
|
Index: qtdeclarative-opensource-src-5.8.0/src/qml/qml/qqmlimport.cpp
|
||||||
===================================================================
|
===================================================================
|
||||||
--- qtdeclarative-opensource-src-5.5.1.orig/src/qml/qml/qqmlimport.cpp
|
--- qtdeclarative-opensource-src-5.8.0.orig/src/qml/qml/qqmlimport.cpp
|
||||||
+++ qtdeclarative-opensource-src-5.5.1/src/qml/qml/qqmlimport.cpp
|
+++ qtdeclarative-opensource-src-5.8.0/src/qml/qml/qqmlimport.cpp
|
||||||
@@ -1549,6 +1549,15 @@ QQmlImportDatabase::QQmlImportDatabase(Q
|
@@ -1630,6 +1630,15 @@ QQmlImportDatabase::QQmlImportDatabase(Q
|
||||||
QString installImportsPath = QLibraryInfo::location(QLibraryInfo::Qml2ImportsPath);
|
QString installImportsPath = QLibraryInfo::location(QLibraryInfo::Qml2ImportsPath);
|
||||||
addImportPath(installImportsPath);
|
addImportPath(installImportsPath);
|
||||||
|
|
||||||
+ // Add library paths derived from NIX_PROFILES.
|
+ // Add library paths derived from NIX_PROFILES.
|
||||||
+ const QByteArrayList profiles = qgetenv("NIX_PROFILES").split(' ');
|
+ const QStringList profiles = QFile::decodeName(qgetenv("NIX_PROFILES")).split(' ');
|
||||||
+ const QString qmldir = QString::fromLatin1("/lib/qt5/qml");
|
+ const QString qmldir = QStringLiteral(NIXPKGS_QML2_IMPORT_PREFIX);
|
||||||
+ Q_FOREACH (const QByteArray &profile, profiles) {
|
+ for (const QString &profile: profiles) {
|
||||||
+ if (!profile.isEmpty()) {
|
+ if (!profile.isEmpty()) {
|
||||||
+ addImportPath(QFile::decodeName(profile) + qmldir);
|
+ addImportPath(profile + QDir::separator() + qmldir);
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
// env import paths
|
// env import paths
|
||||||
QByteArray envImportPath = qgetenv("QML2_IMPORT_PATH");
|
if (Q_UNLIKELY(!qEnvironmentVariableIsEmpty("QML2_IMPORT_PATH"))) {
|
||||||
if (!envImportPath.isEmpty()) {
|
const QByteArray envImportPath = qgetenv("QML2_IMPORT_PATH");
|
||||||
|
|
|
@ -3,7 +3,6 @@ wrapQtProgram() {
|
||||||
shift
|
shift
|
||||||
wrapProgram "$prog" \
|
wrapProgram "$prog" \
|
||||||
--set QT_PLUGIN_PATH "$QT_PLUGIN_PATH" \
|
--set QT_PLUGIN_PATH "$QT_PLUGIN_PATH" \
|
||||||
--set QML_IMPORT_PATH "$QML_IMPORT_PATH" \
|
|
||||||
--set QML2_IMPORT_PATH "$QML2_IMPORT_PATH" \
|
--set QML2_IMPORT_PATH "$QML2_IMPORT_PATH" \
|
||||||
--set DYLD_FRAMEWORK_PATH "/System/Library/Frameworks" \
|
--set DYLD_FRAMEWORK_PATH "/System/Library/Frameworks" \
|
||||||
--prefix XDG_DATA_DIRS : "$RUNTIME_XDG_DATA_DIRS" \
|
--prefix XDG_DATA_DIRS : "$RUNTIME_XDG_DATA_DIRS" \
|
||||||
|
@ -18,7 +17,6 @@ makeQtWrapper() {
|
||||||
shift
|
shift
|
||||||
makeWrapper "$old" "$new" \
|
makeWrapper "$old" "$new" \
|
||||||
--set QT_PLUGIN_PATH "$QT_PLUGIN_PATH" \
|
--set QT_PLUGIN_PATH "$QT_PLUGIN_PATH" \
|
||||||
--set QML_IMPORT_PATH "$QML_IMPORT_PATH" \
|
|
||||||
--set QML2_IMPORT_PATH "$QML2_IMPORT_PATH" \
|
--set QML2_IMPORT_PATH "$QML2_IMPORT_PATH" \
|
||||||
--set DYLD_FRAMEWORK_PATH "/System/Library/Frameworks" \
|
--set DYLD_FRAMEWORK_PATH "/System/Library/Frameworks" \
|
||||||
--prefix XDG_DATA_DIRS : "$RUNTIME_XDG_DATA_DIRS" \
|
--prefix XDG_DATA_DIRS : "$RUNTIME_XDG_DATA_DIRS" \
|
||||||
|
@ -28,9 +26,8 @@ makeQtWrapper() {
|
||||||
|
|
||||||
_makeQtWrapperSetup() {
|
_makeQtWrapperSetup() {
|
||||||
# cannot use addToSearchPath because these directories may not exist yet
|
# cannot use addToSearchPath because these directories may not exist yet
|
||||||
export QT_PLUGIN_PATH="$QT_PLUGIN_PATH${QT_PLUGIN_PATH:+:}${!outputLib}/lib/qt5/plugins"
|
export QT_PLUGIN_PATH="$QT_PLUGIN_PATH${QT_PLUGIN_PATH:+:}${!outputLib}/$qtPluginPrefix"
|
||||||
export QML_IMPORT_PATH="$QML_IMPORT_PATH${QML_IMPORT_PATH:+:}${!outputLib}/lib/qt5/imports"
|
export QML2_IMPORT_PATH="$QML2_IMPORT_PATH${QML2_IMPORT_PATH:+:}${!outputLib}/$qtQmlPrefix"
|
||||||
export QML2_IMPORT_PATH="$QML2_IMPORT_PATH${QML2_IMPORT_PATH:+:}${!outputLib}/lib/qt5/qml"
|
|
||||||
export RUNTIME_XDG_DATA_DIRS="$RUNTIME_XDG_DATA_DIRS${RUNTIME_XDG_DATA_DIRS:+:}${!outputBin}/share"
|
export RUNTIME_XDG_DATA_DIRS="$RUNTIME_XDG_DATA_DIRS${RUNTIME_XDG_DATA_DIRS:+:}${!outputBin}/share"
|
||||||
export RUNTIME_XDG_CONFIG_DIRS="$RUNTIME_XDG_CONFIG_DIRS${RUNTIME_XDG_CONFIG_DIRS:+:}${!outputBin}/etc/xdg"
|
export RUNTIME_XDG_CONFIG_DIRS="$RUNTIME_XDG_CONFIG_DIRS${RUNTIME_XDG_CONFIG_DIRS:+:}${!outputBin}/etc/xdg"
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,6 @@ wrapQtProgram() {
|
||||||
shift
|
shift
|
||||||
wrapProgram "$prog" \
|
wrapProgram "$prog" \
|
||||||
--prefix QT_PLUGIN_PATH : "$QT_PLUGIN_PATH" \
|
--prefix QT_PLUGIN_PATH : "$QT_PLUGIN_PATH" \
|
||||||
--prefix QML_IMPORT_PATH : "$QML_IMPORT_PATH" \
|
|
||||||
--prefix QML2_IMPORT_PATH : "$QML2_IMPORT_PATH" \
|
--prefix QML2_IMPORT_PATH : "$QML2_IMPORT_PATH" \
|
||||||
--prefix XDG_DATA_DIRS : "$RUNTIME_XDG_DATA_DIRS" \
|
--prefix XDG_DATA_DIRS : "$RUNTIME_XDG_DATA_DIRS" \
|
||||||
--prefix XDG_CONFIG_DIRS : "$RUNTIME_XDG_CONFIG_DIRS" \
|
--prefix XDG_CONFIG_DIRS : "$RUNTIME_XDG_CONFIG_DIRS" \
|
||||||
|
@ -18,7 +17,6 @@ makeQtWrapper() {
|
||||||
shift
|
shift
|
||||||
makeWrapper "$old" "$new" \
|
makeWrapper "$old" "$new" \
|
||||||
--prefix QT_PLUGIN_PATH : "$QT_PLUGIN_PATH" \
|
--prefix QT_PLUGIN_PATH : "$QT_PLUGIN_PATH" \
|
||||||
--prefix QML_IMPORT_PATH : "$QML_IMPORT_PATH" \
|
|
||||||
--prefix QML2_IMPORT_PATH : "$QML2_IMPORT_PATH" \
|
--prefix QML2_IMPORT_PATH : "$QML2_IMPORT_PATH" \
|
||||||
--prefix XDG_DATA_DIRS : "$RUNTIME_XDG_DATA_DIRS" \
|
--prefix XDG_DATA_DIRS : "$RUNTIME_XDG_DATA_DIRS" \
|
||||||
--prefix XDG_CONFIG_DIRS : "$RUNTIME_XDG_CONFIG_DIRS" \
|
--prefix XDG_CONFIG_DIRS : "$RUNTIME_XDG_CONFIG_DIRS" \
|
||||||
|
@ -28,9 +26,8 @@ makeQtWrapper() {
|
||||||
|
|
||||||
_makeQtWrapperSetup() {
|
_makeQtWrapperSetup() {
|
||||||
# cannot use addToSearchPath because these directories may not exist yet
|
# cannot use addToSearchPath because these directories may not exist yet
|
||||||
export QT_PLUGIN_PATH="$QT_PLUGIN_PATH${QT_PLUGIN_PATH:+:}${!outputLib}/lib/qt5/plugins"
|
export QT_PLUGIN_PATH="$QT_PLUGIN_PATH${QT_PLUGIN_PATH:+:}${!outputLib}/$qtPluginPrefix"
|
||||||
export QML_IMPORT_PATH="$QML_IMPORT_PATH${QML_IMPORT_PATH:+:}${!outputLib}/lib/qt5/imports"
|
export QML2_IMPORT_PATH="$QML2_IMPORT_PATH${QML2_IMPORT_PATH:+:}${!outputLib}/$qtQmlPrefix"
|
||||||
export QML2_IMPORT_PATH="$QML2_IMPORT_PATH${QML2_IMPORT_PATH:+:}${!outputLib}/lib/qt5/qml"
|
|
||||||
export RUNTIME_XDG_DATA_DIRS="$RUNTIME_XDG_DATA_DIRS${RUNTIME_XDG_DATA_DIRS:+:}${!outputBin}/share${GSETTINGS_SCHEMAS_PATH:+:$GSETTINGS_SCHEMAS_PATH}"
|
export RUNTIME_XDG_DATA_DIRS="$RUNTIME_XDG_DATA_DIRS${RUNTIME_XDG_DATA_DIRS:+:}${!outputBin}/share${GSETTINGS_SCHEMAS_PATH:+:$GSETTINGS_SCHEMAS_PATH}"
|
||||||
export RUNTIME_XDG_CONFIG_DIRS="$RUNTIME_XDG_CONFIG_DIRS${RUNTIME_XDG_CONFIG_DIRS:+:}${!outputBin}/etc/xdg"
|
export RUNTIME_XDG_CONFIG_DIRS="$RUNTIME_XDG_CONFIG_DIRS${RUNTIME_XDG_CONFIG_DIRS:+:}${!outputBin}/etc/xdg"
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,10 +13,9 @@ buildEnv {
|
||||||
cat >"$out/bin/qt.conf" <<EOF
|
cat >"$out/bin/qt.conf" <<EOF
|
||||||
[Paths]
|
[Paths]
|
||||||
Prefix = $out
|
Prefix = $out
|
||||||
Plugins = lib/qt5/plugins
|
Plugins = $qtPluginPrefix
|
||||||
Imports = lib/qt5/imports
|
Qml2Imports = $qtQmlPrefix
|
||||||
Qml2Imports = lib/qt5/qml
|
Documentation = $qtDocPrefix
|
||||||
Documentation = share/doc/qt5
|
|
||||||
EOF
|
EOF
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
|
qtPluginPrefix=@qtPluginPrefix@
|
||||||
|
qtQmlPrefix=@qtQmlPrefix@
|
||||||
|
qtDocPrefix=@qtDocPrefix@
|
||||||
|
|
||||||
addToSearchPathOnceWithCustomDelimiter() {
|
addToSearchPathOnceWithCustomDelimiter() {
|
||||||
local delim="$1"
|
local delim="$1"
|
||||||
local search="$2"
|
local search="$2"
|
||||||
|
@ -25,30 +29,28 @@ propagateOnce() {
|
||||||
}
|
}
|
||||||
|
|
||||||
_qtPropagate() {
|
_qtPropagate() {
|
||||||
for dir in "lib/qt5/plugins" "lib/qt5/qml" "lib/qt5/imports"; do
|
for dir in $qtPluginPrefix $qtQmlPrefix; do
|
||||||
if [ -d "$1/$dir" ]; then
|
if [ -d "$1/$dir" ]; then
|
||||||
propagateOnce propagatedBuildInputs "$1"
|
propagateOnce propagatedBuildInputs "$1"
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
addToSearchPathOnce QT_PLUGIN_PATH "$1/lib/qt5/plugins"
|
addToSearchPathOnce QT_PLUGIN_PATH "$1/$qtPluginPrefix"
|
||||||
addToSearchPathOnce QML_IMPORT_PATH "$1/lib/qt5/imports"
|
addToSearchPathOnce QML2_IMPORT_PATH "$1/$qtQmlPrefix"
|
||||||
addToSearchPathOnce QML2_IMPORT_PATH "$1/lib/qt5/qml"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
crossEnvHooks+=(_qtPropagate)
|
crossEnvHooks+=(_qtPropagate)
|
||||||
|
|
||||||
_qtPropagateNative() {
|
_qtPropagateNative() {
|
||||||
for dir in "lib/qt5/plugins" "lib/qt5/qml" "lib/qt5/imports"; do
|
for dir in $qtPluginPrefix $qtQmlPrefix; do
|
||||||
if [ -d "$1/$dir" ]; then
|
if [ -d "$1/$dir" ]; then
|
||||||
propagateOnce propagatedNativeBuildInputs "$1"
|
propagateOnce propagatedNativeBuildInputs "$1"
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
if [ -z "$crossConfig" ]; then
|
if [ -z "$crossConfig" ]; then
|
||||||
addToSearchPathOnce QT_PLUGIN_PATH "$1/lib/qt5/plugins"
|
addToSearchPathOnce QT_PLUGIN_PATH "$1/$qtPluginPrefix"
|
||||||
addToSearchPathOnce QML_IMPORT_PATH "$1/lib/qt5/imports"
|
addToSearchPathOnce QML2_IMPORT_PATH "$1/$qtQmlPrefix"
|
||||||
addToSearchPathOnce QML2_IMPORT_PATH "$1/lib/qt5/qml"
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -112,10 +114,9 @@ if [ -z "$NIX_QT5_TMP" ]; then
|
||||||
cat >"$NIX_QT5_TMP/bin/qt.conf" <<EOF
|
cat >"$NIX_QT5_TMP/bin/qt.conf" <<EOF
|
||||||
[Paths]
|
[Paths]
|
||||||
Prefix = $NIX_QT5_TMP
|
Prefix = $NIX_QT5_TMP
|
||||||
Plugins = lib/qt5/plugins
|
Plugins = $qtPluginPrefix
|
||||||
Imports = lib/qt5/imports
|
Qml2Imports = $qtQmlPrefix
|
||||||
Qml2Imports = lib/qt5/qml
|
Documentation = $qtDocPrefix
|
||||||
Documentation = share/doc/qt5
|
|
||||||
EOF
|
EOF
|
||||||
echo "bin/qt.conf" >> "$NIX_QT5_TMP/nix-support/qt-inputs"
|
echo "bin/qt.conf" >> "$NIX_QT5_TMP/nix-support/qt-inputs"
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
|
qtPluginPrefix=@qtPluginPrefix@
|
||||||
|
qtQmlPrefix=@qtQmlPrefix@
|
||||||
|
qtDocPrefix=@qtDocPrefix@
|
||||||
|
|
||||||
addToSearchPathOnceWithCustomDelimiter() {
|
addToSearchPathOnceWithCustomDelimiter() {
|
||||||
local delim="$1"
|
local delim="$1"
|
||||||
local search="$2"
|
local search="$2"
|
||||||
|
@ -25,30 +29,28 @@ propagateOnce() {
|
||||||
}
|
}
|
||||||
|
|
||||||
_qtPropagate() {
|
_qtPropagate() {
|
||||||
for dir in "lib/qt5/plugins" "lib/qt5/qml" "lib/qt5/imports"; do
|
for dir in $qtPluginPrefix $qtQmlPrefix; do
|
||||||
if [ -d "$1/$dir" ]; then
|
if [ -d "$1/$dir" ]; then
|
||||||
propagateOnce propagatedBuildInputs "$1"
|
propagateOnce propagatedBuildInputs "$1"
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
addToSearchPathOnce QT_PLUGIN_PATH "$1/lib/qt5/plugins"
|
addToSearchPathOnce QT_PLUGIN_PATH "$1/$qtPluginPrefix"
|
||||||
addToSearchPathOnce QML_IMPORT_PATH "$1/lib/qt5/imports"
|
addToSearchPathOnce QML2_IMPORT_PATH "$1/$qtQmlPrefix"
|
||||||
addToSearchPathOnce QML2_IMPORT_PATH "$1/lib/qt5/qml"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
crossEnvHooks+=(_qtPropagate)
|
crossEnvHooks+=(_qtPropagate)
|
||||||
|
|
||||||
_qtPropagateNative() {
|
_qtPropagateNative() {
|
||||||
for dir in "lib/qt5/plugins" "lib/qt5/qml" "lib/qt5/imports"; do
|
for dir in $qtPluginPrefix $qtQmlPrefix; do
|
||||||
if [ -d "$1/$dir" ]; then
|
if [ -d "$1/$dir" ]; then
|
||||||
propagateOnce propagatedNativeBuildInputs "$1"
|
propagateOnce propagatedNativeBuildInputs "$1"
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
if [ -z "$crossConfig" ]; then
|
if [ -z "$crossConfig" ]; then
|
||||||
addToSearchPathOnce QT_PLUGIN_PATH "$1/lib/qt5/plugins"
|
addToSearchPathOnce QT_PLUGIN_PATH "$1/$qtPluginPrefix"
|
||||||
addToSearchPathOnce QML_IMPORT_PATH "$1/lib/qt5/imports"
|
addToSearchPathOnce QML2_IMPORT_PATH "$1/$qtQmlPrefix"
|
||||||
addToSearchPathOnce QML2_IMPORT_PATH "$1/lib/qt5/qml"
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -111,10 +113,9 @@ if [ -z "$NIX_QT5_TMP" ]; then
|
||||||
cat >"$NIX_QT5_TMP/bin/qt.conf" <<EOF
|
cat >"$NIX_QT5_TMP/bin/qt.conf" <<EOF
|
||||||
[Paths]
|
[Paths]
|
||||||
Prefix = $NIX_QT5_TMP
|
Prefix = $NIX_QT5_TMP
|
||||||
Plugins = lib/qt5/plugins
|
Plugins = $qtPluginPrefix
|
||||||
Imports = lib/qt5/imports
|
Qml2Imports = $qtQmlPrefix
|
||||||
Qml2Imports = lib/qt5/qml
|
Documentation = $qtDocPrefix
|
||||||
Documentation = share/doc/qt5
|
|
||||||
EOF
|
EOF
|
||||||
echo "bin/qt.conf" >> "$NIX_QT5_TMP/nix-support/qt-inputs"
|
echo "bin/qt.conf" >> "$NIX_QT5_TMP/nix-support/qt-inputs"
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ stdenv.mkDerivation {
|
||||||
|
|
||||||
postPatch = ''
|
postPatch = ''
|
||||||
sed -i "s,-lhunspell,-lhunspell-1.6," src/spellcheck/spellcheck.pri
|
sed -i "s,-lhunspell,-lhunspell-1.6," src/spellcheck/spellcheck.pri
|
||||||
sed -i "s,\$\$\[QT_INSTALL_PLUGINS\],$out/lib/qt5/plugins," src/src.pro
|
sed -i "s,\$\$\[QT_INSTALL_PLUGINS\],$out/$qtPluginPrefix," src/src.pro
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
|
|
|
@ -32,7 +32,7 @@ stdenv.mkDerivation rec {
|
||||||
installFlags = [ "INSTALL_ROOT=$(out)" ] ++ optional withDocumentation "install_docs";
|
installFlags = [ "INSTALL_ROOT=$(out)" ] ++ optional withDocumentation "install_docs";
|
||||||
|
|
||||||
preBuild = optional withDocumentation ''
|
preBuild = optional withDocumentation ''
|
||||||
ln -s ${qtbase}/share/doc $NIX_QT5_TMP/share
|
ln -s ${qtbase}/$qtDocPrefix $NIX_QT5_TMP/share
|
||||||
'';
|
'';
|
||||||
|
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
|
|
|
@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
|
||||||
buildInputs = [ qtbase qtsvg ];
|
buildInputs = [ qtbase qtsvg ];
|
||||||
|
|
||||||
preConfigure = ''
|
preConfigure = ''
|
||||||
qmakeFlags="$qmakeFlags PLUGINDIR=$out/lib/qt5/plugins"
|
qmakeFlags="$qmakeFlags PLUGINDIR=$out/$qtPluginPrefix"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
preFixup = ''
|
preFixup = ''
|
||||||
|
|
Loading…
Reference in New Issue