aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Schumacher <roschuma@microsoft.com>2017-05-28 04:47:06 -0700
committerGitHub <noreply@github.com>2017-05-28 04:47:06 -0700
commit88e4f79c77eefb821b09a108fe239f896228e1c1 (patch)
tree267df40f19afb8103287b63a7da43d7299b6f236
parent292834ddf128280ca8a177585f7ef29994d1a8c3 (diff)
parentcad6321b8ea068528a1526224a5deec93c9aa051 (diff)
downloadvcpkg-88e4f79c77eefb821b09a108fe239f896228e1c1.tar.gz
vcpkg-88e4f79c77eefb821b09a108fe239f896228e1c1.zip
Merge pull request #1163 from atkawa7/thrift
Thrift #16
-rw-r--r--ports/thrift/CONTROL4
-rw-r--r--ports/thrift/portfile.cmake53
-rw-r--r--scripts/cmake/vcpkg_find_acquire_program.cmake12
3 files changed, 69 insertions, 0 deletions
diff --git a/ports/thrift/CONTROL b/ports/thrift/CONTROL
new file mode 100644
index 000000000..aef580f73
--- /dev/null
+++ b/ports/thrift/CONTROL
@@ -0,0 +1,4 @@
+Source: thrift
+Version: 20172805-72ca60debae1d9fb35d9f0085118873669006d7f
+Build-Depends: boost, zlib, libevent, openssl
+Description: Apache Thrift is a software project spanning a variety of programming languages and use cases. Our goal is to make reliable, performant communication and data serialization across languages as efficient and seamless as possible. Originally developed at Facebook, Thrift was open sourced in April 2007 and entered the Apache Incubator in May, 2008. Thrift became an Apache TLP in October, 2010.
diff --git a/ports/thrift/portfile.cmake b/ports/thrift/portfile.cmake
new file mode 100644
index 000000000..94e8201bf
--- /dev/null
+++ b/ports/thrift/portfile.cmake
@@ -0,0 +1,53 @@
+include(vcpkg_common_functions)
+
+if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
+ message(STATUS "Warning: Dynamic building not supported. Building static.") # See note below
+ set(VCPKG_LIBRARY_LINKAGE static)
+
+ # As per Ben Craig thrift comment see https://issues.apache.org/jira/browse/THRIFT-1834
+ # Currently, Thrift is designed to be packaged as a static library. As a static library, the consuming program / dll will only pull in the object files that it needs, so the per-binary size increase should be pretty small.
+ # Thrift isn't a very good candidate to become a dynamic library. No attempts are made to preserve binary compatibility, or to provide a C / COM-like interface to make binary compatibility easy.
+endif()
+
+vcpkg_find_acquire_program(FLEX)
+vcpkg_find_acquire_program(BISON)
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO apache/thrift
+ REF 72ca60debae1d9fb35d9f0085118873669006d7f
+ SHA512 6050c66b176ad596d9632b224b8fb49aa3b823c977dacad729dbcdefb0da60eb983d3a32d9326b4317bae6755fb1fc4cee2cc6c282b3e1636a4528844c0f5915
+ HEAD_REF master
+)
+
+vcpkg_configure_cmake(
+ SOURCE_PATH ${SOURCE_PATH}
+ OPTIONS
+ -DWITH_SHARED_LIB=OFF
+ -DWITH_STATIC_LIB=ON
+ -DBUILD_TESTING=off
+ -DBUILD_JAVA=off
+ -DBUILD_C_GLIB=off
+ -DBUILD_PYTHON=off
+ -DBUILD_CPP=on
+ -DBUILD_HASKELL=off
+ -DBUILD_TUTORIALS=off
+ -DFLEX_EXECUTABLE=${FLEX}
+ -DBISON_EXECUTABLE=${BISON}
+)
+
+vcpkg_install_cmake()
+
+file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/thrift RENAME copyright)
+
+file(GLOB EXES "${CURRENT_PACKAGES_DIR}/bin/*.exe")
+if(EXES)
+ file(COPY ${EXES} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/thrift)
+ file(REMOVE ${EXES})
+ vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/thrift)
+endif()
+
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin)
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin)
+vcpkg_copy_pdbs()
diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake
index 5c8a00ad2..127982842 100644
--- a/scripts/cmake/vcpkg_find_acquire_program.cmake
+++ b/scripts/cmake/vcpkg_find_acquire_program.cmake
@@ -84,6 +84,18 @@ function(vcpkg_find_acquire_program VAR)
set(URL "https://github.com/mesonbuild/meson/archive/0.40.1.zip")
set(ARCHIVE "meson-0.40.1.zip")
set(HASH 4c1d07f32d527859f762c34de74d31d569573fc833335ab9652ed38d1f9e64b49869e826527c28a6a07cb8e594fd5c647b34aa95e626236a2707f75df0a2d435)
+ elseif(VAR MATCHES "FLEX")
+ set(PROGNAME win_flex)
+ set(PATHS ${DOWNLOADS}/tools/winflexbison)
+ set(URL "https://sourceforge.net/projects/winflexbison/files/win_flex_bison-2.5.9.zip/download")
+ set(ARCHIVE "win_flex_bison-2.5.9.zip")
+ set(HASH 9580f0e46893670a011645947c1becda69909a41a38bb4197fe33bd1ab7719da6b80e1be316f269e1a4759286870d49a9b07ef83afc4bac33232bd348e0bc814)
+ elseif(VAR MATCHES "BISON")
+ set(PROGNAME win_bison)
+ set(PATHS ${DOWNLOADS}/tools/winflexbison)
+ set(URL "https://sourceforge.net/projects/winflexbison/files/win_flex_bison-2.5.9.zip/download")
+ set(ARCHIVE "win_flex_bison-2.5.9.zip")
+ set(HASH 9580f0e46893670a011645947c1becda69909a41a38bb4197fe33bd1ab7719da6b80e1be316f269e1a4759286870d49a9b07ef83afc4bac33232bd348e0bc814)
else()
message(FATAL "unknown tool ${VAR} -- unable to acquire.")
endif()