summary refs log tree commit diff
diff options
context:
space:
mode:
authorJan Tojnar <jtojnar@gmail.com>2021-05-11 16:00:03 +0200
committerJan Tojnar <jtojnar@gmail.com>2021-05-11 18:43:00 +0200
commitd8258b513d6a4b0f7776876f9c5a6b406f8ec9af (patch)
tree9f5ccf317224cc072af2534eac56fd688d2c41db
parentd2f30b0b11e66f8064132357892340fd814f8338 (diff)
downloadnixpkgs-d8258b513d6a4b0f7776876f9c5a6b406f8ec9af.tar
nixpkgs-d8258b513d6a4b0f7776876f9c5a6b406f8ec9af.tar.gz
nixpkgs-d8258b513d6a4b0f7776876f9c5a6b406f8ec9af.tar.bz2
nixpkgs-d8258b513d6a4b0f7776876f9c5a6b406f8ec9af.tar.lz
nixpkgs-d8258b513d6a4b0f7776876f9c5a6b406f8ec9af.tar.xz
nixpkgs-d8258b513d6a4b0f7776876f9c5a6b406f8ec9af.tar.zst
nixpkgs-d8258b513d6a4b0f7776876f9c5a6b406f8ec9af.zip
tbb: add pkg-config file
Gazebo does not list the tbb dependency in its pkg-config file otherwise.
-rw-r--r--pkgs/development/libraries/tbb/default.nix17
1 files changed, 17 insertions, 0 deletions
diff --git a/pkgs/development/libraries/tbb/default.nix b/pkgs/development/libraries/tbb/default.nix
index af22361f7a2..7aef5ba7476 100644
--- a/pkgs/development/libraries/tbb/default.nix
+++ b/pkgs/development/libraries/tbb/default.nix
@@ -51,6 +51,23 @@ stdenv.mkDerivation rec {
     runHook postInstall
   '';
 
+  postInstall = let
+    pcTemplate = fetchurl {
+      url = "https://github.com/oneapi-src/oneTBB/raw/master/integration/pkg-config/tbb.pc.in";
+      sha256 = "2pCad9txSpNbzac0vp/VY3x7HNySaYkbH3Rx8LK53pI=";
+    };
+  in ''
+    # Generate pkg-config file based on upstream template.
+    # It should not be necessary with tbb after 2021.2.
+    mkdir -p "$out/lib/pkgconfig"
+    substitute "${pcTemplate}" "$out/lib/pkgconfig/tbb.pc" \
+      --subst-var-by CMAKE_INSTALL_PREFIX "$out" \
+      --subst-var-by CMAKE_INSTALL_LIBDIR "lib" \
+      --subst-var-by CMAKE_INSTALL_INCLUDEDIR "include" \
+      --subst-var-by TBB_VERSION "${version}" \
+      --subst-var-by TBB_LIB_NAME "tbb"
+  '';
+
   meta = with lib; {
     description = "Intel Thread Building Blocks C++ Library";
     homepage = "http://threadingbuildingblocks.org/";