diff options
author | bbenoist <return_0@live.com> | 2013-09-30 15:15:25 +0200 |
---|---|---|
committer | bbenoist <return_0@live.com> | 2013-10-21 09:36:45 +0200 |
commit | 45851fc39abb0172c8c16b66913e22344da8c3fb (patch) | |
tree | 816184a96e13a01c211a756ab4ab89c0171376d3 /pkgs/development/qtcreator | |
parent | 36e31d5aadf75a958dc5c57f98879d6698cd6b4b (diff) |
qtcreator: Make the qt package optional and introduce the QtSDK
To give the ability to use a different Qt version than the default one
(which can build 3 different times Qt Libraries if we mixed the default
one, the qtcreator one and the version including all the examples and the
docs).
Right now a developer can choose to directly install the QtSDK which
includes a "full" (developerBuild + docs + examples) Qt version and uses
it to build QtCreator.
The possibility to only install QtCreator and its previous behavior has
been kept for flexibility purposes (we do not need to force someone on the
SDK approach).
Diffstat (limited to 'pkgs/development/qtcreator')
-rw-r--r-- | pkgs/development/qtcreator/default.nix | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/pkgs/development/qtcreator/default.nix b/pkgs/development/qtcreator/default.nix index 6cfe5efbe815..b12f81db9c4c 100644 --- a/pkgs/development/qtcreator/default.nix +++ b/pkgs/development/qtcreator/default.nix @@ -1,30 +1,39 @@ -{ stdenv, fetchurl, qt48 }: +{ stdenv, fetchurl, qtLib, sdkBuild ? false }: + +with stdenv.lib; let baseVersion = "2.8"; revision = "1"; version = "${baseVersion}.${revision}"; - qt4_for_qtcreator = qt48.override { - developerBuild = true; - }; in stdenv.mkDerivation rec { - name = "qtcreator-${version}"; + # The package name depends on wether we are just building the QtCreator package or the whole Qt SDK + # If we are building the QtCreator package: qtcreator-version + # If we are building the QtSDK package, the Qt version is also included: qtsdk-version-qt-version + name = "qt${if sdkBuild then "sdk" else "creator"}-${version}" + + optionalString sdkBuild "-qt-${qtLib.version}"; src = fetchurl { url = "http://download.qt-project.org/official_releases/qtcreator/${baseVersion}/${version}/qt-creator-${version}-src.tar.gz"; sha256 = "d5ae007a297a4288d0e95fd605edbfb8aee80f6788c7a6cfb9cb297f50c364b9"; }; - buildInputs = [ qt4_for_qtcreator ]; + # This property can be used in a nix development environment to refer to the Qt package + # eg: export QTDIR=${qtSDK.qt} + qt = qtLib; + + # We must only propagate Qt (including qmake) when building the QtSDK + propagatedBuildInputs = if sdkBuild then [ qtLib ] else []; + buildInputs = if sdkBuild == false then [ qtLib ] else []; doCheck = false; enableParallelBuilding = true; preConfigure = '' - qmake -spec linux-g++ "QT_PRIVATE_HEADERS=${qt4_for_qtcreator}/include" qtcreator.pro + qmake -spec linux-g++ "QT_PRIVATE_HEADERS=${qtLib}/include" qtcreator.pro ''; installFlags = "INSTALL_ROOT=$(out)"; @@ -38,7 +47,7 @@ stdenv.mkDerivation rec { ''; homepage = "http://qt-project.org/wiki/Category:Tools::QtCreator"; license = "LGPL"; - maintainers = [ stdenv.lib.maintainers.bbenoist ]; - platforms = stdenv.lib.platforms.all; + maintainers = [ maintainers.bbenoist ]; + platforms = platforms.all; }; } |