File tree Expand file tree Collapse file tree 2 files changed +51
-3
lines changed Expand file tree Collapse file tree 2 files changed +51
-3
lines changed Original file line number Diff line number Diff line change 56
56
ruby = super . ruby_3_1 ;
57
57
yarn = super . yarn . override { nodejs = super . nodejs-18_x ; } ;
58
58
openjdk = super . openjdk11_headless ;
59
- xcodeWrapper = super . xcodeenv . composeXcodeWrapper {
60
- version = "15.0" ;
61
- allowHigher = true ;
59
+ xcodeWrapper = callPackage ./pkgs/xcodeenv/compose-xcodewrapper.nix { } {
60
+ versions = [ "15.1" ] ;
62
61
} ;
63
62
go = super . go_1_20 ;
64
63
clang = super . clang_15 ;
Original file line number Diff line number Diff line change
1
+ { stdenv , lib , writeShellScriptBin } :
2
+ { versions ? [ "15.1" ]
3
+ , xcodeBaseDir ? "/Applications/Xcode.app" } :
4
+
5
+ assert stdenv . isDarwin ;
6
+
7
+ let
8
+ xcodebuildPath = "${ xcodeBaseDir } /Contents/Developer/usr/bin/xcodebuild" ;
9
+
10
+ xcodebuildWrapper = writeShellScriptBin "xcodebuild" ''
11
+ currentVer="$(${ xcodebuildPath } -version | awk 'NR==1{print $2}')"
12
+ wrapperVers=(${ lib . concatStringsSep " " versions } )
13
+
14
+ for ver in "'' ${wrapperVers[@]}"; do
15
+ if [[ "$currentVer" == "$ver" ]]; then
16
+ exec "${ xcodebuildPath } " "$@"
17
+ exit 0
18
+ fi
19
+ done
20
+
21
+ echo "The installed Xcode version ($currentVer) does not match any of the allowed versions: ${ lib . concatStringsSep ", " versions } "
22
+ echo "Please update your local Xcode installation to match one of the allowed versions"
23
+ exit 1
24
+ '' ;
25
+ in
26
+ stdenv . mkDerivation {
27
+ pname = "xcode-wrapper-plus" ;
28
+ version = lib . concatStringsSep "," versions ;
29
+ # Fails in sandbox. Use `--option sandbox relaxed` or `--option sandbox false`.
30
+ __noChroot = true ;
31
+ buildCommand = ''
32
+ mkdir -p $out/bin
33
+ cd $out/bin
34
+ ln -s "${ xcodebuildWrapper } /bin/xcode-select"
35
+ ln -s /usr/bin/security
36
+ ln -s /usr/bin/codesign
37
+ ln -s /usr/bin/xcrun
38
+ ln -s /usr/bin/plutil
39
+ ln -s /usr/bin/clang
40
+ ln -s /usr/bin/lipo
41
+ ln -s /usr/bin/file
42
+ ln -s /usr/bin/rev
43
+ ln -s "${ xcodebuildWrapper } /bin/xcodebuild"
44
+ ln -s "${ xcodeBaseDir } /Contents/Developer/Applications/Simulator.app/Contents/MacOS/Simulator"
45
+
46
+ cd ..
47
+ ln -s "${ xcodeBaseDir } /Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs"
48
+ '' ;
49
+ }
You can’t perform that action at this time.
0 commit comments