aboutsummaryrefslogtreecommitdiff
path: root/ports/avro-cpp
diff options
context:
space:
mode:
authoralexander-smyslov <37107500+alexander-smyslov@users.noreply.github.com>2020-08-01 22:55:50 +0200
committerGitHub <noreply@github.com>2020-08-01 13:55:50 -0700
commit021db935f6c5eed48e093e16e3bef1721cb3a156 (patch)
tree08676e2e46008cef298b2677cf216eb083bb6399 /ports/avro-cpp
parentf7fe9e374fa85103e144972d0d9a2dc368d8f66f (diff)
downloadvcpkg-021db935f6c5eed48e093e16e3bef1721cb3a156.tar.gz
vcpkg-021db935f6c5eed48e093e16e3bef1721cb3a156.zip
[avro-cpp] new port (#11376)
* Add files via upload * [new port] avro-cpp * add boost-format * remove comments * remove comments * avro-cpp 1.9.2 * avro-cpp 1.9.2 * avro-cpp 1.9.2 * avro-cpp 1.9.2 * avro-cpp 1.9.2 * avro-cpp 1.9.2 * fix remarks * fix remarks * fix remarks * Update ports/avro-cpp/portfile.cmake Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com> * Update ports/avro-cpp/portfile.cmake Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com> * add linux support * back osx restriction * Update ports/avro-cpp/portfile.cmake Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com> * fix remarks * Update ports/avro-cpp/CONTROL * Update ports/avro-cpp/portfile.cmake * add osx support * Update portfile.cmake * Update CONTROL * Update scripts/ci.baseline.txt Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com> * fix * disable all static build * fix remarks * fix remarks * Update ports/avro-cpp/portfile.cmake Remove whitespace Co-authored-by: Alexander Smyslov <aleksandr.smyslov@libertexgroup.com> Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com> Co-authored-by: Smyslov Alexander Nikolayevich <aleksandr.smyslov@fxclub.com> Co-authored-by: Billy Robert O'Neal III <bion@microsoft.com> Co-authored-by: nicole mazzuca <mazzucan@outlook.com>
Diffstat (limited to 'ports/avro-cpp')
-rw-r--r--ports/avro-cpp/CONTROL9
-rw-r--r--ports/avro-cpp/install.patch100
-rw-r--r--ports/avro-cpp/portfile.cmake35
3 files changed, 144 insertions, 0 deletions
diff --git a/ports/avro-cpp/CONTROL b/ports/avro-cpp/CONTROL
new file mode 100644
index 000000000..0f75d7e24
--- /dev/null
+++ b/ports/avro-cpp/CONTROL
@@ -0,0 +1,9 @@
+Source: avro-cpp
+Version: 1.9.2
+Homepage: https://github.com/apache/avro
+Description: Apache Avro is a data serialization system
+Build-Depends: boost-format, boost-thread, boost-filesystem, boost-iostreams, boost-program-options, boost-random, boost-crc, boost-test, libzip, bzip2, liblzma, zlib, zstd
+
+Feature: snappy
+Build-Depends: snappy
+Description: Support Snappy for compression
diff --git a/ports/avro-cpp/install.patch b/ports/avro-cpp/install.patch
new file mode 100644
index 000000000..12ead2861
--- /dev/null
+++ b/ports/avro-cpp/install.patch
@@ -0,0 +1,100 @@
+diff --git a/lang/c++/CMakeLists.txt b/lang/c++/CMakeLists.txt
+index 30a5d66..f7f2b94 100644
+--- a/lang/c++/CMakeLists.txt
++++ b/lang/c++/CMakeLists.txt
+@@ -40,6 +40,8 @@ set (AVRO_VERSION_MINOR "0")
+ project (Avro-cpp)
+ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR})
+
++find_package(ZLIB REQUIRED)
++
+ if (WIN32 AND NOT CYGWIN AND NOT MSYS)
+ add_definitions (/EHa)
+ add_definitions (
+@@ -118,11 +120,11 @@ set_target_properties (avrocpp PROPERTIES
+ set_target_properties (avrocpp_s PROPERTIES
+ VERSION ${AVRO_VERSION_MAJOR}.${AVRO_VERSION_MINOR})
+
+-target_link_libraries (avrocpp ${Boost_LIBRARIES} ${SNAPPY_LIBRARIES})
++target_link_libraries (avrocpp ${Boost_LIBRARIES} ${SNAPPY_LIBRARIES} ZLIB::ZLIB)
+
+ add_executable (precompile test/precompile.cc)
+
+-target_link_libraries (precompile avrocpp_s ${Boost_LIBRARIES} ${SNAPPY_LIBRARIES})
++target_link_libraries (precompile avrocpp_s ${Boost_LIBRARIES} ${SNAPPY_LIBRARIES} ZLIB::ZLIB)
+
+ macro (gen file ns)
+ add_custom_command (OUTPUT ${file}.hh
+@@ -151,34 +153,40 @@ gen (crossref cr)
+ gen (primitivetypes pt)
+
+ add_executable (avrogencpp impl/avrogencpp.cc)
+-target_link_libraries (avrogencpp avrocpp_s ${Boost_LIBRARIES} ${SNAPPY_LIBRARIES})
++target_link_libraries (avrogencpp avrocpp_s ${Boost_LIBRARIES} ${SNAPPY_LIBRARIES} ZLIB::ZLIB)
++
+
+-enable_testing()
++if(BUILD_TESTING)
++ enable_testing()
++endif()
+
+ macro (unittest name)
+ add_executable (${name} test/${name}.cc)
+- target_link_libraries (${name} avrocpp ${Boost_LIBRARIES} ${SNAPPY_LIBRARIES})
++ target_link_libraries (${name} avrocpp ${Boost_LIBRARIES} ${SNAPPY_LIBRARIES} ZLIB::ZLIB)
+ add_test (NAME ${name} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ COMMAND ${CMAKE_CURRENT_BINARY_DIR}/${name})
+ endmacro (unittest)
+
+-unittest (buffertest)
+-unittest (unittest)
+-unittest (SchemaTests)
+-unittest (LargeSchemaTests)
+-unittest (CodecTests)
+-unittest (StreamTests)
+-unittest (SpecificTests)
+-unittest (DataFileTests)
+-unittest (JsonTests)
+-unittest (AvrogencppTests)
+-unittest (CompilerTests)
+-
+-add_dependencies (AvrogencppTests bigrecord_hh bigrecord_r_hh bigrecord2_hh
+- tweet_hh
+- union_array_union_hh union_map_union_hh union_conflict_hh
+- recursive_hh reuse_hh circulardep_hh tree1_hh tree2_hh crossref_hh
+- primitivetypes_hh empty_record_hh)
++if(BUILD_TESTING)
++ unittest (buffertest)
++ unittest (unittest)
++ unittest (SchemaTests)
++ unittest (LargeSchemaTests)
++ unittest (CodecTests)
++ unittest (StreamTests)
++ unittest (SpecificTests)
++ unittest (DataFileTests)
++ unittest (JsonTests)
++ unittest (AvrogencppTests)
++ unittest (CompilerTests)
++
++ add_dependencies (AvrogencppTests bigrecord_hh bigrecord_r_hh bigrecord2_hh
++ tweet_hh
++ union_array_union_hh union_map_union_hh union_conflict_hh
++ recursive_hh reuse_hh circulardep_hh tree1_hh tree2_hh crossref_hh
++ primitivetypes_hh empty_record_hh)
++
++endif()
+
+ include (InstallRequiredSystemLibraries)
+
+@@ -189,9 +197,9 @@ include (CPack)
+ install (TARGETS avrocpp avrocpp_s
+ LIBRARY DESTINATION lib
+ ARCHIVE DESTINATION lib
+- RUNTIME DESTINATION lib)
++ RUNTIME DESTINATION bin)
+
+-install (TARGETS avrogencpp RUNTIME DESTINATION bin)
++install (TARGETS avrogencpp RUNTIME DESTINATION tools/bin)
+
+ install (DIRECTORY api/ DESTINATION include/avro
+ FILES_MATCHING PATTERN *.hh)
diff --git a/ports/avro-cpp/portfile.cmake b/ports/avro-cpp/portfile.cmake
new file mode 100644
index 000000000..49f0af20c
--- /dev/null
+++ b/ports/avro-cpp/portfile.cmake
@@ -0,0 +1,35 @@
+vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY)
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO apache/avro
+ REF release-1.9.2
+ SHA512 6a6980901eea964c050eb3d61fadf28712e2f02c36985bf8e5176b668bba48985f6a666554a1964435448de29b18d790ab86b787d0288a22fd9cba00746a7846
+ HEAD_REF master
+ PATCHES
+ install.patch
+)
+
+vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
+ INVERTED_FEATURES
+ snappy CMAKE_DISABLE_FIND_PACKAGE_Snappy
+)
+
+vcpkg_configure_cmake(
+ SOURCE_PATH ${SOURCE_PATH}/lang/c++
+ PREFER_NINJA
+ DISABLE_PARALLEL_CONFIGURE
+ OPTIONS
+ -DBUILD_TESTING=OFF
+ ${FEATURE_OPTIONS}
+ OPTIONS_DEBUG
+ -DAVRO_ADD_PROTECTOR_FLAGS=1
+)
+
+vcpkg_install_cmake(ADD_BIN_TO_PATH)
+
+vcpkg_copy_pdbs()
+
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
+
+file(INSTALL ${SOURCE_PATH}/lang/c++/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)