libclc: fix .pc paths

This commit is contained in:
Ryan Burns 2023-06-03 12:37:17 -07:00
parent f47f0a525c
commit 0ff0ba125c
2 changed files with 14 additions and 3 deletions

View file

@ -14,6 +14,10 @@ stdenv.mkDerivation rec {
outputs = [ "out" "dev" ];
patches = [
./libclc-gnu-install-dirs.patch
];
# cmake expects all required binaries to be in the same place, so it will not be able to find clang without the patch
postPatch = ''
substituteInPlace CMakeLists.txt \
@ -35,9 +39,6 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ cmake ninja python3 ];
buildInputs = [ llvm_14 ];
strictDeps = true;
cmakeFlags = [
"-DCMAKE_INSTALL_INCLUDEDIR=include"
];
postInstall = ''
install -Dt $dev/bin prepare_builtins

View file

@ -0,0 +1,10 @@
--- a/libclc.pc.in
+++ b/libclc.pc.in
@@ -1,5 +1,5 @@
-includedir=@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_INCLUDEDIR@
-libexecdir=@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_DATADIR@/clc
+includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
+libexecdir=@CMAKE_INSTALL_FULL_DATADIR@/clc
Name: libclc
Description: Library requirements of the OpenCL C programming language