summaryrefslogtreecommitdiffstats
path: root/pkgs/applications/editors/codeblocks
diff options
context:
space:
mode:
authorLinquize <linquize@yahoo.com.hk>2014-04-20 10:21:04 +0800
committerVladimír Čunát <vcunat@gmail.com>2014-05-13 12:59:19 +0200
commit977248ba15ddaab007d4eeb48aa6f1bee6527ec3 (patch)
tree6bc62319c7c7a3e80377f0a27c2e4550617a5242 /pkgs/applications/editors/codeblocks
parent11f1d0e377fbc951fa34b729400d1d190fc40299 (diff)
codeblocks: new package 13.12 (close #2533)
@vcunat: minor refactoring.
Diffstat (limited to 'pkgs/applications/editors/codeblocks')
-rw-r--r--pkgs/applications/editors/codeblocks/default.nix37
-rw-r--r--pkgs/applications/editors/codeblocks/writable-projects.patch18
2 files changed, 55 insertions, 0 deletions
diff --git a/pkgs/applications/editors/codeblocks/default.nix b/pkgs/applications/editors/codeblocks/default.nix
new file mode 100644
index 000000000000..73e9189e63aa
--- /dev/null
+++ b/pkgs/applications/editors/codeblocks/default.nix
@@ -0,0 +1,37 @@
+{ stdenv, fetchurl, autoconf, automake, libtool, pkgconfig, file, zip, wxGTK, gtk
+, contribPlugins ? false, hunspell, gamin , boost
+}:
+
+stdenv.mkDerivation rec {
+ name = "${pname}-${stdenv.lib.optionalString contribPlugins "full-"}${version}";
+ version = "13.12";
+ pname = "codeblocks";
+
+ src = fetchurl {
+ url = "mirror://sourceforge/codeblocks/Sources/${version}/codeblocks_${version}-1.tar.gz";
+ sha256 = "044njhps4cm1ijfdyr5f9wjyd0vblhrz9b4603ma52wcdq25093p";
+ };
+
+ buildInputs = [ automake autoconf libtool pkgconfig file zip wxGTK gtk ]
+ ++ stdenv.lib.optionals contribPlugins [ hunspell gamin boost ];
+ enableParallelBuilding = true;
+ patches = [ ./writable-projects.patch ];
+ preConfigure = "substituteInPlace ./configure --replace /usr/bin/file ${file}/bin/file";
+ postConfigure = "substituteInPlace libtool --replace ldconfig ${stdenv.gcc.libc}/sbin/ldconfig";
+ configureFlags = [ "--enable-pch=no" ]
+ ++ stdenv.lib.optional contribPlugins "--with-contrib-plugins";
+
+ meta = with stdenv.lib; {
+ maintainers = [ maintainers.linquize ];
+ platforms = platforms.all;
+ description = "The 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 = licenses.gpl3;
+ };
+}
diff --git a/pkgs/applications/editors/codeblocks/writable-projects.patch b/pkgs/applications/editors/codeblocks/writable-projects.patch
new file mode 100644
index 000000000000..3b6364a52a1c
--- /dev/null
+++ b/pkgs/applications/editors/codeblocks/writable-projects.patch
@@ -0,0 +1,18 @@
+diff --git a/src/plugins/scriptedwizard/wiz.cpp b/src/plugins/scriptedwizard/wiz.cpp
+index 0eb4b27..7d469fe 100644
+--- a/src/plugins/scriptedwizard/wiz.cpp
++++ b/src/plugins/scriptedwizard/wiz.cpp
+@@ -785,6 +785,13 @@ void Wiz::CopyFiles(cbProject* theproject, const wxString& prjdir, const wxStri
+ }
+ }
+ if (do_copy) wxCopyFile(srcfile, dstfile, true);
++ // Noticed! Files in Nix Store are readonly, so make the copied file writable
++ if (do_copy)
++ {
++ struct stat statbuf;
++ if (!::stat(dstfile.mb_str(), &statbuf))
++ ::chmod(dstfile.mb_str(), statbuf.st_mode | 0200);
++ }
+
+ // and add it to the project
+ fname.MakeRelativeTo(prjdir);