2019-09-19 08:04:54 +01:00
|
|
|
{ mkDerivation, lib, fetchurl, fetchgit, fetchpatch
|
2019-05-07 15:18:21 +01:00
|
|
|
, qtbase, qtquickcontrols, qtscript, qtdeclarative, qmake, llvmPackages_8
|
2015-12-20 03:45:37 +00:00
|
|
|
, withDocumentation ? false
|
|
|
|
}:
|
2013-09-30 14:15:25 +01:00
|
|
|
|
2019-09-19 08:04:54 +01:00
|
|
|
with lib;
|
2012-10-16 16:30:56 +01:00
|
|
|
|
|
|
|
let
|
2019-05-31 12:56:09 +01:00
|
|
|
baseVersion = "4.9";
|
|
|
|
revision = "1";
|
2019-05-07 15:18:21 +01:00
|
|
|
|
|
|
|
# Fetch clang from qt vendor, this contains submodules like this:
|
2019-07-05 16:42:08 +01:00
|
|
|
# clang<-clang-tools-extra<-clazy.
|
2019-08-13 22:52:01 +01:00
|
|
|
clang_qt_vendor = llvmPackages_8.clang-unwrapped.overrideAttrs (oldAttrs: {
|
2019-05-07 15:18:21 +01:00
|
|
|
src = fetchgit {
|
|
|
|
url = "https://code.qt.io/clang/clang.git";
|
|
|
|
rev = "c12b012bb7465299490cf93c2ae90499a5c417d5";
|
|
|
|
sha256 = "0mgmnazgr19hnd03xcrv7d932j6dpz88nhhx008b0lv4bah9mqm0";
|
|
|
|
};
|
|
|
|
unpackPhase = "";
|
|
|
|
});
|
2012-10-16 16:30:56 +01:00
|
|
|
in
|
|
|
|
|
2019-09-19 08:04:54 +01:00
|
|
|
mkDerivation rec {
|
2019-05-31 12:56:09 +01:00
|
|
|
pname = "qtcreator";
|
2016-12-29 19:30:05 +00:00
|
|
|
version = "${baseVersion}.${revision}";
|
2012-10-16 16:30:56 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2019-05-31 12:56:09 +01:00
|
|
|
url = "http://download.qt-project.org/official_releases/${pname}/${baseVersion}/${version}/qt-creator-opensource-src-${version}.tar.xz";
|
|
|
|
sha256 = "10ddp1365rf0z4bs7yzc9hajisp3j6mzjshyd0vpi4ki126j5f3r";
|
2012-10-16 16:30:56 +01:00
|
|
|
};
|
|
|
|
|
2019-05-07 15:18:21 +01:00
|
|
|
buildInputs = [ qtbase qtscript qtquickcontrols qtdeclarative llvmPackages_8.libclang clang_qt_vendor llvmPackages_8.llvm ];
|
2012-10-16 16:30:56 +01:00
|
|
|
|
2019-07-05 16:42:08 +01:00
|
|
|
nativeBuildInputs = [ qmake ];
|
2016-04-17 00:50:41 +01:00
|
|
|
|
2019-07-05 16:42:08 +01:00
|
|
|
# 0001-Fix-clang-libcpp-regexp.patch is for fixing regexp that is used to
|
2019-05-07 15:18:21 +01:00
|
|
|
# find clang libc++ library include paths. By default it's not covering paths
|
|
|
|
# like libc++-version, which is default name for libc++ folder in nixos.
|
2019-07-05 16:42:08 +01:00
|
|
|
patches = [ ./0001-Fix-clang-libcpp-regexp.patch
|
2019-05-07 15:18:21 +01:00
|
|
|
|
2019-07-05 16:42:08 +01:00
|
|
|
# Fix clazy plugin name. This plugin was renamed with clang8
|
|
|
|
# release, and patch didn't make it into 4.9.1 release. Should be removed
|
2019-05-07 15:18:21 +01:00
|
|
|
# on qtcreator update, if this problem is fixed.
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://code.qt.io/cgit/qt-creator/qt-creator.git/patch/src/plugins/clangcodemodel/clangeditordocumentprocessor.cpp?id=53c407bc0c87e0b65b537bf26836ddd8e00ead82";
|
|
|
|
sha256 = "1lanp7jg0x8jffajb852q8p4r34facg41l410xsz6s1k91jskbi9";
|
|
|
|
})
|
|
|
|
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://code.qt.io/cgit/qt-creator/qt-creator.git/patch/src/plugins/clangtools/clangtidyclazyrunner.cpp?id=53c407bc0c87e0b65b537bf26836ddd8e00ead82";
|
|
|
|
sha256 = "1rl0rc2l297lpfhhawvkkmj77zb081hhp0bbi7nnykf3q9ch0clh";
|
|
|
|
})
|
2019-07-05 16:42:08 +01:00
|
|
|
];
|
2019-05-07 15:18:21 +01:00
|
|
|
|
2016-09-06 12:59:03 +01:00
|
|
|
doCheck = true;
|
2012-10-16 16:30:56 +01:00
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2016-04-17 00:50:41 +01:00
|
|
|
buildFlags = optional withDocumentation "docs";
|
2014-08-02 19:21:03 +01:00
|
|
|
|
2016-04-17 00:50:41 +01:00
|
|
|
installFlags = [ "INSTALL_ROOT=$(out)" ] ++ optional withDocumentation "install_docs";
|
2012-10-16 16:30:56 +01:00
|
|
|
|
2018-01-04 04:04:03 +00:00
|
|
|
preConfigure = ''
|
|
|
|
substituteInPlace src/plugins/plugins.pro \
|
|
|
|
--replace '$$[QT_INSTALL_QML]/QtQuick/Controls' '${qtquickcontrols}/${qtbase.qtQmlPrefix}/QtQuick/Controls'
|
2019-05-07 15:18:21 +01:00
|
|
|
|
|
|
|
# Fix paths for llvm/clang includes directories.
|
|
|
|
substituteInPlace src/shared/clang/clang_defines.pri \
|
|
|
|
--replace '$$clean_path($${LLVM_LIBDIR}/clang/$${LLVM_VERSION}/include)' '${clang_qt_vendor}/lib/clang/8.0.0/include' \
|
|
|
|
--replace '$$clean_path($${LLVM_BINDIR})' '${clang_qt_vendor}/bin'
|
|
|
|
|
2019-07-05 16:42:08 +01:00
|
|
|
# Fix include path to find clang and clang-c include directories.
|
2019-05-07 15:18:21 +01:00
|
|
|
substituteInPlace src/plugins/clangtools/clangtools.pro \
|
|
|
|
--replace 'INCLUDEPATH += $$LLVM_INCLUDEPATH' 'INCLUDEPATH += $$LLVM_INCLUDEPATH ${clang_qt_vendor}'
|
|
|
|
|
|
|
|
# Fix paths to libclang library.
|
|
|
|
substituteInPlace src/shared/clang/clang_installation.pri \
|
|
|
|
--replace 'LIBCLANG_LIBS = -L$${LLVM_LIBDIR}' 'LIBCLANG_LIBS = -L${llvmPackages_8.libclang}/lib' \
|
|
|
|
--replace 'LIBCLANG_LIBS += $${CLANG_LIB}' 'LIBCLANG_LIBS += -lclang'
|
2018-01-04 04:04:03 +00:00
|
|
|
'';
|
|
|
|
|
2016-12-29 19:30:05 +00:00
|
|
|
preBuild = optional withDocumentation ''
|
2017-09-27 01:10:16 +01:00
|
|
|
ln -s ${getLib qtbase}/$qtDocPrefix $NIX_QT5_TMP/share
|
2016-12-29 19:30:05 +00:00
|
|
|
'';
|
|
|
|
|
2014-08-02 19:37:39 +01:00
|
|
|
postInstall = ''
|
2017-06-18 10:36:41 +01:00
|
|
|
substituteInPlace $out/share/applications/org.qt-project.qtcreator.desktop \
|
|
|
|
--replace "Exec=qtcreator" "Exec=$out/bin/qtcreator"
|
2014-08-02 19:37:39 +01:00
|
|
|
'';
|
|
|
|
|
2012-10-16 16:30:56 +01:00
|
|
|
meta = {
|
2013-10-06 10:49:53 +01:00
|
|
|
description = "Cross-platform IDE tailored to the needs of Qt developers";
|
2012-10-16 16:30:56 +01:00
|
|
|
longDescription = ''
|
2013-10-06 10:49:53 +01:00
|
|
|
Qt Creator is a cross-platform IDE (integrated development environment)
|
|
|
|
tailored to the needs of Qt developers. It includes features such as an
|
|
|
|
advanced code editor, a visual debugger and a GUI designer.
|
|
|
|
'';
|
2017-08-01 21:03:30 +01:00
|
|
|
homepage = https://wiki.qt.io/Category:Tools::QtCreator;
|
2012-10-16 16:30:56 +01:00
|
|
|
license = "LGPL";
|
2017-03-23 02:02:09 +00:00
|
|
|
maintainers = [ maintainers.akaWolf ];
|
2018-08-18 19:18:32 +01:00
|
|
|
platforms = [ "i686-linux" "x86_64-linux" "aarch64-linux" "armv7l-linux" ];
|
2012-10-16 16:30:56 +01:00
|
|
|
};
|
|
|
|
}
|