heroic: use qt6 version of kdialog (#372495)
[NixPkgs.git] / pkgs / by-name / co / codeblocks / package.nix
bloba9cfa5d99d179226ed31d814b5a66703ffd26e22
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,
17 stdenv.mkDerivation rec {
18   name = "${pname}-${lib.optionalString contribPlugins "full-"}${version}";
19   version = "20.03";
20   pname = "codeblocks";
22   src = fetchurl {
23     url = "mirror://sourceforge/codeblocks/Sources/${version}/codeblocks-${version}.tar.xz";
24     sha256 = "1idaksw1vacmm83krxh5zlb12kad3dkz9ixh70glw1gaibib7vhm";
25   };
27   nativeBuildInputs = [
28     pkg-config
29     file
30     zip
31     wrapGAppsHook3
32   ];
33   buildInputs =
34     [
35       wxGTK32
36       gtk3
37     ]
38     ++ lib.optionals contribPlugins [
39       hunspell
40       boost
41     ];
42   enableParallelBuilding = true;
43   patches = [
44     ./writable-projects.patch
45     ./fix-clipboard-flush.patch
46     # Fix build on non-x86 machines
47     (fetchpatch {
48       name = "remove-int3.patch";
49       url = "https://github.com/arnholm/codeblocks_sfmirror/commit/d76c015c456561d2c7987935a5f4dc6c0932b0c4.patch";
50       sha256 = "sha256-dpH33vGf2aNdYTeLwxglYDNbvwoY2bGSG6YFRyoGw+A=";
51     })
52     (fetchpatch {
53       name = "remove-pragmas.patch";
54       url = "https://github.com/arnholm/codeblocks_sfmirror/commit/966949d5ab7f3cb86e2a2c7ef4e853ee209b5a1a.patch";
55       sha256 = "sha256-XjejjGOvDk3gl1/n9R69XATGLj5n7tOZNyG8vIlwfyg=";
56     })
57     # Fix build with GCC 11
58     (fetchpatch {
59       name = "use-gcc11-openfilelist.patch";
60       url = "https://github.com/arnholm/codeblocks_sfmirror/commit/a5ea6ff7ff301d739d3dc8145db1578f504ee4ca.patch";
61       sha256 = "sha256-kATaLej8kJf4xm0VicHfRetOepX8O9gOhwdna0qylvQ=";
62     })
63     (fetchpatch {
64       name = "use-gcc11-ccmanager.patch";
65       url = "https://github.com/arnholm/codeblocks_sfmirror/commit/04b7c50fb8c6a29b2d84579ee448d2498414d855.patch";
66       sha256 = "sha256-VPy/M6IvNBxUE4hZRbLExFm0DJf4gmertrqrvsXQNz4=";
67     })
68     # Fix build with wxGTK 3.1.5
69     (fetchpatch {
70       name = "use-wxgtk315.patch";
71       url = "https://github.com/arnholm/codeblocks_sfmirror/commit/2345b020b862ec855038dd32a51ebb072647f28d.patch";
72       sha256 = "sha256-RRjwZA37RllnG8cJdBEnASpEd8z0+ru96fjntO42OvU=";
73     })
74     (fetchpatch {
75       name = "fix-taskbar-icons.patch";
76       url = "https://github.com/arnholm/codeblocks_sfmirror/commit/40eb88e3f2b933f19f9933e06c8d0899c54f5e25.patch";
77       hash = "sha256-Gj5gtxX5QNYAeF+QrPS/bBHLLEmflSxUHSLUK3GSs0I=";
78     })
79     (fetchpatch {
80       name = "fix-warnings.patch";
81       url = "https://github.com/arnholm/codeblocks_sfmirror/commit/56ac0396fad7a5b4bbb40bb8c4b5fe1755078aef.patch";
82       excludes = [ "src/src/environmentsettingsdlg.h" ];
83       hash = "sha256-tl4rF9iAf1TzCIbKhVFqcxvr1IiPdwqLYZg0SY5BJ7I=";
84     })
85     (fetchpatch {
86       name = "fix-getstring.patch";
87       url = "https://github.com/arnholm/codeblocks_sfmirror/commit/dbdf5c5ea9e3161233f0588a7616b7e4fedc7870.patch";
88       sha256 = "sha256-DrEMFluN8vs0LERa7ULGshl7HdejpsuvXAMjIr/K1fQ=";
89     })
90     # Fix build with wxGTK 3.1.6
91     (fetchpatch {
92       name = "remove-code-for-old-wx-1.patch";
93       url = "https://github.com/arnholm/codeblocks_sfmirror/commit/8035dfdff321754819f79e3165401aa59bd8c7f7.patch";
94       hash = "sha256-Z8Ap03W/XH5VwKFVudJr7rugb0BgI2dKJgQS4yIWbEM=";
95     })
96     (fetchpatch {
97       name = "remove-code-for-old-wx-2.patch";
98       url = "https://github.com/arnholm/codeblocks_sfmirror/commit/9a9c6a9d5e3e0f6eff5594ecd61a2222f073be9c.patch";
99       hash = "sha256-SwYixvbRuXQ+jA1ijmClWkzqzzr0viVuFOAsihGc5dM=";
100     })
101     (fetchpatch {
102       name = "remove-code-for-old-wx-3.patch";
103       url = "https://github.com/arnholm/codeblocks_sfmirror/commit/c28746f4887f10e6f9f10eeafae0fb22ecdbf9c7.patch";
104       hash = "sha256-1lcIiCnY2nBuUsffXC2rdglOE3ccIbogcgTx4M2Ee2I=";
105     })
106     (fetchpatch {
107       name = "fix-notebookstyles.patch";
108       url = "https://github.com/arnholm/codeblocks_sfmirror/commit/29315df024251850832583f73e67e515dae10830.patch";
109       hash = "sha256-Uc1V0eEbNljnN+1Dqb/35MLSSoLjyuRZMTofgcXRyb8=";
110     })
111     (fetchpatch {
112       name = "fix-regex.patch";
113       url = "https://github.com/arnholm/codeblocks_sfmirror/commit/46720043319758cb0e798eb23520063583c40eaa.patch";
114       hash = "sha256-Aix58T0JJcX/7VZukU/9i/nXh9GJywXC3yXEyUZK0js=";
115     })
116     (fetchpatch {
117       name = "fix-build-with-clang.patch";
118       url = "https://github.com/arnholm/codeblocks_sfmirror/commit/92cb2239662952e3b59b31e03edd653bb8066e64.patch";
119       hash = "sha256-XI7JW9Nuueb7muKpaC2icM/CxhrCJtO48cLHK+BVWXI=";
120     })
121     (fetchpatch {
122       name = "fix-build-with-clang-2.patch";
123       url = "https://github.com/arnholm/codeblocks_sfmirror/commit/edc6b145bcdcaf2823ef9c7da51a211f65d6f5d0.patch";
124       hash = "sha256-GuttBL4gp1IBn3ia2O8wtOR6xOSGrzwCKXwFLI3RO5o=";
125     })
126     (fetchpatch {
127       name = "fix-normalize.patch";
128       url = "https://github.com/archlinux/svntogit-community/raw/458eacb60bc0e71e3d333943cebbc41e75ed0956/trunk/sc_wxtypes-normalize.patch";
129       hash = "sha256-7wEwDLwuNUWHUwHjFyq74sHiuEha1VexRLEX42rPZSs=";
130     })
131     # Fix HiDPI
132     (fetchpatch {
133       name = "update-about-dialog.patch";
134       url = "https://github.com/arnholm/codeblocks_sfmirror/commit/a4aacc92640b587ad049cd6aa68c637e536e9ab5.patch";
135       hash = "sha256-2S4sVn+Dq5y9xcxCkzQ+WeR+qWxAOLbQUZEnk060RI0=";
136     })
137     (fetchpatch {
138       name = "add-display-info.patch";
139       url = "https://github.com/arnholm/codeblocks_sfmirror/commit/f2f127cf5cd97c7da6a957a3f7764cb25cc9017e.patch";
140       hash = "sha256-C0dVfC0NIHMXfWNlOwjzoGz5tmG2dlnU/EE92Jjebbs=";
141     })
142     (fetchpatch {
143       name = "fix-hidpi.patch";
144       url = "https://github.com/arnholm/codeblocks_sfmirror/commit/b2e4f1279804e1d11b71bc75eeb37072c3589296.patch";
145       hash = "sha256-/Xp6ww9C3V6I67tTA4MrGpSGo3J0MXzFjzQU7RxY84U=";
146     })
147   ];
148   preConfigure = "substituteInPlace ./configure --replace /usr/bin/file ${file}/bin/file";
149   postConfigure = lib.optionalString stdenv.hostPlatform.isLinux "substituteInPlace libtool --replace ldconfig ${stdenv.cc.libc.bin}/bin/ldconfig";
150   configureFlags =
151     [ "--enable-pch=no" ]
152     ++ lib.optionals contribPlugins [
153       (
154         "--with-contrib-plugins=all,-FileManager"
155         + lib.optionalString stdenv.hostPlatform.isDarwin ",-NassiShneiderman"
156       )
157       "--with-boost-libdir=${boost}/lib"
158     ];
159   postInstall = lib.optionalString stdenv.hostPlatform.isDarwin ''
160     ln -s $out/lib/codeblocks/plugins $out/share/codeblocks/plugins
161   '';
163   meta = with lib; {
164     maintainers = [ maintainers.linquize ];
165     platforms = platforms.all;
166     description = "Open source, cross platform, free C, C++ and Fortran IDE";
167     longDescription = ''
168       Code::Blocks is a free C, C++ and Fortran IDE built to meet the most demanding needs of its users.
169       It is designed to be very extensible and fully configurable.
170       Finally, an IDE with all the features you need, having a consistent look, feel and operation across platforms.
171     '';
172     homepage = "http://www.codeblocks.org";
173     license = licenses.gpl3;
174   };