[dlib] Updated dlib to v19.19 (#10826)

* [dlib] Updated dlib to v19.19

* - [dlib] Corrected dlib version.
- [dlib] Corrected copyright installation.
- [dlib] Removed deprecated calls from portfile.
This commit is contained in:
stoperro 2020-04-22 20:28:56 +02:00 committed by GitHub
parent 43d13abe44
commit a3ad23650f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 48 additions and 165 deletions

View File

@ -1,5 +1,5 @@
Source: dlib
Version: 19.17-1
Version: 19.19
Build-Depends: libjpeg-turbo, libpng, sqlite3, fftw3, openblas (!osx), clapack (!osx)
Homepage: https://github.com/davisking/dlib
Description: Modern C++ toolkit containing machine learning algorithms and tools for creating complex software in C++

View File

@ -1,12 +0,0 @@
diff --git a/dlib/CMakeLists.txt b/dlib/CMakeLists.txt
--- a/dlib/CMakeLists.txt
+++ b/dlib/CMakeLists.txt
@@ -480,7 +480,7 @@
set(CMAKE_REQUIRED_LIBRARIES ${JPEG_LIBRARY})
CHECK_FUNCTION_EXISTS(jpeg_read_header LIBJPEG_IS_GOOD)
endif()
- if (JPEG_FOUND AND LIBJPEG_IS_GOOD AND NOT APPLE)
+ if (JPEG_FOUND AND LIBJPEG_IS_GOOD)
include_directories(${JPEG_INCLUDE_DIR})
set (dlib_needed_libraries ${dlib_needed_libraries} ${JPEG_LIBRARY})
else()

View File

@ -1,147 +1,44 @@
--- a/dlib/CMakeLists.txt
+++ b/dlib/CMakeLists.txt
@@ -430,70 +430,9 @@
endif()
diff --git a/dlib/cmake_utils/find_libjpeg.cmake b/dlib/cmake_utils/find_libjpeg.cmake
index 3b9e656..d741f31 100644
--- a/dlib/cmake_utils/find_libjpeg.cmake
+++ b/dlib/cmake_utils/find_libjpeg.cmake
@@ -14,7 +14,7 @@ if (DEFINED JPEG_FOUND)
return()
endif()
if (DLIB_PNG_SUPPORT)
- # try to find libpng
- find_package(PNG QUIET)
- # Make sure there isn't something wrong with the version of LIBPNG
- # installed on this system. Also never link to anything from anaconda
- # since it's probably broken.
- if (PNG_FOUND AND NOT ("${PNG_INCLUDE_DIR}" MATCHES "(.*)(Ana|ana|mini)conda(.*)") AND NOT BUILDING_PYTHON_IN_MSVC)
- set(CMAKE_REQUIRED_LIBRARIES ${PNG_LIBRARIES})
- CHECK_FUNCTION_EXISTS(png_create_read_struct LIBPNG_IS_GOOD)
- endif()
- if (PNG_FOUND AND LIBPNG_IS_GOOD)
- include_directories(${PNG_INCLUDE_DIR})
- set (dlib_needed_libraries ${dlib_needed_libraries} ${PNG_LIBRARIES})
- set(REQUIRES_LIBS " libpng")
- else()
- # If we can't find libpng then statically compile it in.
- include_directories(external/libpng external/zlib)
- set(source_files ${source_files}
- external/libpng/arm/arm_init.c
- external/libpng/arm/filter_neon_intrinsics.c
- external/libpng/png.c
- external/libpng/pngerror.c
- external/libpng/pngget.c
- external/libpng/pngmem.c
- external/libpng/pngpread.c
- external/libpng/pngread.c
- external/libpng/pngrio.c
- external/libpng/pngrtran.c
- external/libpng/pngrutil.c
- external/libpng/pngset.c
- external/libpng/pngtrans.c
- external/libpng/pngwio.c
- external/libpng/pngwrite.c
- external/libpng/pngwtran.c
- external/libpng/pngwutil.c
- external/zlib/adler32.c
- external/zlib/compress.c
- external/zlib/crc32.c
- external/zlib/deflate.c
- external/zlib/gzclose.c
- external/zlib/gzlib.c
- external/zlib/gzread.c
- external/zlib/gzwrite.c
- external/zlib/infback.c
- external/zlib/inffast.c
- external/zlib/inflate.c
- external/zlib/inftrees.c
- external/zlib/trees.c
- external/zlib/uncompr.c
- external/zlib/zutil.c
- )
-
- include(cmake_utils/check_if_neon_available.cmake)
- if (ARM_NEON_IS_AVAILABLE)
- message (STATUS "NEON instructions will be used for libpng.")
- enable_language(ASM)
- set(source_files ${source_files}
- external/libpng/arm/arm_init.c
- external/libpng/arm/filter_neon_intrinsics.c
- external/libpng/arm/filter_neon.S
- )
- set_source_files_properties(external/libpng/arm/filter_neon.S PROPERTIES COMPILE_FLAGS "${CMAKE_ASM_FLAGS} ${CMAKE_CXX_FLAGS} -x assembler-with-cpp")
- endif()
- set(REQUIRES_LIBS "")
- endif()
+ find_package(PNG REQUIRED)
+ include_directories(${PNG_INCLUDE_DIR})
+ set (dlib_needed_libraries ${dlib_needed_libraries} ${PNG_LIBRARIES})
set(source_files ${source_files}
image_loader/png_loader.cpp
image_saver/save_png.cpp
@@ -501,68 +440,8 @@
endif()
-find_package(JPEG QUIET)
+find_package(JPEG REQUIRED)
if(JPEG_FOUND)
set(JPEG_TEST_CMAKE_FLAGS
@@ -31,7 +31,7 @@ if(JPEG_FOUND)
message (STATUS "Found system copy of libjpeg: ${JPEG_LIBRARY}")
if(NOT test_for_libjpeg_worked)
set(JPEG_FOUND 0)
- message (STATUS "System copy of libjpeg is broken or too old. Will build our own libjpeg and use that instead.")
+ message (FATAL_ERROR "System copy of libjpeg is broken or too old. Will build our own libjpeg and use that instead.")
endif()
endif()
diff --git a/dlib/cmake_utils/find_libpng.cmake b/dlib/cmake_utils/find_libpng.cmake
index 1b35604..489a4c8 100644
--- a/dlib/cmake_utils/find_libpng.cmake
+++ b/dlib/cmake_utils/find_libpng.cmake
@@ -14,7 +14,7 @@ if (DEFINED PNG_FOUND)
return()
endif()
-find_package(PNG QUIET)
+find_package(PNG REQUIRED)
if(PNG_FOUND)
set(PNG_TEST_CMAKE_FLAGS
@@ -31,7 +31,7 @@ if(PNG_FOUND)
message (STATUS "Found system copy of libpng: ${PNG_LIBRARIES}")
if(NOT test_for_libpng_worked)
set(PNG_FOUND 0)
- message (STATUS "System copy of libpng is broken. Will build our own libpng and use that instead.")
+ message (FATAL_ERROR "System copy of libpng is broken. Will build our own libpng and use that instead.")
endif()
endif()
if (DLIB_JPEG_SUPPORT)
- # try to find libjpeg
- find_package(JPEG QUIET)
- # Make sure there isn't something wrong with the version of libjpeg
- # installed on this system. Also don't use the installed libjpeg
- # if this is an APPLE system because apparently it's broken (as of 2015/01/01).
- if (JPEG_FOUND AND NOT ("${JPEG_INCLUDE_DIR}" MATCHES "(.*)(Ana|ana|mini)conda(.*)") AND NOT BUILDING_PYTHON_IN_MSVC)
- set(CMAKE_REQUIRED_LIBRARIES ${JPEG_LIBRARY})
- CHECK_FUNCTION_EXISTS(jpeg_read_header LIBJPEG_IS_GOOD)
- endif()
- if (JPEG_FOUND AND LIBJPEG_IS_GOOD)
- include_directories(${JPEG_INCLUDE_DIR})
- set (dlib_needed_libraries ${dlib_needed_libraries} ${JPEG_LIBRARY})
- else()
- # If we can't find libjpeg then statically compile it in.
- add_definitions(-DDLIB_JPEG_STATIC)
- set(source_files ${source_files}
- external/libjpeg/jcomapi.cpp
- external/libjpeg/jdapimin.cpp
- external/libjpeg/jdapistd.cpp
- external/libjpeg/jdatasrc.cpp
- external/libjpeg/jdcoefct.cpp
- external/libjpeg/jdcolor.cpp
- external/libjpeg/jddctmgr.cpp
- external/libjpeg/jdhuff.cpp
- external/libjpeg/jdinput.cpp
- external/libjpeg/jdmainct.cpp
- external/libjpeg/jdmarker.cpp
- external/libjpeg/jdmaster.cpp
- external/libjpeg/jdmerge.cpp
- external/libjpeg/jdphuff.cpp
- external/libjpeg/jdpostct.cpp
- external/libjpeg/jdsample.cpp
- external/libjpeg/jerror.cpp
- external/libjpeg/jidctflt.cpp
- external/libjpeg/jidctfst.cpp
- external/libjpeg/jidctint.cpp
- external/libjpeg/jidctred.cpp
- external/libjpeg/jmemmgr.cpp
- external/libjpeg/jmemnobs.cpp
- external/libjpeg/jquant1.cpp
- external/libjpeg/jquant2.cpp
- external/libjpeg/jutils.cpp
- external/libjpeg/jcapimin.cpp
- external/libjpeg/jdatadst.cpp
- external/libjpeg/jcparam.cpp
- external/libjpeg/jcapistd.cpp
- external/libjpeg/jcmarker.cpp
- external/libjpeg/jcinit.cpp
- external/libjpeg/jcmaster.cpp
- external/libjpeg/jcdctmgr.cpp
- external/libjpeg/jccoefct.cpp
- external/libjpeg/jccolor.cpp
- external/libjpeg/jchuff.cpp
- external/libjpeg/jcmainct.cpp
- external/libjpeg/jcphuff.cpp
- external/libjpeg/jcprepct.cpp
- external/libjpeg/jcsample.cpp
- external/libjpeg/jfdctint.cpp
- external/libjpeg/jfdctflt.cpp
- external/libjpeg/jfdctfst.cpp
- )
- endif()
+ find_package(JPEG REQUIRED)
+ include_directories(${JPEG_INCLUDE_DIR})
set(source_files ${source_files}
image_loader/jpeg_loader.cpp
image_saver/save_jpeg.cpp

View File

@ -1,15 +1,12 @@
include(vcpkg_common_functions)
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO davisking/dlib
REF v19.17
SHA512 8574f48d0cc55685d494b3933079c16526fc7cfa3df85a76d51a1f13bebeccf3b6d7247981b53bd1c9e6e664e42245e518cefadf3420be1ab25b5dd6b8d55441
REF v19.19
SHA512 013f0c37fa98b0b93824ef94f2c50cb7b41461906ddec1df3021b489e8a02d299b20802416e9dcd6483fd55197e3792119e7b7774ca8dd9c307e8be68a39fe6b
HEAD_REF master
PATCHES
fix-mac-jpeg.patch
fix-sqlite3-fftw-linkage.patch
force_finding_packages.patch
find_blas.patch
@ -67,6 +64,8 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/dlib/cmake_utils/test_for_cu
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/dlib/cmake_utils/test_for_cpp11)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/dlib/cmake_utils/test_for_avx)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/dlib/cmake_utils/test_for_sse4)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/dlib/cmake_utils/test_for_libjpeg)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/dlib/cmake_utils/test_for_libpng)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/dlib/external/libpng/arm)
# Dlib encodes debug/release in its config.h. Patch it to respond to the NDEBUG macro instead.
@ -76,6 +75,5 @@ string(REPLACE "#define DLIB_DISABLE_ASSERTS" "#if !defined(_DEBUG)\n#define DLI
file(WRITE ${CURRENT_PACKAGES_DIR}/include/dlib/config.h "${_contents}")
# Handle copyright
file(COPY ${SOURCE_PATH}/dlib/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/dlib)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/dlib/LICENSE.txt ${CURRENT_PACKAGES_DIR}/share/dlib/copyright)
file(INSTALL ${SOURCE_PATH}/dlib/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/share/doc)