Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
awawa-dev committed Jul 15, 2024
1 parent 569972b commit 7a0daf2
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 16 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
*.swp
/*.user
/build
.DS_Store
CMakeFiles/
__/
Expand All @@ -18,6 +17,9 @@ CMakeCache.txt
.directory
*.pyc
compile_commands.json
.ccache/
deploy/
build/

# Autogenerated by flatbuffers
include/flatbuffers/parser/hyperhdr_reply_generated.h
Expand Down
16 changes: 9 additions & 7 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ print_manual()
CyanColor="${EscChar}[36;1m"

printf "\n${GreenColor}Required environmental options:${ColorReset}"
printf "\n${YellowColor}PLATFORM${ColorReset} - one of supported target: osx|windows|linux|rpi"
printf "\n${YellowColor}DOCKER_TAG${ColorReset} | ${YellowColor}DOCKER_IMAGE${ColorReset} - both are required only for linux/rpi platforms:"
printf "\n${YellowColor}PLATFORM${ColorReset} - one of the supported targets: osx|windows|linux|rpi"
printf "\n${YellowColor}DOCKER_TAG${ColorReset} | ${YellowColor}DOCKER_IMAGE${ColorReset} - both are required only for linux|rpi platforms:"

printf "\n Debian => ${YellowColor2}bullseye${ColorReset} | ${YellowColor2}x86_64${ColorReset}"
printf "\n Debian => ${YellowColor2}bullseye${ColorReset} | ${YellowColor2}arm-32bit-armv6l${ColorReset}"
Expand All @@ -27,11 +27,13 @@ print_manual()
printf "\n ArchLinux => ${YellowColor2}ArchLinux${ColorReset} | ${YellowColor2}x86_64${ColorReset}"

printf "\n\n${GreenColor}Optional environmental options:${ColorReset}"
printf "\n${CyanColor}BUILD_TYPE${ColorReset} - one of Release|Debug option. Default is: Release"
printf "\n${CyanColor}BUILD_ARCHIVES${ColorReset} - false | true, cpack will compile ZIP package"
printf "\n${CyanColor}USE_STANDARD_INSTALLER_NAME${ColorReset} - false | true, use standard Linux package naming"
printf "\n${CyanColor}USE_CCACHE${ColorReset} - false | true, use ccache if available"
printf "\n${CyanColor}RESET_CACHE${ColorReset} - false | true, reset ccache storage"
printf "\n${CyanColor}BUILD_TYPE${ColorReset} - Release|Debug, default is Release version"
printf "\n${CyanColor}BUILD_ARCHIVES${ColorReset} - false|true, cpack will build ZIP package"
printf "\n${CyanColor}USE_STANDARD_INSTALLER_NAME${ColorReset} - false|true, use standard Linux package naming"
printf "\n${CyanColor}USE_CCACHE${ColorReset} - false|true, use ccache if available"
printf "\n${CyanColor}RESET_CACHE${ColorReset} - false|true, reset ccache storage"
printf "\n\n${GreenColor}Example of usage:${ColorReset}\n${YellowColor}PLATFORM=linux DOCKER_TAG=bullseye DOCKER_IMAGE=arm-64bit-aarch64 ./build.sh${ColorReset}"
printf "\nInstallers from Docker builds will be ready in the ${RedColor}deploy${ColorReset} folder"
printf "\n\n"
exit 0
}
Expand Down
17 changes: 15 additions & 2 deletions cmake/installers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -474,10 +474,23 @@ macro(DeployUnix TARGET)

# Copy dependencies to 'share/hyperhdr/lib'
foreach(PREREQUISITE_LIB ${PREREQUISITE_LIBS})
message("Installing: " ${PREREQUISITE_LIB})
set(FILE_TO_INSTALL ${PREREQUISITE_LIB})
string(FIND ${PREREQUISITE_LIB} "libproxy" libproxyindex)
string(FIND ${PREREQUISITE_LIB} "libpxbackend" libpxbackendindex)
if((NOT IS_SYMLINK ${PREREQUISITE_LIB}) AND (${libproxyindex} GREATER -1 OR ${libpxbackendindex} GREATER -1))
get_filename_component(pathingFilename ${PREREQUISITE_LIB} NAME)
set(FILE_TO_INSTALL "${CMAKE_BINARY_DIR}/${pathingFilename}")
message("Patching RPATH: ${FILE_TO_INSTALL}")
file(COPY_FILE ${PREREQUISITE_LIB} ${FILE_TO_INSTALL} )
execute_process (
COMMAND bash -c "chrpath -d ${FILE_TO_INSTALL}"
OUTPUT_VARIABLE outputResult
)
endif()
message("Installing: " ${FILE_TO_INSTALL})
file(
INSTALL
FILES ${PREREQUISITE_LIB}
FILES ${FILE_TO_INSTALL}
DESTINATION "${CMAKE_INSTALL_PREFIX}/share/hyperhdr/lib"
TYPE SHARED_LIBRARY
)
Expand Down
12 changes: 6 additions & 6 deletions cmake/packages.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ ENDMACRO (CHECK_GLIBC_VERSION)

# default packages to build
if(BUILD_ARCHIVES)
message(STATUS "Building archives")
message("Building archives")
IF (APPLE)
SET ( CPACK_GENERATOR "TGZ")
ELSEIF (UNIX)
Expand All @@ -22,7 +22,7 @@ if(BUILD_ARCHIVES)
SET ( CPACK_GENERATOR "ZIP" "NSIS")
ENDIF()
ELSE()
message(STATUS "Skipping archives")
message("Skipping archives")
IF (WIN32)
SET ( CPACK_GENERATOR "NSIS")
ENDIF()
Expand All @@ -33,13 +33,13 @@ ENDIF()
# Github Action enables it for packages
find_package(RpmBuilder)
IF(RPM_BUILDER_FOUND)
message(STATUS "CPACK: Found RPM builder")
message("CPACK: Found RPM builder")
SET ( CPACK_GENERATOR ${CPACK_GENERATOR} "RPM")
ENDIF()

find_package(DebBuilder)
IF(DEB_BUILDER_FOUND)
message(STATUS "CPACK: Found DEB builder")
message("CPACK: Found DEB builder")
SET ( CPACK_GENERATOR ${CPACK_GENERATOR} "DEB")
ENDIF()

Expand Down Expand Up @@ -82,7 +82,7 @@ if(USE_STANDARD_INSTALLER_NAME AND UNIX AND NOT APPLE)
string(CONCAT CPACK_PACKAGE_VERSION_PATCH "${CPACK_PACKAGE_VERSION_PATCH}" "~${DEBIAN_NAME_TAG}")
endif()
SET ( CPACK_PACKAGE_FILE_NAME "HyperHDR-${HYPERHDR_VERSION_MAJOR}.${HYPERHDR_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}-${CMAKE_SYSTEM_PROCESSOR}")
message( STATUS "Package name: ${CPACK_PACKAGE_FILE_NAME}" )
message("Package name: ${CPACK_PACKAGE_FILE_NAME}" )
endif()
endif()

Expand Down Expand Up @@ -111,7 +111,7 @@ SET ( CPACK_DEBIAN_PACKAGE_DEPENDS "xz-utils, libglib2.0-0" )
if ( UNIX AND NOT APPLE )
CHECK_GLIBC_VERSION()
if ( GLIBC_VERSION )
MESSAGE (STATUS "Glibc version: ${GLIBC_VERSION}")
MESSAGE ("Glibc version: ${GLIBC_VERSION}")
string(CONCAT CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}" ", libc6 (>=${GLIBC_VERSION})" )
endif()
endif()
Expand Down

0 comments on commit 7a0daf2

Please sign in to comment.