Skip to content

Commit

Permalink
Fixed ci builds
Browse files Browse the repository at this point in the history
ubuntu:14.04 does not have quazip5 libraries in the standard repository, therefore only insecure builds are created using the ci server
  • Loading branch information
Christian Kieschnick committed Jan 4, 2019
1 parent 080b02e commit ba60439
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 24 deletions.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -359,8 +359,9 @@ include_directories(SYSTEM ${ARGON2_INCLUDE_DIR})

# Optional
if(WITH_XC_KEESHARE)
# ZLIB is needed and already required
find_package(QuaZip QUIET)
if(QuaZip_FOUND)
if(QUAZIP_FOUND)
message(STATUS "Found QuaZip - allow KeeShare with secure container\n")
set(WITH_XC_KEESHARE_INSECURE ON)
set(WITH_XC_KEESHARE_SECURE ON)
Expand Down
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ RUN set -x \
zlib1g-dev \
libxi-dev \
libxtst-dev \
libquazip-dev \
# ubuntu:14.04 has no quazip (it's optional)
# libquazip5-dev \
mesa-common-dev \
libyubikey-dev \
libykpers-1-dev \
Expand Down
3 changes: 2 additions & 1 deletion ci/trusty/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ RUN set -x \
zlib1g-dev \
libyubikey-dev \
libykpers-1-dev \
libquazip-dev \
# ubuntu:14.04 has no quazip (it's optional)
# libquazip5-dev \
libxi-dev \
libxtst-dev \
libqrencode-dev \
Expand Down
62 changes: 41 additions & 21 deletions cmake/FindQuaZip.cmake
Original file line number Diff line number Diff line change
@@ -1,23 +1,43 @@
# Copyright (C) 2018 KeePassXC Team <team@keepassxc.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 or (at your option)
# version 3 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# QUAZIP_FOUND - QuaZip library was found
# QUAZIP_INCLUDE_DIR - Path to QuaZip include dir
# QUAZIP_INCLUDE_DIRS - Path to QuaZip and zlib include dir (combined from QUAZIP_INCLUDE_DIR + ZLIB_INCLUDE_DIR)
# QUAZIP_LIBRARIES - List of QuaZip libraries
# QUAZIP_ZLIB_INCLUDE_DIR - The include dir of zlib headers

find_path(QUAZIP_INCLUDE_DIR quazip5/quazip.h)
find_library(QUAZIP_LIBRARIES quazip5)

mark_as_advanced(QUAZIP_LIBRARIES QUAZIP_INCLUDE_DIR)

include(FindPackageHandleStandardArgs)
include_directories(${QUAZIP_INCLUDE_DIR})
find_package_handle_standard_args(QuaZip DEFAULT_MSG QUAZIP_LIBRARIES QUAZIP_INCLUDE_DIR)
IF (QUAZIP_INCLUDE_DIRS AND QUAZIP_LIBRARIES)
# in cache already
SET(QUAZIP_FOUND TRUE)
ELSE (QUAZIP_INCLUDE_DIRS AND QUAZIP_LIBRARIES)
IF (Qt5Core_FOUND)
set(QUAZIP_LIB_VERSION_SUFFIX 5)
ENDIF()
IF (WIN32)
FIND_PATH(QUAZIP_LIBRARY_DIR
WIN32_DEBUG_POSTFIX d
NAMES libquazip${QUAZIP_LIB_VERSION_SUFFIX}.dll
HINTS "C:/Programme/" "C:/Program Files"
PATH_SUFFIXES QuaZip/lib
)
FIND_LIBRARY(QUAZIP_LIBRARIES NAMES libquazip${QUAZIP_LIB_VERSION_SUFFIX}.dll HINTS ${QUAZIP_LIBRARY_DIR})
FIND_PATH(QUAZIP_INCLUDE_DIR NAMES quazip.h HINTS ${QUAZIP_LIBRARY_DIR}/../ PATH_SUFFIXES include/quazip)
FIND_PATH(QUAZIP_ZLIB_INCLUDE_DIR NAMES zlib.h)
ELSE(WIN32)
FIND_PACKAGE(PkgConfig)
# pkg_check_modules(PC_QCA2 QUIET qca2)
pkg_check_modules(PC_QUAZIP quazip)
FIND_LIBRARY(QUAZIP_LIBRARIES
WIN32_DEBUG_POSTFIX d
NAMES quazip${QUAZIP_LIB_VERSION_SUFFIX}
HINTS /usr/lib /usr/lib64
)
FIND_PATH(QUAZIP_INCLUDE_DIR quazip.h
HINTS /usr/include /usr/local/include
PATH_SUFFIXES quazip${QUAZIP_LIB_VERSION_SUFFIX}
)
FIND_PATH(QUAZIP_ZLIB_INCLUDE_DIR zlib.h HINTS /usr/include /usr/local/include)
ENDIF (WIN32)
INCLUDE(FindPackageHandleStandardArgs)
SET(QUAZIP_INCLUDE_DIRS ${QUAZIP_INCLUDE_DIR} ${QUAZIP_ZLIB_INCLUDE_DIR})
find_package_handle_standard_args(QUAZIP DEFAULT_MSG QUAZIP_LIBRARIES QUAZIP_INCLUDE_DIR QUAZIP_ZLIB_INCLUDE_DIR QUAZIP_INCLUDE_DIRS)
ENDIF (QUAZIP_INCLUDE_DIRS AND QUAZIP_LIBRARIES)

0 comments on commit ba60439

Please sign in to comment.