codeblocks: new package 13.12 (close #2533)

@vcunat: minor refactoring.

authored by Linquize and committed by Vladimír Čunát 977248ba 11f1d0e3

+58
+37
pkgs/applications/editors/codeblocks/default.nix
··· 1 + { stdenv, fetchurl, autoconf, automake, libtool, pkgconfig, file, zip, wxGTK, gtk 2 + , contribPlugins ? false, hunspell, gamin , boost 3 + }: 4 + 5 + stdenv.mkDerivation rec { 6 + name = "${pname}-${stdenv.lib.optionalString contribPlugins "full-"}${version}"; 7 + version = "13.12"; 8 + pname = "codeblocks"; 9 + 10 + src = fetchurl { 11 + url = "mirror://sourceforge/codeblocks/Sources/${version}/codeblocks_${version}-1.tar.gz"; 12 + sha256 = "044njhps4cm1ijfdyr5f9wjyd0vblhrz9b4603ma52wcdq25093p"; 13 + }; 14 + 15 + buildInputs = [ automake autoconf libtool pkgconfig file zip wxGTK gtk ] 16 + ++ stdenv.lib.optionals contribPlugins [ hunspell gamin boost ]; 17 + enableParallelBuilding = true; 18 + patches = [ ./writable-projects.patch ]; 19 + preConfigure = "substituteInPlace ./configure --replace /usr/bin/file ${file}/bin/file"; 20 + postConfigure = "substituteInPlace libtool --replace ldconfig ${stdenv.gcc.libc}/sbin/ldconfig"; 21 + configureFlags = [ "--enable-pch=no" ] 22 + ++ stdenv.lib.optional contribPlugins "--with-contrib-plugins"; 23 + 24 + meta = with stdenv.lib; { 25 + maintainers = [ maintainers.linquize ]; 26 + platforms = platforms.all; 27 + description = "The open source, cross platform, free C, C++ and Fortran IDE"; 28 + longDescription = 29 + '' 30 + Code::Blocks is a free C, C++ and Fortran IDE built to meet the most demanding needs of its users. 31 + It is designed to be very extensible and fully configurable. 32 + Finally, an IDE with all the features you need, having a consistent look, feel and operation across platforms. 33 + ''; 34 + homepage = http://www.codeblocks.org; 35 + license = licenses.gpl3; 36 + }; 37 + }
+18
pkgs/applications/editors/codeblocks/writable-projects.patch
··· 1 + diff --git a/src/plugins/scriptedwizard/wiz.cpp b/src/plugins/scriptedwizard/wiz.cpp 2 + index 0eb4b27..7d469fe 100644 3 + --- a/src/plugins/scriptedwizard/wiz.cpp 4 + +++ b/src/plugins/scriptedwizard/wiz.cpp 5 + @@ -785,6 +785,13 @@ void Wiz::CopyFiles(cbProject* theproject, const wxString& prjdir, const wxStri 6 + } 7 + } 8 + if (do_copy) wxCopyFile(srcfile, dstfile, true); 9 + + // Noticed! Files in Nix Store are readonly, so make the copied file writable 10 + + if (do_copy) 11 + + { 12 + + struct stat statbuf; 13 + + if (!::stat(dstfile.mb_str(), &statbuf)) 14 + + ::chmod(dstfile.mb_str(), statbuf.st_mode | 0200); 15 + + } 16 + 17 + // and add it to the project 18 + fname.MakeRelativeTo(prjdir);
+3
pkgs/top-level/all-packages.nix
··· 7931 7931 libpng = libpng12; 7932 7932 }; 7933 7933 7934 + codeblocks = callPackage ../applications/editors/codeblocks { }; 7935 + codeblocksFull = callPackage ../applications/editors/codeblocks { contribPlugins = true; }; 7936 + 7934 7937 codeville = builderDefsPackage (import ../applications/version-management/codeville/0.8.0.nix) { 7935 7938 inherit makeWrapper; 7936 7939 python = pythonFull;