···1+diff --git a/hints/darwin.sh b/hints/darwin.sh
2+index 0a91bc083c0..fdfbdd4a3b9 100644
3+--- a/hints/darwin.sh
4++++ b/hints/darwin.sh
5+@@ -301,7 +301,7 @@ case "$osvers" in # Note: osvers is the kernel version, not the 10.x
6+ # We now use MACOSX_DEPLOYMENT_TARGET, if set, as an override by
7+ # capturing its value and adding it to the flags.
8+ case "$MACOSX_DEPLOYMENT_TARGET" in
9+- 10.*)
10++ [1-9][0-9].*)
11+ add_macosx_version_min ccflags $MACOSX_DEPLOYMENT_TARGET
12+ add_macosx_version_min ldflags $MACOSX_DEPLOYMENT_TARGET
13+ ;;
14+@@ -313,7 +313,7 @@ case "$osvers" in # Note: osvers is the kernel version, not the 10.x
15+16+ *** Unexpected MACOSX_DEPLOYMENT_TARGET=$MACOSX_DEPLOYMENT_TARGET
17+ ***
18+-*** Please either set it to 10.something, or to empty.
19++*** Please either set it to a valid macOS version number (e.g., 10.15) or to empty.
20+21+ EOM
22+ exit 1
23+@@ -327,7 +327,7 @@ EOM
24+ # "ProductVersion: 10.11" "10.11"
25+ prodvers=`sw_vers|awk '/^ProductVersion:/{print $2}'|awk -F. '{print $1"."$2}'`
26+ case "$prodvers" in
27+- 10.*)
28++ [1-9][0-9].*)
29+ add_macosx_version_min ccflags $prodvers
30+ add_macosx_version_min ldflags $prodvers
31+ ;;
32+@@ -342,11 +342,10 @@ EOM
33+ exit 1
34+ esac
35+36+- # The X in 10.X
37+- prodvers_minor=$(echo $prodvers|awk -F. '{print $2}')
38++ darwin_major=$(echo $osvers|awk -F. '{print $1}')
39+40+- # macOS (10.12) deprecated syscall().
41+- if [ "$prodvers_minor" -ge 12 ]; then
42++ # macOS 10.12 (darwin 16.0.0) deprecated syscall().
43++ if [ "$darwin_major" -ge 16 ]; then
44+ d_syscall='undef'
45+ # If deploying to pre-10.12, suppress Time::HiRes's detection of the system clock_gettime()
46+ case "$MACOSX_DEPLOYMENT_TARGET" in
+4-1
pkgs/development/interpreters/perl/default.nix
···41 ]
42 ++ optional stdenv.isSunOS ./ld-shared.patch
43 ++ optionals stdenv.isDarwin [ ./cpp-precomp.patch ./sw_vers.patch ]
44- ++ optional crossCompiling ./MakeMaker-cross.patch;
0004546 # This is not done for native builds because pwd may need to come from
47 # bootstrap tools when building bootstrap perl.
···41 ]
42 ++ optional stdenv.isSunOS ./ld-shared.patch
43 ++ optionals stdenv.isDarwin [ ./cpp-precomp.patch ./sw_vers.patch ]
44+ ++ optional crossCompiling ./MakeMaker-cross.patch
45+ # Backporting https://github.com/Perl/perl5/pull/17946, can be
46+ # removed if there's ever a 5.30.x release with it included.
47+ ++ optional (versionOlder version "5.32.1") ./aarch64-darwin.patch;
4849 # This is not done for native builds because pwd may need to come from
50 # bootstrap tools when building bootstrap perl.