Browse Source

Merge pull request #275 from patrickelectric/exclude_list_warnings

Add exclude list messages and tests in project
master
TheAssassin 7 years ago
committed by GitHub
parent
commit
a714ea2e90
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 40
      CMakeLists.txt
  2. 3
      tools/excludelist.sh
  3. 5
      tools/linuxdeployqt/CMakeLists.txt
  4. 19
      tools/linuxdeployqt/linuxdeployqt.pro

40
CMakeLists.txt

@ -5,38 +5,53 @@ cmake_minimum_required(VERSION 3.2)
project(linuxdeployqt) project(linuxdeployqt)
# read Git revision ID find_program(GIT git)
execute_process(
COMMAND git rev-parse --short HEAD
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
OUTPUT_VARIABLE GIT_COMMIT
OUTPUT_STRIP_TRAILING_WHITESPACE
)
# make sure Git revision ID and latest tag is not stored in the CMake cache # make sure Git revision ID and latest tag is not stored in the CMake cache
# otherwise, one would have to reset the CMake cache on every new commit to make sure the Git commit ID is up to date # otherwise, one would have to reset the CMake cache on every new commit to make sure the Git commit ID is up to date
unset(GIT_COMMIT CACHE) unset(GIT_COMMIT CACHE)
unset(GIT_LATEST_TAG CACHE) unset(GIT_LATEST_TAG CACHE)
if("${GIT}" STREQUAL "GIT-NOTFOUND")
message(FATAL_ERROR "Could not find git")
endif()
# read Git revision ID and latest tag number # read Git revision ID and latest tag number
execute_process( execute_process(
COMMAND git rev-parse --short HEAD COMMAND "${GIT}" rev-parse --short HEAD
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
OUTPUT_VARIABLE GIT_COMMIT OUTPUT_VARIABLE GIT_COMMIT
OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_STRIP_TRAILING_WHITESPACE
RESULT_VARIABLE GIT_COMMIT_RESULT
) )
if(NOT GIT_COMMIT_RESULT EQUAL 0)
message(FATAL_ERROR "Failed to determine git commit ID")
endif()
mark_as_advanced(GIT_COMMIT GIT_COMMIT_RESULT)
execute_process( execute_process(
COMMAND git rev-list --tags --skip=1 --max-count=1 COMMAND "${GIT}" rev-list --tags --skip=1 --max-count=1
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
OUTPUT_VARIABLE GIT_TAG_ID OUTPUT_VARIABLE GIT_TAG_ID
OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_STRIP_TRAILING_WHITESPACE
RESULT_VARIABLE GIT_TAG_ID_RESULT
) )
if(NOT GIT_TAG_ID_RESULT EQUAL 0)
message(FATAL_ERROR "Failed to determine git tag ID")
endif()
mark_as_advanced(GIT_TAG_ID GIT_TAG_ID_RESULT)
execute_process( execute_process(
COMMAND git describe --tags ${GIT_TAG_ID} --abbrev=0 COMMAND "${GIT}" describe --tags ${GIT_TAG_ID} --abbrev=0
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
OUTPUT_VARIABLE GIT_TAG_NAME OUTPUT_VARIABLE GIT_TAG_NAME
OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_STRIP_TRAILING_WHITESPACE
RESULT_VARIABLE GIT_TAG_NAME_RESULT
) )
if(NOT GIT_TAG_NAME_RESULT EQUAL 0)
message(FATAL_ERROR "Failed to determine git tag name")
endif()
mark_as_advanced(GIT_TAG_NAME GIT_TAG_NAME_RESULT)
# set version and build number # set version and build number
set(VERSION 1-alpha) set(VERSION 1-alpha)
@ -51,6 +66,11 @@ execute_process(
COMMAND env LC_ALL=C date -u "+%Y-%m-%d %H:%M:%S %Z" COMMAND env LC_ALL=C date -u "+%Y-%m-%d %H:%M:%S %Z"
OUTPUT_VARIABLE DATE OUTPUT_VARIABLE DATE
OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_STRIP_TRAILING_WHITESPACE
RESULT_VARIABLE DATE_RESULT
) )
if(NOT DATE_RESULT EQUAL 0)
message(FATAL_ERROR "Failed to determine date string")
endif()
mark_as_advanced(DATE DATE_RESULT)
add_subdirectory(tools/linuxdeployqt) add_subdirectory(tools/linuxdeployqt)

3
tools/excludelist.sh

@ -1,7 +1,10 @@
#!/bin/bash #!/bin/bash
set -e
# Download excludelist # Download excludelist
blacklisted=($(wget --quiet https://raw.githubusercontent.com/probonopd/AppImages/master/excludelist -O - | sort | uniq | grep -v "^#.*" | grep "[^-\s]")) blacklisted=($(wget --quiet https://raw.githubusercontent.com/probonopd/AppImages/master/excludelist -O - | sort | uniq | grep -v "^#.*" | grep "[^-\s]"))
# Create array # Create array
for item in ${blacklisted[@]:0:${#blacklisted[@]}-1}; do for item in ${blacklisted[@]:0:${#blacklisted[@]}-1}; do
echo -ne '\\"'$item'\\" << ' echo -ne '\\"'$item'\\" << '

5
tools/linuxdeployqt/CMakeLists.txt

@ -13,7 +13,12 @@ execute_process(
COMMAND bash ${CMAKE_CURRENT_SOURCE_DIR}/../excludelist.sh COMMAND bash ${CMAKE_CURRENT_SOURCE_DIR}/../excludelist.sh
OUTPUT_VARIABLE EXCLUDELIST OUTPUT_VARIABLE EXCLUDELIST
TIMEOUT 10 TIMEOUT 10
RESULT_VARIABLE EXCLUDELIST_RESULT
) )
if(NOT EXCLUDELIST_RESULT EQUAL 0)
message(FATAL_ERROR "Failed to fetch and generate excludelist")
endif()
mark_as_advanced(EXCLUDELIST EXCLUDELIST_RESULT)
add_executable(linuxdeployqt main.cpp shared.cpp) add_executable(linuxdeployqt main.cpp shared.cpp)
target_include_directories(linuxdeployqt PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) target_include_directories(linuxdeployqt PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})

19
tools/linuxdeployqt/linuxdeployqt.pro

@ -35,4 +35,21 @@ isEmpty(_BUILD_NUMBER) {
} }
DEFINES += LINUXDEPLOYQT_VERSION="'\"$(shell cd $$PWD && git describe --tags $(shell cd $$PWD && git rev-list --tags --skip=1 --max-count=1) --abbrev=0)\"'" DEFINES += LINUXDEPLOYQT_VERSION="'\"$(shell cd $$PWD && git describe --tags $(shell cd $$PWD && git rev-list --tags --skip=1 --max-count=1) --abbrev=0)\"'"
DEFINES += EXCLUDELIST=\""$$system($$_PRO_FILE_PWD_/../excludelist.sh)"\" contains(DEFINES, EXCLUDELIST.*) {
message("EXCLUDELIST specified, to use the most recent exclude list, please run qmake without EXCLUDELIST definition and with internet.")
} else {
message("Creating exclude list.")
# check whether command _would_ run successfully
EXCLUDELIST_GENERATION_WORKS = FALSE
system($$_PRO_FILE_PWD_/../excludelist.sh): EXCLUDELIST_GENERATION_WORKS = TRUE
isEqual(EXCLUDELIST_GENERATION_WORKS, FALSE) {
error("Generating excludelist failed")
}
EXCLUDELIST = $$system($$_PRO_FILE_PWD_/../excludelist.sh)
isEmpty(EXCLUDELIST) {
error("Generated excludelist is empty")
}
DEFINES += EXCLUDELIST=\""$$EXCLUDELIST"\"
}

Loading…
Cancel
Save