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).
This commit is contained in:
bbenoist 2013-09-30 15:15:25 +02:00
parent 36e31d5aad
commit 45851fc39a
3 changed files with 31 additions and 11 deletions

View File

@ -33,6 +33,9 @@ stdenv.mkDerivation rec {
sha256 = "0f51dbgn1dcck8pqimls2qyf1pfmsmyknh767cvw87c3d218ywpb";
};
# The version property must be kept because it will be included into the QtSDK package name
version = vers;
prePatch = ''
substituteInPlace configure --replace /bin/pwd pwd
substituteInPlace src/corelib/global/global.pri --replace /bin/ls ${coreutils}/bin/ls

View File

@ -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;
};
}

View File

@ -5438,6 +5438,16 @@ let
docs = true;
demos = true;
examples = true;
developerBuild = true;
};
qt4SDK = qtcreator.override {
sdkBuild = true;
qtLib = qt48Full;
};
qtcreator = callPackage ../development/qtcreator {
qtLib = qt48.override { developerBuild = true; };
};
qtscriptgenerator = callPackage ../development/libraries/qtscriptgenerator { };
@ -8511,8 +8521,6 @@ let
qsynth = callPackage ../applications/audio/qsynth { };
qtcreator = callPackage ../development/qtcreator { };
qtpfsgui = callPackage ../applications/graphics/qtpfsgui { };
qtractor = callPackage ../applications/audio/qtractor { };