From ddd8604a3bd33c3a25f56d613d458c26a84d42d2 Mon Sep 17 00:00:00 2001 From: Weijia Wang <9713184+wegank@users.noreply.github.com> Date: Fri, 14 Apr 2023 14:43:39 +0300 Subject: [PATCH] moveBuildTree: init --- pkgs/build-support/setup-hooks/move-build-tree.sh | 12 ++++++++++++ pkgs/top-level/all-packages.nix | 4 ++++ 2 files changed, 16 insertions(+) create mode 100644 pkgs/build-support/setup-hooks/move-build-tree.sh diff --git a/pkgs/build-support/setup-hooks/move-build-tree.sh b/pkgs/build-support/setup-hooks/move-build-tree.sh new file mode 100644 index 000000000000..2718070f3933 --- /dev/null +++ b/pkgs/build-support/setup-hooks/move-build-tree.sh @@ -0,0 +1,12 @@ +prePhases+=" moveBuildDir" + +moveBuildDir() { + mkdir -p $out/.build + cd $out/.build +} + +postPhases+=" removeBuildDir" + +removeBuildDir() { + rm -rf $out/.build +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 1373cef64c77..05e237d283b3 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1173,6 +1173,10 @@ with pkgs; name = "keep-build-tree-hook"; } ../build-support/setup-hooks/keep-build-tree.sh; + moveBuildTree = makeSetupHook { + name = "move-build-tree-hook"; + } ../build-support/setup-hooks/move-build-tree.sh; + enableGCOVInstrumentation = makeSetupHook { name = "enable-gcov-instrumentation-hook"; } ../build-support/setup-hooks/enable-coverage-instrumentation.sh;