1{
2 mkDerivation,
3 lib,
4 cmake,
5 gettext,
6 pkg-config,
7 extra-cmake-modules,
8 qtquickcontrols,
9 qttools,
10 kde-cli-tools,
11 kconfig,
12 kdeclarative,
13 kdoctools,
14 kiconthemes,
15 ki18n,
16 kitemmodels,
17 kitemviews,
18 kjobwidgets,
19 kcmutils,
20 kio,
21 knewstuff,
22 knotifyconfig,
23 kparts,
24 ktexteditor,
25 threadweaver,
26 kxmlgui,
27 kwindowsystem,
28 grantlee,
29 kcrash,
30 karchive,
31 kguiaddons,
32 plasma-framework,
33 krunner,
34 kdevelop-pg-qt,
35 shared-mime-info,
36 libkomparediff2,
37 libksysguard,
38 konsole,
39 llvmPackages_13,
40 makeWrapper,
41 kpurpose,
42 boost,
43 qtwebengine,
44 cppcheck,
45}:
46
47let
48 llvmPackages = llvmPackages_13;
49in
50mkDerivation {
51 pname = "kdevelop";
52
53 nativeBuildInputs = [
54 cmake
55 gettext
56 pkg-config
57 extra-cmake-modules
58 makeWrapper
59 ];
60
61 buildInputs = [
62 kdevelop-pg-qt
63 llvmPackages.llvm
64 llvmPackages.libclang
65 ];
66
67 propagatedBuildInputs = [
68 qtquickcontrols
69 boost
70 libkomparediff2
71 kconfig
72 kdeclarative
73 kdoctools
74 kiconthemes
75 ki18n
76 kitemmodels
77 kitemviews
78 kjobwidgets
79 kcmutils
80 kio
81 knewstuff
82 knotifyconfig
83 kparts
84 ktexteditor
85 threadweaver
86 kxmlgui
87 kwindowsystem
88 grantlee
89 plasma-framework
90 krunner
91 shared-mime-info
92 libksysguard
93 konsole
94 kcrash
95 karchive
96 kguiaddons
97 kpurpose
98 cppcheck
99 qtwebengine
100 ];
101
102 # https://cgit.kde.org/kdevelop.git/commit/?id=716372ae2e8dff9c51e94d33443536786e4bd85b
103 # required as nixos seems to be unable to find CLANG_BUILTIN_DIR
104 cmakeFlags = [
105 "-DCLANG_BUILTIN_DIR=${lib.getLib llvmPackages.libclang}/lib/clang/${lib.getVersion llvmPackages.clang}/include"
106 ];
107
108 dontWrapQtApps = true;
109
110 postInstall = ''
111 # The kdevelop! script (shell environment) needs qdbus and kioclient5 in PATH.
112 wrapProgram "$out/bin/kdevelop!" \
113 --prefix PATH ":" "${
114 lib.makeBinPath [
115 qttools
116 kde-cli-tools
117 ]
118 }"
119
120 wrapQtApp "$out/bin/kdevelop"
121
122 # Fix the (now wrapped) kdevelop! to find things in right places:
123 # - Fixup the one use where KDEV_BASEDIR is assumed to contain kdevelop.
124 kdev_fixup_sed+=";s|\\\$KDEV_BASEDIR/kdevelop|$out/bin/kdevelop|"
125 sed -E -i "$kdev_fixup_sed" "$out/bin/.kdevelop!-wrapped"
126 '';
127
128 meta = with lib; {
129 maintainers = [ maintainers.ambrop72 ];
130 platforms = platforms.linux;
131 description = "KDE official IDE";
132 longDescription = ''
133 A free, opensource IDE (Integrated Development Environment)
134 for MS Windows, Mac OsX, Linux, Solaris and FreeBSD. It is a
135 feature-full, plugin extendable IDE for C/C++ and other
136 programming languages. It is based on KDevPlatform, KDE and Qt
137 libraries and is under development since 1998.
138 '';
139 homepage = "https://www.kdevelop.org";
140 license = with licenses; [
141 gpl2Plus
142 lgpl2Plus
143 ];
144 };
145}