diff options
Diffstat (limited to 'pkgs/development/libraries')
47 files changed, 146 insertions, 18 deletions
diff --git a/pkgs/development/libraries/aqbanking/gwenhywfar.nix b/pkgs/development/libraries/aqbanking/gwenhywfar.nix index d240e7e3a9d..073ad3254a0 100644 --- a/pkgs/development/libraries/aqbanking/gwenhywfar.nix +++ b/pkgs/development/libraries/aqbanking/gwenhywfar.nix @@ -57,6 +57,8 @@ in stdenv.mkDerivation rec { buildInputs = [ gtk2 gtk3 qt5.qtbase gnutls openssl libgcrypt libgpgerror ]; + dontWrapQtApps = true; + meta = with lib; { description = "OS abstraction functions used by aqbanking and related tools"; homepage = "http://www2.aquamaniac.de/sites/download/packages.php?package=01&showall=1"; diff --git a/pkgs/development/libraries/audio/suil/default.nix b/pkgs/development/libraries/audio/suil/default.nix index 0f4dd0f62c4..56008ae8dd6 100644 --- a/pkgs/development/libraries/audio/suil/default.nix +++ b/pkgs/development/libraries/audio/suil/default.nix @@ -22,6 +22,8 @@ stdenv.mkDerivation rec { ++ (lib.optionals withQt4 [ qt4 ]) ++ (lib.optionals withQt5 (with qt5; [ qtbase qttools ])); + dontWrapQtApps = true; + meta = with lib; { homepage = "http://drobilla.net/software/suil"; description = "A lightweight C library for loading and wrapping LV2 plugin UIs"; diff --git a/pkgs/development/libraries/dxflib/default.nix b/pkgs/development/libraries/dxflib/default.nix index b2cd97398c6..09f2ad3ccad 100644 --- a/pkgs/development/libraries/dxflib/default.nix +++ b/pkgs/development/libraries/dxflib/default.nix @@ -13,6 +13,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ qmake ]; + dontWrapQtApps = true; preConfigure = '' sed -i 's/CONFIG += staticlib/CONFIG += shared/' dxflib.pro ''; diff --git a/pkgs/development/libraries/g2o/default.nix b/pkgs/development/libraries/g2o/default.nix index 675d994cf0e..6e32db59de4 100644 --- a/pkgs/development/libraries/g2o/default.nix +++ b/pkgs/development/libraries/g2o/default.nix @@ -23,6 +23,8 @@ mkDerivation rec { # Silence noisy warning CXXFLAGS = "-Wno-deprecated-copy"; + dontWrapQtApps = true; + cmakeFlags = [ # Detection script is broken "-DQGLVIEWER_INCLUDE_DIR=${libqglviewer}/include/QGLViewer" diff --git a/pkgs/development/libraries/gecode/default.nix b/pkgs/development/libraries/gecode/default.nix index 46b13e6e37f..fc9835d85db 100644 --- a/pkgs/development/libraries/gecode/default.nix +++ b/pkgs/development/libraries/gecode/default.nix @@ -12,6 +12,7 @@ stdenv.mkDerivation rec { }; enableParallelBuilding = true; + dontWrapQtApps = true; nativeBuildInputs = [ bison flex ]; buildInputs = [ perl gmp mpfr ] ++ lib.optional enableGist qtbase; diff --git a/pkgs/development/libraries/gpgme/default.nix b/pkgs/development/libraries/gpgme/default.nix index 5b24955af43..8a448759c7f 100644 --- a/pkgs/development/libraries/gpgme/default.nix +++ b/pkgs/development/libraries/gpgme/default.nix @@ -50,6 +50,8 @@ stdenv.mkDerivation rec { depsBuildBuild = [ buildPackages.stdenv.cc ]; + dontWrapQtApps = true; + configureFlags = [ "--enable-fixed-path=${gnupg}/bin" "--with-libgpg-error-prefix=${libgpgerror.dev}" diff --git a/pkgs/development/libraries/kpmcore/default.nix b/pkgs/development/libraries/kpmcore/default.nix index 837333407b2..315a38197a1 100644 --- a/pkgs/development/libraries/kpmcore/default.nix +++ b/pkgs/development/libraries/kpmcore/default.nix @@ -24,6 +24,8 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ extra-cmake-modules ]; + dontWrapQtApps = true; + meta = with lib; { maintainers = with lib.maintainers; [ peterhoeg ]; # The build requires at least Qt 5.14: diff --git a/pkgs/development/libraries/libcommuni/default.nix b/pkgs/development/libraries/libcommuni/default.nix index 47360e11bc5..cdc716731fa 100644 --- a/pkgs/development/libraries/libcommuni/default.nix +++ b/pkgs/development/libraries/libcommuni/default.nix @@ -21,6 +21,8 @@ stdenv.mkDerivation rec { dontUseQmakeConfigure = true; configureFlags = [ "-config" "release" ]; + dontWrapQtApps = true; + preConfigure = '' sed -i -e 's|/bin/pwd|pwd|g' configure ''; diff --git a/pkgs/development/libraries/libdbusmenu-qt/default.nix b/pkgs/development/libraries/libdbusmenu-qt/default.nix index e44f3e37d20..75d4f76b31f 100644 --- a/pkgs/development/libraries/libdbusmenu-qt/default.nix +++ b/pkgs/development/libraries/libdbusmenu-qt/default.nix @@ -20,6 +20,8 @@ stdenv.mkDerivation { cmakeFlags = [ "-DWITH_DOC=OFF" ]; + dontWrapQtApps = true; + meta = with lib; { description = "Provides a Qt implementation of the DBusMenu spec"; inherit homepage; diff --git a/pkgs/development/libraries/libdbusmenu-qt/qt-5.5.nix b/pkgs/development/libraries/libdbusmenu-qt/qt-5.5.nix index 5ce811e9fea..7219bcbdeb5 100644 --- a/pkgs/development/libraries/libdbusmenu-qt/qt-5.5.nix +++ b/pkgs/development/libraries/libdbusmenu-qt/qt-5.5.nix @@ -15,6 +15,8 @@ stdenv.mkDerivation rec { cmakeFlags = [ "-DWITH_DOC=OFF" ]; + dontWrapQtApps = true; + meta = with lib; { homepage = "https://launchpad.net/libdbusmenu-qt"; description = "Provides a Qt implementation of the DBusMenu spec"; diff --git a/pkgs/development/libraries/libkeyfinder/default.nix b/pkgs/development/libraries/libkeyfinder/default.nix index d2aecccdedf..a38fa0dc6f6 100644 --- a/pkgs/development/libraries/libkeyfinder/default.nix +++ b/pkgs/development/libraries/libkeyfinder/default.nix @@ -14,6 +14,8 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ qmake ]; buildInputs = [ fftw qtbase ]; + dontWrapQtApps = true; + postPatch = '' substituteInPlace LibKeyFinder.pro \ --replace "/usr/local" "$out" \ diff --git a/pkgs/development/libraries/libktorrent/default.nix b/pkgs/development/libraries/libktorrent/default.nix index 610efa7ed4f..825fe87fe2f 100644 --- a/pkgs/development/libraries/libktorrent/default.nix +++ b/pkgs/development/libraries/libktorrent/default.nix @@ -27,6 +27,8 @@ in stdenv.mkDerivation rec { inherit mainVersion; }; + dontWrapQtApps = true; + meta = with lib; { description = "A BitTorrent library used by KTorrent"; homepage = "https://www.kde.org/applications/internet/ktorrent/"; diff --git a/pkgs/development/libraries/liblastfm/default.nix b/pkgs/development/libraries/liblastfm/default.nix index 10cdb301479..5183c47bc06 100644 --- a/pkgs/development/libraries/liblastfm/default.nix +++ b/pkgs/development/libraries/liblastfm/default.nix @@ -23,6 +23,8 @@ stdenv.mkDerivation rec { buildInputs = [ fftwSinglePrec libsamplerate qtbase ] ++ lib.optional stdenv.isDarwin darwin.apple_sdk.frameworks.SystemConfiguration; + dontWrapQtApps = true; + meta = with lib; { homepage = "https://github.com/lastfm/liblastfm"; repositories.git = "git://github.com/lastfm/liblastfm.git"; diff --git a/pkgs/development/libraries/libqglviewer/default.nix b/pkgs/development/libraries/libqglviewer/default.nix index 4fc50f20730..65d7a83a838 100644 --- a/pkgs/development/libraries/libqglviewer/default.nix +++ b/pkgs/development/libraries/libqglviewer/default.nix @@ -13,6 +13,8 @@ stdenv.mkDerivation rec { buildInputs = [ qtbase libGLU ] ++ lib.optional stdenv.isDarwin AGL; + dontWrapQtApps = true; + postPatch = '' cd QGLViewer ''; diff --git a/pkgs/development/libraries/opencsg/default.nix b/pkgs/development/libraries/opencsg/default.nix index 53adbdf414f..7625db9a595 100644 --- a/pkgs/development/libraries/opencsg/default.nix +++ b/pkgs/development/libraries/opencsg/default.nix @@ -33,6 +33,8 @@ stdenv.mkDerivation rec { rmdir $out/bin || true ''; + dontWrapQtApps = true; + postFixup = lib.optionalString stdenv.isDarwin '' app=$out/Applications/opencsgexample.app/Contents/MacOS/opencsgexample install_name_tool -change \ diff --git a/pkgs/development/libraries/phonon/backends/gstreamer.nix b/pkgs/development/libraries/phonon/backends/gstreamer.nix index 249ce4e3629..3e21415b4c7 100644 --- a/pkgs/development/libraries/phonon/backends/gstreamer.nix +++ b/pkgs/development/libraries/phonon/backends/gstreamer.nix @@ -26,6 +26,8 @@ stdenv.mkDerivation rec { # on system paths being set. patches = [ ./gst-plugin-paths.patch ]; + dontWrapQtApps = true; + NIX_CFLAGS_COMPILE = let gstPluginPaths = lib.makeSearchPathOutput "lib" "/lib/gstreamer-1.0" diff --git a/pkgs/development/libraries/phonon/backends/vlc.nix b/pkgs/development/libraries/phonon/backends/vlc.nix index 07e6ccf1f34..b874c2e1d01 100644 --- a/pkgs/development/libraries/phonon/backends/vlc.nix +++ b/pkgs/development/libraries/phonon/backends/vlc.nix @@ -35,6 +35,8 @@ stdenv.mkDerivation rec { extra-cmake-modules ]; + dontWrapQtApps = true; + cmakeFlags = [ "-DCMAKE_BUILD_TYPE=${if debug then "Debug" else "Release"}" ]; diff --git a/pkgs/development/libraries/phonon/default.nix b/pkgs/development/libraries/phonon/default.nix index 88a6af658dd..877bf973194 100644 --- a/pkgs/development/libraries/phonon/default.nix +++ b/pkgs/development/libraries/phonon/default.nix @@ -58,6 +58,8 @@ stdenv.mkDerivation rec { "-DCMAKE_BUILD_TYPE=${if debug then "Debug" else "Release"}" ]; + dontWrapQtApps = true; + preConfigure = '' cmakeFlags+=" -DPHONON_QT_MKSPECS_INSTALL_DIR=''${!outputDev}/mkspecs" cmakeFlags+=" -DPHONON_QT_IMPORTS_INSTALL_DIR=''${!outputBin}/$qtQmlPrefix" diff --git a/pkgs/development/libraries/polkit-qt-1/qt-5.nix b/pkgs/development/libraries/polkit-qt-1/qt-5.nix index be425b39401..c4918d9d8e9 100644 --- a/pkgs/development/libraries/polkit-qt-1/qt-5.nix +++ b/pkgs/development/libraries/polkit-qt-1/qt-5.nix @@ -16,6 +16,8 @@ stdenv.mkDerivation { propagatedBuildInputs = [ polkit glib qtbase ]; + dontWrapQtApps = true; + postFixup = '' # Fix library location in CMake module sed -i "$dev/lib/cmake/PolkitQt5-1/PolkitQt5-1Config.cmake" \ diff --git a/pkgs/development/libraries/poppler/0.61.nix b/pkgs/development/libraries/poppler/0.61.nix index a49bfad7ab3..9b89283972d 100644 --- a/pkgs/development/libraries/poppler/0.61.nix +++ b/pkgs/development/libraries/poppler/0.61.nix @@ -53,6 +53,8 @@ stdenv.mkDerivation rec { (mkFlag qt5Support "QT5") ]; + dontWrapQtApps = true; + meta = with lib; { homepage = "https://poppler.freedesktop.org/"; description = "A PDF rendering library"; diff --git a/pkgs/development/libraries/poppler/default.nix b/pkgs/development/libraries/poppler/default.nix index f75c8c1474f..f3fae283e87 100644 --- a/pkgs/development/libraries/poppler/default.nix +++ b/pkgs/development/libraries/poppler/default.nix @@ -38,6 +38,8 @@ stdenv.mkDerivation rec { sed -i -e '1i cmake_policy(SET CMP0025 NEW)' CMakeLists.txt ''; + dontWrapQtApps = true; + cmakeFlags = [ (mkFlag true "UNSTABLE_API_ABI_HEADERS") # previously "XPDF_HEADERS" (mkFlag (!minimal) "GLIB") diff --git a/pkgs/development/libraries/pyotherside/default.nix b/pkgs/development/libraries/pyotherside/default.nix index 58d38651a76..da327ae13fa 100644 --- a/pkgs/development/libraries/pyotherside/default.nix +++ b/pkgs/development/libraries/pyotherside/default.nix @@ -17,6 +17,8 @@ stdenv.mkDerivation rec { python3 qtbase qtquickcontrols qtsvg ncurses ]; + dontWrapQtApps = true; + patches = [ ./qml-path.patch ]; installTargets = [ "sub-src-install_subtargets" ]; diff --git a/pkgs/development/libraries/python-qt/default.nix b/pkgs/development/libraries/python-qt/default.nix index bd778f1a945..0fe0806b1eb 100644 --- a/pkgs/development/libraries/python-qt/default.nix +++ b/pkgs/development/libraries/python-qt/default.nix @@ -22,6 +22,8 @@ stdenv.mkDerivation rec { "PYTHON_PATH=${python}/bin" "PYTHON_LIB=${python}/lib"]; + dontWrapQtApps = true; + unpackCmd = "unzip $src"; installPhase = '' diff --git a/pkgs/development/libraries/qca-qt5/default.nix b/pkgs/development/libraries/qca-qt5/default.nix index d1b545884b5..e53404557fb 100644 --- a/pkgs/development/libraries/qca-qt5/default.nix +++ b/pkgs/development/libraries/qca-qt5/default.nix @@ -12,6 +12,8 @@ stdenv.mkDerivation rec { buildInputs = [ openssl qtbase ]; nativeBuildInputs = [ cmake pkg-config ]; + dontWrapQtApps = true; + # Without this patch cmake fails with a "No known features for CXX compiler" # error on darwin patches = lib.optional stdenv.isDarwin ./move-project.patch ; diff --git a/pkgs/development/libraries/qmlbox2d/default.nix b/pkgs/development/libraries/qmlbox2d/default.nix index 88c94543045..f5257ad0e8e 100644 --- a/pkgs/development/libraries/qmlbox2d/default.nix +++ b/pkgs/development/libraries/qmlbox2d/default.nix @@ -9,6 +9,7 @@ stdenv.mkDerivation { }; enableParallelBuilding = true; + dontWrapQtApps = true; nativeBuildInputs = [ qmake ]; buildInputs = [ qtdeclarative ]; diff --git a/pkgs/development/libraries/qmltermwidget/default.nix b/pkgs/development/libraries/qmltermwidget/default.nix index 75f95a53800..7914af08df6 100644 --- a/pkgs/development/libraries/qmltermwidget/default.nix +++ b/pkgs/development/libraries/qmltermwidget/default.nix @@ -32,6 +32,8 @@ stdenv.mkDerivation { enableParallelBuilding = true; + dontWrapQtApps = true; + meta = { description = "A QML port of qtermwidget"; homepage = "https://github.com/Swordfish90/qmltermwidget"; diff --git a/pkgs/development/libraries/qoauth/default.nix b/pkgs/development/libraries/qoauth/default.nix index 8afa19c229f..2b0be6f0b3d 100644 --- a/pkgs/development/libraries/qoauth/default.nix +++ b/pkgs/development/libraries/qoauth/default.nix @@ -21,6 +21,8 @@ stdenv.mkDerivation { NIX_CFLAGS_COMPILE = "-I${qca-qt5}/include/Qca-qt5/QtCrypto"; NIX_LDFLAGS = "-lqca-qt5"; + dontWrapQtApps = true; + meta = with lib; { description = "Qt library for OAuth authentication"; inherit (qtbase.meta) platforms; diff --git a/pkgs/development/libraries/qscintilla/default.nix b/pkgs/development/libraries/qscintilla/default.nix index 26a3c2e36d3..314bdabdb55 100644 --- a/pkgs/development/libraries/qscintilla/default.nix +++ b/pkgs/development/libraries/qscintilla/default.nix @@ -35,6 +35,7 @@ in stdenv.mkDerivation rec { ''; enableParallelBuilding = true; + dontWrapQtApps = true; postPatch = '' substituteInPlace qscintilla.pro \ diff --git a/pkgs/development/libraries/qt-5/5.12/default.nix b/pkgs/development/libraries/qt-5/5.12/default.nix index cf5a0de11ad..e55b66d626a 100644 --- a/pkgs/development/libraries/qt-5/5.12/default.nix +++ b/pkgs/development/libraries/qt-5/5.12/default.nix @@ -145,7 +145,7 @@ let patches = patches.qtbase; inherit bison cups harfbuzz libGL; withGtk3 = true; inherit dconf gtk3; - inherit developerBuild decryptSslTraffic; + inherit debug developerBuild decryptSslTraffic; }; qtcharts = callPackage ../modules/qtcharts.nix {}; @@ -197,6 +197,7 @@ let qmake = makeSetupHook { deps = [ self.qtbase.dev ]; substitutions = { + inherit debug; fix_qmake_libtool = ../hooks/fix-qmake-libtool.sh; }; } ../hooks/qmake-hook.sh; diff --git a/pkgs/development/libraries/qt-5/5.14/default.nix b/pkgs/development/libraries/qt-5/5.14/default.nix index 7139a3b7354..7be50799275 100644 --- a/pkgs/development/libraries/qt-5/5.14/default.nix +++ b/pkgs/development/libraries/qt-5/5.14/default.nix @@ -149,7 +149,7 @@ let patches = patches.qtbase; inherit bison cups harfbuzz libGL; withGtk3 = true; inherit dconf gtk3; - inherit developerBuild decryptSslTraffic; + inherit debug developerBuild decryptSslTraffic; }; qtcharts = callPackage ../modules/qtcharts.nix {}; @@ -199,6 +199,7 @@ let qmake = makeSetupHook { deps = [ self.qtbase.dev ]; substitutions = { + inherit debug; fix_qmake_libtool = ../hooks/fix-qmake-libtool.sh; }; } ../hooks/qmake-hook.sh; diff --git a/pkgs/development/libraries/qt-5/5.15/default.nix b/pkgs/development/libraries/qt-5/5.15/default.nix index a3a0496f160..c3f6ab159c4 100644 --- a/pkgs/development/libraries/qt-5/5.15/default.nix +++ b/pkgs/development/libraries/qt-5/5.15/default.nix @@ -179,6 +179,7 @@ let qmake = makeSetupHook { deps = [ self.qtbase.dev ]; substitutions = { + inherit debug; fix_qmake_libtool = ../hooks/fix-qmake-libtool.sh; }; } ../hooks/qmake-hook.sh; diff --git a/pkgs/development/libraries/qt-5/hooks/qmake-hook.sh b/pkgs/development/libraries/qt-5/hooks/qmake-hook.sh index 7f6ddb76ad5..741225a5aa8 100644 --- a/pkgs/development/libraries/qt-5/hooks/qmake-hook.sh +++ b/pkgs/development/libraries/qt-5/hooks/qmake-hook.sh @@ -3,6 +3,9 @@ qmakeFlags=( ${qmakeFlags-} ) qmakePrePhase() { + qmakeFlags_orig=( "${qmakeFlags[@]}" ) + + # These flags must be added _before_ the flags specified in the derivation. qmakeFlags=( \ "PREFIX=$out" \ "NIX_OUTPUT_OUT=$out" \ @@ -11,8 +14,15 @@ qmakePrePhase() { "NIX_OUTPUT_DOC=${!outputDev}/${qtDocPrefix:?}" \ "NIX_OUTPUT_QML=${!outputBin}/${qtQmlPrefix:?}" \ "NIX_OUTPUT_PLUGIN=${!outputBin}/${qtPluginPrefix:?}" \ - "${qmakeFlags[@]}" \ ) + + if [ -n "@debug@" ]; then + qmakeFlags+=( "CONFIG+=debug" ) + else + qmakeFlags+=( "CONFIG+=release" ) + fi + + qmakeFlags+=( "${qmakeFlags_orig[@]}" ) } prePhases+=" qmakePrePhase" diff --git a/pkgs/development/libraries/qt-5/hooks/qtbase-setup-hook.sh b/pkgs/development/libraries/qt-5/hooks/qtbase-setup-hook.sh index 9f2a9f06f1a..1b57d676e1f 100644 --- a/pkgs/development/libraries/qt-5/hooks/qtbase-setup-hook.sh +++ b/pkgs/development/libraries/qt-5/hooks/qtbase-setup-hook.sh @@ -1,3 +1,14 @@ +if [[ -n "${__nix_qtbase-}" ]]; then + # Throw an error if a different version of Qt was already set up. + if [[ "$__nix_qtbase" != "@dev@" ]]; then + echo >&2 "Error: detected mismatched Qt dependencies:" + echo >&2 " @dev@" + echo >&2 " $__nix_qtbase" + exit 1 + fi +else # Only set up Qt once. +__nix_qtbase="@dev@" + qtPluginPrefix=@qtPluginPrefix@ qtQmlPrefix=@qtQmlPrefix@ qtDocPrefix=@qtDocPrefix@ @@ -5,6 +16,20 @@ qtDocPrefix=@qtDocPrefix@ . @fix_qt_builtin_paths@ . @fix_qt_module_paths@ +# Disable debug symbols if qtbase was built without debugging. +# This stops -dev paths from leaking into other outputs. +if [ -z "@debug@" ]; then + NIX_CFLAGS_COMPILE="${NIX_CFLAGS_COMPILE-}${NIX_CFLAGS_COMPILE:+ }-DQT_NO_DEBUG" +fi + +# Integration with CMake: +# Set the CMake build type corresponding to how qtbase was built. +if [ -n "@debug@" ]; then + cmakeBuildType="Debug" +else + cmakeBuildType="Release" +fi + providesQtRuntime() { [ -d "$1/$qtPluginPrefix" ] || [ -d "$1/$qtQmlPrefix" ] } @@ -19,7 +44,12 @@ export QMAKEPATH QMAKEMODULES= export QMAKEMODULES +declare -Ag qmakePathSeen=() qmakePathHook() { + # Skip this path if we have seen it before. + # MUST use 'if' because 'qmakePathSeen[$]' may be unset. + if [ -n "${qmakePathSeen[$1]-}" ]; then return; fi + qmakePathSeen[$1]=1 if [ -d "$1/mkspecs" ] then QMAKEMODULES="${QMAKEMODULES}${QMAKEMODULES:+:}/mkspecs" @@ -34,7 +64,12 @@ envBuildHostHooks+=(qmakePathHook) # package depending on the building package. (This is necessary in case # the building package does not provide runtime dependencies itself and so # would not be propagated to the user environment.) +declare -Ag qtEnvHostTargetSeen=() qtEnvHostTargetHook() { + # Skip this path if we have seen it before. + # MUST use 'if' because 'qmakePathSeen[$]' may be unset. + if [ -n "${qtEnvHostTargetSeen[$1]-}" ]; then return; fi + qtEnvHostTargetSeen[$1]=1 if providesQtRuntime "$1" && [ "z${!outputBin}" != "z${!outputDev}" ] then propagatedBuildInputs+=" $1" @@ -64,3 +99,14 @@ postPatchMkspecs() { if [ -z "${dontPatchMkspecs-}" ]; then postPhases="${postPhases-}${postPhases:+ }postPatchMkspecs" fi + +qtPreHook() { + # Check that wrapQtAppsHook is used, or it is explicitly disabled. + if [[ -z "$__nix_wrapQtAppsHook" && -z "$dontWrapQtApps" ]]; then + echo >&2 "Error: wrapQtAppsHook is not used, and dontWrapQtApps is not set." + exit 1 + fi +} +prePhases+=" qtPreHook" + +fi diff --git a/pkgs/development/libraries/qt-5/hooks/wrap-qt-apps-hook.sh b/pkgs/development/libraries/qt-5/hooks/wrap-qt-apps-hook.sh index 7356c8ee356..ce4d78fbb50 100644 --- a/pkgs/development/libraries/qt-5/hooks/wrap-qt-apps-hook.sh +++ b/pkgs/development/libraries/qt-5/hooks/wrap-qt-apps-hook.sh @@ -1,3 +1,6 @@ +if [[ -z "${__nix_wrapQtAppsHook-}" ]]; then +__nix_wrapQtAppsHook=1 # Don't run this hook more than once. + # Inherit arguments given in mkDerivation qtWrapperArgs=( ${qtWrapperArgs-} ) @@ -100,3 +103,5 @@ wrapQtAppsHook() { } fixupOutputHooks+=(wrapQtAppsHook) + +fi diff --git a/pkgs/development/libraries/qt-5/mkDerivation.nix b/pkgs/development/libraries/qt-5/mkDerivation.nix index 2c6333cb020..98f9a05fac7 100644 --- a/pkgs/development/libraries/qt-5/mkDerivation.nix +++ b/pkgs/development/libraries/qt-5/mkDerivation.nix @@ -9,21 +9,6 @@ args: let args_ = { - qmakeFlags = [ ("CONFIG+=" + (if debug then "debug" else "release")) ] - ++ (args.qmakeFlags or []); - - NIX_CFLAGS_COMPILE = toString ( - optional (!debug) "-DQT_NO_DEBUG" - ++ lib.toList (args.NIX_CFLAGS_COMPILE or [])); - - cmakeFlags = - (args.cmakeFlags or []) - ++ [ - ("-DCMAKE_BUILD_TYPE=" + (if debug then "Debug" else "Release")) - ]; - - enableParallelBuilding = args.enableParallelBuilding or true; - nativeBuildInputs = (args.nativeBuildInputs or []) ++ [ wrapQtAppsHook ]; }; diff --git a/pkgs/development/libraries/qt-5/modules/qtbase.nix b/pkgs/development/libraries/qt-5/modules/qtbase.nix index 24f1d6f81a2..0d0bef342b0 100644 --- a/pkgs/development/libraries/qt-5/modules/qtbase.nix +++ b/pkgs/development/libraries/qt-5/modules/qtbase.nix @@ -22,6 +22,7 @@ libGL, buildExamples ? false, buildTests ? false, + debug ? false, developerBuild ? false, decryptSslTraffic ? false }: @@ -33,12 +34,14 @@ let compareVersion = v: builtins.compareVersions version v; qmakeCacheName = if compareVersion "5.12.4" < 0 then ".qmake.cache" else ".qmake.stash"; + debugSymbols = debug || developerBuild; in stdenv.mkDerivation { name = "qtbase-${version}"; inherit qtCompatVersion src version; + debug = debugSymbols; propagatedBuildInputs = [ @@ -241,6 +244,7 @@ stdenv.mkDerivation { "-I" "${icu.dev}/include" "-pch" ] + ++ lib.optional debugSymbols "-debug" ++ lib.optionals (compareVersion "5.11.0" < 0) [ "-qml-debug" @@ -397,6 +401,8 @@ stdenv.mkDerivation { -e "/^host_bins=/ c host_bins=$dev/bin" ''; + dontStrip = debugSymbols; + setupHook = ../hooks/qtbase-setup-hook.sh; meta = with lib; { diff --git a/pkgs/development/libraries/qt-5/qtModule.nix b/pkgs/development/libraries/qt-5/qtModule.nix index 0481f000c6c..930ed9d67ba 100644 --- a/pkgs/development/libraries/qt-5/qtModule.nix +++ b/pkgs/development/libraries/qt-5/qtModule.nix @@ -34,6 +34,8 @@ mkDerivation (args // { fixQtBuiltinPaths . '*.pr?' ''; + dontWrapQtApps = args.dontWrapQtApps or true; + postFixup = '' if [ -d "''${!outputDev}/lib/pkgconfig" ]; then find "''${!outputDev}/lib/pkgconfig" -name '*.pc' | while read pc; do diff --git a/pkgs/development/libraries/qtinstaller/default.nix b/pkgs/development/libraries/qtinstaller/default.nix index 91f85371106..ce69c855ac2 100644 --- a/pkgs/development/libraries/qtinstaller/default.nix +++ b/pkgs/development/libraries/qtinstaller/default.nix @@ -18,6 +18,7 @@ stdenv.mkDerivation rec { setOutputFlags = false; enableParallelBuilding = true; NIX_QT_SUBMODULE = true; + dontWrapQtApps = true; installPhase = '' mkdir -p $out/{bin,lib,share/qt-installer-framework} diff --git a/pkgs/development/libraries/qtkeychain/default.nix b/pkgs/development/libraries/qtkeychain/default.nix index 6da4abb756e..3da0587210d 100644 --- a/pkgs/development/libraries/qtkeychain/default.nix +++ b/pkgs/development/libraries/qtkeychain/default.nix @@ -19,6 +19,8 @@ stdenv.mkDerivation rec { sha256 = "0h4wgngn2yl35hapbjs24amkjfbzsvnna4ixfhn87snjnq5lmjbc"; # v0.9.1 }; + dontWrapQtApps = true; + patches = (if withQt5 then [] else [ ./0001-Fixes-build-with-Qt4.patch ]) ++ (if stdenv.isDarwin then [ ./0002-Fix-install-name-Darwin.patch ] else []); cmakeFlags = [ "-DQT_TRANSLATIONS_DIR=share/qt/translations" ]; diff --git a/pkgs/development/libraries/qtpbfimageplugin/default.nix b/pkgs/development/libraries/qtpbfimageplugin/default.nix index 3558201015c..9dbc2491ad9 100644 --- a/pkgs/development/libraries/qtpbfimageplugin/default.nix +++ b/pkgs/development/libraries/qtpbfimageplugin/default.nix @@ -14,6 +14,8 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ qmake ]; buildInputs = [ qtbase protobuf ]; + dontWrapQtApps = true; + postPatch = '' # Fix plugin dir substituteInPlace pbfplugin.pro \ diff --git a/pkgs/development/libraries/qtutilities/default.nix b/pkgs/development/libraries/qtutilities/default.nix index 831c51fa234..f5398d92dfc 100644 --- a/pkgs/development/libraries/qtutilities/default.nix +++ b/pkgs/development/libraries/qtutilities/default.nix @@ -22,6 +22,8 @@ stdenv.mkDerivation rec { buildInputs = [ qtbase cpp-utilities ]; nativeBuildInputs = [ cmake qttools ]; + dontWrapQtApps = true; + meta = with lib; { homepage = "https://github.com/Martchus/qtutilities"; description = "Common C++ classes and routines used by @Martchus' applications featuring argument parser, IO and conversion utilities"; diff --git a/pkgs/development/libraries/qtwebkit-plugins/default.nix b/pkgs/development/libraries/qtwebkit-plugins/default.nix index 652c49aa6ca..5bc30db059e 100644 --- a/pkgs/development/libraries/qtwebkit-plugins/default.nix +++ b/pkgs/development/libraries/qtwebkit-plugins/default.nix @@ -14,6 +14,8 @@ stdenv.mkDerivation { buildInputs = [ qtwebkit hunspell ]; + dontWrapQtApps = true; + postPatch = '' sed -i "s,-lhunspell,-lhunspell-${lib.versions.majorMinor hunspell.version}," src/spellcheck/spellcheck.pri sed -i "s,\$\$\[QT_INSTALL_PLUGINS\],$out/$qtPluginPrefix," src/src.pro diff --git a/pkgs/development/libraries/quazip/default.nix b/pkgs/development/libraries/quazip/default.nix index 3f186314d01..a12d6cafe4a 100644 --- a/pkgs/development/libraries/quazip/default.nix +++ b/pkgs/development/libraries/quazip/default.nix @@ -15,6 +15,8 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake ] ++ lib.optional stdenv.isDarwin fixDarwinDylibNames; + dontWrapQtApps = true; + meta = with lib; { description = "Provides access to ZIP archives from Qt programs"; license = licenses.lgpl21Plus; diff --git a/pkgs/development/libraries/qwt/6.nix b/pkgs/development/libraries/qwt/6.nix index edfd3b4e24a..e5fad490f6e 100644 --- a/pkgs/development/libraries/qwt/6.nix +++ b/pkgs/development/libraries/qwt/6.nix @@ -17,6 +17,8 @@ stdenv.mkDerivation rec { qmakeFlags = [ "-after doc.path=$out/share/doc/${name}" ]; + dontWrapQtApps = true; + meta = with lib; { description = "Qt widgets for technical applications"; homepage = "http://qwt.sourceforge.net/"; diff --git a/pkgs/development/libraries/soqt/default.nix b/pkgs/development/libraries/soqt/default.nix index 2be6c662145..fe7901bddd5 100644 --- a/pkgs/development/libraries/soqt/default.nix +++ b/pkgs/development/libraries/soqt/default.nix @@ -17,6 +17,8 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake pkg-config ]; + dontWrapQtApps = true; + meta = with lib; { homepage = "https://github.com/coin3d/soqt"; license = licenses.bsd3; diff --git a/pkgs/development/libraries/telepathy/qt/default.nix b/pkgs/development/libraries/telepathy/qt/default.nix index b606c56445e..f61811428ce 100644 --- a/pkgs/development/libraries/telepathy/qt/default.nix +++ b/pkgs/development/libraries/telepathy/qt/default.nix @@ -20,6 +20,8 @@ in stdenv.mkDerivation rec { # On 0.9.7, they do not even build with QT4 cmakeFlags = lib.optional (!doCheck) "-DENABLE_TESTS=OFF"; + dontWrapQtApps = true; + doCheck = false; # giving up for now meta = with lib; { diff --git a/pkgs/development/libraries/vtk/generic.nix b/pkgs/development/libraries/vtk/generic.nix index 273bff8852e..85eaa1ae80e 100644 --- a/pkgs/development/libraries/vtk/generic.nix +++ b/pkgs/development/libraries/vtk/generic.nix @@ -57,6 +57,8 @@ in stdenv.mkDerivation rec { export LD_LIBRARY_PATH="$(pwd)/lib"; ''; + dontWrapQtApps = true; + # Shared libraries don't work, because of rpath troubles with the current # nixpkgs cmake approach. It wants to call a binary at build time, just # built and requiring one of the shared objects. |