From de37bc613c4d0ae379dba2a20c337ac420fc7e0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stanis=C5=82aw=20Pitucha?= Date: Thu, 28 Sep 2023 21:56:15 +1000 Subject: [PATCH] justbuild: partial fixes for darwin They don't make the build successful, but most issues are removed. Darwin requires the gcc environment to build. --- pkgs/by-name/ju/justbuild/package.nix | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/ju/justbuild/package.nix b/pkgs/by-name/ju/justbuild/package.nix index fd9acbc6dc46..3403edcaaccf 100644 --- a/pkgs/by-name/ju/justbuild/package.nix +++ b/pkgs/by-name/ju/justbuild/package.nix @@ -1,5 +1,5 @@ { - stdenv, + gccStdenv, fetchFromGitHub, fetchurl, @@ -23,6 +23,8 @@ curl, libarchive, }: +let stdenv = gccStdenv; +in stdenv.mkDerivation rec { pname = "justbuild"; version = "1.2.1"; @@ -31,7 +33,14 @@ stdenv.mkDerivation rec { owner = "just-buildsystem"; repo = "justbuild"; rev = "v${version}"; - sha256 = "sha256-5Fz/ID7xKbt6pq2B5/MOS6f2xUnKGvmNAYuPboPwKJY="; + sha256 = "sha256-36njngcGmRtYh/U3wkZUAU6ivPQ8qP8zVj1JzI9TuDY="; + + # The source contains both test/end-to-end/targets and + # test/end-to-end/TARGETS, causing issues on case-insensitive filesystems. + # Remove them, since we're not running end-to-end tests. + postFetch = '' + rm -rf $out/test/end-to-end/targets $out/test/end-to-end/TARGETS + ''; }; bazelapi = fetchurl { @@ -91,6 +100,8 @@ stdenv.mkDerivation rec { mv etc/repos.json.patched etc/repos.json jq '.unknown.PATH = []' etc/toolchain/CC/TARGETS > etc/toolchain/CC/TARGETS.patched mv etc/toolchain/CC/TARGETS.patched etc/toolchain/CC/TARGETS + '' + lib.optionalString stdenv.isDarwin '' + sed -ie 's|-Wl,-z,stack-size=8388608|-Wl,-stack_size,0x800000|' bin/bootstrap.py ''; /* The build phase follows the bootstrap procedure that is explained in @@ -131,7 +142,7 @@ stdenv.mkDerivation rec { # Bootstrap just export PACKAGE=YES export NON_LOCAL_DEPS='[ "google_apis", "bazel_remote_apis" ]' - export JUST_BUILD_CONF=`echo $PATH | jq -R '{ ENV: { PATH: . }, "ADD_CFLAGS": ["-Wno-error=pedantic"], "ADD_CXXFLAGS": ["-Wno-error=pedantic"] }'` + export JUST_BUILD_CONF=`echo $PATH | jq -R '{ ENV: { PATH: . }, "ADD_CFLAGS": ["-Wno-error=pedantic"], "ADD_CXXFLAGS": ["-Wno-error=pedantic", "-D__unix__", "-DFMT_HEADER_ONLY"], "ARCH": "'$(uname -m)'" }'` mkdir ../build python3 ./bin/bootstrap.py `pwd` ../build "`pwd`/.distfiles"