From ae435f825388a7e51e27257a233bb172a5962936 Mon Sep 17 00:00:00 2001 From: Pruthvi Madugundu Date: Wed, 1 Apr 2020 02:17:11 -0700 Subject: [PATCH] Updating the hsa include directory symlink creation - Symlink creation is corrected only for deb packages - It is follow up package of http://git.amd.com:8080/c/hsa/ec/hsa-runtime/+/334403 - configure_file() is called to update the scripts with proper cmake variable values Signed-off-by: Pruthvi Madugundu Change-Id: I0e833ead265166411e83593fd57265a9ab356904 [ROCm/ROCR-Runtime commit: 241cdfdd0178a2e3d58b13f2d2551254a19c6884] --- projects/rocr-runtime/runtime/hsa-runtime/CMakeLists.txt | 4 ++++ .../runtime/hsa-runtime/DEBIAN/{postinst => post_install} | 5 ++--- .../runtime/hsa-runtime/DEBIAN/{prerm => pre_remove} | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) rename projects/rocr-runtime/runtime/hsa-runtime/DEBIAN/{postinst => post_install} (52%) rename projects/rocr-runtime/runtime/hsa-runtime/DEBIAN/{prerm => pre_remove} (76%) diff --git a/projects/rocr-runtime/runtime/hsa-runtime/CMakeLists.txt b/projects/rocr-runtime/runtime/hsa-runtime/CMakeLists.txt index 2aa3f1788d..04ea8c3d9d 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/CMakeLists.txt +++ b/projects/rocr-runtime/runtime/hsa-runtime/CMakeLists.txt @@ -206,6 +206,10 @@ set ( CPACK_PACKAGE_CONTACT "Advanced Micro Devices Inc." ) set ( CPACK_PACKAGE_DESCRIPTION_SUMMARY "AMD Heterogeneous System Architecture HSA - Linux HSA Runtime for Boltzmann (ROCm) platforms" ) set ( CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.md" ) +## Process the install scripts to update the CPACK variables +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/DEBIAN/post_install ${CMAKE_CURRENT_SOURCE_DIR}/DEBIAN/postinst @ONLY) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/DEBIAN/pre_remove ${CMAKE_CURRENT_SOURCE_DIR}/DEBIAN/prerm @ONLY) + # Debian package specific variables set ( CPACK_DEBIAN_PACKAGE_DEPENDS "hsakmt-roct" ) set ( CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://github.com/RadeonOpenCompute/ROCR-Runtime" ) diff --git a/projects/rocr-runtime/runtime/hsa-runtime/DEBIAN/postinst b/projects/rocr-runtime/runtime/hsa-runtime/DEBIAN/post_install similarity index 52% rename from projects/rocr-runtime/runtime/hsa-runtime/DEBIAN/postinst rename to projects/rocr-runtime/runtime/hsa-runtime/DEBIAN/post_install index 4a28ba94f3..295922dcfc 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/DEBIAN/postinst +++ b/projects/rocr-runtime/runtime/hsa-runtime/DEBIAN/post_install @@ -3,14 +3,13 @@ set -e do_ldconfig() { - echo /opt/rocm/hsa/lib > /etc/ld.so.conf.d/hsa-rocr-dev.conf && ldconfig + echo @CPACK_PACKAGING_INSTALL_PREFIX@/hsa/lib > /etc/ld.so.conf.d/hsa-rocr-dev.conf && ldconfig } case "$1" in configure) do_ldconfig - mkdir -p /opt/rocm/include - ln -s ../hsa/include/hsa /opt/rocm/include/hsa + ln -sf ../hsa/include/hsa @CPACK_PACKAGING_INSTALL_PREFIX@/include/hsa ;; abort-upgrade|abort-remove|abort-deconfigure) echo "$1" diff --git a/projects/rocr-runtime/runtime/hsa-runtime/DEBIAN/prerm b/projects/rocr-runtime/runtime/hsa-runtime/DEBIAN/pre_remove similarity index 76% rename from projects/rocr-runtime/runtime/hsa-runtime/DEBIAN/prerm rename to projects/rocr-runtime/runtime/hsa-runtime/DEBIAN/pre_remove index 23c416a055..2dd27fdc36 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/DEBIAN/prerm +++ b/projects/rocr-runtime/runtime/hsa-runtime/DEBIAN/pre_remove @@ -9,7 +9,7 @@ rm_ldconfig() { case "$1" in remove) rm_ldconfig - rm /opt/rocm/include/hsa + rm -rf @CPACK_PACKAGING_INSTALL_PREFIX@/include/hsa ;; purge) ;;