summaryrefslogtreecommitdiffstats
path: root/pkgs/applications/editors/codeblocks/writable-projects.patch
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/applications/editors/codeblocks/writable-projects.patch')
-rw-r--r--pkgs/applications/editors/codeblocks/writable-projects.patch18
1 files changed, 18 insertions, 0 deletions
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);