about summary refs log tree commit diff
path: root/pkgs/applications/graphics/potreeconverter
diff options
context:
space:
mode:
authormatthewcroughan <matt@croughan.sh>2023-04-03 12:48:48 +0100
committermatthewcroughan <matt@croughan.sh>2023-04-03 12:48:54 +0100
commitb173c1c6e2257ec2bb44ab70dc49ddacf697552f (patch)
treeb7612b2ad74bd8e20de287f09a8f870b4f792706 /pkgs/applications/graphics/potreeconverter
parent2714719012aa1c57b75236f19a01effc92d53754 (diff)
potreeconverter: stop copy operation from inheriting permissions from store
Diffstat (limited to 'pkgs/applications/graphics/potreeconverter')
-rw-r--r--pkgs/applications/graphics/potreeconverter/default.nix9
1 files changed, 9 insertions, 0 deletions
diff --git a/pkgs/applications/graphics/potreeconverter/default.nix b/pkgs/applications/graphics/potreeconverter/default.nix
index 4255a12dbab2a..146c528604f82 100644
--- a/pkgs/applications/graphics/potreeconverter/default.nix
+++ b/pkgs/applications/graphics/potreeconverter/default.nix
@@ -29,8 +29,16 @@ stdenv.mkDerivation rec {
   ];
 
   patchPhase = ''
+    runHook prePatch
+
     substituteInPlace ./CMakeLists.txt \
       --replace "find_package(TBB REQUIRED)" ""
+
+    # prevent inheriting permissions from /nix/store when copying
+    substituteInPlace Converter/src/main.cpp --replace \
+      'fs::copy(templateDir, pagedir, fs::copy_options::overwrite_existing | fs::copy_options::recursive)' 'string cmd = "cp --no-preserve=mode -r " + templateDir + " " + pagedir; system(cmd.c_str());'
+
+    runHook postPatch
   '';
 
   installPhase = ''
@@ -53,6 +61,7 @@ stdenv.mkDerivation rec {
     ln -s $src/resources $out/bin/resources
     runHook postFixup
   '';
+
   meta = with lib; {
     description = "Create multi res point cloud to use with potree";
     homepage = "https://github.com/potree/PotreeConverter";