From 4622001a1507a43bcb85a26de002da91f0802a95 Mon Sep 17 00:00:00 2001 From: Siddarth Kumar Date: Thu, 16 Jan 2025 10:28:26 +0530 Subject: [PATCH] nix: modify xcodewrapper from latest nixpkgs --- nix/pkgs/xcodeenv/compose-xcodewrapper.nix | 32 +++++++++++++++------- nix/shell.nix | 4 +-- 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/nix/pkgs/xcodeenv/compose-xcodewrapper.nix b/nix/pkgs/xcodeenv/compose-xcodewrapper.nix index 18f1e9ef0df..c7a092babba 100644 --- a/nix/pkgs/xcodeenv/compose-xcodewrapper.nix +++ b/nix/pkgs/xcodeenv/compose-xcodewrapper.nix @@ -1,9 +1,14 @@ -{ stdenv, lib, writeShellScriptBin }: -{ versions ? [ "14.3" "15.1" "15.2" "15.3" ] -, xcodeBaseDir ? "/Applications/Xcode.app" }: - -assert stdenv.isDarwin; +{ + lib, + stdenv, + writeShellScriptBin, +}: +{ + versions ? [ ], + xcodeBaseDir ? "/Applications/Xcode.app", +}: +assert stdenv.hostPlatform.isDarwin; let xcodebuildPath = "${xcodeBaseDir}/Contents/Developer/usr/bin/xcodebuild"; @@ -25,14 +30,22 @@ let ''; in stdenv.mkDerivation { - pname = "xcode-wrapper-plus"; - version = lib.concatStringsSep "," versions; + name = "xcode-wrapper-impure"; # Fails in sandbox. Use `--option sandbox relaxed` or `--option sandbox false`. __noChroot = true; buildCommand = '' mkdir -p $out/bin cd $out/bin - ln -s "${xcodebuildWrapper}/bin/xcode-select" + ${ + if versions == [ ] then + '' + ln -s "${xcodebuildPath}" + '' + else + '' + ln -s "${xcodebuildWrapper}/bin/xcode-select" + '' + } ln -s /usr/bin/security ln -s /usr/bin/codesign ln -s /usr/bin/xcrun @@ -41,10 +54,9 @@ stdenv.mkDerivation { ln -s /usr/bin/lipo ln -s /usr/bin/file ln -s /usr/bin/rev - ln -s "${xcodebuildWrapper}/bin/xcodebuild" ln -s "${xcodeBaseDir}/Contents/Developer/Applications/Simulator.app/Contents/MacOS/Simulator" cd .. ln -s "${xcodeBaseDir}/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs" ''; -} +} \ No newline at end of file diff --git a/nix/shell.nix b/nix/shell.nix index c7e750a4b69..d2fbb17d647 100644 --- a/nix/shell.nix +++ b/nix/shell.nix @@ -8,7 +8,7 @@ let /* Lock requires Xcode verison. */ xcodeWrapper = callPackage ./pkgs/xcodeenv/compose-xcodewrapper.nix { } { - versions = ["14.3" "15.1" "15.2" "15.3" "15.4"]; + versions = [ ]; }; /* Gomobile also needs the Xcode wrapper. */ @@ -27,7 +27,7 @@ in mkShell { buildInputs = with pkgs; [ git jq which go golangci-lint go-junit-report gopls go-bindata gomobileMod codecov-cli go-generate-fast - mockgen protobuf3_20 protoc-gen-go gotestsum go-modvendor openjdk + mockgen protobuf3_21 protoc-gen-go gotestsum go-modvendor openjdk ] ++ lib.optionals (stdenv.isDarwin) [ xcodeWrapper ]; shellHook = lib.optionalString (!isMacM1) ''