diff --git a/local/recipes/dev/libclc/recipe.toml b/local/recipes/dev/libclc/recipe.toml index 8b58fffeb0..f5c715cef1 100644 --- a/local/recipes/dev/libclc/recipe.toml +++ b/local/recipes/dev/libclc/recipe.toml @@ -157,7 +157,7 @@ COOKBOOK_CMAKE_FLAGS+=( -DLIBCLC_STANDALONE_BUILD=TRUE -DLIBCLC_TARGETS_TO_BUILD="r600--;amdgcn--;amdgcn--amdhsa;amdgcn-mesa-mesa3d" -DENABLE_RUNTIME_SUBNORMAL=OFF - -DCMAKE_INSTALL_PREFIX="${COOKBOOK_STAGE}/usr" + -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_INSTALL_INCLUDEDIR=include -DCMAKE_INSTALL_DATADIR=share @@ -185,15 +185,14 @@ fi # on PATH for the ninja run. export PATH="$(pwd):${PATH}" "${COOKBOOK_NINJA}" -j"${COOKBOOK_MAKE_JOBS}" -DESTDIR="${COOKBOOK_STAGE}/stage" "${COOKBOOK_NINJA}" install - -# Move installed files from $COOKBOOK_STAGE/stage to $COOKBOOK_STAGE. -# The DESTDIR install above places everything under -# $COOKBOOK_STAGE/stage; flatten the extra stage dir. -if [ -d "${COOKBOOK_STAGE}/stage" ]; then - cp -a "${COOKBOOK_STAGE}/stage/." "${COOKBOOK_STAGE}/" - rm -rf "${COOKBOOK_STAGE}/stage" -fi +# Standard install: RELATIVE prefix (/usr, set in COOKBOOK_CMAKE_FLAGS) + +# DESTDIR=${COOKBOOK_STAGE} -> files land at ${COOKBOOK_STAGE}/usr/... and the +# generated libclc.pc carries prefix=/usr, which the downstream mesa build +# resolves via PKG_CONFIG_SYSROOT_DIR. (The previous absolute prefix + +# DESTDIR/stage double-nested everything under +# stage.tmp//stage.tmp/usr/... so libclc.pc was never at the expected +# path.) +DESTDIR="${COOKBOOK_STAGE}" "${COOKBOOK_NINJA}" install # Restore the cross-compile env for any subsequent (cross) steps. The native # cmake/ninja above MUST run with the clean (unset) env, so this restore is @@ -208,6 +207,16 @@ export CPPFLAGS="$_SAVED_CPPFLAGS" # The cmake install above places them at $COOKBOOK_STAGE/usr/share/clc # which is the right path; no further action needed. +# Upstream libclc installs libclc.pc under share/pkgconfig (its DATADIR); +# relocate it to lib/pkgconfig, the cookbook convention that mesa's +# dependency('libclc') pkg-config lookup uses. +if [ -f "${COOKBOOK_STAGE}/usr/share/pkgconfig/libclc.pc" ] \ + && [ ! -f "${COOKBOOK_STAGE}/usr/lib/pkgconfig/libclc.pc" ]; then + mkdir -p "${COOKBOOK_STAGE}/usr/lib/pkgconfig" + mv "${COOKBOOK_STAGE}/usr/share/pkgconfig/libclc.pc" \ + "${COOKBOOK_STAGE}/usr/lib/pkgconfig/libclc.pc" +fi + if [ ! -f "${COOKBOOK_STAGE}/usr/lib/pkgconfig/libclc.pc" ]; then echo "libclc: ERROR — install did not produce libclc.pc" >&2 echo "libclc: expected at ${COOKBOOK_STAGE}/usr/lib/pkgconfig/libclc.pc" >&2