diff --git a/pkgs/development/libraries/tbb/default.nix b/pkgs/development/libraries/tbb/default.nix index af22361f7a21..7aef5ba74768 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/";