From 73a02b9f70ac1cf27f7ab2aca023e0b0370a0762 Mon Sep 17 00:00:00 2001 From: Mikhail Paulyshka Date: Sat, 19 Aug 2017 23:29:24 +0300 Subject: [PATCH] [lcms] fix header file * fix header file * prefer ninja * use github --- ports/lcms/CMakeLists.txt | 5 +++++ ports/lcms/CONTROL | 2 +- ports/lcms/portfile.cmake | 25 +++++++++++-------------- ports/lcms/shared.patch | 2 +- 4 files changed, 18 insertions(+), 16 deletions(-) diff --git a/ports/lcms/CMakeLists.txt b/ports/lcms/CMakeLists.txt index cd69bab3be..809fe505ec 100644 --- a/ports/lcms/CMakeLists.txt +++ b/ports/lcms/CMakeLists.txt @@ -34,6 +34,11 @@ set(SRCS ) add_definitions(-DUNICODE -D_UNICODE) + +if(BUILD_SHARED_LIBS) + add_definitions(-DCMS_DLL_BUILD) +endif() + string(REPLACE "/utf-8" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") include_directories( diff --git a/ports/lcms/CONTROL b/ports/lcms/CONTROL index 2349503e97..b8c222333c 100644 --- a/ports/lcms/CONTROL +++ b/ports/lcms/CONTROL @@ -1,4 +1,4 @@ Source: lcms -Version: 2.8-1 +Version: 2.8-2 Build-Depends: Description: Little CMS. \ No newline at end of file diff --git a/ports/lcms/portfile.cmake b/ports/lcms/portfile.cmake index 4487cce6aa..6007208585 100644 --- a/ports/lcms/portfile.cmake +++ b/ports/lcms/portfile.cmake @@ -1,26 +1,23 @@ include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/lcms2-2.8) -vcpkg_download_distfile(ARCHIVE - URLS "https://sourceforge.net/projects/lcms/files/lcms/2.8/lcms2-2.8.tar.gz/download" - FILENAME "lcms2-2.8.tar.gz" - SHA512 a9478885b4892c79314a2ef9ab560e6655ac8f2d17abae0805e8b871138bb190e21f0e5c805398449f9dad528dc50baaf9e3cce8b8158eb8ff74179be5733f8f -) -vcpkg_extract_source_archive(${ARCHIVE}) -message(STATUS ${SOURCE_PATH}) +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO mm2/Little-CMS + REF lcms2.8 + SHA512 ad904ce8acead6c8e255feb8386c1ab3fa432c3b36a3b521bc5c50993cb47ce4d42be0ad240dd8dd3bfeb3c0e884d8184f58797da5ef297b2f9a0e7da9788644 + HEAD_REF master +) + file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) -set(USE_SHARED_LIBRARY OFF) -if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - set(USE_SHARED_LIBRARY ON) -endif() - vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA OPTIONS_DEBUG -DSKIP_INSTALL_HEADERS=ON ) +vcpkg_build_cmake() vcpkg_install_cmake() file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/lcms RENAME copyright) @@ -32,4 +29,4 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) vcpkg_apply_patches( SOURCE_PATH ${CURRENT_PACKAGES_DIR}/include PATCHES "${CMAKE_CURRENT_LIST_DIR}/shared.patch") -endif(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) +endif() diff --git a/ports/lcms/shared.patch b/ports/lcms/shared.patch index b3e7bf75f6..2d7506c529 100644 --- a/ports/lcms/shared.patch +++ b/ports/lcms/shared.patch @@ -4,7 +4,7 @@ #endif // CMS_USE_BIG_ENDIAN -+#define CMS_DLL_BUILD ++#define CMS_DLL // Calling convention -- this is hardly platform and compiler dependent #ifdef CMS_IS_WINDOWS_