1{
2 lib,
3 stdenv,
4 fetchurl,
5 fetchpatch,
6 pkg-config,
7 file,
8 zip,
9 wxGTK32,
10 gtk3,
11 contribPlugins ? false,
12 hunspell,
13 boost,
14 wrapGAppsHook3,
15}:
16
17stdenv.mkDerivation rec {
18 name = "${pname}-${lib.optionalString contribPlugins "full-"}${version}";
19 pname = "codeblocks";
20 version = "25.03";
21
22 src = fetchurl {
23 url = "mirror://sourceforge/codeblocks/Sources/${version}/codeblocks_${version}.tar.xz";
24 hash = "sha256-sPaqWQjTNtf0H5V2skGKx9J++8WSgqqMkXHYjOp0BJ4=";
25 };
26
27 nativeBuildInputs = [
28 pkg-config
29 file
30 zip
31 wrapGAppsHook3
32 ];
33
34 buildInputs = [
35 wxGTK32
36 gtk3
37 ]
38 ++ lib.optionals contribPlugins [
39 hunspell
40 boost
41 ];
42
43 enableParallelBuilding = true;
44
45 patches = [ ./writable-projects.patch ];
46
47 preConfigure = "substituteInPlace ./configure --replace-fail /bin/file ${file}/bin/file";
48
49 postConfigure = lib.optionalString stdenv.hostPlatform.isLinux "substituteInPlace libtool --replace ldconfig ${stdenv.cc.libc.bin}/bin/ldconfig";
50
51 configureFlags = [
52 "--enable-pch=no"
53 ]
54 ++ lib.optionals contribPlugins [
55 (
56 "--with-contrib-plugins=all,-FileManager"
57 + lib.optionalString stdenv.hostPlatform.isDarwin ",-NassiShneiderman"
58 )
59 "--with-boost-libdir=${boost}/lib"
60 ];
61
62 postInstall = lib.optionalString stdenv.hostPlatform.isDarwin ''
63 ln -s $out/lib/codeblocks/plugins $out/share/codeblocks/plugins
64 '';
65
66 meta = {
67 maintainers = [ lib.maintainers.linquize ];
68 platforms = lib.platforms.all;
69 description = "Open source, cross platform, free C, C++ and Fortran IDE";
70 longDescription = ''
71 Code::Blocks is a free C, C++ and Fortran IDE built to meet the most demanding needs of its users.
72 It is designed to be very extensible and fully configurable.
73 Finally, an IDE with all the features you need, having a consistent look, feel and operation across platforms.
74 '';
75 homepage = "http://www.codeblocks.org";
76 license = lib.licenses.gpl3;
77 };
78}