···11+diff --git a/hints/darwin.sh b/hints/darwin.sh
22+index 0a91bc083c0..fdfbdd4a3b9 100644
33+--- a/hints/darwin.sh
44++++ b/hints/darwin.sh
55+@@ -301,7 +301,7 @@ case "$osvers" in # Note: osvers is the kernel version, not the 10.x
66+ # We now use MACOSX_DEPLOYMENT_TARGET, if set, as an override by
77+ # capturing its value and adding it to the flags.
88+ case "$MACOSX_DEPLOYMENT_TARGET" in
99+- 10.*)
1010++ [1-9][0-9].*)
1111+ add_macosx_version_min ccflags $MACOSX_DEPLOYMENT_TARGET
1212+ add_macosx_version_min ldflags $MACOSX_DEPLOYMENT_TARGET
1313+ ;;
1414+@@ -313,7 +313,7 @@ case "$osvers" in # Note: osvers is the kernel version, not the 10.x
1515+1616+ *** Unexpected MACOSX_DEPLOYMENT_TARGET=$MACOSX_DEPLOYMENT_TARGET
1717+ ***
1818+-*** Please either set it to 10.something, or to empty.
1919++*** Please either set it to a valid macOS version number (e.g., 10.15) or to empty.
2020+2121+ EOM
2222+ exit 1
2323+@@ -327,7 +327,7 @@ EOM
2424+ # "ProductVersion: 10.11" "10.11"
2525+ prodvers=`sw_vers|awk '/^ProductVersion:/{print $2}'|awk -F. '{print $1"."$2}'`
2626+ case "$prodvers" in
2727+- 10.*)
2828++ [1-9][0-9].*)
2929+ add_macosx_version_min ccflags $prodvers
3030+ add_macosx_version_min ldflags $prodvers
3131+ ;;
3232+@@ -342,11 +342,10 @@ EOM
3333+ exit 1
3434+ esac
3535+3636+- # The X in 10.X
3737+- prodvers_minor=$(echo $prodvers|awk -F. '{print $2}')
3838++ darwin_major=$(echo $osvers|awk -F. '{print $1}')
3939+4040+- # macOS (10.12) deprecated syscall().
4141+- if [ "$prodvers_minor" -ge 12 ]; then
4242++ # macOS 10.12 (darwin 16.0.0) deprecated syscall().
4343++ if [ "$darwin_major" -ge 16 ]; then
4444+ d_syscall='undef'
4545+ # If deploying to pre-10.12, suppress Time::HiRes's detection of the system clock_gettime()
4646+ case "$MACOSX_DEPLOYMENT_TARGET" in
+4-1
pkgs/development/interpreters/perl/default.nix
···4141 ]
4242 ++ optional stdenv.isSunOS ./ld-shared.patch
4343 ++ optionals stdenv.isDarwin [ ./cpp-precomp.patch ./sw_vers.patch ]
4444- ++ optional crossCompiling ./MakeMaker-cross.patch;
4444+ ++ optional crossCompiling ./MakeMaker-cross.patch
4545+ # Backporting https://github.com/Perl/perl5/pull/17946, can be
4646+ # removed if there's ever a 5.30.x release with it included.
4747+ ++ optional (versionOlder version "5.32.1") ./aarch64-darwin.patch;
45484649 # This is not done for native builds because pwd may need to come from
4750 # bootstrap tools when building bootstrap perl.