From 9529bf7063cb83ec81f60e7232242358deadeb34 Mon Sep 17 00:00:00 2001 From: Kent Russell Date: Wed, 10 Nov 2021 12:33:05 -0500 Subject: [PATCH] CMakeLists: Fix libdrm-amdgpu dependencies SUGGESTS doesn't get installed by default by dpkg, it requires --install-suggests. While the libdrm-amdgpu-amdgpu1 lib might not be critical to core thunk usage, it's necessary enough to increase the dependency from weak to strong, thus we use RECOMMENDS instead Since CPack doesn't support RECOMMENDS for RPMs, and SUGGESTS isn't strong enough, we just set it as REQUIRED. This should handle any standard installation situations instead of trying to be fancy to try to make things exactly the way we want them to be. Signed-off-by: Kent Russell Change-Id: I5a676fb4a3fbf5c7b35f503acc30cf01c056266d --- CMakeLists.txt | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b63ff21e18..764d9c00e9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -351,21 +351,13 @@ set(CPACK_PACKAGE_VERSION "${PACKAGE_VERSION_STR}") # Setting devel package dependendent version set(CPACK_DEBIAN_PACKAGE_DEPENDS "libdrm-dev, rocm-core") -set(CPACK_DEBIAN_PACKAGE_SUGGESTS "libdrm-amdgpu-amdgpu1") +set(CPACK_DEBIAN_PACKAGE_RECOMMENDS "libdrm-amdgpu-amdgpu1") set(CPACK_DEBIAN_PACKAGE_REPLACES "hsakmt-roct") -set(CPACK_RPM_PACKAGE_REQUIRES "libdrm-devel, rocm-core") - -# NOTE: CentOS/RHEL <8 and SUSE <10 have no concept of "Suggests" -# so a "suggests" field will just cause rpm installation to fail -# If the HSAKMT_REQUIRES_LIBDRM variable is true in the build -# environment, we use REQUIRES. Otherwise we use SUGGESTS -# For the distros above, this variable should be set to true -if(DEFINED HSAKMT_REQUIRES_LIBDRM) - string ( APPEND CPACK_RPM_PACKAGE_REQUIRES ", libdrm-amdgpu" ) -else() - set(CPACK_RPM_PACKAGE_SUGGESTS "libdrm-amdgpu" ) -endif() +# Certain versions of rpm can't handle SUGGESTS or RECOMMENDS +# Also, CPACK_RPM_PACKAGE_RECOMMENDS isn't supported by +# CPack, so just set libdrm-amdgpu as a requirement for RPMs +set(CPACK_RPM_PACKAGE_REQUIRES "libdrm-devel, rocm-core, libdrm-amdgpu") # Set the names now using CPACK utility set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT")