From 93b0accc76ffccee15a1b34ff8206f84a64069cb Mon Sep 17 00:00:00 2001 From: Lily Ballard Date: Thu, 5 Nov 2020 18:00:31 -0800 Subject: [PATCH] macvim: fix building with nix-daemon (#102975) When building MacVim with nix-daemon it tries to place the derived data into a path rooted in `/var/empty`, which fails. Specifying the derived data path ourselves fixes this problem. --- pkgs/applications/editors/vim/macvim.nix | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pkgs/applications/editors/vim/macvim.nix b/pkgs/applications/editors/vim/macvim.nix index ef6c6a14407..d2cc14c30c4 100644 --- a/pkgs/applications/editors/vim/macvim.nix +++ b/pkgs/applications/editors/vim/macvim.nix @@ -94,6 +94,19 @@ stdenv.mkDerivation { + '' unset LD '' + # When building with nix-daemon, we need to pass -derivedDataPath or else it tries to use + # a folder rooted in /var/empty and fails. Unfortunately we can't just pass -derivedDataPath + # by itself as this flag requires the use of -scheme or -xctestrun (not sure why), but MacVim + # by default just runs `xcodebuild -project src/MacVim/MacVim.xcodeproj`, relying on the default + # behavior to build the first target in the project. Experimentally, there seems to be a scheme + # called MacVim, so we'll explicitly select that. We also need to specify the configuration too + # as the scheme seems to have the wrong default. + + '' + configureFlagsArray+=( + XCODEFLAGS="-scheme MacVim -derivedDataPath $NIX_BUILD_TOP/derivedData" + --with-xcodecfg="Release" + ) + '' ; # Because we're building with system clang, this means we're building against Xcode's SDK and