File cmake.obscpio of Package AppImageLauncher
07070100000000000081a400000000000000000000000168cf694000000fce000000000000000000000000000000000000001400000000cmake/install.cmake# required by file(CHMOD ...)
cmake_minimum_required(VERSION 3.19)
# define private libraries install destination
include(GNUInstallDirs)
# debugging: libdir should be lib/<triplet>
message(STATUS "CMAKE_INSTALL_LIBDIR: ${CMAKE_INSTALL_LIBDIR}")
if(NOT IS_ABSOLUTE ${CMAKE_INSTALL_LIBDIR})
set(_libdir ${CMAKE_INSTALL_LIBDIR})
else()
file(RELATIVE_PATH _libdir ${CMAKE_INSTALL_LIBDIR} ${CMAKE_INSTALL_PREFIX})
endif()
set(_private_libdir ${_libdir}/appimagelauncher)
# calculate relative path from binary install destination to private library install dir
if(NOT IS_ABSOLUTE ${CMAKE_INSTALL_BINDIR})
set(_bindir ${CMAKE_INSTALL_BINDIR})
else()
file(RELATIVE_PATH _bindir ${CMAKE_INSTALL_BINDIR} ${CMAKE_INSTALL_PREFIX})
#set(_bindir ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR})
endif()
set(_abs_bindir ${CMAKE_INSTALL_PREFIX}/${_bindir})
set(_abs_private_libdir ${CMAKE_INSTALL_PREFIX}/${_private_libdir})
file(RELATIVE_PATH _rpath ${_abs_bindir} ${_abs_private_libdir})
set(_rpath "\$ORIGIN/${_rpath}")
# install libappimage.so into lib/appimagekit to avoid overwriting a libappimage potentially installed into /usr/lib
# or /usr/lib/x86_64-... or wherever the OS puts its libraries
install(
TARGETS libappimage
LIBRARY DESTINATION "${_private_libdir}" COMPONENT APPIMAGELAUNCHER
)
if(ENABLE_UPDATE_HELPER)
install(
TARGETS libappimageupdate libappimageupdate-qt
LIBRARY DESTINATION "${_private_libdir}" COMPONENT APPIMAGELAUNCHER
)
endif()
option(BINFMT_INTERPRETER_PATH_PREPEND_LD_P_NATIVE_PACKAGES_PREFIX "")
if(NOT BUILD_LITE)
# unfortunately, due to a cyclic dependency, we need to hardcode parts of this variable, which is included in the
# install scripts and the binfmt.d config
set(BINFMT_INTERPRETER_PATH ${CMAKE_INSTALL_PREFIX}/${_private_libdir}/binfmt-interpreter)
if(BINFMT_INTERPRETER_PATH_PREPEND_LD_P_NATIVE_PACKAGES_PREFIX)
message(STATUS "Prepending prefix ${BINFMT_INTERPRETER_PATH_PREPEND_LD_P_NATIVE_PACKAGES_PREFIX} to binfmt interpreter path")
set(BINFMT_INTERPRETER_PATH "${BINFMT_INTERPRETER_PATH_PREPEND_LD_P_NATIVE_PACKAGES_PREFIX}${BINFMT_INTERPRETER_PATH}")
endif()
# according to https://www.kernel.org/doc/html/latest/admin-guide/binfmt-misc.html, we must make sure the
# interpreter string does not exceed 127 characters
set(BINFMT_INTERPRETER_PATH_LENGTH_MAX 127)
string(LENGTH BINFMT_INTERPRETER_PATH BINFMT_INTERPRETER_PATH_LENGTH)
if(BINFMT_INTERPRETER_PATH_LENGTH GREATER BINFMT_INTERPRETER_PATH_LENGTH_MAX)
message(FATAL_ERROR "interpreter path exceeds maximum length of ${BINFMT_INTERPRETER_PATH_LENGTH_MAX}")
endif()
# binfmt.d config file -- used as a fallback, if update-binfmts is not available
configure_file(
${PROJECT_SOURCE_DIR}/resources/binfmt.d/appimagelauncher.conf.in
${PROJECT_BINARY_DIR}/resources/binfmt.d/appimagelauncher.conf
@ONLY
)
# caution: don't use ${CMAKE_INSTALL_LIBDIR} here, it's really just lib/binfmt.d
install(
FILES ${PROJECT_BINARY_DIR}/resources/binfmt.d/appimagelauncher.conf
DESTINATION lib/binfmt.d COMPONENT APPIMAGELAUNCHER
)
# prepare postinst and prerm hooks to Debian package
configure_file(
${PROJECT_SOURCE_DIR}/resources/install-scripts/post-install.in
${PROJECT_BINARY_DIR}/cmake/debian/postinst
@ONLY
)
configure_file(
${PROJECT_SOURCE_DIR}/resources/install-scripts/post-uninstall.in
${PROJECT_BINARY_DIR}/cmake/debian/postrm
@ONLY
)
endif()
# install systemd service configuration for appimagelauncherd
configure_file(
${PROJECT_SOURCE_DIR}/resources/appimagelauncherd.service.in
${PROJECT_BINARY_DIR}/resources/appimagelauncherd.service
@ONLY
)
# caution: don't use ${CMAKE_INSTALL_LIBDIR} here, it's really just lib/systemd/user
install(
FILES ${PROJECT_BINARY_DIR}/resources/appimagelauncherd.service
DESTINATION lib/systemd/user/ COMPONENT APPIMAGELAUNCHER
)
07070100000001000081a400000000000000000000000168cf6940000001c0000000000000000000000000000000000000002000000000cmake/modules/FindINotify.cmakefind_path(INOTIFY_INCLUDE_DIR sys/inotify.h PATH_SUFFIXES inotify)
find_library(INOTIFY_LIBRARY inotify)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(INotify DEFAULT_MSG INOTIFY_INCLUDE_DIR)
IF(INOTIFY_FOUND)
set(INotify_INCLUDE_DIRS ${INOTIFY_INCLUDE_DIR})
add_library(inotify IMPORTED INTERFACE)
set_property(TARGET inotify PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${INOTIFY_INCLUDE_DIRS})
ENDIF(INOTIFY_FOUND)
07070100000002000041ed00000000000000000000000168cf694000000000000000000000000000000000000000000000000e00000000cmake/modules07070100000003000081a400000000000000000000000168cf694000000553000000000000000000000000000000000000002000000000cmake/reproducible_builds.cmake# this little snippet makes sure that no absolute paths end up in the binaries built by CMake
# it will replace such paths with relative ones
# see https://reproducible-builds.org/docs/build-path/ for more information
cmake_minimum_required(VERSION 3.5)
include(CheckCCompilerFlag)
if(CMAKE_BUILD_TYPE STREQUAL Release)
message(STATUS "Release build detected, enabling reproducible builds mode")
get_filename_component(abs_source_path ${PROJECT_SOURCE_DIR} ABSOLUTE)
file(RELATIVE_PATH rel_source_path ${PROJECT_BINARY_DIR} ${PROJECT_SOURCE_DIR})
set(map_fix ${abs_source_path}=${rel_source_path})
# can only add flags when the compiler supports them
# known working compilers: GCC >= 8
foreach(type debug macro)
set(flag_name -f${type}-prefix-map)
set(flags ${flag_name}=${map_fix})
check_c_compiler_flag(${flags} ${type}_prefix_map_flag_available)
if(${type}_prefix_map_flag_available)
set(extra_flags "${extra_flags} ${flags}")
else()
message(WARNING "${flag_name} not available, cannot enable full reproducible builds mode")
endif()
endforeach()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${extra_flags}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${extra_flags}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${extra_flags}")
endif()
07070100000004000081a400000000000000000000000168cf694000000506000000000000000000000000000000000000001400000000cmake/scripts.cmake# borrowed from libappimage
if(NOT COMMAND check_program)
function(check_program)
set(keywords FORCE_PREFIX)
set(oneValueArgs NAME)
cmake_parse_arguments(ARG "${keywords}" "${oneValueArgs}" "" "${ARGN}")
if(NOT ARG_NAME)
message(FATAL_ERROR "NAME argument required for check_program")
endif()
if(TOOLS_PREFIX)
set(prefix ${TOOLS_PREFIX})
endif()
message(STATUS "Checking for program ${ARG_NAME}")
string(TOUPPER ${ARG_NAME} name_upper)
if(prefix)
# try prefixed version first
find_program(${name_upper} ${prefix}${ARG_NAME})
endif()
# try non-prefixed version
if(NOT ${name_upper})
if(TOOLS_PREFIX AND ARG_FORCE_PREFIX)
message(FATAL_ERROR "TOOLS_PREFIX set, but could not find program with prefix in PATH (FORCE_PREFIX is set)")
endif()
find_program(${name_upper} ${ARG_NAME})
if(NOT ${name_upper})
message(FATAL_ERROR "Could not find required program ${ARG_NAME}.")
endif()
endif()
message(STATUS "Found program ${ARG_NAME}: ${${name_upper}}")
mark_as_advanced(${name_upper})
endfunction()
endif()
07070100000005000081a400000000000000000000000168cf694000000746000000000000000000000000000000000000002600000000cmake/toolchains/i386-linux-gnu.cmake# this toolchain file works for cross compiling on Ubuntu when the following prerequisites are given:
# - all dependencies that would be needed for a normal build must be installed as i386 versions
# - building XZ/liblzma doesn't work yet, so one has to install liblzma-dev:i386 and set -DUSE_SYSTEM_XZ=ON
# - building GTest doesn't work yet, so one has to install libgtest-dev:i386 and set -DUSE_SYSTEM_GTEST=ON
# - building libarchive doesn't work yet, so one has to install liblzma-dev:i386 and set -DUSE_SYSTEM_LIBARCHIVE=ON (TODO: link system libarchive statically like liblzma)
# some of the packets interfere with their x86_64 version (e.g., libfuse-dev:i386, libglib2-dev:i386), so building on a
# normal system will most likely not work, but on systems like Travis it should work fine
set(CMAKE_SYSTEM_NAME Linux CACHE STRING "" FORCE)
set(CMAKE_SYSTEM_PROCESSOR i386 CACHE STRING "" FORCE)
set(CMAKE_C_FLAGS "-m32" CACHE STRING "" FORCE)
set(CMAKE_CXX_FLAGS "-m32" CACHE STRING "" FORCE)
# CMAKE_SHARED_LINKER_FLAGS, CMAKE_STATIC_LINKER_FLAGS etc. must not be set, but CMAKE_EXE_LINKER_FLAGS is necessary
set(CMAKE_EXE_LINKER_FLAGS "-m32" CACHE STRING "" FORCE)
set(DEPENDENCIES_CFLAGS "-m32" CACHE STRING "" FORCE)
set(DEPENDENCIES_CPPFLAGS "-m32" CACHE STRING "" FORCE)
set(DEPENDENCIES_LDFLAGS "-m32" CACHE STRING "" FORCE)
# host = target system
# build = build system
# both must be specified
set(EXTRA_CONFIGURE_FLAGS "--host=i686-pc-linux-gnu" "--build=x86_64-pc-linux-gnu" CACHE STRING "" FORCE)
# may help with some rare issues
set(CMAKE_PREFIX_PATH /usr/lib/i386-linux-gnu CACHE STRING "" FORCE)
# makes sure that at least on Ubuntu pkg-config will search for the :i386 packages
set(ENV{PKG_CONFIG_PATH} /usr/lib/i386-linux-gnu/pkgconfig/ CACHE STRING "" FORCE)
# make qtchooser find qt5
set(ENV{QT_SELECT} qt5 CACHE STRING "" FORCE)
07070100000006000041ed00000000000000000000000168cf694000000000000000000000000000000000000000000000001100000000cmake/toolchains07070100000007000081a400000000000000000000000168cf694000000adf000000000000000000000000000000000000001700000000cmake/versioning.cmakeset(V_MAJOR 3)
set(V_MINOR 0)
set(V_PATCH 0)
set(V_SUFFIX "-alpha-4")
set(APPIMAGELAUNCHER_VERSION ${V_MAJOR}.${V_MINOR}.${V_PATCH}${V_SUFFIX})
# check whether git is available
find_program(GIT git)
set(GIT_COMMIT_CACHE_FILE "${PROJECT_SOURCE_DIR}/cmake/GIT_COMMIT")
if(NOT GIT STREQUAL "GIT-NOTFOUND")
# read Git revision ID
# WARNING: this value will be stored in the CMake cache
# to update it, you will have to reset the CMake cache
# (doesn't matter for CI builds like Travis for instance, where there's no permanent CMake cache)
execute_process(
COMMAND git rev-parse --short HEAD
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
OUTPUT_VARIABLE APPIMAGELAUNCHER_GIT_COMMIT
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_QUIET
RESULT_VARIABLE GIT_RESULT
)
if(GIT_RESULT EQUAL 0)
message(STATUS "Storing git commit ID in cache file")
file(WRITE "${GIT_COMMIT_CACHE_FILE}" "${APPIMAGELAUNCHER_GIT_COMMIT}")
endif()
endif()
if(NOT GIT_RESULT EQUAL 0)
# git call failed or git hasn't been found, might happen when calling CMake in an extracted source tarball
# therefore we try to find the git commit cache file
# if it doesn't exist, refuse to configure
message(WARNING "Failed to gather commit ID via git command, trying to read cache file")
if(EXISTS "${GIT_COMMIT_CACHE_FILE}")
file(READ "${GIT_COMMIT_CACHE_FILE}" APPIMAGELAUNCHER_CACHED_GIT_COMMIT)
mark_as_advanced(FORCE APPIMAGELAUNCHER_CACHED_GIT_COMMIT)
string(REPLACE "\n" "" APPIMAGELAUNCHER_GIT_COMMIT "${APPIMAGELAUNCHER_CACHED_GIT_COMMIT}")
else()
message(FATAL_ERROR "Could not find git commit cache file, git commit ID not available for versioning")
endif()
endif()
if("${APPIMAGELAUNCHER_GIT_COMMIT}" STREQUAL "")
message(FATAL_ERROR "Invalid git commit ID: ${APPIMAGELAUNCHER_GIT_COMMIT}")
endif()
message(STATUS "Git commit: ${APPIMAGELAUNCHER_GIT_COMMIT}")
mark_as_advanced(FORCE APPIMAGELAUNCHER_GIT_COMMIT)
# add build number based on GitHub actions build number if possible
if("$ENV{GITHUB_RUN_NUMBER}" STREQUAL "")
set(APPIMAGELAUNCHER_BUILD_NUMBER "<local dev build>")
else()
set(APPIMAGELAUNCHER_BUILD_NUMBER "$ENV{GITHUB_RUN_NUMBER}")
endif()
# get current date
execute_process(
COMMAND env LC_ALL=C date -u "+%Y-%m-%d %H:%M:%S %Z"
OUTPUT_VARIABLE APPIMAGELAUNCHER_BUILD_DATE
OUTPUT_STRIP_TRAILING_WHITESPACE
)
add_definitions(-DAPPIMAGELAUNCHER_VERSION="${APPIMAGELAUNCHER_VERSION}")
add_definitions(-DAPPIMAGELAUNCHER_GIT_COMMIT="${APPIMAGELAUNCHER_GIT_COMMIT}")
add_definitions(-DAPPIMAGELAUNCHER_BUILD_NUMBER="${APPIMAGELAUNCHER_BUILD_NUMBER}")
add_definitions(-DAPPIMAGELAUNCHER_BUILD_DATE="${APPIMAGELAUNCHER_BUILD_DATE}")
07070100000008000041ed00000000000000000000000168cf694000000000000000000000000000000000000000000000000600000000cmake07070100000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000b00000000TRAILER!!!