Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cpr/crc32c] Update version #13678

Merged
merged 6 commits into from
Oct 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
127 changes: 33 additions & 94 deletions ports/cpr/001-cpr-config.patch
Original file line number Diff line number Diff line change
@@ -1,94 +1,33 @@
diff --git a/cpr/CMakeLists.txt b/cpr/CMakeLists.txt
index a6db5bd..90bec48 100644
--- a/cpr/CMakeLists.txt
+++ b/cpr/CMakeLists.txt
@@ -1,47 +1,46 @@
-message(STATUS "Using CURL_INCLUDE_DIRS: ${CURL_INCLUDE_DIRS}.")
-include_directories(
- ${CPR_INCLUDE_DIRS}
- ${CURL_INCLUDE_DIRS})
-
add_library(${CPR_LIBRARIES}
+ auth.cpp
+ cookies.cpp
+ cprtypes.cpp
+ digest.cpp
+ error.cpp
+ multipart.cpp
+ parameters.cpp
+ payload.cpp
+ proxies.cpp
+ session.cpp
+ timeout.cpp
+ util.cpp
+ ssl_options.cpp
+)
+
+target_link_libraries( ${CPR_LIBRARIES}
+ PUBLIC ${CURL_LIBRARIES}
+)
+
+target_include_directories(${CPR_LIBRARIES}
+ PUBLIC
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../include>
+ $<INSTALL_INTERFACE:include>
+ PRIVATE
+ $<BUILD_INTERFACE:${CURL_INCLUDE_DIRS}>
+)
+

- # Source files
- auth.cpp
- cookies.cpp
- cprtypes.cpp
- digest.cpp
- error.cpp
- multipart.cpp
- parameters.cpp
- payload.cpp
- proxies.cpp
- session.cpp
- timeout.cpp
- util.cpp
- ssl_options.cpp
+set(TARGETS_EXPORT_NAME "${PROJECT_NAME}Targets")
+install(
+ TARGETS ${CPR_LIBRARIES}
+ EXPORT ${TARGETS_EXPORT_NAME}
+ RUNTIME DESTINATION bin
+ LIBRARY DESTINATION lib
+ ARCHIVE DESTINATION lib
+)

- # Header files (useful in IDEs)
- "${CPR_INCLUDE_DIRS}/cpr/api.h"
- "${CPR_INCLUDE_DIRS}/cpr/auth.h"
- "${CPR_INCLUDE_DIRS}/cpr/body.h"
- "${CPR_INCLUDE_DIRS}/cpr/cookies.h"
- "${CPR_INCLUDE_DIRS}/cpr/cpr.h"
- "${CPR_INCLUDE_DIRS}/cpr/cprtypes.h"
- "${CPR_INCLUDE_DIRS}/cpr/curlholder.h"
- "${CPR_INCLUDE_DIRS}/cpr/defines.h"
- "${CPR_INCLUDE_DIRS}/cpr/digest.h"
- "${CPR_INCLUDE_DIRS}/cpr/error.h"
- "${CPR_INCLUDE_DIRS}/cpr/max_redirects.h"
- "${CPR_INCLUDE_DIRS}/cpr/multipart.h"
- "${CPR_INCLUDE_DIRS}/cpr/parameters.h"
- "${CPR_INCLUDE_DIRS}/cpr/payload.h"
- "${CPR_INCLUDE_DIRS}/cpr/proxies.h"
- "${CPR_INCLUDE_DIRS}/cpr/response.h"
- "${CPR_INCLUDE_DIRS}/cpr/session.h"
- "${CPR_INCLUDE_DIRS}/cpr/timeout.h"
- "${CPR_INCLUDE_DIRS}/cpr/util.h"
- "${CPR_INCLUDE_DIRS}/cpr/ssl_options.h")
+install(
+ EXPORT ${TARGETS_EXPORT_NAME}
+ DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}"
+)

-message(STATUS "Using CURL_LIBRARIES: ${CURL_LIBRARIES}.")
-target_link_libraries(${CPR_LIBRARIES}
- ${CURL_LIBRARIES})
+if (NOT DISABLE_INSTALL_HEADERS)
+ install(DIRECTORY ${CPR_INCLUDE_DIRS}/cpr DESTINATION include)
+endif()
diff --git a/cpr/CMakeLists.txt b/cpr/CMakeLists.txt
index 563b785..20f8a54 100644
--- a/cpr/CMakeLists.txt
+++ b/cpr/CMakeLists.txt
@@ -20,6 +20,7 @@ add_library(cpr

add_library(cpr::cpr ALIAS cpr)

+target_include_directories(cpr PUBLIC $<INSTALL_INTERFACE:include>)
target_link_libraries(cpr PUBLIC CURL::libcurl) # todo should be private, but first dependencys in ssl_options need to be removed

# Set version for shared libraries.
@@ -28,4 +29,18 @@ set_target_properties(cpr
VERSION ${${PROJECT_NAME}_VERSION}
SOVERSION ${${PROJECT_NAME}_VERSION_MAJOR})

-install(TARGETS cpr)
+set(TARGETS_EXPORT_NAME "${PROJECT_NAME}Targets")
+install(TARGETS cpr
+ EXPORT ${TARGETS_EXPORT_NAME}
+ RUNTIME DESTINATION bin
+ LIBRARY DESTINATION lib
+ ARCHIVE DESTINATION lib)
+
+install(
+ EXPORT ${TARGETS_EXPORT_NAME}
+ DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}"
+)
+
+if (NOT DISABLE_INSTALL_HEADERS)
+ install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/../include/cpr DESTINATION include)
+endif()
\ No newline at end of file
13 changes: 0 additions & 13 deletions ports/cpr/002_cpr_fixcase.patch

This file was deleted.

2 changes: 1 addition & 1 deletion ports/cpr/CONTROL
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Source: cpr
Version: 1.3.0-8
Version: 1.5.1
Homepage: https://github.com/whoshuu/cpr
Description: C++ Requests is a simple wrapper around libcurl inspired by the excellent Python Requests project.
Build-Depends: curl[core]
10 changes: 3 additions & 7 deletions ports/cpr/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
include(vcpkg_common_functions)

vcpkg_check_linkage(ONLY_STATIC_LIBRARY)

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO whoshuu/cpr
REF 1.3.0
SHA512 fd08f8a592a5e1fb8dc93158a4850b81575983c08527fb415f65bd9284f93c804c8680d16c548744583cd26b9353a7d4838269cfc59ccb6003da8941f620c273
REF 5e87cb5f45ac99858f0286dc1c35a6cd27c3bcb9 # v1.5.1
SHA512 1ea6295b5568d8d5d099cb1d89d19b3cae873bd869f64be4495be301561c91893f3c1c375823ce18419c780cda52aab79520293ff63ee529ded5431ec511ce5c
HEAD_REF master
PATCHES
001-cpr-config.patch
002_cpr_fixcase.patch
)

vcpkg_configure_cmake(
Expand All @@ -33,5 +30,4 @@ vcpkg_copy_pdbs()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)

# Handle copyright
file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/cpr)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/cpr/LICENSE ${CURRENT_PACKAGES_DIR}/share/cpr/copyright)
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
15 changes: 0 additions & 15 deletions ports/crc32c/0001_export_symbols.patch

This file was deleted.

2 changes: 1 addition & 1 deletion ports/crc32c/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Source: crc32c
Version: 1.1.0
Version: 1.1.1
Homepage: https://github.com/google/crc32c
Description: CRC32C implementation with support for CPU-specific acceleration instructions.
9 changes: 4 additions & 5 deletions ports/crc32c/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
include(vcpkg_common_functions)
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO google/crc32c
REF 83c31e797274a5b26e9e4a5355ba394cd0cabc10
SHA512 829f8618c2769d274b400cf6de1dd2ab874d50d36e8cb086238aadae804154360b113faecd3c60e029a8d5ebc620d4b7cc7e1492775a4235d53989116227cd52
REF ba741856254e3c6f6c7bcf0704fe1344a668a227 # 1.1.1
SHA512 129e7cf36a92f6d953b4545e673860b0d956aa0ecf89ae98dfcfdff03031482d03f9036d11d0546446f1e73f65548cdd87065759dc6efd39f0fd9c58234ebb24
HEAD_REF master
PATCHES ${CMAKE_CURRENT_LIST_DIR}/0001_export_symbols.patch
)

vcpkg_configure_cmake(
Expand All @@ -30,4 +29,4 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
endif()

# Handle copyright
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/crc32c RENAME copyright)
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
52 changes: 52 additions & 0 deletions ports/devil/0004_compatible-jasper-2-0-20.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
diff --git a/DevIL/src-IL/src/il_jp2.cpp b/DevIL/src-IL/src/il_jp2.cpp
index 730afee..a419c14 100644
--- a/DevIL/src-IL/src/il_jp2.cpp
+++ b/DevIL/src-IL/src/il_jp2.cpp
@@ -313,20 +313,31 @@ ILboolean iLoadJp2Internal(jas_stream_t *Stream, ILimage *Image)
}


-
-static int iJp2_file_read(jas_stream_obj_t *obj, char *buf, int cnt)
+#ifdef __APPLE__
+static int iJp2_file_read(void *obj, char *buf, unsigned int cnt)
+#else
+static int iJp2_file_read(jas_stream_obj_t *obj, char *buf, unsigned int cnt)
+#endif
{
obj;
- return iread(buf, 1, cnt);
+ return iread((void*)buf, 1, cnt);
}

-static int iJp2_file_write(jas_stream_obj_t *obj, char *buf, int cnt)
+#ifdef __APPLE__
+static int iJp2_file_write(void *obj, const char *buf, unsigned int cnt)
+#else
+static int iJp2_file_write(jas_stream_obj_t *obj, const char *buf, unsigned int cnt)
+#endif
{
obj;
return iwrite(buf, 1, cnt);
}

+#ifdef __APPLE__
static long iJp2_file_seek(jas_stream_obj_t *obj, long offset, int origin)
+#else
+static long iJp2_file_seek(void *obj, long offset, int origin)
+#endif
{
obj;

@@ -343,7 +354,11 @@ static long iJp2_file_seek(jas_stream_obj_t *obj, long offset, int origin)
return 0; // Failed
}

+#ifdef __APPLE__
+static int iJp2_file_close(void *obj)
+#else
static int iJp2_file_close(jas_stream_obj_t *obj)
+#endif
{
obj;
return 0; // We choose when we want to close the file.
3 changes: 2 additions & 1 deletion ports/devil/CONTROL
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Source: devil
Version: 1.8.0-5
Version: 1.8.0
Port-Version: 6
Build-Depends:
Homepage: https://github.com/DentonW/DevIL
Description: A full featured cross-platform image library
Expand Down
71 changes: 16 additions & 55 deletions ports/devil/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
include(vcpkg_common_functions)

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO DentonW/DevIL
Expand All @@ -12,66 +10,29 @@ vcpkg_from_github(
0003_fix-openexr.patch
enable-static.patch
)
file(REMOVE ${SOURCE_PATH}/DevIL/src-IL/cmake/FindOpenEXR.cmake)
set(IL_NO_PNG 1)
if("libpng" IN_LIST FEATURES)
set(IL_NO_PNG 0)
endif()

set(IL_NO_TIF 1)
if("tiff" IN_LIST FEATURES)
set(IL_NO_TIF 0)
endif()

set(IL_NO_JPG 1)
if("libjpeg" IN_LIST FEATURES)
set(IL_NO_JPG 0)
endif()

set(IL_NO_EXR 1)
if("openexr" IN_LIST FEATURES)
set(IL_NO_EXR 0)
endif()

set(IL_NO_JP2 1)
if("jasper" IN_LIST FEATURES)
set(IL_NO_JP2 0)
endif()

set(IL_NO_MNG 1)
#if("libmng" IN_LIST FEATURES)
# set(IL_NO_MNG 0)
#endif()

set(IL_NO_LCMS 1)
if("lcms" IN_LIST FEATURES)
set(IL_NO_LCMS 0)
endif()

set(IL_USE_DXTC_NVIDIA 0)
#if("nvtt" IN_LIST FEATURES)
# set(IL_USE_DXTC_NVIDIA 1)
#endif()
file(REMOVE ${SOURCE_PATH}/DevIL/src-IL/cmake/FindOpenEXR.cmake)

set(IL_USE_DXTC_SQUISH 0)
#if("libsquish" IN_LIST FEATURES)
# set(IL_USE_DXTC_SQUISH 1)
#endif()
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
INVERTED_FEATURES
libpng IL_NO_PNG
tiff IL_NO_TIF
libjpeg IL_NO_JPG
openexr IL_NO_EXR
jasper IL_NO_JP2
lcms IL_NO_LCMS
)

vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}/DevIL
PREFER_NINJA
DISABLE_PARALLEL_CONFIGURE
OPTIONS
-DIL_NO_PNG=${IL_NO_PNG}
-DIL_NO_TIF=${IL_NO_TIF}
-DIL_NO_JPG=${IL_NO_JPG}
-DIL_NO_EXR=${IL_NO_EXR}
-DIL_NO_JP2=${IL_NO_JP2}
-DIL_NO_MNG=${IL_NO_MNG}
-DIL_NO_LCMS=${IL_NO_LCMS}
-DIL_USE_DXTC_NVIDIA=${IL_USE_DXTC_NVIDIA}
-DIL_USE_DXTC_SQUISH=${IL_USE_DXTC_SQUISH}
${FEATURE_OPTIONS}
-DIL_NO_MNG=ON
-DIL_USE_DXTC_NVIDIA=OFF
-DIL_USE_DXTC_SQUISH=OFF
)

vcpkg_install_cmake()
Expand All @@ -80,4 +41,4 @@ vcpkg_copy_pdbs()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)

# Handle copyright
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/devil RENAME copyright)
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)