1{ mkDerivation, lib, cmake, gettext, pkg-config, extra-cmake-modules
2, qtquickcontrols, qttools, kde-cli-tools, qtbase
3, kconfig, kdeclarative, kdoctools, kiconthemes, ki18n, kitemmodels, kitemviews
4, kjobwidgets, kcmutils, kio, knewstuff, knotifyconfig, kparts, ktexteditor
5, threadweaver, kxmlgui, kwindowsystem, grantlee, kcrash, karchive, kguiaddons
6, plasma-framework, krunner, kdevelop-pg-qt, shared-mime-info, libkomparediff2
7, libksysguard, konsole, llvmPackages_13, makeWrapper, kpurpose, boost
8, qtwebengine, cppcheck
9}:
10
11let
12 llvmPackages = llvmPackages_13;
13in
14mkDerivation rec {
15 pname = "kdevelop";
16
17 nativeBuildInputs = [
18 cmake gettext pkg-config extra-cmake-modules makeWrapper
19 ];
20
21 buildInputs = [
22 kdevelop-pg-qt
23 llvmPackages.llvm llvmPackages.libclang
24 ];
25
26 propagatedBuildInputs = [
27 qtquickcontrols boost libkomparediff2
28 kconfig kdeclarative kdoctools kiconthemes ki18n kitemmodels kitemviews
29 kjobwidgets kcmutils kio knewstuff knotifyconfig kparts ktexteditor
30 threadweaver kxmlgui kwindowsystem grantlee plasma-framework krunner
31 shared-mime-info libksysguard konsole kcrash karchive kguiaddons kpurpose
32 cppcheck qtwebengine
33 ];
34
35 # https://cgit.kde.org/kdevelop.git/commit/?id=716372ae2e8dff9c51e94d33443536786e4bd85b
36 # required as nixos seems to be unable to find CLANG_BUILTIN_DIR
37 cmakeFlags = [
38 "-DCLANG_BUILTIN_DIR=${llvmPackages.libclang.lib}/lib/clang/${lib.getVersion llvmPackages.clang}/include"
39 ];
40
41 dontWrapQtApps = true;
42
43 postInstall = ''
44 # The kdevelop! script (shell environment) needs qdbus and kioclient5 in PATH.
45 wrapProgram "$out/bin/kdevelop!" \
46 --prefix PATH ":" "${lib.makeBinPath [ qttools kde-cli-tools ]}"
47
48 wrapQtApp "$out/bin/kdevelop"
49
50 # Fix the (now wrapped) kdevelop! to find things in right places:
51 # - Fixup the one use where KDEV_BASEDIR is assumed to contain kdevelop.
52 kdev_fixup_sed+=";s|\\\$KDEV_BASEDIR/kdevelop|$out/bin/kdevelop|"
53 sed -E -i "$kdev_fixup_sed" "$out/bin/.kdevelop!-wrapped"
54 '';
55
56 meta = with lib; {
57 maintainers = [ maintainers.ambrop72 ];
58 platforms = platforms.linux;
59 description = "KDE official IDE";
60 longDescription =
61 ''
62 A free, opensource IDE (Integrated Development Environment)
63 for MS Windows, Mac OsX, Linux, Solaris and FreeBSD. It is a
64 feature-full, plugin extendable IDE for C/C++ and other
65 programming languages. It is based on KDevPlatform, KDE and Qt
66 libraries and is under development since 1998.
67 '';
68 homepage = "https://www.kdevelop.org";
69 license = with licenses; [ gpl2Plus lgpl2Plus ];
70 };
71}