Merge pull request #66404 from eraserhd/pr/master/plan9port-mac-compiler-fixes

plan9port: use C compiler from Nix
This commit is contained in:
Anderson Torres
2019-09-10 07:45:51 -03:00
committed by GitHub
5 changed files with 185 additions and 30 deletions
+22 -22
View File
@@ -1,7 +1,11 @@
{ stdenv, fetchFromGitHub, which, libX11, libXt, fontconfig, freetype
{ stdenv, fetchFromGitHub, which
, darwin ? null
, xorgproto ? null
, libX11
, libXext ? null
, zlib ? null
, libXt ? null
, fontconfig ? null
, freetype ? null
, perl ? null # For building web manuals
}:
@@ -16,14 +20,24 @@ stdenv.mkDerivation {
sha256 = "1lp17948q7vpl8rc2bf5a45bc8jqyj0s3zffmks9r25ai42vgb43";
};
patches = [
./tmpdir.patch
./darwin-sw_vers.patch
./darwin-cfframework.patch
];
postPatch = ''
#hardcoded path
substituteInPlace src/cmd/acme/acme.c \
--replace /lib/font/bit $out/plan9/font
#deprecated flags
find . -type f \
-exec sed -i -e 's/_SVID_SOURCE/_DEFAULT_SOURCE/g' {} \; \
-exec sed -i -e 's/_BSD_SOURCE/_DEFAULT_SOURCE/g' {} \;
substituteInPlace bin/9c \
--replace 'which uniq' '${which}/bin/which uniq'
'' + stdenv.lib.optionalString (!stdenv.isDarwin) ''
#add missing ctrl+c\z\x\v keybind for non-Darwin
substituteInPlace src/cmd/acme/text.c \
@@ -34,30 +48,16 @@ stdenv.mkDerivation {
'';
buildInputs = [
which perl libX11 fontconfig xorgproto libXt libXext
perl
] ++ stdenv.lib.optionals (!stdenv.isDarwin) [
xorgproto libX11 libXext libXt fontconfig
freetype # fontsrv wants ft2build.h provides system fonts for acme and sam.
];
] ++ stdenv.lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
darwin.cf-private Carbon Cocoa IOKit Metal QuartzCore
]);
builder = ./builder.sh;
libX11_dev = libX11.dev;
libXt_dev = libXt.dev;
libXext_dev = libXext.dev;
fontconfig_dev = fontconfig.dev;
freetype_dev = freetype.dev;
zlib_dev = zlib.dev;
xorgproto_exp = xorgproto;
libX11_exp = libX11;
libXt_exp = libXt;
libXext_exp = libXext;
freetype_exp = freetype;
zlib_exp = zlib;
fontconfig_lib = fontconfig.lib;
NIX_LDFLAGS="-lgcc_s";
enableParallelBuilding = true;
doInstallCheck = true;
installCheckPhase = ''