nixpkgs/pkgs/tools/system/plan9port/tmpdir.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

42 lines
1.1 KiB
Diff

From c762625549ff367b54bcd8281d1ce248a69b4401 Mon Sep 17 00:00:00 2001
From: Jason Felice <jason.m.felice@gmail.com>
Date: Mon, 1 Jul 2019 15:01:21 -0400
Subject: [PATCH] Use $TMPDIR if available
NixOS sandboxed builds (at least on Mac) don't have access to /tmp,
and this should be better POSIX.
---
bin/9c | 2 +-
bin/9l | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/bin/9c b/bin/9c
index 3ffb716c..88c47887 100755
--- a/bin/9c
+++ b/bin/9c
@@ -133,7 +133,7 @@ case "$tag" in
esac
# N.B. Must use temp file to avoid pipe; pipe loses status.
-xtmp=/tmp/9c.$$.$USER.out
+xtmp=${TMPDIR-/tmp}/9c.$$.$USER.out
$cc -DPLAN9PORT -I$PLAN9/include $cflags "$@" 2>$xtmp
status=$?
quiet $xtmp
diff --git a/bin/9l b/bin/9l
index 6195815f..717a540a 100755
--- a/bin/9l
+++ b/bin/9l
@@ -346,7 +346,7 @@ then
echo $ld -L$PLAN9/lib "$@" $libsl $extralibs $frameworks
fi
-xtmp=/tmp/9l.$$.$USER.out
+xtmp="${TMPDIR-/tmp}/9l.$$.$USER.out"
xxout() {
sed 's/.*: In function `[^:]*: *//' $xtmp | egrep . |
egrep -v 'is (often|almost always) misused|is dangerous, better use|text-based stub'
--
2.21.0