From 542b211fa736e6b6f296eb1e5a555d103626bfc4 Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Thu, 28 Nov 2024 10:58:41 -0500 Subject: [PATCH 1/2] bear: fix cross compilation, set strictDeps --- pkgs/by-name/be/bear/package.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/be/bear/package.nix b/pkgs/by-name/be/bear/package.nix index 01d7560b9302..32fe7f95435d 100644 --- a/pkgs/by-name/be/bear/package.nix +++ b/pkgs/by-name/be/bear/package.nix @@ -31,10 +31,14 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-pwdjytP+kmTwozRl1Gd0jUqRs3wfvcYPqiQvVwa6s9c="; }; + strictDeps = true; + nativeBuildInputs = [ cmake ninja pkg-config + grpc + protobuf ]; buildInputs = [ @@ -72,8 +76,8 @@ stdenv.mkDerivation (finalAttrs: { # CMAKE_INSTALL_{BIN,LIB}DIR, which breaks if these are absolute paths. "-DCMAKE_INSTALL_BINDIR=bin" "-DCMAKE_INSTALL_LIBDIR=lib" - (lib.cmakeBool "ENABLE_UNIT_TESTS" finalAttrs.doCheck) - (lib.cmakeBool "ENABLE_FUNC_TESTS" finalAttrs.doCheck) + (lib.cmakeBool "ENABLE_UNIT_TESTS" finalAttrs.finalPackage.doCheck) + (lib.cmakeBool "ENABLE_FUNC_TESTS" finalAttrs.finalPackage.doCheck) ]; checkTarget = lib.concatStringsSep " " [ From 9941229fd90d5ebb4b1427ef636b3c60d3a245ca Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Thu, 28 Nov 2024 11:00:41 -0500 Subject: [PATCH 2/2] bear: use lib.cmakeFeature, drop with lib --- pkgs/by-name/be/bear/package.nix | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkgs/by-name/be/bear/package.nix b/pkgs/by-name/be/bear/package.nix index 32fe7f95435d..98e64fe535f5 100644 --- a/pkgs/by-name/be/bear/package.nix +++ b/pkgs/by-name/be/bear/package.nix @@ -74,8 +74,8 @@ stdenv.mkDerivation (finalAttrs: { cmakeFlags = [ # Build system and generated files concatenate install prefix and # CMAKE_INSTALL_{BIN,LIB}DIR, which breaks if these are absolute paths. - "-DCMAKE_INSTALL_BINDIR=bin" - "-DCMAKE_INSTALL_LIBDIR=lib" + (lib.cmakeFeature "CMAKE_INSTALL_BINDIR" "bin") + (lib.cmakeFeature "CMAKE_INSTALL_LIBDIR" "lib") (lib.cmakeBool "ENABLE_UNIT_TESTS" finalAttrs.finalPackage.doCheck) (lib.cmakeBool "ENABLE_FUNC_TESTS" finalAttrs.finalPackage.doCheck) ]; @@ -110,7 +110,7 @@ stdenv.mkDerivation (finalAttrs: { # Functional tests use loopback networking. __darwinAllowLocalNetworking = true; - meta = with lib; { + meta = { description = "Tool that generates a compilation database for clang tooling"; mainProgram = "bear"; longDescription = '' @@ -119,8 +119,8 @@ stdenv.mkDerivation (finalAttrs: { and run `bear make`. It's not perfect, but it gets a long way. ''; homepage = "https://github.com/rizsotto/Bear"; - license = licenses.gpl3Plus; - platforms = platforms.unix; - maintainers = with maintainers; [ DieracDelta ]; + license = lib.licenses.gpl3Plus; + platforms = lib.platforms.unix; + maintainers = with lib.maintainers; [ DieracDelta ]; }; })