Hasp-tool 支持 aarch64 架构, CI 增加 rocky9 aarch64 rpm 打包, 移除 centos7 打包
This commit is contained in:
216
.gitlab-ci.yml
216
.gitlab-ci.yml
@@ -3,118 +3,15 @@ variables:
|
||||
BUILD_PADDING_PREFIX: /tmp/padding_for_CPACK_RPM_BUILD_SOURCE_DIRS_PREFIX_PREFIX_PREFIX_PREFIX_PREFIX_PREFIX/
|
||||
INSTALL_PREFIX: "/opt/tsg/hasp-tools"
|
||||
TESTING_VERSION_BUILD: 0
|
||||
BUILD_IMAGE_CENTOS7: "git.mesalab.cn:7443/mesa_platform/build-env:master"
|
||||
# BUILD_IMAGE_CENTOS7: "git.mesalab.cn:7443/mesa_platform/build-env:master"
|
||||
BUILD_IMAGE_CENTOS8: "git.mesalab.cn:7443/mesa_platform/build-env:rockylinux"
|
||||
# aarch64 build image
|
||||
BUILD_IMAGE_ROCKY8_AARCH64: "git.mesalab.cn:7443/mesa_platform/build-env:rocky8-aarch64"
|
||||
BUILD_IMAGE_ROCKY9_AARCH64: "git.mesalab.cn:7443/mesa_platform/build-env:rocky9-aarch64"
|
||||
|
||||
stages:
|
||||
- build
|
||||
|
||||
###############################################################################
|
||||
# compile use image: build-env:master
|
||||
###############################################################################
|
||||
|
||||
.build_by_travis_for_centos7:
|
||||
image: $BUILD_IMAGE_CENTOS7
|
||||
before_script:
|
||||
- mkdir -p $BUILD_PADDING_PREFIX/$CI_PROJECT_NAMESPACE/
|
||||
- ln -s $CI_PROJECT_DIR $BUILD_PADDING_PREFIX/$CI_PROJECT_PATH
|
||||
- cd $BUILD_PADDING_PREFIX/$CI_PROJECT_PATH
|
||||
- chmod +x ./ci/travis.sh
|
||||
- yum install -y elfutils-libelf-devel
|
||||
script:
|
||||
- yum makecache
|
||||
- ./ci/travis.sh
|
||||
tags:
|
||||
- share
|
||||
|
||||
branch_build_debug_centos7:
|
||||
stage: build
|
||||
extends: .build_by_travis_for_centos7
|
||||
variables:
|
||||
BUILD_TYPE: Debug
|
||||
except:
|
||||
- /^develop-.*$/i
|
||||
- /^release-.*$/i
|
||||
- tags
|
||||
|
||||
branch_build_release_centos7:
|
||||
stage: build
|
||||
variables:
|
||||
BUILD_TYPE: RelWithDebInfo
|
||||
extends: .build_by_travis_for_centos7
|
||||
except:
|
||||
- /^develop-.*$/i
|
||||
- /^release-.*$/i
|
||||
- tags
|
||||
|
||||
develop_build_debug_centos7:
|
||||
stage: build
|
||||
extends: .build_by_travis_for_centos7
|
||||
variables:
|
||||
TESTING_VERSION_BUILD: 1
|
||||
#UPLOAD_SYMBOL_FILES: 0
|
||||
BUILD_TYPE: Debug
|
||||
PACKAGE: 1
|
||||
PULP3_REPO_NAME: tsg-testing-x86_64.el7
|
||||
PULP3_DIST_NAME: tsg-testing-x86_64.el7
|
||||
artifacts:
|
||||
name: "hasp-tools-develop-$CI_COMMIT_REF_NAME-debug"
|
||||
paths:
|
||||
- build/*.rpm
|
||||
only:
|
||||
- /^develop-.*$/i
|
||||
- /^release-.*$/i
|
||||
|
||||
develop_build_release_centos7:
|
||||
stage: build
|
||||
extends: .build_by_travis_for_centos7
|
||||
variables:
|
||||
TESTING_VERSION_BUILD: 1
|
||||
#UPLOAD_SYMBOL_FILES: 0
|
||||
BUILD_TYPE: RelWithDebInfo
|
||||
PACKAGE: 1
|
||||
PULP3_REPO_NAME: tsg-testing-x86_64.el7
|
||||
PULP3_DIST_NAME: tsg-testing-x86_64.el7
|
||||
artifacts:
|
||||
name: "hasp-tools-develop-$CI_COMMIT_REF_NAME-release"
|
||||
paths:
|
||||
- build/*.rpm
|
||||
only:
|
||||
- /^develop-.*$/i
|
||||
- /^release-.*$/i
|
||||
|
||||
release_build_debug_centos7:
|
||||
stage: build
|
||||
variables:
|
||||
#UPLOAD_SYMBOL_FILES: 0
|
||||
BUILD_TYPE: Debug
|
||||
PACKAGE: 1
|
||||
PULP3_REPO_NAME: tsg-stable-x86_64.el7
|
||||
PULP3_DIST_NAME: tsg-stable-x86_64.el7
|
||||
extends: .build_by_travis_for_centos7
|
||||
artifacts:
|
||||
name: "hasp-tools-install-$CI_COMMIT_REF_NAME-debug"
|
||||
paths:
|
||||
- build/*.rpm
|
||||
only:
|
||||
- tags
|
||||
|
||||
release_build_release_centos7:
|
||||
stage: build
|
||||
variables:
|
||||
BUILD_TYPE: RelWithDebInfo
|
||||
#UPLOAD_SYMBOL_FILES: 0
|
||||
PACKAGE: 1
|
||||
PULP3_REPO_NAME: tsg-stable-x86_64.el7
|
||||
PULP3_DIST_NAME: tsg-stable-x86_64.el7
|
||||
extends: .build_by_travis_for_centos7
|
||||
artifacts:
|
||||
name: "hasp-tools-install-$CI_COMMIT_REF_NAME-release"
|
||||
paths:
|
||||
- build/*.rpm
|
||||
only:
|
||||
- tags
|
||||
|
||||
###############################################################################
|
||||
# compile use image: build-env:rockylinux"
|
||||
###############################################################################
|
||||
@@ -214,6 +111,111 @@ release_build_release_centos8:
|
||||
PULP3_REPO_NAME: tsg-stable-x86_64.el8
|
||||
PULP3_DIST_NAME: tsg-stable-x86_64.el8
|
||||
extends: .build_by_travis_for_centos8
|
||||
artifacts:
|
||||
name: "hasp-tools-install-$CI_COMMIT_REF_NAME-release"
|
||||
paths:
|
||||
- build/*.rpm
|
||||
only:
|
||||
- tags
|
||||
|
||||
###############################################################################
|
||||
# compile use image: rocky9-aarch64
|
||||
###############################################################################
|
||||
|
||||
.build_by_travis_for_rocky9_aarch64:
|
||||
image: $BUILD_IMAGE_ROCKY9_AARCH64
|
||||
before_script:
|
||||
- mkdir -p $BUILD_PADDING_PREFIX/$CI_PROJECT_NAMESPACE/
|
||||
- ln -s $CI_PROJECT_DIR $BUILD_PADDING_PREFIX/$CI_PROJECT_PATH
|
||||
- cd $BUILD_PADDING_PREFIX/$CI_PROJECT_PATH
|
||||
- chmod +x ./ci/travis.sh
|
||||
- yum install -y elfutils-libelf-devel
|
||||
script:
|
||||
- yum makecache
|
||||
- ./ci/travis.sh
|
||||
tags:
|
||||
- tsg-os-builder-aarch64 # 修改这里以匹配实际的 runner 标签
|
||||
|
||||
# Branch builds for Rocky9 aarch64
|
||||
branch_build_debug_rocky9_aarch64:
|
||||
stage: build
|
||||
extends: .build_by_travis_for_rocky9_aarch64
|
||||
variables:
|
||||
BUILD_TYPE: Debug
|
||||
except:
|
||||
- /^develop-.*$/i
|
||||
- /^release-.*$/i
|
||||
- tags
|
||||
|
||||
branch_build_release_rocky9_aarch64:
|
||||
stage: build
|
||||
variables:
|
||||
BUILD_TYPE: RelWithDebInfo
|
||||
extends: .build_by_travis_for_rocky9_aarch64
|
||||
except:
|
||||
- /^develop-.*$/i
|
||||
- /^release-.*$/i
|
||||
- tags
|
||||
|
||||
# Develop builds for Rocky9 aarch64
|
||||
develop_build_debug_rocky9_aarch64:
|
||||
stage: build
|
||||
extends: .build_by_travis_for_rocky9_aarch64
|
||||
variables:
|
||||
TESTING_VERSION_BUILD: 1
|
||||
BUILD_TYPE: Debug
|
||||
PACKAGE: 1
|
||||
PULP3_REPO_NAME: tsg-testing-aarch64.el9
|
||||
PULP3_DIST_NAME: tsg-testing-aarch64.el9
|
||||
artifacts:
|
||||
name: "hasp-tools-develop-$CI_COMMIT_REF_NAME-debug"
|
||||
paths:
|
||||
- build/*.rpm
|
||||
only:
|
||||
- /^develop-.*$/i
|
||||
- /^release-.*$/i
|
||||
|
||||
develop_build_release_rocky9_aarch64:
|
||||
stage: build
|
||||
extends: .build_by_travis_for_rocky9_aarch64
|
||||
variables:
|
||||
TESTING_VERSION_BUILD: 1
|
||||
BUILD_TYPE: RelWithDebInfo
|
||||
PACKAGE: 1
|
||||
PULP3_REPO_NAME: tsg-testing-aarch64.el9
|
||||
PULP3_DIST_NAME: tsg-testing-aarch64.el9
|
||||
artifacts:
|
||||
name: "hasp-tools-develop-$CI_COMMIT_REF_NAME-release"
|
||||
paths:
|
||||
- build/*.rpm
|
||||
only:
|
||||
- /^develop-.*$/i
|
||||
- /^release-.*$/i
|
||||
|
||||
# Release builds for Rocky9 aarch64
|
||||
release_build_debug_rocky9_aarch64:
|
||||
stage: build
|
||||
variables:
|
||||
BUILD_TYPE: Debug
|
||||
PACKAGE: 1
|
||||
PULP3_REPO_NAME: tsg-stable-aarch64.el9
|
||||
PULP3_DIST_NAME: tsg-stable-aarch64.el9
|
||||
extends: .build_by_travis_for_rocky9_aarch64
|
||||
artifacts:
|
||||
name: "hasp-tools-install-$CI_COMMIT_REF_NAME-debug"
|
||||
paths:
|
||||
- build/*.rpm
|
||||
only:
|
||||
- tags
|
||||
|
||||
release_build_release_rocky9_aarch64:
|
||||
stage: build
|
||||
variables:
|
||||
BUILD_TYPE: RelWithDebInfo
|
||||
PACKAGE: 1
|
||||
PULP3_REPO_NAME: tsg-stable-aarch64.el9
|
||||
PULP3_DIST_NAME: tsg-stable-aarch64.el9
|
||||
extends: .build_by_travis_for_rocky9_aarch64
|
||||
artifacts:
|
||||
name: "hasp-tools-install-$CI_COMMIT_REF_NAME-release"
|
||||
paths:
|
||||
|
||||
@@ -20,6 +20,13 @@ set(CPACK_RPM_PACKAGE_AUTOREQPROV "no")
|
||||
set(CPACK_RPM_PACKAGE_RELEASE_DIST on)
|
||||
set(CPACK_RPM_DEBUGINFO_PACKAGE on)
|
||||
|
||||
# set RPM architecture
|
||||
if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "aarch64")
|
||||
set(CPACK_RPM_PACKAGE_ARCHITECTURE "aarch64")
|
||||
else()
|
||||
set(CPACK_RPM_PACKAGE_ARCHITECTURE "x86_64")
|
||||
endif()
|
||||
|
||||
# Must uninstall the debug package before install release package
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
set(CPACK_RPM_PACKAGE_CONFLICTS "hasp-tools")
|
||||
|
||||
BIN
depend/aksusbd-8.31-1.aarch64.rpm
Normal file
BIN
depend/aksusbd-8.31-1.aarch64.rpm
Normal file
Binary file not shown.
BIN
lib/libhasp_linux_arm64_25743.a
Normal file
BIN
lib/libhasp_linux_arm64_25743.a
Normal file
Binary file not shown.
@@ -2,14 +2,22 @@
|
||||
add_executable(hasp_update src/hasp_update.c)
|
||||
target_include_directories(hasp_update PUBLIC ${CMAKE_CURRENT_LIST_DIR}/include/)
|
||||
target_link_libraries(hasp_update pthread)
|
||||
target_link_libraries(hasp_update ${CMAKE_SOURCE_DIR}/lib/libhasp_linux_x86_64_25743.a)
|
||||
|
||||
# aarch64 or x86_64
|
||||
if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "aarch64")
|
||||
set(HASP_LIB "libhasp_linux_arm64_25743.a")
|
||||
else()
|
||||
set(HASP_LIB "libhasp_linux_x86_64_25743.a")
|
||||
endif()
|
||||
|
||||
target_link_libraries(hasp_update ${CMAKE_SOURCE_DIR}/lib/${HASP_LIB})
|
||||
install(TARGETS hasp_update RUNTIME DESTINATION bin COMPONENT Program)
|
||||
|
||||
# compile lib hasp-tools
|
||||
add_library(hasp-tools SHARED src/hasp_verify.c)
|
||||
target_include_directories(hasp-tools PUBLIC ${CMAKE_CURRENT_LIST_DIR}/include)
|
||||
target_link_libraries(hasp-tools pthread rt)
|
||||
target_link_libraries(hasp-tools ${CMAKE_SOURCE_DIR}/lib/libhasp_linux_x86_64_25743.a)
|
||||
target_link_libraries(hasp-tools ${CMAKE_SOURCE_DIR}/lib/${HASP_LIB})
|
||||
install(TARGETS hasp-tools LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/ COMPONENT LIBRARIES)
|
||||
install(FILES include/hasp_verify.h DESTINATION ${CMAKE_INSTALL_PREFIX}/include/ COMPONENT LIBRARIES)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user