summaryrefslogtreecommitdiffstats
path: root/pkgs/by-name/co/codeblocks/package.nix
blob: 43e4eaef86c33e9441a1425b3f95f4cc55fa049a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
{
  lib,
  stdenv,
  fetchurl,
  fetchpatch,
  pkg-config,
  file,
  zip,
  wxwidgets_3_2,
  gtk3,
  contribPlugins ? false,
  hunspell,
  boost187,
  wrapGAppsHook3,
}:
let
  boost' = boost187;
in
stdenv.mkDerivation rec {
  name = "${pname}-${lib.optionalString contribPlugins "full-"}${version}";
  pname = "codeblocks";
  version = "25.03";

  src = fetchurl {
    url = "mirror://sourceforge/codeblocks/Sources/${version}/codeblocks_${version}.tar.xz";
    hash = "sha256-sPaqWQjTNtf0H5V2skGKx9J++8WSgqqMkXHYjOp0BJ4=";
  };

  nativeBuildInputs = [
    pkg-config
    file
    zip
    wrapGAppsHook3
  ];

  buildInputs = [
    wxwidgets_3_2
    gtk3
  ]
  ++ lib.optionals contribPlugins [
    hunspell
    boost'
  ];

  enableParallelBuilding = true;

  patches = [ ./writable-projects.patch ];

  preConfigure = "substituteInPlace ./configure --replace-fail /bin/file ${file}/bin/file";

  postConfigure = lib.optionalString stdenv.hostPlatform.isLinux "substituteInPlace libtool --replace ldconfig ${stdenv.cc.libc.bin}/bin/ldconfig";

  configureFlags = [
    "--enable-pch=no"
  ]
  ++ lib.optionals contribPlugins [
    (
      "--with-contrib-plugins=all,-FileManager"
      + lib.optionalString stdenv.hostPlatform.isDarwin ",-NassiShneiderman"
    )
    "--with-boost-libdir=${boost'}/lib"
  ];

  postInstall = lib.optionalString stdenv.hostPlatform.isDarwin ''
    ln -s $out/lib/codeblocks/plugins $out/share/codeblocks/plugins
  '';

  meta = {
    maintainers = [ ];
    platforms = lib.platforms.all;
    description = "Open source, cross platform, free C, C++ and Fortran IDE";
    longDescription = ''
      Code::Blocks is a free C, C++ and Fortran IDE built to meet the most demanding needs of its users.
      It is designed to be very extensible and fully configurable.
      Finally, an IDE with all the features you need, having a consistent look, feel and operation across platforms.
    '';
    homepage = "http://www.codeblocks.org";
    license = lib.licenses.gpl3;
  };
}