diff --git a/meson.build b/meson.build index acd9e4745..ddb463bcf 100644 --- a/meson.build +++ b/meson.build @@ -265,6 +265,7 @@ brotli = [ ] openssl = dependency('libcrypto', 'openssl', required : true, include_type : 'system') +ncurses = dependency('ncurses', required : true, include_type : 'system') # FIXME: confirm we actually support such old versions of aws-sdk-cpp aws_sdk = dependency('aws-cpp-sdk-core', required : false, version : '>=1.8', include_type : 'system') diff --git a/misc/capnproto.nix b/misc/capnproto.nix index 0160050a0..4d09a2892 100644 --- a/misc/capnproto.nix +++ b/misc/capnproto.nix @@ -1,5 +1,6 @@ # FIXME: upstream to nixpkgs (do NOT build with gcc due to gcc coroutine bugs) { + binutils, lib, stdenv, fetchFromGitHub, @@ -8,6 +9,20 @@ zlib, }: assert stdenv.cc.isClang; +let + # HACK: work around https://github.com/NixOS/nixpkgs/issues/177129 + # Though this is an issue between Clang and GCC, + # so it may not get fixed anytime soon... + empty-libgcc_eh = stdenv.mkDerivation { + pname = "empty-libgcc_eh"; + version = "0"; + dontUnpack = true; + installPhase = '' + mkdir -p "$out"/lib + "${binutils}"/bin/ar r "$out"/lib/libgcc_eh.a + ''; + }; +in stdenv.mkDerivation rec { pname = "capnproto"; version = "1.0.2"; @@ -24,7 +39,7 @@ stdenv.mkDerivation rec { propagatedBuildInputs = [ openssl zlib - ]; + ] ++ lib.optional (stdenv.cc.isClang && stdenv.targetPlatform.isStatic) empty-libgcc_eh; # FIXME: separate the binaries from the stuff that user systems actually use # This runs into a terrible UX issue in Lix and I just don't want to debug it diff --git a/package.nix b/package.nix index bb5ae1dee..5c66b8446 100644 --- a/package.nix +++ b/package.nix @@ -97,10 +97,10 @@ # Enable ANSI arrow keys. (lib.enableFeature true "arrow-keys") # Use termcap library to query terminal size. - (lib.enableFeature (ncurses != null) "termcap") + (lib.enableFeature true "termcap") ]; - buildInputs = (prev.buildInputs or [ ]) ++ [ ncurses ]; + propagatedBuildInputs = (prev.propagatedBuildInputs or [ ]) ++ [ ncurses ]; }); build-release-notes = callPackage ./maintainers/build-release-notes.nix { }; @@ -245,9 +245,10 @@ stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = [ - python3 - python3.pkgs.pytest - python3.pkgs.pytest-xdist + (python3.pythonOnBuildForHost.withPackages (p: [ + p.pytest + p.pytest-xdist + ])) meson ninja cmake diff --git a/src/libcmd/meson.build b/src/libcmd/meson.build index 0a3ff8620..82071b3b2 100644 --- a/src/libcmd/meson.build +++ b/src/libcmd/meson.build @@ -47,6 +47,7 @@ libcmd = library( liblixfetchers, liblixmain, boehm, + ncurses, editline, lowdown, nlohmann_json,