diff options
Diffstat (limited to 'pkgs/development')
17 files changed, 167 insertions, 134 deletions
diff --git a/pkgs/development/libraries/qt-5/5.6/default.nix b/pkgs/development/libraries/qt-5/5.6/default.nix index 7996a316bdb6f..b286f8c529845 100644 --- a/pkgs/development/libraries/qt-5/5.6/default.nix +++ b/pkgs/development/libraries/qt-5/5.6/default.nix @@ -50,10 +50,6 @@ let outputs = args.outputs or [ "out" "dev" ]; - propagatedUserEnvPkgs = - (args.propagatedUserEnvPkgs or []) - ++ map getBin (args.propagatedBuildInputs or []); - qmakeFlags = (args.qmakeFlags or []) ++ optional (debug != null) @@ -90,7 +86,13 @@ let setupHook = ../qtsubmodule-setup-hook.sh; - meta = self.qtbase.meta // (args.meta or {}); + meta = { + homepage = http://www.qt.io; + description = "A cross-platform application framework for C++"; + license = with licenses; [ fdl13 gpl2 lgpl21 lgpl3 ]; + maintainers = with maintainers; [ qknight ttuegel periklis ]; + platforms = platforms.unix; + } // (args.meta or {}); }); addPackages = self: with self; diff --git a/pkgs/development/libraries/qt-5/5.8/default.nix b/pkgs/development/libraries/qt-5/5.8/default.nix index 57728ad13cee0..034c7fd10e1e9 100644 --- a/pkgs/development/libraries/qt-5/5.8/default.nix +++ b/pkgs/development/libraries/qt-5/5.8/default.nix @@ -41,10 +41,6 @@ let outputs = args.outputs or [ "out" "dev" ]; - propagatedUserEnvPkgs = - (args.propagatedUserEnvPkgs or []) - ++ map getBin (args.propagatedBuildInputs or []); - qmakeFlags = (args.qmakeFlags or []) ++ optional (debug != null) @@ -81,7 +77,13 @@ let setupHook = ../qtsubmodule-setup-hook.sh; - meta = self.qtbase.meta // (args.meta or {}); + meta = { + homepage = http://www.qt.io; + description = "A cross-platform application framework for C++"; + license = with licenses; [ fdl13 gpl2 lgpl21 lgpl3 ]; + maintainers = with maintainers; [ qknight ttuegel periklis ]; + platforms = platforms.unix; + } // (args.meta or {}); }); addPackages = self: with self; diff --git a/pkgs/development/libraries/qt-5/5.8/qtbase/default.nix b/pkgs/development/libraries/qt-5/5.8/qtbase/default.nix index 64e208a22b094..a627bcbee5286 100644 --- a/pkgs/development/libraries/qt-5/5.8/qtbase/default.nix +++ b/pkgs/development/libraries/qt-5/5.8/qtbase/default.nix @@ -76,7 +76,7 @@ stdenv.mkDerivation { [ bison flex gperf lndir perl pkgconfig python2 ] ++ lib.optional (!stdenv.isDarwin) patchelf; - outputs = [ "out" "dev" ]; + outputs = [ "out" "dev" "bin" ]; patches = copyPathsToStore (lib.readPathsFromFile ./. ./series); @@ -264,29 +264,32 @@ stdenv.mkDerivation { enableParallelBuilding = true; - postInstall = '' - find "$out" -name "*.cmake" | while read file; do - substituteInPlace "$file" \ - --subst-var-by NIX_OUT "$out" \ - --subst-var-by NIX_DEV "$dev" - done - ''; + postInstall = + # Hardcode some CMake module paths. + '' + find "$out" -name "*.cmake" | while read file; do + substituteInPlace "$file" \ + --subst-var-by NIX_OUT "$out" \ + --subst-var-by NIX_DEV "$dev" + done + ''; - preFixup = '' - # We cannot simply set these paths in configureFlags because libQtCore retains - # references to the paths it was built with. - moveToOutput "bin" "$dev" - moveToOutput "include" "$dev" - moveToOutput "mkspecs" "$dev" + preFixup = + # Move selected outputs. + '' + moveToOutput "bin" "$dev" + moveToOutput "include" "$dev" + moveToOutput "mkspecs" "$dev" - # The destination directory must exist or moveToOutput will do nothing - mkdir -p "$dev/share" - moveToOutput "share/doc" "$dev" - ''; + mkdir -p "$dev/share" + moveToOutput "share/doc" "$dev" + + moveToOutput "$qtPluginPrefix" "$bin" + ''; postFixup = + # Don't retain build-time dependencies like gdb. '' - # Don't retain build-time dependencies like gdb. sed '/QMAKE_DEFAULT_.*DIRS/ d' -i $dev/mkspecs/qconfig.pri '' diff --git a/pkgs/development/libraries/qt-5/5.8/qtconnectivity.nix b/pkgs/development/libraries/qt-5/5.8/qtconnectivity.nix index 95cd6fea79b40..1c10535c78530 100644 --- a/pkgs/development/libraries/qt-5/5.8/qtconnectivity.nix +++ b/pkgs/development/libraries/qt-5/5.8/qtconnectivity.nix @@ -3,4 +3,8 @@ qtSubmodule { name = "qtconnectivity"; qtInputs = [ qtbase qtdeclarative ]; + outputs = [ "out" "dev" "bin" ]; + postInstall = '' + moveToOutput "$qtQmlPrefix" "$bin" + ''; } diff --git a/pkgs/development/libraries/qt-5/5.8/qtdeclarative/default.nix b/pkgs/development/libraries/qt-5/5.8/qtdeclarative/default.nix index 6f2ff593f1e73..cc6653348859d 100644 --- a/pkgs/development/libraries/qt-5/5.8/qtdeclarative/default.nix +++ b/pkgs/development/libraries/qt-5/5.8/qtdeclarative/default.nix @@ -7,8 +7,14 @@ qtSubmodule { patches = copyPathsToStore (readPathsFromFile ./. ./series); qtInputs = [ qtbase qtsvg qtxmlpatterns ]; nativeBuildInputs = [ python2 ]; + outputs = [ "out" "dev" "bin" ]; preConfigure = '' NIX_CFLAGS_COMPILE+=" -DNIXPKGS_QML2_IMPORT_PREFIX=\"$qtQmlPrefix\"" ''; + + postInstall = '' + moveToOutput "$qtPluginPrefix" "$bin" + moveToOutput "$qtQmlPrefix" "$bin" + ''; } diff --git a/pkgs/development/libraries/qt-5/5.8/qtdoc.nix b/pkgs/development/libraries/qt-5/5.8/qtdoc.nix index 578ea6ba0b226..7f979ee94c0fb 100644 --- a/pkgs/development/libraries/qt-5/5.8/qtdoc.nix +++ b/pkgs/development/libraries/qt-5/5.8/qtdoc.nix @@ -3,4 +3,5 @@ qtSubmodule { name = "qtdoc"; qtInputs = [ qtdeclarative ]; + outputs = [ "out" ]; } diff --git a/pkgs/development/libraries/qt-5/5.8/qtlocation.nix b/pkgs/development/libraries/qt-5/5.8/qtlocation.nix index 1e134057c4b47..0eabe04e478c0 100644 --- a/pkgs/development/libraries/qt-5/5.8/qtlocation.nix +++ b/pkgs/development/libraries/qt-5/5.8/qtlocation.nix @@ -3,4 +3,9 @@ qtSubmodule { name = "qtlocation"; qtInputs = [ qtbase qtmultimedia ]; + outputs = [ "out" "dev" "bin" ]; + postInstall = '' + moveToOutput "$qtPluginPrefix" "$bin" + moveToOutput "$qtQmlPrefix" "$bin" + ''; } diff --git a/pkgs/development/libraries/qt-5/5.8/qtmultimedia.nix b/pkgs/development/libraries/qt-5/5.8/qtmultimedia.nix index 1c2dcc90d41a2..e133256e9004e 100644 --- a/pkgs/development/libraries/qt-5/5.8/qtmultimedia.nix +++ b/pkgs/development/libraries/qt-5/5.8/qtmultimedia.nix @@ -10,6 +10,11 @@ qtSubmodule { qtInputs = [ qtbase qtdeclarative ]; buildInputs = [ pkgconfig gstreamer gst-plugins-base libpulseaudio] ++ optional (stdenv.isLinux) alsaLib; + outputs = [ "out" "dev" "bin" ]; qmakeFlags = [ "GST_VERSION=1.0" ]; NIX_LDFLAGS = optionalString (stdenv.isDarwin) "-lobjc"; + postInstall = '' + moveToOutput "$qtPluginPrefix" "$bin" + moveToOutput "$qtQmlPrefix" "$bin" + ''; } diff --git a/pkgs/development/libraries/qt-5/5.8/qtquickcontrols2.nix b/pkgs/development/libraries/qt-5/5.8/qtquickcontrols2.nix index 19750f2fd99d8..1a52d1802cee3 100644 --- a/pkgs/development/libraries/qt-5/5.8/qtquickcontrols2.nix +++ b/pkgs/development/libraries/qt-5/5.8/qtquickcontrols2.nix @@ -3,4 +3,8 @@ qtSubmodule { name = "qtquickcontrols2"; qtInputs = [ qtdeclarative ]; + outputs = [ "out" "dev" "bin" ]; + postInstall = '' + moveToOutput "$qtQmlPrefix" "$bin" + ''; } diff --git a/pkgs/development/libraries/qt-5/5.8/qtsensors.nix b/pkgs/development/libraries/qt-5/5.8/qtsensors.nix index 7bb18f56fe2ec..75829d3f0aafc 100644 --- a/pkgs/development/libraries/qt-5/5.8/qtsensors.nix +++ b/pkgs/development/libraries/qt-5/5.8/qtsensors.nix @@ -5,4 +5,9 @@ with stdenv.lib; qtSubmodule { name = "qtsensors"; qtInputs = [ qtbase qtdeclarative ]; + outputs = [ "out" "dev" "bin" ]; + postInstall = '' + moveToOutput "$qtPluginPrefix" "$bin" + moveToOutput "$qtQmlPrefix" "$bin" + ''; } diff --git a/pkgs/development/libraries/qt-5/5.8/qtsvg.nix b/pkgs/development/libraries/qt-5/5.8/qtsvg.nix index b9ccac7cf9331..0e21cf89340a9 100644 --- a/pkgs/development/libraries/qt-5/5.8/qtsvg.nix +++ b/pkgs/development/libraries/qt-5/5.8/qtsvg.nix @@ -3,4 +3,8 @@ qtSubmodule { name = "qtsvg"; qtInputs = [ qtbase ]; + outputs = [ "out" "dev" "bin" ]; + postInstall = '' + moveToOutput "$qtPluginPrefix" "$bin" + ''; } diff --git a/pkgs/development/libraries/qt-5/5.8/qttools/default.nix b/pkgs/development/libraries/qt-5/5.8/qttools/default.nix index 6fa5390855d01..6c0f540e79b6a 100644 --- a/pkgs/development/libraries/qt-5/5.8/qttools/default.nix +++ b/pkgs/development/libraries/qt-5/5.8/qttools/default.nix @@ -5,10 +5,10 @@ with stdenv.lib; qtSubmodule { name = "qttools"; qtInputs = [ qtbase ]; - + outputs = [ "out" "dev" "bin" ]; patches = copyPathsToStore (readPathsFromFile ./. ./series); - postFixup = '' - moveToOutput "bin/qdbus" "$out" - moveToOutput "bin/qtpaths" "$out" + postInstall = '' + moveToOutput "bin/qdbus" "$bin" + moveToOutput "bin/qtpaths" "$bin" ''; } diff --git a/pkgs/development/libraries/qt-5/5.8/qtwayland.nix b/pkgs/development/libraries/qt-5/5.8/qtwayland.nix index 6d887f7c650b0..7b7bd2f6ebcc4 100644 --- a/pkgs/development/libraries/qt-5/5.8/qtwayland.nix +++ b/pkgs/development/libraries/qt-5/5.8/qtwayland.nix @@ -5,4 +5,9 @@ qtSubmodule { qtInputs = [ qtbase qtquickcontrols ]; buildInputs = [ wayland ]; nativeBuildInputs = [ pkgconfig ]; + outputs = [ "out" "dev" "bin" ]; + postInstall = '' + moveToOutput "$qtPluginPrefix" "$bin" + moveToOutput "$qtQmlPrefix "$bin" + ''; } diff --git a/pkgs/development/libraries/qt-5/5.8/qtwebchannel.nix b/pkgs/development/libraries/qt-5/5.8/qtwebchannel.nix index fd7a3c52026ed..50a539dbe7296 100644 --- a/pkgs/development/libraries/qt-5/5.8/qtwebchannel.nix +++ b/pkgs/development/libraries/qt-5/5.8/qtwebchannel.nix @@ -3,5 +3,9 @@ qtSubmodule { name = "qtwebchannel"; qtInputs = [ qtbase qtdeclarative ]; + outputs = [ "out" "dev" "bin" ]; + postInstall = '' + moveToOutput "$qtQmlPrefix" "$bin" + ''; } diff --git a/pkgs/development/libraries/qt-5/5.8/qtwebengine/default.nix b/pkgs/development/libraries/qt-5/5.8/qtwebengine/default.nix index 37f12eed758c1..871fb21c10658 100644 --- a/pkgs/development/libraries/qt-5/5.8/qtwebengine/default.nix +++ b/pkgs/development/libraries/qt-5/5.8/qtwebengine/default.nix @@ -25,6 +25,7 @@ qtSubmodule { buildInputs = [ bison flex git which gperf ]; nativeBuildInputs = [ pkgconfig python2 coreutils ]; doCheck = true; + outputs = [ "out" "dev" "bin" ]; enableParallelBuilding = true; @@ -90,5 +91,7 @@ qtSubmodule { EOF paxmark m $out/libexec/QtWebEngineProcess + + moveToOutput "$qtQmlPrefix" "$bin" ''; } diff --git a/pkgs/development/libraries/qt-5/5.8/qtwebsockets.nix b/pkgs/development/libraries/qt-5/5.8/qtwebsockets.nix index fbdfbbcf0dbed..925adce75a92c 100644 --- a/pkgs/development/libraries/qt-5/5.8/qtwebsockets.nix +++ b/pkgs/development/libraries/qt-5/5.8/qtwebsockets.nix @@ -3,4 +3,8 @@ qtSubmodule { name = "qtwebsockets"; qtInputs = [ qtbase qtdeclarative ]; + outputs = [ "out" "dev" "bin" ]; + postInstall = '' + moveToOutput "$qtQmlPrefix" "$bin" + ''; } diff --git a/pkgs/development/libraries/qt-5/qtbase-setup-hook.sh b/pkgs/development/libraries/qt-5/qtbase-setup-hook.sh index 66f5d3f5818af..35df52d7a083d 100644 --- a/pkgs/development/libraries/qt-5/qtbase-setup-hook.sh +++ b/pkgs/development/libraries/qt-5/qtbase-setup-hook.sh @@ -2,72 +2,54 @@ qtPluginPrefix=@qtPluginPrefix@ qtQmlPrefix=@qtQmlPrefix@ qtDocPrefix=@qtDocPrefix@ -addToSearchPathOnceWithCustomDelimiter() { - local delim="$1" - local search="$2" - local target="$3" - local dirs - local exported - IFS="$delim" read -a dirs <<< "${!search}" - local canonical - if canonical=$(readlink -e "$target"); then - for dir in ${dirs[@]}; do - if [ "z$dir" == "z$canonical" ]; then exported=1; fi - done - if [ -z $exported ]; then - eval "export ${search}=\"${!search}${!search:+$delim}$canonical\"" - fi - fi -} - -addToSearchPathOnce() { - addToSearchPathOnceWithCustomDelimiter ':' "$@" -} +NIX_QT5_MODULES="${NIX_QT5_MODULES}${NIX_QT5_MODULES:+:}@out@" +NIX_QT5_MODULES_DEV="${NIX_QT5_MODULES_DEV}${NIX_QT5_MODULES_DEV:+:}@dev@" -propagateOnce() { - addToSearchPathOnceWithCustomDelimiter ' ' "$@" +providesQtRuntime() { + [ -d "$1/$qtPluginPrefix" ] || [ -d "$1/$qtQmlPrefix" ] } -_qtPropagate() { - for dir in $qtPluginPrefix $qtQmlPrefix; do - if [ -d "$1/$dir" ]; then - propagateOnce propagatedBuildInputs "$1" - break - fi - done - addToSearchPathOnce QT_PLUGIN_PATH "$1/$qtPluginPrefix" - addToSearchPathOnce QML2_IMPORT_PATH "$1/$qtQmlPrefix" +# Propagate any runtime dependency of the building package. +# Each dependency is propagated to the user environment and as a build +# input so that it will be re-propagated to the user environment by any +# 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.) +_qtCrossEnvHook() { + if providesQtRuntime "$1"; then + propagatedBuildInputs+=" $1" + propagatedUserEnvPkgs+=" $1" + fi } +if [ -z "$NIX_QT5_TMP" ]; then + crossEnvHooks+=(_qtCrossEnvHook) +fi -crossEnvHooks+=(_qtPropagate) - -_qtPropagateNative() { - for dir in $qtPluginPrefix $qtQmlPrefix; do - if [ -d "$1/$dir" ]; then - propagateOnce propagatedNativeBuildInputs "$1" - break +_qtEnvHook() { + if providesQtRuntime "$1"; then + propagatedNativeBuildInputs+=" $1" + if [ -z "$crossConfig" ]; then + propagatedUserEnvPkgs+=" $1" fi - done - if [ -z "$crossConfig" ]; then - addToSearchPathOnce QT_PLUGIN_PATH "$1/$qtPluginPrefix" - addToSearchPathOnce QML2_IMPORT_PATH "$1/$qtQmlPrefix" fi } +if [ -z "$NIX_QT5_TMP" ]; then + envHooks+=(_qtEnvHook) +fi -envHooks+=(_qtPropagateNative) - -_qtMultioutDevs() { - # This is necessary whether the package is a Qt module or not +_qtPreFixupHook() { moveToOutput "mkspecs" "${!outputDev}" } +if [ -z "$NIX_QT5_TMP" ]; then + preFixupHooks+=(_qtPreFixupHook) +fi -preFixupHooks+=(_qtMultioutDevs) - -_qtSetCMakePrefix() { - export CMAKE_PREFIX_PATH="$NIX_QT5_TMP${CMAKE_PREFIX_PATH:+:}${CMAKE_PREFIX_PATH}" -} - -_qtRmTmp() { +_qtPostInstallHook() { + # Clean up temporary installation files created by this setup hook. + # For building Qt modules, this is necessary to prevent including + # dependencies in the output. For all other packages, this is necessary + # to induce patchelf to remove the temporary paths from the RPATH of + # dynamically-linked objects. if [ -z "$NIX_QT_SUBMODULE" ]; then rm -fr "$NIX_QT5_TMP" else @@ -85,11 +67,51 @@ _qtRmTmp() { rm "$NIX_QT5_TMP/nix-support/qt-inputs" fi + + # Patch CMake modules + if [ -n "$NIX_QT_SUBMODULE" ]; then + find "${!outputLib}" -name "*.cmake" | while read file; do + substituteInPlace "$file" \ + --subst-var-by NIX_OUT "${!outputLib}" \ + --subst-var-by NIX_DEV "${!outputDev}" + done + fi +} +if [ -z "$NIX_QT5_TMP" ]; then + preConfigureHooks+=(_qtPreConfigureHook) +fi + +_qtLinkModuleDir() { + if [ -d "$1/$2" ]; then + @lndir@/bin/lndir -silent "$1/$2" "$NIX_QT5_TMP/$2" + find "$1/$2" -printf "$2/%P\n" >> "$NIX_QT5_TMP/nix-support/qt-inputs" + fi } -_qtSetQmakePath() { +_qtPreConfigureHook() { + # Find the temporary qmake executable first. + # This must run after all the environment hooks! export PATH="$NIX_QT5_TMP/bin${PATH:+:}$PATH" + + # Link all runtime module dependencies into the temporary directory. + IFS=: read -a modules <<< $NIX_QT5_MODULES + for module in ${modules[@]}; do + _qtLinkModuleDir "$module" "lib" + done + + # Link all the build-time module dependencies into the temporary directory. + IFS=: read -a modules <<< $NIX_QT5_MODULES_DEV + for module in ${modules[@]}; do + _qtLinkModuleDir "$module" "bin" + _qtLinkModuleDir "$module" "include" + _qtLinkModuleDir "$module" "lib" + _qtLinkModuleDir "$module" "mkspecs" + _qtLinkModuleDir "$module" "share" + done } +if [ -z "$NIX_QT5_TMP" ]; then + postInstallHooks+=(_qtPostInstallHook) +fi if [ -z "$NIX_QT5_TMP" ]; then if [ -z "$NIX_QT_SUBMODULE" ]; then @@ -97,7 +119,6 @@ if [ -z "$NIX_QT5_TMP" ]; then else NIX_QT5_TMP=$out fi - postInstallHooks+=(_qtRmTmp) mkdir -p "$NIX_QT5_TMP/nix-support" for subdir in bin include lib mkspecs share; do @@ -105,8 +126,6 @@ if [ -z "$NIX_QT5_TMP" ]; then echo "$subdir/" >> "$NIX_QT5_TMP/nix-support/qt-inputs" done - postHooks+=(_qtSetCMakePrefix) - cp "@dev@/bin/qmake" "$NIX_QT5_TMP/bin" echo "bin/qmake" >> "$NIX_QT5_TMP/nix-support/qt-inputs" @@ -120,48 +139,5 @@ EOF echo "bin/qt.conf" >> "$NIX_QT5_TMP/nix-support/qt-inputs" export QMAKE="$NIX_QT5_TMP/bin/qmake" - - # Set PATH to find qmake first in a preConfigure hook - # It must run after all the envHooks! - preConfigureHooks+=(_qtSetQmakePath) fi -qt5LinkModuleDir() { - if [ -d "$1/$2" ]; then - @lndir@/bin/lndir -silent "$1/$2" "$NIX_QT5_TMP/$2" - find "$1/$2" -printf "$2/%P\n" >> "$NIX_QT5_TMP/nix-support/qt-inputs" - fi -} - -NIX_QT5_MODULES="${NIX_QT5_MODULES}${NIX_QT5_MODULES:+:}@out@" -NIX_QT5_MODULES_DEV="${NIX_QT5_MODULES_DEV}${NIX_QT5_MODULES_DEV:+:}@dev@" - -_qtLinkAllModules() { - IFS=: read -a modules <<< $NIX_QT5_MODULES - for module in ${modules[@]}; do - qt5LinkModuleDir "$module" "lib" - done - - IFS=: read -a modules <<< $NIX_QT5_MODULES_DEV - for module in ${modules[@]}; do - qt5LinkModuleDir "$module" "bin" - qt5LinkModuleDir "$module" "include" - qt5LinkModuleDir "$module" "lib" - qt5LinkModuleDir "$module" "mkspecs" - qt5LinkModuleDir "$module" "share" - done -} - -preConfigureHooks+=(_qtLinkAllModules) - -_qtFixCMakePaths() { - find "${!outputLib}" -name "*.cmake" | while read file; do - substituteInPlace "$file" \ - --subst-var-by NIX_OUT "${!outputLib}" \ - --subst-var-by NIX_DEV "${!outputDev}" - done -} - -if [ -n "$NIX_QT_SUBMODULE" ]; then - postInstallHooks+=(_qtFixCMakePaths) -fi |