aboutsummaryrefslogtreecommitdiff
path: root/infra/libkookie/nixpkgs/pkgs/development/tools/build-managers/bear
diff options
context:
space:
mode:
Diffstat (limited to 'infra/libkookie/nixpkgs/pkgs/development/tools/build-managers/bear')
-rw-r--r--infra/libkookie/nixpkgs/pkgs/development/tools/build-managers/bear/cmakepaths.patch13
-rw-r--r--infra/libkookie/nixpkgs/pkgs/development/tools/build-managers/bear/default.nix41
-rw-r--r--infra/libkookie/nixpkgs/pkgs/development/tools/build-managers/bear/ignore_wrapper.patch27
-rw-r--r--infra/libkookie/nixpkgs/pkgs/development/tools/build-managers/bear/no-double-relative.patch14
4 files changed, 48 insertions, 47 deletions
diff --git a/infra/libkookie/nixpkgs/pkgs/development/tools/build-managers/bear/cmakepaths.patch b/infra/libkookie/nixpkgs/pkgs/development/tools/build-managers/bear/cmakepaths.patch
deleted file mode 100644
index d237267078e6..000000000000
--- a/infra/libkookie/nixpkgs/pkgs/development/tools/build-managers/bear/cmakepaths.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 04c5c58..429ca47 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -24,7 +24,7 @@ set(CMAKE_OSX_ARCHITECTURES "i386;x86_64" CACHE STRING "Rogue")
-
- set(EAR_LIB_FILE ${CMAKE_SHARED_LIBRARY_PREFIX}ear${CMAKE_SHARED_LIBRARY_SUFFIX})
- set(EAR_LIB_PATH "${CMAKE_INSTALL_LIBDIR}/bear")
--set(DEFAULT_PRELOAD_FILE ${CMAKE_INSTALL_PREFIX}/${EAR_LIB_PATH}/${EAR_LIB_FILE} CACHE STRING "Default path to libear.")
-+set(DEFAULT_PRELOAD_FILE ${EAR_LIB_PATH}/${EAR_LIB_FILE} CACHE STRING "Default path to libear.")
-
- add_subdirectory(libear)
- add_subdirectory(bear)
diff --git a/infra/libkookie/nixpkgs/pkgs/development/tools/build-managers/bear/default.nix b/infra/libkookie/nixpkgs/pkgs/development/tools/build-managers/bear/default.nix
index bc7bb46cd5b9..756e68b56781 100644
--- a/infra/libkookie/nixpkgs/pkgs/development/tools/build-managers/bear/default.nix
+++ b/infra/libkookie/nixpkgs/pkgs/development/tools/build-managers/bear/default.nix
@@ -1,22 +1,49 @@
-{ stdenv, fetchFromGitHub, cmake, python3 }:
+{ stdenv
+, fetchFromGitHub
+, cmake
+, pkg-config
+, grpc
+, protobuf
+, openssl
+, nlohmann_json
+, gtest
+, fmt
+, spdlog
+, c-ares
+, abseil-cpp
+, zlib
+}:
stdenv.mkDerivation rec {
pname = "bear";
- version = "2.4.2";
+ version = "3.0.3";
src = fetchFromGitHub {
owner = "rizsotto";
repo = pname;
rev = version;
- sha256 = "1w1kyjzvvy5lj16kn3yyf7iil2cqlfkszi8kvagql7f5h5l6w9b1";
+ sha256 = "1abx5h6xy0h3mz29ial5si8smkmjzla050d130pcc6dzr4ic642w";
};
- nativeBuildInputs = [ cmake ];
- buildInputs = [ python3 ]; # just for shebang of bin/bear
+ nativeBuildInputs = [ cmake pkg-config ];
- doCheck = false; # all fail
+ buildInputs = [
+ grpc
+ protobuf
+ openssl
+ nlohmann_json
+ gtest
+ fmt
+ spdlog
+ c-ares
+ abseil-cpp
+ zlib
+ ];
- patches = [ ./ignore_wrapper.patch ./cmakepaths.patch ];
+ patches = [
+ # Default libexec would be set to /nix/store/*-bear//nix/store/*-bear/libexec/...
+ ./no-double-relative.patch
+ ];
meta = with stdenv.lib; {
description = "Tool that generates a compilation database for clang tooling";
diff --git a/infra/libkookie/nixpkgs/pkgs/development/tools/build-managers/bear/ignore_wrapper.patch b/infra/libkookie/nixpkgs/pkgs/development/tools/build-managers/bear/ignore_wrapper.patch
deleted file mode 100644
index 8effc723bbab..000000000000
--- a/infra/libkookie/nixpkgs/pkgs/development/tools/build-managers/bear/ignore_wrapper.patch
+++ /dev/null
@@ -1,27 +0,0 @@
---- a/bear/main.py.in
-+++ b/bear/main.py.in
-@@ -49,6 +49,7 @@ import tempfile
- import shutil
- import contextlib
- import logging
-+from distutils.spawn import find_executable
-
- # Map of ignored compiler option for the creation of a compilation database.
- # This map is used in _split_command method, which classifies the parameters
-@@ -569,7 +570,15 @@ class Compilation:
- (compiler, language, rest of the command) otherwise """
-
- if command: # not empty list will allow to index '0' and '1:'
-- executable = os.path.basename(command[0]) # type: str
-+ executable_file = find_executable(command[0])
-+ if executable_file:
-+ absolute_executable = os.path.realpath(executable_file)
-+ # Ignore Nix wrappers.
-+ if 'wrapper' in absolute_executable:
-+ return None
-+ executable = os.path.basename(absolute_executable)
-+ else:
-+ executable = os.path.basename(command[0])
- parameters = command[1:] # type: List[str]
- # 'wrapper' 'parameters' and
- # 'wrapper' 'compiler' 'parameters' are valid. \ No newline at end of file
diff --git a/infra/libkookie/nixpkgs/pkgs/development/tools/build-managers/bear/no-double-relative.patch b/infra/libkookie/nixpkgs/pkgs/development/tools/build-managers/bear/no-double-relative.patch
new file mode 100644
index 000000000000..0184bdfd6ba7
--- /dev/null
+++ b/infra/libkookie/nixpkgs/pkgs/development/tools/build-managers/bear/no-double-relative.patch
@@ -0,0 +1,14 @@
+diff --git a/source/config.h.in b/source/config.h.in
+index 2ca8853..2564c63 100644
+--- a/source/config.h.in
++++ b/source/config.h.in
+@@ -65,6 +65,6 @@ constexpr char VERSION[] = "@CMAKE_PROJECT_VERSION@";
+
+ constexpr char CITNAMES_DEFAULT_PATH[] = "@ROOT_INSTALL_PREFIX@/@CMAKE_INSTALL_BINDIR@/citnames";
+ constexpr char INTERCEPT_DEFAULT_PATH[] = "@ROOT_INSTALL_PREFIX@/@CMAKE_INSTALL_BINDIR@/intercept";
+-constexpr char LIBRARY_DEFAULT_PATH[] = "@ROOT_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBEXECDIR@/@CMAKE_SHARED_LIBRARY_PREFIX@exec@CMAKE_SHARED_LIBRARY_SUFFIX@";
+-constexpr char EXECUTOR_DEFAULT_PATH[] = "@ROOT_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBEXECDIR@/er";
+-constexpr char WRAPPER_DEFAULT_PATH[] = "@ROOT_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBEXECDIR@/wrapper.d";
++constexpr char LIBRARY_DEFAULT_PATH[] = "@CMAKE_INSTALL_LIBEXECDIR@/@CMAKE_SHARED_LIBRARY_PREFIX@exec@CMAKE_SHARED_LIBRARY_SUFFIX@";
++constexpr char EXECUTOR_DEFAULT_PATH[] = "@CMAKE_INSTALL_LIBEXECDIR@/er";
++constexpr char WRAPPER_DEFAULT_PATH[] = "@CMAKE_INSTALL_LIBEXECDIR@/wrapper.d";