Skip to content

Commit

Permalink
SWDEV-371122 - Package name corrected for hip-catch-amd (#160)
Browse files Browse the repository at this point in the history
Change-Id: I8ca14f50761e8f332bc0ca096594e241077f4715
  • Loading branch information
rocm-ci authored Feb 10, 2023
1 parent 5e90a5e commit 66ad409
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
6 changes: 6 additions & 0 deletions catch/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@ list(GET VERSION_LIST 2 HIP_VERSION_PATCH_GITHASH)
string(REPLACE "-" ";" VERSION_LIST ${HIP_VERSION_PATCH_GITHASH})
list(GET VERSION_LIST 0 HIP_VERSION_PATCH)

if(DEFINED ENV{ROCM_LIBPATCH_VERSION})
set(HIP_PACKAGING_VERSION_PATCH ${HIP_VERSION_PATCH}.$ENV{ROCM_LIBPATCH_VERSION})
else()
set(HIP_PACKAGING_VERSION_PATCH ${HIP_VERSION_PATCH}-${HIP_VERSION_GITHASH})
endif()

if(NOT DEFINED CATCH2_PATH)
if(DEFINED ENV{CATCH2_PATH})
set(CATCH2_PATH $ENV{CATCH2_PATH} CACHE STRING "Catch2 Path")
Expand Down
23 changes: 22 additions & 1 deletion catch/packaging/hip-tests.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ set(CPACK_PACKAGE_DESCRIPTION "HIP:
Heterogenous-computing Interface for Portability [CATCH TESTS]")
set(CPACK_PACKAGE_VENDOR "Advanced Micro Devices, Inc.")
set(CPACK_PACKAGE_CONTACT "HIP Support <[email protected]>")
set(CPACK_PACKAGE_VERSION @HIP_VERSION_MAJOR@.@HIP_VERSION_MINOR@.@HIP_VERSION_PATCH_GITHASH@)
set(CPACK_PACKAGE_VERSION @HIP_VERSION_MAJOR@.@HIP_VERSION_MINOR@.@HIP_PACKAGING_VERSION_PATCH@)
# by default rpm tries to reduce the file size by stripping the executable
# To avoid build/packaging failures SWDEV-375603 and skip stripping
set(CPACK_RPM_SPEC_MORE_DEFINE "%global __os_install_post %{nil}")
Expand All @@ -100,6 +100,27 @@ if (CPACK_PACKAGE_VERSION MATCHES "local" )
set(CPACK_RPM_BUILD_SOURCE_DIRS_PREFIX ${CPACK_INSTALL_PREFIX})
endif()

if (DEFINED ENV{CPACK_DEBIAN_PACKAGE_RELEASE})
set(CPACK_DEBIAN_PACKAGE_RELEASE $ENV{CPACK_DEBIAN_PACKAGE_RELEASE})
else()
set(CPACK_DEBIAN_PACKAGE_RELEASE "local")
endif()

if(DEFINED ENV{CPACK_RPM_PACKAGE_RELEASE})
set(CPACK_RPM_PACKAGE_RELEASE $ENV{CPACK_RPM_PACKAGE_RELEASE})
else()
set(CPACK_RPM_PACKAGE_RELEASE "local")
endif()

execute_process( COMMAND rpm --eval %{?dist}
RESULT_VARIABLE PROC_RESULT
OUTPUT_VARIABLE EVAL_RESULT
OUTPUT_STRIP_TRAILING_WHITESPACE )
# Add os distribution tag to rpm package name . For deb package its set from build env
if ( PROC_RESULT EQUAL "0" AND NOT EVAL_RESULT STREQUAL "" )
string(APPEND CPACK_RPM_PACKAGE_RELEASE "%{?dist}")
endif()

set(CPACK_SOURCE_GENERATOR "TGZ")
# Install license file
set ( CPACK_RESOURCE_FILE_LICENSE "@CMAKE_CURRENT_LIST_DIR@/../LICENSE.txt" )
Expand Down

0 comments on commit 66ad409

Please sign in to comment.