nixpkgs/pkgs/tools/system/plan9port/darwin-sw_vers.patch
Jason Felice 83c1e8c319 plan9port: use C compiler from Nix
The install script was escaping the Nix environment on Mac OS by using
`xcrun -sdk macos clang` as its C compiler.  Using the Nix compiler
required declaring the necessary frameworks as inputs and patching
build scripts to assume MacOS 10.12 (and not try to detect).

So cached derivations prior to this would probably not work on all
intended target machines.

This *might* also fix installCheck on Darwin on Hydra.

Other minor fixes:

* Disable parallel building due to a race with a missing y.tab.h
* Use NIX_CFLAGS_COMPILE/NIX_LDFLAGS instead of trying to synthesize
  something like them.
* X11 dependencies aren't used on Darwin when the windowing system
  is correctly detected
2019-08-09 16:29:51 -04:00

48 lines
1.5 KiB
Diff

From d21d082275f04f88eabcc8ecdb03ee932c71ebf1 Mon Sep 17 00:00:00 2001
From: Jason Felice <jason.m.felice@gmail.com>
Date: Mon, 1 Jul 2019 15:23:19 -0400
Subject: [PATCH 2/3] Build for 10.12
---
bin/osxvers | 3 +--
src/cmd/devdraw/mkwsysrules.sh | 4 ++--
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/bin/osxvers b/bin/osxvers
index 4af44da2..3be7e6e9 100755
--- a/bin/osxvers
+++ b/bin/osxvers
@@ -2,6 +2,5 @@
u=`uname`
case "$u" in
-Darwin)
- sw_vers | awk '$1 == "ProductVersion:" {print $2}' | awk -F. '{printf("CFLAGS=$CFLAGS -DOSX_VERSION=%d%02d%02d\n", $1, $2, $3)}'
+Darwin) printf 'CFLAGS=$CFLAGS -DOSX_VERSION=101200\n';;
esac
diff --git a/src/cmd/devdraw/mkwsysrules.sh b/src/cmd/devdraw/mkwsysrules.sh
index e94afbd3..40e632db 100644
--- a/src/cmd/devdraw/mkwsysrules.sh
+++ b/src/cmd/devdraw/mkwsysrules.sh
@@ -22,7 +22,7 @@ fi
if [ "x$WSYSTYPE" = "x" ]; then
if [ "x`uname`" = "xDarwin" ]; then
- if sw_vers | grep 'ProductVersion: 10\.[0-5]\.' >/dev/null; then
+ if false; then
echo 1>&2 'OS X 10.5 and older are not supported'
exit 1
else
@@ -54,7 +54,7 @@ if [ $WSYSTYPE = x11 ]; then
XO=`ls x11-*.c 2>/dev/null | sed 's/\.c$/.o/'`
echo 'WSYSOFILES=$WSYSOFILES '$XO
elif [ $WSYSTYPE = osx-cocoa ]; then
- if sw_vers|awk '/ProductVersion/{split($2,a,".");exit(a[2]<14)}' >/dev/null; then # 0 is true in sh.
+ if false; then
echo 'OBJCFLAGS=$OBJCFLAGS -fobjc-arc'
echo 'WSYSOFILES=$WSYSOFILES osx-draw.o cocoa-screen-metal-objc.o cocoa-srv.o cocoa-thread.o'
else
--
2.21.0