Moving from govendor to dep, updated dependencies (#48)

* Moving from govendor to dep.

* Making the pull request template more friendly.

* Fixing akward space in PR template.

* goimports run on whole project using ` goimports -w $(find . -type f -name '*.go' -not -path "./vendor/*" -not -path "./gen-go/*")`

source of command: https://gist.github.com/bgentry/fd1ffef7dbde01857f66
This commit is contained in:
Renan DelValle 2018-01-07 13:13:47 -08:00 committed by GitHub
parent 9631aa3aab
commit 8d445c1c77
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2186 changed files with 400410 additions and 352 deletions

View file

@ -0,0 +1,41 @@
import urllib.request
import sys
OUT = 'Win64OpenSSL.exe'
URL_STR = 'https://slproweb.com/download/Win64OpenSSL-%s.exe'
VERSION_MAJOR = 1
VERSION_MINOR = 0
VERSION_PATCH = 2
VERSION_SUFFIX = 'j'
VERSION_STR = '%d_%d_%d%s'
TRY_COUNT = 4
def main():
for patch in range(VERSION_PATCH, TRY_COUNT):
for suffix in range(TRY_COUNT):
if patch == VERSION_PATCH:
s = VERSION_SUFFIX
else:
s = 'a'
s = chr(ord(s) + suffix)
ver = VERSION_STR % (VERSION_MAJOR, VERSION_MINOR, patch, s)
url = URL_STR % ver
try:
with urllib.request.urlopen(url) as res:
if res.getcode() == 200:
with open(OUT, 'wb') as out:
out.write(res.read())
print('successfully downloaded from ' + url)
return 0
except urllib.error.HTTPError:
pass
print('failed to download from ' + url, file=sys.stderr)
print('could not download openssl', file=sys.stderr)
return 1
if __name__ == '__main__':
sys.exit(main())

View file

@ -0,0 +1,68 @@
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
#TODO: Should we bundle system libraries for DLLs?
#include(InstallRequiredSystemLibraries)
# For help take a look at:
# http://www.cmake.org/Wiki/CMake:CPackConfiguration
### general settings
set(CPACK_PACKAGE_NAME "thrift")
set(CPACK_PACKAGE_VERSION "${PACKAGE_VERSION}")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Apache Thrift")
set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README.md")
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
set(CPACK_PACKAGE_VENDOR "Apache Software Foundation")
set(CPACK_PACKAGE_CONTACT "dev@thrift.apache.org")
set(CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_NAME}")
set(CPACK_SYSTEM_NAME "${CMAKE_SYSTEM_NAME}")
### versions
set(CPACK_PACKAGE_VERSION_MAJOR ${thrift_VERSION_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR ${thrift_VERSION_MINOR})
set(CPACK_PACKAGE_VERSION_PATCH ${thrift_VERSION_PATCH})
### source generator
set(CPACK_SOURCE_GENERATOR "TGZ")
set(CPACK_SOURCE_IGNORE_FILES "~$;[.]swp$;/[.]svn/;/[.]git/;.gitignore;/build/;tags;cscope.*")
set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}")
### zip generator
set(CPACK_GENERATOR "ZIP")
set(CPACK_PACKAGE_INSTALL_DIRECTORY "thrift")
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
set(CPACK_GENERATOR "NSIS")
set(CPACK_NSIS_HELP_LINK "http://thrift.apache.org")
set(CPACK_NSIS_MENU_LINKS
"http://thrift.apache.org" "Apache Thrift - Web Site"
"https://issues.apache.org/jira/browse/THRIFT" "Apache Thrift - Issues")
set(CPACK_NSIS_CONTACT ${CPACK_PACKAGE_CONTACT})
set(CPACK_NSIS_MODIFY_PATH "ON")
set(CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_NAME}")
else()
set(CPACK_GENERATOR "DEB" )
set(CPACK_DEBIAN_PACKAGE_MAINTAINER ${CPACK_PACKAGE_CONTACT})
endif()
include(CPack)

View file

@ -0,0 +1,76 @@
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
include(CheckSymbolExists)
include(CheckIncludeFile)
include(CheckIncludeFiles)
include(CheckFunctionExists)
# If AI_ADDRCONFIG is not defined we define it as 0
check_symbol_exists(AI_ADDRCONFIG "sys/types.h;sys/socket.h;netdb.h" HAVE_AI_ADDRCONFIG)
if(NOT HAVE_AI_ADDRCONFIG)
set(AI_ADDRCONFIG 1)
endif(NOT HAVE_AI_ADDRCONFIG)
check_include_file(arpa/inet.h HAVE_ARPA_INET_H)
check_include_file(fcntl.h HAVE_FCNTL_H)
check_include_file(getopt.h HAVE_GETOPT_H)
check_include_file(inttypes.h HAVE_INTTYPES_H)
check_include_file(netdb.h HAVE_NETDB_H)
check_include_file(netinet/in.h HAVE_NETINET_IN_H)
check_include_file(stdint.h HAVE_STDINT_H)
check_include_file(unistd.h HAVE_UNISTD_H)
check_include_file(pthread.h HAVE_PTHREAD_H)
check_include_file(sys/time.h HAVE_SYS_TIME_H)
check_include_file(sys/param.h HAVE_SYS_PARAM_H)
check_include_file(sys/resource.h HAVE_SYS_RESOURCE_H)
check_include_file(sys/socket.h HAVE_SYS_SOCKET_H)
check_include_file(sys/stat.h HAVE_SYS_STAT_H)
check_include_file(sys/un.h HAVE_SYS_UN_H)
check_include_file(sys/poll.h HAVE_SYS_POLL_H)
check_include_file(sys/select.h HAVE_SYS_SELECT_H)
check_include_file(sched.h HAVE_SCHED_H)
check_include_file(strings.h HAVE_STRINGS_H)
check_function_exists(gethostbyname HAVE_GETHOSTBYNAME)
check_function_exists(gethostbyname_r HAVE_GETHOSTBYNAME_R)
check_function_exists(strerror_r HAVE_STRERROR_R)
check_function_exists(sched_get_priority_max HAVE_SCHED_GET_PRIORITY_MAX)
check_function_exists(sched_get_priority_min HAVE_SCHED_GET_PRIORITY_MIN)
include(CheckCSourceCompiles)
include(CheckCXXSourceCompiles)
check_cxx_source_compiles(
"
#include <string.h>
int main(){char b;char *a = strerror_r(0, &b, 0); return(0);}
"
STRERROR_R_CHAR_P)
set(PACKAGE ${PACKAGE_NAME})
set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
set(VERSION ${thrift_VERSION})
# generate a config.h file
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/build/cmake/config.h.in" "${CMAKE_CURRENT_BINARY_DIR}/thrift/config.h")
# HACK: Some files include thrift/config.h and some config.h so we include both. This should be cleaned up.
include_directories("${CMAKE_CURRENT_BINARY_DIR}/thrift" "${CMAKE_CURRENT_BINARY_DIR}")

View file

@ -0,0 +1,70 @@
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
# Always include srcdir and builddir in include path
# This saves typing ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY} in
# about every subdir
# since cmake 2.4.0
set(CMAKE_INCLUDE_CURRENT_DIR ON)
# Put the include dirs which are in the source or build tree
# before all other include dirs, so the headers in the sources
# are preferred over the already installed ones
# since cmake 2.4.1
set(CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE ON)
# Use colored output
# since cmake 2.4.0
set(CMAKE_COLOR_MAKEFILE ON)
# Define the generic version of the libraries here
set(GENERIC_LIB_VERSION "0.10.0")
set(GENERIC_LIB_SOVERSION "0")
# Set the default build type to release with debug info
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE RelWithDebInfo
CACHE STRING
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
)
endif (NOT CMAKE_BUILD_TYPE)
# Create the compile command database for clang by default
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# Put the libraries and binaries that get built into directories at the
# top of the build tree rather than in hard-to-find leaf
# directories. This simplifies manual testing and the use of the build
# tree rather than installed thrift libraries.
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
#
# "rpath" support.
# See http://www.itk.org/Wiki/index.php?title=CMake_RPATH_handling
#
# On MacOSX, for shared libraries, enable rpath support.
set(CMAKE_MACOSX_RPATH TRUE)
#
# On any OS, for executables, allow linking with shared libraries in non-system
# locations and running the executables without LD_PRELOAD or similar.
# This requires the library to be built with rpath support.
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)

View file

@ -0,0 +1,26 @@
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
# Define the default install paths
set(BIN_INSTALL_DIR "bin" CACHE PATH "The binary install dir (default: bin)")
set(LIB_INSTALL_DIR "lib${LIB_SUFFIX}" CACHE PATH "The library install dir (default: lib${LIB_SUFFIX})")
set(INCLUDE_INSTALL_DIR "include" CACHE PATH "The library install dir (default: include)")
set(CMAKE_INSTALL_DIR "cmake" CACHE PATH "The subdirectory to install cmake config files (default: cmake)")
set(DOC_INSTALL_DIR "share/doc" CACHE PATH "The subdirectory to install documentation files (default: share/doc)")

View file

@ -0,0 +1,210 @@
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
include(CMakeDependentOption)
set(THRIFT_COMPILER "" CACHE FILEPATH "External Thrift compiler to use during build")
# Additional components
option(BUILD_COMPILER "Build Thrift compiler" ON)
if(BUILD_COMPILER OR EXISTS ${THRIFT_COMPILER})
set(HAVE_COMPILER ON)
endif()
CMAKE_DEPENDENT_OPTION(BUILD_TESTING "Build with unit tests" ON "HAVE_COMPILER" OFF)
CMAKE_DEPENDENT_OPTION(BUILD_EXAMPLES "Build examples" ON "HAVE_COMPILER" OFF)
CMAKE_DEPENDENT_OPTION(BUILD_TUTORIALS "Build Thrift tutorials" ON "HAVE_COMPILER" OFF)
option(BUILD_LIBRARIES "Build Thrift libraries" ON)
# Libraries to build
# Each language library can be enabled or disabled using the WITH_<LANG> flag.
# By default CMake checks if the required dependencies for a language are present
# and enables the library if all are found. This means the default is to build as
# much as possible but leaving out libraries if their dependencies are not met.
CMAKE_DEPENDENT_OPTION(WITH_BOOST_STATIC "Build with Boost static link library" OFF "NOT MSVC" ON)
set(Boost_USE_STATIC_LIBS ${WITH_BOOST_STATIC})
if (NOT WITH_BOOST_STATIC)
add_definitions(-DBOOST_ALL_DYN_LINK)
add_definitions(-DBOOST_TEST_DYN_LINK)
endif()
# C++
option(WITH_CPP "Build C++ Thrift library" ON)
if(WITH_CPP)
find_package(Boost 1.53 QUIET)
# NOTE: Currently the following options are C++ specific,
# but in future other libraries might reuse them.
# So they are not dependent on WITH_CPP but setting them without WITH_CPP currently
# has no effect.
if(ZLIB_LIBRARY)
# FindZLIB.cmake does not normalize path so we need to do it ourselves.
file(TO_CMAKE_PATH ${ZLIB_LIBRARY} ZLIB_LIBRARY)
endif()
find_package(ZLIB QUIET)
CMAKE_DEPENDENT_OPTION(WITH_ZLIB "Build with ZLIB support" ON
"ZLIB_FOUND" OFF)
find_package(Libevent QUIET)
CMAKE_DEPENDENT_OPTION(WITH_LIBEVENT "Build with libevent support" ON
"Libevent_FOUND" OFF)
find_package(Qt4 QUIET COMPONENTS QtCore QtNetwork)
CMAKE_DEPENDENT_OPTION(WITH_QT4 "Build with Qt4 support" ON
"QT4_FOUND" OFF)
find_package(Qt5 QUIET COMPONENTS Core Network)
CMAKE_DEPENDENT_OPTION(WITH_QT5 "Build with Qt5 support" ON
"Qt5_FOUND" OFF)
if(${WITH_QT4} AND ${WITH_QT5} AND ${CMAKE_MAJOR_VERSION} LESS 3)
# cmake < 3.0.0 causes conflict when building both Qt4 and Qt5
set(WITH_QT4 OFF)
endif()
find_package(OpenSSL QUIET)
CMAKE_DEPENDENT_OPTION(WITH_OPENSSL "Build with OpenSSL support" ON
"OPENSSL_FOUND" OFF)
option(WITH_STDTHREADS "Build with C++ std::thread support" OFF)
CMAKE_DEPENDENT_OPTION(WITH_BOOSTTHREADS "Build with Boost threads support" OFF
"NOT WITH_STDTHREADS;Boost_FOUND" OFF)
endif()
CMAKE_DEPENDENT_OPTION(BUILD_CPP "Build C++ library" ON
"BUILD_LIBRARIES;WITH_CPP;Boost_FOUND" OFF)
CMAKE_DEPENDENT_OPTION(WITH_PLUGIN "Build compiler plugin support" ON
"BUILD_COMPILER;BUILD_CPP" OFF)
# C GLib
option(WITH_C_GLIB "Build C (GLib) Thrift library" ON)
if(WITH_C_GLIB)
find_package(GLIB QUIET COMPONENTS gobject)
endif()
CMAKE_DEPENDENT_OPTION(BUILD_C_GLIB "Build C (GLib) library" ON
"BUILD_LIBRARIES;WITH_C_GLIB;GLIB_FOUND" OFF)
if(BUILD_CPP)
set(boost_components)
if(WITH_BOOSTTHREADS OR BUILD_TESTING)
list(APPEND boost_components system thread)
endif()
if(BUILD_TESTING)
list(APPEND boost_components unit_test_framework filesystem chrono program_options)
endif()
if(boost_components)
find_package(Boost 1.53 REQUIRED COMPONENTS ${boost_components})
endif()
elseif(BUILD_C_GLIB AND BUILD_TESTING)
find_package(Boost 1.53 REQUIRED)
endif()
# Java
option(WITH_JAVA "Build Java Thrift library" ON)
if(ANDROID)
find_package(Gradle QUIET)
CMAKE_DEPENDENT_OPTION(BUILD_JAVA "Build Java library" ON
"BUILD_LIBRARIES;WITH_JAVA;GRADLE_FOUND" OFF)
else()
find_package(Java QUIET)
find_package(Ant QUIET)
CMAKE_DEPENDENT_OPTION(BUILD_JAVA "Build Java library" ON
"BUILD_LIBRARIES;WITH_JAVA;JAVA_FOUND;ANT_FOUND" OFF)
endif()
# Python
option(WITH_PYTHON "Build Python Thrift library" ON)
find_package(PythonInterp QUIET) # for Python executable
find_package(PythonLibs QUIET) # for Python.h
CMAKE_DEPENDENT_OPTION(BUILD_PYTHON "Build Python library" ON
"BUILD_LIBRARIES;WITH_PYTHON;PYTHONLIBS_FOUND" OFF)
# Haskell
option(WITH_HASKELL "Build Haskell Thrift library" ON)
find_package(GHC QUIET)
find_package(Cabal QUIET)
CMAKE_DEPENDENT_OPTION(BUILD_HASKELL "Build GHC library" ON
"BUILD_LIBRARIES;WITH_HASKELL;GHC_FOUND;CABAL_FOUND" OFF)
# Common library options
option(WITH_SHARED_LIB "Build shared libraries" ON)
option(WITH_STATIC_LIB "Build static libraries" ON)
if (NOT WITH_SHARED_LIB AND NOT WITH_STATIC_LIB)
message(FATAL_ERROR "Cannot build with both shared and static outputs disabled!")
endif()
#NOTE: C++ compiler options are defined in the lib/cpp/CMakeLists.txt
# Visual Studio only options
if(MSVC)
option(WITH_MT "Build using MT instead of MD (MSVC only)" OFF)
endif(MSVC)
macro(MESSAGE_DEP flag summary)
if(NOT ${flag})
message(STATUS " - ${summary}")
endif()
endmacro(MESSAGE_DEP flag summary)
macro(PRINT_CONFIG_SUMMARY)
message(STATUS "----------------------------------------------------------")
message(STATUS "Thrift version: ${thrift_VERSION} (${thrift_VERSION_MAJOR}.${thrift_VERSION_MINOR}.${thrift_VERSION_PATCH})")
message(STATUS "Thrift package version: ${PACKAGE_VERSION}")
message(STATUS "Build configuration Summary")
message(STATUS " Build Thrift compiler: ${BUILD_COMPILER}")
message(STATUS " Build compiler plugin support: ${WITH_PLUGIN}")
MESSAGE_DEP(PLUGIN_COMPILER_NOT_TOO_OLD "Disabled due to older compiler")
message(STATUS " Build with unit tests: ${BUILD_TESTING}")
MESSAGE_DEP(HAVE_COMPILER "Disabled because BUILD_THRIFT=OFF and no valid THRIFT_COMPILER is given")
message(STATUS " Build examples: ${BUILD_EXAMPLES}")
MESSAGE_DEP(HAVE_COMPILER "Disabled because BUILD_THRIFT=OFF and no valid THRIFT_COMPILER is given")
message(STATUS " Build Thrift libraries: ${BUILD_LIBRARIES}")
message(STATUS " Language libraries:")
message(STATUS " Build C++ library: ${BUILD_CPP}")
MESSAGE_DEP(WITH_CPP "Disabled by WITH_CPP=OFF")
MESSAGE_DEP(Boost_FOUND "Boost headers missing")
message(STATUS " Build C (GLib) library: ${BUILD_C_GLIB}")
MESSAGE_DEP(WITH_C_GLIB "Disabled by WITH_C_GLIB=OFF")
MESSAGE_DEP(GLIB_FOUND "GLib missing")
message(STATUS " Build Java library: ${BUILD_JAVA}")
MESSAGE_DEP(WITH_JAVA "Disabled by WITH_JAVA=OFF")
if(ANDROID)
MESSAGE_DEP(GRADLE_FOUND "Gradle missing")
else()
MESSAGE_DEP(JAVA_FOUND "Java Runtime missing")
MESSAGE_DEP(ANT_FOUND "Ant missing")
endif()
message(STATUS " Build Python library: ${BUILD_PYTHON}")
MESSAGE_DEP(WITH_PYTHON "Disabled by WITH_PYTHON=OFF")
MESSAGE_DEP(PYTHONLIBS_FOUND "Python libraries missing")
message(STATUS " Build Haskell library: ${BUILD_HASKELL}")
MESSAGE_DEP(WITH_HASKELL "Disabled by WITH_HASKELL=OFF")
MESSAGE_DEP(GHC_FOUND "GHC missing")
MESSAGE_DEP(CABAL_FOUND "Cabal missing")
message(STATUS " Library features:")
message(STATUS " Build shared libraries: ${WITH_SHARED_LIB}")
message(STATUS " Build static libraries: ${WITH_STATIC_LIB}")
message(STATUS " Build with ZLIB support: ${WITH_ZLIB}")
message(STATUS " Build with libevent support: ${WITH_LIBEVENT}")
message(STATUS " Build with Qt4 support: ${WITH_QT4}")
message(STATUS " Build with Qt5 support: ${WITH_QT5}")
message(STATUS " Build with OpenSSL support: ${WITH_OPENSSL}")
message(STATUS " Build with Boost thread support: ${WITH_BOOSTTHREADS}")
message(STATUS " Build with C++ std::thread support: ${WITH_STDTHREADS}")
message(STATUS " Build with Boost static link library: ${WITH_BOOST_STATIC}")
if(MSVC)
message(STATUS " - Enabled for Visual C++")
endif()
message(STATUS "----------------------------------------------------------")
endmacro(PRINT_CONFIG_SUMMARY)

View file

@ -0,0 +1,106 @@
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
# Visual Studio specific options
if(MSVC)
#For visual studio the library naming is as following:
# Dynamic libraries:
# - thrift.dll for release library
# - thriftd.dll for debug library
#
# Static libraries:
# - thriftmd.lib for /MD release build
# - thriftmt.lib for /MT release build
#
# - thriftmdd.lib for /MD debug build
# - thriftmtd.lib for /MT debug build
#
# the same holds for other libraries like libthriftz etc.
# For Debug build types, append a "d" to the library names.
set(CMAKE_DEBUG_POSTFIX "d" CACHE STRING "Set debug library postfix" FORCE)
set(CMAKE_RELEASE_POSTFIX "" CACHE STRING "Set release library postfix" FORCE)
set(CMAKE_RELWITHDEBINFO_POSTFIX "" CACHE STRING "Set release library postfix" FORCE)
# Build using /MT option instead of /MD if the WITH_MT options is set
if(WITH_MT)
set(CompilerFlags
CMAKE_CXX_FLAGS
CMAKE_CXX_FLAGS_DEBUG
CMAKE_CXX_FLAGS_RELEASE
CMAKE_CXX_FLAGS_RELWITHDEBINFO
CMAKE_C_FLAGS
CMAKE_C_FLAGS_DEBUG
CMAKE_C_FLAGS_RELEASE
CMAKE_C_FLAGS_RELWITHDEBINFO
)
foreach(CompilerFlag ${CompilerFlags})
string(REPLACE "/MD" "/MT" ${CompilerFlag} "${${CompilerFlag}}")
endforeach()
set(STATIC_POSTFIX "mt" CACHE STRING "Set static library postfix" FORCE)
else(WITH_MT)
set(STATIC_POSTFIX "md" CACHE STRING "Set static library postfix" FORCE)
endif(WITH_MT)
# Disable Windows.h definition of macros for min and max
add_definitions("-DNOMINMAX")
# Disable boost auto linking pragmas - cmake includes the right files
add_definitions("-DBOOST_ALL_NO_LIB")
# Windows build does not know how to make a shared library yet
# as there are no __declspec(dllexport) or exports files in the project.
if (WITH_SHARED_LIB)
message (FATAL_ERROR "Windows build does not support shared library output yet, please set -DWITH_SHARED_LIB=off")
endif()
elseif(UNIX)
find_program( MEMORYCHECK_COMMAND valgrind )
set( MEMORYCHECK_COMMAND_OPTIONS "--gen-suppressions=all --leak-check=full" )
set( MEMORYCHECK_SUPPRESSIONS_FILE "${PROJECT_SOURCE_DIR}/test/valgrind.suppress" )
endif()
# WITH_*THREADS selects which threading library to use
if(WITH_BOOSTTHREADS)
add_definitions("-DUSE_BOOST_THREAD=1")
elseif(WITH_STDTHREADS)
add_definitions("-DUSE_STD_THREAD=1")
endif()
# GCC and Clang.
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
# FIXME -pedantic can not be used at the moment because of: https://issues.apache.org/jira/browse/THRIFT-2784
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -O2 -Wall -Wextra -pedantic")
# FIXME enabling c++11 breaks some Linux builds on Travis by triggering a g++ bug, see
# https://travis-ci.org/apache/thrift/jobs/58017022
# on the other hand, both MacOSX and FreeBSD need c++11
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin" OR ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -O2 -Wall -Wextra")
endif()
endif()
# If gcc older than 4.8 is detected, disable new compiler plug-in support (see THRIFT-3937)
set(PLUGIN_COMPILER_NOT_TOO_OLD ON) # simplifies messaging in DefineOptions summary
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.8" AND WITH_PLUGIN)
message(STATUS "Disabling compiler plug-in support to work with older gcc compiler")
set(WITH_PLUGIN OFF)
set(PLUGIN_COMPILER_NOT_TOO_OLD OFF)
endif()

View file

@ -0,0 +1,30 @@
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
# ANT_FOUND - system has Ant
# Ant_EXECUTABLE - the Ant executable
#
# It will search the environment variable ANT_HOME if it is set
include(FindPackageHandleStandardArgs)
find_program(Ant_EXECUTABLE NAMES ant PATHS $ENV{ANT_HOME}/bin)
find_package_handle_standard_args(Ant DEFAULT_MSG Ant_EXECUTABLE)
mark_as_advanced(Ant_EXECUTABLE)

View file

@ -0,0 +1,30 @@
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
# Cabal_FOUND - system has Cabal
# Cabal - the Cabal executable
#
# It will search the environment variable CABAL_HOME if it is set
include(FindPackageHandleStandardArgs)
find_program(CABAL NAMES cabal PATHS $ENV{HOME}/.cabal/bin $ENV{CABAL_HOME}/bin)
find_package_handle_standard_args(CABAL DEFAULT_MSG CABAL)
mark_as_advanced(CABAL)

View file

@ -0,0 +1,36 @@
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
# GHC_FOUND - system has GHC
# GHC - the GHC executable
# RUN_HASKELL_FOUND - system has runhaskell
# RUN_HASKELL - the runhaskell executable
#
# It will search the environment variable GHC_HOME if it is set
include(FindPackageHandleStandardArgs)
find_program(GHC NAMES ghc PATHS $ENV{GHC_HOME}/bin)
find_package_handle_standard_args(GHC DEFAULT_MSG GHC)
mark_as_advanced(GHC)
find_program(RUN_HASKELL NAMES runhaskell PATHS $ENV{GHC_HOME}/bin)
find_package_handle_standard_args(RUN_HASKELL DEFAULT_MSG RUN_HASKELL)
mark_as_advanced(RUN_HASKELL)

View file

@ -0,0 +1,122 @@
# - Try to find Glib and its components (gio, gobject etc)
# Once done, this will define
#
# GLIB_FOUND - system has Glib
# GLIB_INCLUDE_DIRS - the Glib include directories
# GLIB_LIBRARIES - link these to use Glib
#
# Optionally, the COMPONENTS keyword can be passed to find_package()
# and Glib components can be looked for. Currently, the following
# components can be used, and they define the following variables if
# found:
#
# gio: GLIB_GIO_LIBRARIES
# gobject: GLIB_GOBJECT_LIBRARIES
# gmodule: GLIB_GMODULE_LIBRARIES
# gthread: GLIB_GTHREAD_LIBRARIES
#
# Note that the respective _INCLUDE_DIR variables are not set, since
# all headers are in the same directory as GLIB_INCLUDE_DIRS.
#
# Copyright (C) 2012 Raphael Kubo da Costa <rakuco@webkit.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND ITS CONTRIBUTORS ``AS
# IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR ITS
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
find_package(PkgConfig)
pkg_check_modules(PC_GLIB QUIET glib-2.0)
find_library(GLIB_LIBRARIES
NAMES glib-2.0
HINTS ${PC_GLIB_LIBDIR}
${PC_GLIB_LIBRARY_DIRS}
)
# Files in glib's main include path may include glibconfig.h, which,
# for some odd reason, is normally in $LIBDIR/glib-2.0/include.
get_filename_component(_GLIB_LIBRARY_DIR ${GLIB_LIBRARIES} PATH)
find_path(GLIBCONFIG_INCLUDE_DIR
NAMES glibconfig.h
HINTS ${PC_LIBDIR} ${PC_LIBRARY_DIRS} ${_GLIB_LIBRARY_DIR}
${PC_GLIB_INCLUDEDIR} ${PC_GLIB_INCLUDE_DIRS}
PATH_SUFFIXES glib-2.0/include
)
find_path(GLIB_INCLUDE_DIR
NAMES glib.h
HINTS ${PC_GLIB_INCLUDEDIR}
${PC_GLIB_INCLUDE_DIRS}
PATH_SUFFIXES glib-2.0
)
set(GLIB_INCLUDE_DIRS ${GLIB_INCLUDE_DIR} ${GLIBCONFIG_INCLUDE_DIR})
if(GLIBCONFIG_INCLUDE_DIR)
# Version detection
file(READ "${GLIBCONFIG_INCLUDE_DIR}/glibconfig.h" GLIBCONFIG_H_CONTENTS)
string(REGEX MATCH "#define GLIB_MAJOR_VERSION ([0-9]+)" _dummy "${GLIBCONFIG_H_CONTENTS}")
set(GLIB_VERSION_MAJOR "${CMAKE_MATCH_1}")
string(REGEX MATCH "#define GLIB_MINOR_VERSION ([0-9]+)" _dummy "${GLIBCONFIG_H_CONTENTS}")
set(GLIB_VERSION_MINOR "${CMAKE_MATCH_1}")
string(REGEX MATCH "#define GLIB_MICRO_VERSION ([0-9]+)" _dummy "${GLIBCONFIG_H_CONTENTS}")
set(GLIB_VERSION_MICRO "${CMAKE_MATCH_1}")
set(GLIB_VERSION "${GLIB_VERSION_MAJOR}.${GLIB_VERSION_MINOR}.${GLIB_VERSION_MICRO}")
endif()
# Additional Glib components. We only look for libraries, as not all of them
# have corresponding headers and all headers are installed alongside the main
# glib ones.
foreach (_component ${GLIB_FIND_COMPONENTS})
if (${_component} STREQUAL "gio")
find_library(GLIB_GIO_LIBRARIES NAMES gio-2.0 HINTS ${_GLIB_LIBRARY_DIR})
set(ADDITIONAL_REQUIRED_VARS ${ADDITIONAL_REQUIRED_VARS} GLIB_GIO_LIBRARIES)
elseif (${_component} STREQUAL "gobject")
find_library(GLIB_GOBJECT_LIBRARIES NAMES gobject-2.0 HINTS ${_GLIB_LIBRARY_DIR})
set(ADDITIONAL_REQUIRED_VARS ${ADDITIONAL_REQUIRED_VARS} GLIB_GOBJECT_LIBRARIES)
elseif (${_component} STREQUAL "gmodule")
find_library(GLIB_GMODULE_LIBRARIES NAMES gmodule-2.0 HINTS ${_GLIB_LIBRARY_DIR})
set(ADDITIONAL_REQUIRED_VARS ${ADDITIONAL_REQUIRED_VARS} GLIB_GMODULE_LIBRARIES)
elseif (${_component} STREQUAL "gthread")
find_library(GLIB_GTHREAD_LIBRARIES NAMES gthread-2.0 HINTS ${_GLIB_LIBRARY_DIR})
set(ADDITIONAL_REQUIRED_VARS ${ADDITIONAL_REQUIRED_VARS} GLIB_GTHREAD_LIBRARIES)
elseif (${_component} STREQUAL "gio-unix")
# gio-unix is compiled as part of the gio library, but the include paths
# are separate from the shared glib ones. Since this is currently only used
# by WebKitGTK+ we don't go to extraordinary measures beyond pkg-config.
pkg_check_modules(GIO_UNIX QUIET gio-unix-2.0)
endif ()
endforeach ()
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GLIB REQUIRED_VARS GLIB_INCLUDE_DIRS GLIB_LIBRARIES ${ADDITIONAL_REQUIRED_VARS}
VERSION_VAR GLIB_VERSION)
mark_as_advanced(
GLIBCONFIG_INCLUDE_DIR
GLIB_GIO_LIBRARIES
GLIB_GIO_UNIX_LIBRARIES
GLIB_GMODULE_LIBRARIES
GLIB_GOBJECT_LIBRARIES
GLIB_GTHREAD_LIBRARIES
GLIB_INCLUDE_DIR
GLIB_INCLUDE_DIRS
GLIB_LIBRARIES
)

View file

@ -0,0 +1,30 @@
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
# GRADLE_FOUND - system has Gradle
# GRADLE_EXECUTABLE - the Gradle executable
#
# It will search the environment variable ANT_HOME if it is set
include(FindPackageHandleStandardArgs)
find_program(GRADLE_EXECUTABLE NAMES gradle PATHS $ENV{GRADLE_HOME}/bin NO_CMAKE_FIND_ROOT_PATH)
find_package_handle_standard_args(Gradle DEFAULT_MSG GRADLE_EXECUTABLE)
mark_as_advanced(GRADLE_EXECUTABLE)

View file

@ -0,0 +1,41 @@
# find LibEvent
# an event notification library (http://libevent.org/)
#
# Usage:
# LIBEVENT_INCLUDE_DIRS, where to find LibEvent headers
# LIBEVENT_LIBRARIES, LibEvent libraries
# Libevent_FOUND, If false, do not try to use libevent
set(LIBEVENT_ROOT CACHE PATH "Root directory of libevent installation")
set(LibEvent_EXTRA_PREFIXES /usr/local /opt/local "$ENV{HOME}" ${LIBEVENT_ROOT})
foreach(prefix ${LibEvent_EXTRA_PREFIXES})
list(APPEND LibEvent_INCLUDE_PATHS "${prefix}/include")
list(APPEND LibEvent_LIBRARIES_PATHS "${prefix}/lib")
endforeach()
find_path(LIBEVENT_INCLUDE_DIRS event.h PATHS ${LibEvent_INCLUDE_PATHS})
# "lib" prefix is needed on Windows
find_library(LIBEVENT_LIBRARIES NAMES event libevent PATHS ${LibEvent_LIBRARIES_PATHS})
if (LIBEVENT_LIBRARIES AND LIBEVENT_INCLUDE_DIRS)
set(Libevent_FOUND TRUE)
set(LIBEVENT_LIBRARIES ${LIBEVENT_LIBRARIES})
else ()
set(Libevent_FOUND FALSE)
endif ()
if (Libevent_FOUND)
if (NOT Libevent_FIND_QUIETLY)
message(STATUS "Found libevent: ${LIBEVENT_LIBRARIES}")
endif ()
else ()
if (LibEvent_FIND_REQUIRED)
message(FATAL_ERROR "Could NOT find libevent.")
endif ()
message(STATUS "libevent NOT found.")
endif ()
mark_as_advanced(
LIBEVENT_LIBRARIES
LIBEVENT_INCLUDE_DIRS
)

60
vendor/git.apache.org/thrift.git/build/cmake/README.md generated vendored Normal file
View file

@ -0,0 +1,60 @@
# Apache Thrift - CMake build
## Goal
Extend Apache Thrift's *make cross* approach to the build system.
Due to growing the field of operating system support, a proper executable
and library detection mechanism running on as much platforms as possible
becomes required. The other aspect to simplify the release process and
package generation process.
As nice side benefit of CMake is the generation of development environment
specific soultion files. => No solution files within source tree.
## Usage
just do this:
mkdir cmake-build && cd cmake-build
cmake ..
if you use a specific toolchain pass it to cmake, the same for options:
cmake -DCMAKE_TOOLCHAIN_FILE=../build/cmake/mingw32-toolchain.cmake ..
cmake -DCMAKE_C_COMPILER=clang-3.5 -DCMAKE_CXX_COMPILER=clang++-3.5 ..
cmake -DTHRIFT_COMPILER_HS=OFF ..
cmake -DWITH_ZLIB=ON ..
or on Windows
cmake -G "Visual Studio 12 2013 Win64" \
-DBOOST_ROOT=C:/3rdparty/boost_1_58_0 \
-DZLIB_ROOT=C:/3rdparty/zlib128-dll \
-DWITH_SHARED_LIB=off -DWITH_BOOSTTHREADS=ON ..
and open the development environment you like with the solution or do this:
make
make check
make cross
make dist
to generate an installer and distribution package do this:
cpack
## TODO
* git hash or tag based versioning depending on source state
* build tutorial
* build test
* with/without language lib/<lang>/
* enable/disable
* make cross
* make dist (create an alias to make package_source)
* make doc
* cpack (C++ and make dist only ?)
* thrift-compiler
* libthrift
* tutorial
* test
* merge into /README.md

View file

@ -0,0 +1,105 @@
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
set(CMAKE_DEBUG_POSTFIX "d" CACHE STRING "Set debug library postfix" FORCE)
macro(ADD_LIBRARY_THRIFT name)
if(WITH_SHARED_LIB)
add_library(${name} SHARED ${ARGN})
set_target_properties(${name} PROPERTIES
OUTPUT_NAME ${name}
VERSION ${thrift_VERSION}
SOVERSION ${thrift_VERSION} )
#set_target_properties(${name} PROPERTIES PUBLIC_HEADER "${thriftcpp_HEADERS}")
install(TARGETS ${name}
RUNTIME DESTINATION "${BIN_INSTALL_DIR}"
LIBRARY DESTINATION "${LIB_INSTALL_DIR}"
ARCHIVE DESTINATION "${LIB_INSTALL_DIR}"
PUBLIC_HEADER DESTINATION "${INCLUDE_INSTALL_DIR}")
endif()
if(WITH_STATIC_LIB)
add_library(${name}_static STATIC ${ARGN})
set_target_properties(${name}_static PROPERTIES
OUTPUT_NAME ${name}${STATIC_POSTFIX}
VERSION ${thrift_VERSION}
SOVERSION ${thrift_VERSION} )
install(TARGETS ${name}_static
RUNTIME DESTINATION "${BIN_INSTALL_DIR}"
LIBRARY DESTINATION "${LIB_INSTALL_DIR}"
ARCHIVE DESTINATION "${LIB_INSTALL_DIR}"
PUBLIC_HEADER DESTINATION "${INCLUDE_INSTALL_DIR}")
endif()
endmacro(ADD_LIBRARY_THRIFT)
macro(TARGET_INCLUDE_DIRECTORIES_THRIFT name)
if(WITH_SHARED_LIB)
target_include_directories(${name} ${ARGN})
endif()
if(WITH_STATIC_LIB)
target_include_directories(${name}_static ${ARGN})
endif()
endmacro(TARGET_INCLUDE_DIRECTORIES_THRIFT)
macro(TARGET_LINK_LIBRARIES_THRIFT name)
if(WITH_SHARED_LIB)
target_link_libraries(${name} ${ARGN})
endif()
if(WITH_STATIC_LIB)
target_link_libraries(${name}_static ${ARGN})
endif()
endmacro(TARGET_LINK_LIBRARIES_THRIFT)
macro(LINK_AGAINST_THRIFT_LIBRARY target libname)
if (WITH_SHARED_LIB)
target_link_libraries(${target} ${libname})
elseif (WITH_STATIC_LIB)
target_link_libraries(${target} ${libname}_static)
else()
message(FATAL "Not linking with shared or static libraries?")
endif()
endmacro(LINK_AGAINST_THRIFT_LIBRARY)
macro(TARGET_LINK_LIBRARIES_THRIFT_AGAINST_THRIFT_LIBRARY target libname)
if(WITH_SHARED_LIB)
target_link_libraries(${target} ${ARGN} ${libname})
endif()
if(WITH_STATIC_LIB)
target_link_libraries(${target}_static ${ARGN} ${libname}_static)
endif()
endmacro(TARGET_LINK_LIBRARIES_THRIFT_AGAINST_THRIFT_LIBRARY)

View file

@ -0,0 +1,26 @@
set(ANDROID_NDK "/opt/android-ndk" CACHE)
set(ANDROID_PLATFORM "android-15" CACHE)
set(ANDROID_ARCH "arch-arm" CACHE)
set(ANDROID_TOOL_ARCH "android-arm" CACHE)
set(ANDROID_CPU "armeabi-v7a" CACHE)
set(ANDROID_GCC_VERSION 4.9 CACHE)
set(HOST_ARCH linux-x86_64 CACHE)
set(CMAKE_SYSTEM_NAME Android)
set(ANDROID_SYSROOT "${ANDROID_NDK}/platforms/${ANDROID_PLATFORM}/${ANDROID_ARCH}")
set(ANDROID_TRIPLET arm-linux-androideabi)
set(ANDROID_STL "${ANDROID_NDK}/sources/cxx-stl/gnu-libstd++/${ANDROID_GCC_VERSION}")
set(_COMPILER_ROOT ${ANDROID_NDK}/prebuilt/${ANDROID_TRIPLET}-${ANDROID_GCC_VERSION}/prebuilt/${HOST_ARCH})
set(CMAKE_C_COMPILER ${_COMPILER_ROOT}/bin/${ANDROID_TRIPLET}-gcc)
set(CMAKE_CXCX_COMPILER ${_COMPILER_ROOT}/bin/${ANDROID_TRIPLET}-g++)
include_directories(
${ANDROID_STL}/include
${ANDROID_STL}/libs/${ANDROID_CPU}/include)
set(CMAKE_FIND_ROOT_PATH ${ANDROID_SYSROOT})
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

View file

@ -0,0 +1,157 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
/* config.h generated by CMake from config.h.in */
#ifndef CONFIG_H
#define CONFIG_H
/* Name of package */
#cmakedefine PACKAGE "${PACKAGE}"
/* Define to the address where bug reports for this package should be sent. */
#cmakedefine PACKAGE_BUGREPORT "${PACKAGE_BUGREPORT}"
/* Define to the full name of this package. */
#cmakedefine PACKAGE_NAME "${PACKAGE_NAME}"
/* Define to the one symbol short name of this package. */
#cmakedefine PACKAGE_TARNAME "${PACKAGE_TARNAME}"
/* Define to the home page for this package. */
#cmakedefine PACKAGE_URL "${PACKAGE_URL}"
/* Define to the version of this package. */
#define PACKAGE_VERSION "${PACKAGE_VERSION}"
/* Define to the full name and version of this package. */
#define PACKAGE_STRING "${PACKAGE_STRING}"
/* Version number of package */
#define VERSION "${VERSION}"
/************************** DEFINES *************************/
/* Define if the AI_ADDRCONFIG symbol is unavailable */
#cmakedefine AI_ADDRCONFIG 0
/* Possible value for SIGNED_RIGHT_SHIFT_IS */
/* TODO: This is just set to 1 for the moment
port the macro aclocal/ax_signed_right_shift.m4 to CMake to make this work */
#define ARITHMETIC_RIGHT_SHIFT 1
/* Indicates the effect of the right shift operator on negative signed
integers */
/* TODO: This is just set to 1 for the moment */
#define SIGNED_RIGHT_SHIFT_IS 1
/* Use *.h extension for parser header file */
/* TODO: This might now be necessary anymore as it is set only for automake < 1.11
see: aclocal/ac_prog_bison.m4 */
#cmakedefine BISON_USE_PARSER_H_EXTENSION 1
/* replaces POSIX pthread by boost::thread */
#cmakedefine USE_BOOST_THREAD 1
/* replaces POSIX pthread by std::thread */
#cmakedefine USE_STD_THREAD 1
/* Define to 1 if strerror_r returns char *. */
#cmakedefine STRERROR_R_CHAR_P 1
/************************** HEADER FILES *************************/
/* Define to 1 if you have the <arpa/inet.h> header file. */
#cmakedefine HAVE_ARPA_INET_H 1
/* Define to 1 if you have the <fcntl.h> header file. */
#cmakedefine HAVE_FCNTL_H 1
/* Define to 1 if you have the <inttypes.h> header file. */
#cmakedefine HAVE_INTTYPES_H 1
/* Define to 1 if you have the <netdb.h> header file. */
#cmakedefine HAVE_NETDB_H 1
/* Define to 1 if you have the <netinet/in.h> header file. */
#cmakedefine HAVE_NETINET_IN_H 1
/* Define to 1 if you have the <stdint.h> header file. */
#cmakedefine HAVE_STDINT_H 1
/* Define to 1 if you have the <unistd.h> header file. */
#cmakedefine HAVE_UNISTD_H 1
/* Define to 1 if you have the <pthread.h> header file. */
#cmakedefine HAVE_PTHREAD_H 1
/* Define to 1 if you have the <sys/time.h> header file. */
#cmakedefine HAVE_SYS_TIME_H 1
/* Define to 1 if you have the <sys/param.h> header file. */
#cmakedefine HAVE_SYS_PARAM_H 1
/* Define to 1 if you have the <sys/resource.h> header file. */
#cmakedefine HAVE_SYS_RESOURCE_H 1
/* Define to 1 if you have the <sys/socket.h> header file. */
#cmakedefine HAVE_SYS_SOCKET_H 1
/* Define to 1 if you have the <sys/stat.h> header file. */
#cmakedefine HAVE_SYS_STAT_H 1
/* Define to 1 if you have the <sys/un.h> header file. */
#cmakedefine HAVE_SYS_UN_H 1
/* Define to 1 if you have the <sys/poll.h> header file. */
#cmakedefine HAVE_SYS_POLL_H 1
/* Define to 1 if you have the <sys/select.h> header file. */
#cmakedefine HAVE_SYS_SELECT_H 1
/* Define to 1 if you have the <sched.h> header file. */
#cmakedefine HAVE_SCHED_H 1
/* Define to 1 if you have the <strings.h> header file. */
#define HAVE_STRINGS_H 1
/*************************** FUNCTIONS ***************************/
/* Define to 1 if you have the `gethostbyname' function. */
#cmakedefine HAVE_GETHOSTBYNAME 1
/* Define to 1 if you have the `gethostbyname_r' function. */
#cmakedefine HAVE_GETHOSTBYNAME_R 1
/* Define to 1 if you have the `strerror_r' function. */
#cmakedefine HAVE_STRERROR_R 1
/* Define to 1 if you have the `sched_get_priority_max' function. */
#cmakedefine HAVE_SCHED_GET_PRIORITY_MAX 1
/* Define to 1 if you have the `sched_get_priority_min' function. */
#cmakedefine HAVE_SCHED_GET_PRIORITY_MIN 1
/* Define to 1 if strerror_r returns char *. */
#cmakedefine STRERROR_R_CHAR_P 1
#endif

View file

@ -0,0 +1,24 @@
# CMake mingw32 cross compile toolchain file
# the name of the target operating system
SET(CMAKE_SYSTEM_NAME Windows)
# which compilers to use for C and C++
SET(CMAKE_C_COMPILER i586-mingw32msvc-gcc)
SET(CMAKE_CXX_COMPILER i586-mingw32msvc-g++)
SET(CMAKE_RC_COMPILER i586-mingw32msvc-windres)
# here is the target environment located
SET(CMAKE_FIND_ROOT_PATH /usr/i586-mingw32msvc)
# adjust the default behaviour of the FIND_XXX() commands:
# search headers and libraries in the target environment, search
# programs in the host environment
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(BUILD_SHARED_LIBS OFF)
SET(CMAKE_EXE_LINKER_FLAGS "-static")
set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} "-static-libgcc")
set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "-static-libstdc++")

View file

@ -0,0 +1,27 @@
# Apache Thrift Docker containers
A set of docker containers used to build and test Apache Thrift
### Available Containers
* Ubuntu - based on ubuntu:trusty (14.04)
* Centos - based on centos:6.6
## Dependencies
* A working Docker environment. A Vagrantfile is provided which will setup an Ubuntu host and working Docker environment as well as build the Apache Thrift Docker container for testing and development
## Usage
From the Apache Thrift code base root
* Build
docker build -t thrift build/docker/ubuntu
or
docker build -t thrift build/docker/centos
* Run
docker run -v $(pwd):/thrift/src -it thrift /bin/bash

View file

@ -0,0 +1,59 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Base system bootstrap script
$bootstrap_script = <<__BOOTSTRAP__
echo "Provisioning defaults"
sudo apt-get update -y
sudo apt-get upgrade -y
# Install default packages
sudo apt-get install -y build-essential curl git
# Install latest Docker version
sudo curl -sSL https://get.docker.io/gpg | sudo apt-key add -
sudo echo "deb http://get.docker.io/ubuntu docker main" > /etc/apt/sources.list.d/docker.list
sudo apt-get update -y
sudo apt-get install -y linux-image-extra-`uname -r` aufs-tools
sudo apt-get install -y lxc-docker
echo "Finished provisioning defaults"
__BOOTSTRAP__
Vagrant.configure("2") do |config|
config.vm.box = "trusty64"
config.vm.box_url = "https://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-amd64-vagrant-disk1.box"
config.ssh.forward_agent = true
config.vm.provider :virtualbox do |vbox|
vbox.customize ["modifyvm", :id, "--memory", "1024"]
vbox.customize ["modifyvm", :id, "--cpus", "2"]
end
# Setup the default bootstrap script for our ubuntu base box image
config.vm.provision "shell", inline: $bootstrap_script
# Setup the custom docker image from our Ubuntu Dockerfile
config.vm.provision "docker" do |d|
d.build_image "/vagrant/ubuntu", args: "-t thrift"
end
# Setup the custom docker image from our Centos Dockerfile
#config.vm.provision "docker" do |d|
# d.build_image "/vagrant/centos", args: "-t thrift-centos"
#end
end

View file

@ -0,0 +1,142 @@
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Apache Thrift Docker build environment for Centos
#
# Known missing client libraries:
# - D
# - Haxe
# - Lua
#
FROM centos:7
MAINTAINER Apache Thrift <dev@thrift.apache.org>
RUN yum install -y epel-release
# General dependencies
RUN yum install -y \
tar \
m4 \
perl \
clang \
gcc \
gcc-c++ \
git \
libtool \
autoconf \
make \
bison \
bison-devel \
flex
# C++ dependencies
RUN yum install -y \
boost-devel-static \
zlib-devel \
openssl-devel \
libevent-devel
# Java Dependencies
RUN yum install -y \
ant \
junit \
ant-junit \
java-1.7.0-openjdk-devel
# Python Dependencies
RUN yum install -y \
python-devel \
python-pip \
python-setuptools \
python-six \
python-twisted-web && \
pip install -U backports.ssl_match_hostname ipaddress tornado
# Ruby Dependencies
RUN yum install -y \
ruby \
ruby-devel \
rubygems && \
gem install bundler rake
# Perl Dependencies
RUN yum install -y \
perl-Bit-Vector \
perl-Class-Accessor \
perl-ExtUtils-MakeMaker \
perl-Test-Simple \
perl-IO-Socket-SSL \
perl-Net-SSLeay \
perl-Crypt-SSLeay
# PHP Dependencies
RUN yum install -y \
php \
php-devel \
php-pear \
re2c \
php-phpunit-PHPUnit \
bzip2
# GLibC Dependencies
RUN yum install -y glib2-devel
# Erlang Dependencies
RUN curl -sSL http://packages.erlang-solutions.com/rpm/centos/erlang_solutions.repo -o /etc/yum.repos.d/erlang_solutions.repo && \
yum install -y \
erlang-kernel \
erlang-erts \
erlang-stdlib \
erlang-eunit \
erlang-rebar \
erlang-tools
# Go Dependencies
RUN curl -sSL https://storage.googleapis.com/golang/go1.4.3.linux-amd64.tar.gz | tar -C /usr/local/ -xz
ENV PATH /usr/local/go/bin:$PATH
# Haskell Dependencies
RUN yum -y install haskell-platform
# Node.js Dependencies
RUN yum install -y \
nodejs \
nodejs-devel \
npm
# C# Dependencies
RUN yum install -y \
mono-core \
mono-devel \
mono-web-devel \
mono-extras \
# MinGW Dependencies
RUN yum install -y \
mingw32-binutils \
mingw32-crt \
mingw32-nsis
# CMake
RUN curl -sSL https://cmake.org/files/v3.4/cmake-3.4.0.tar.gz | tar -xz && \
cd cmake-3.4.0 && ./bootstrap && make -j4 && make install && \
cd .. && rm -rf cmake-3.4.0
# Clean up
RUN rm -rf /tmp/* && \
yum clean all
ENV THRIFT_ROOT /thrift
RUN mkdir -p $THRIFT_ROOT/src
COPY Dockerfile $THRIFT_ROOT/
WORKDIR $THRIFT_ROOT/src

View file

@ -0,0 +1,54 @@
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Apache Thrift Docker build environment for Centos 6
#
# This file is intended for testing old packages that are not available for
# latest Ubuntu LTS/Debian/CentOS. Currently, it is only used for Python 2.6.
#
FROM centos:6
MAINTAINER Apache Thrift <dev@thrift.apache.org>
RUN yum install -y epel-release && \
yum install -y \
autoconf \
bison \
bison-devel \
clang \
flex \
gcc \
gcc-c++ \
git \
libtool \
m4 \
make \
perl \
tar \
python-devel \
python-setuptools \
python-twisted-web \
python-pip \
&& yum clean all
# optional dependencies
RUN pip install ipaddress backports.ssl_match_hostname tornado
# CMake
RUN curl -sSL https://cmake.org/files/v3.4/cmake-3.4.1.tar.gz | tar -xz && \
cd cmake-3.4.1 && ./bootstrap && make -j4 && make install && \
cd .. && rm -rf cmake-3.4.1
ENV THRIFT_ROOT /thrift
RUN mkdir -p $THRIFT_ROOT/src
COPY Dockerfile $THRIFT_ROOT/
WORKDIR $THRIFT_ROOT/src

View file

@ -0,0 +1,42 @@
#!/bin/bash
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
# Download prebuilt docker image and compare Dockerfile hash values
set -ex
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
DISTRO=$1
SRC_IMG=thrift/thrift-build:$DISTRO
function try_pull {
docker pull $SRC_IMG
cd ${SCRIPT_DIR}/$DISTRO
docker run $SRC_IMG bash -c 'cd .. && sha512sum Dockerfile' > .Dockerfile.sha512
sha512sum -c .Dockerfile.sha512
}
if try_pull; then
echo Dockerfile seems identical. No need to rebuild from scratch.
docker tag thrift/thrift-build:$DISTRO thrift-build:$DISTRO
else
echo Either Dockerfile has changed or pull failure. Need to build brand new one.
exit 1
fi

View file

@ -0,0 +1,192 @@
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Apache Thrift Docker build environment for Centos
#
# Known missing client libraries:
# - None
FROM buildpack-deps:jessie-scm
MAINTAINER Apache Thrift <dev@thrift.apache.org>
ENV DEBIAN_FRONTEND noninteractive
# Add apt sources
# Dart
RUN curl https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \
curl https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > /etc/apt/sources.list.d/dart_stable.list && \
sed -i /etc/apt/sources.list.d/dart_stable.list -e 's/https:/http:/g'
RUN apt-get update && apt-get install -y --no-install-recommends \
`# General dependencies` \
bison \
build-essential \
clang \
cmake \
debhelper \
flex \
pkg-config
RUN apt-get update && apt-get install -y --no-install-recommends \
`# C++ dependencies` \
libboost-dev \
libboost-filesystem-dev \
libboost-program-options-dev \
libboost-system-dev \
libboost-test-dev \
libboost-thread-dev \
libevent-dev \
libssl-dev \
qt5-default \
qtbase5-dev \
qtbase5-dev-tools
RUN apt-get update && apt-get install -y --no-install-recommends \
`# Java dependencies` \
ant \
ant-optional \
openjdk-7-jdk \
maven
RUN apt-get update && apt-get install -y --no-install-recommends \
`# Python dependencies` \
python-all \
python-all-dbg \
python-all-dev \
python-pip \
python-setuptools \
python-twisted \
python-zope.interface \
python3-all \
python3-all-dbg \
python3-all-dev \
python3-setuptools \
python3-pip
RUN echo 'deb http://deb.debian.org/debian jessie-backports main' >> /etc/apt/sources.list \
&& apt-get update && apt-get install -y --no-install-recommends \
`# Ruby dependencies` \
ruby \
ruby-bundler \
ruby-dev \
`# Perl dependencies` \
libbit-vector-perl \
libclass-accessor-class-perl \
libcrypt-ssleay-perl \
libio-socket-ssl-perl \
libnet-ssleay-perl
RUN apt-get update && apt-get install -y --no-install-recommends \
`# Php dependencies` \
php5 \
php5-dev \
php5-cli \
php-pear \
re2c \
phpunit \
`# GlibC dependencies` \
libglib2.0-dev
RUN apt-get update && apt-get install -y --no-install-recommends \
`# Erlang dependencies` \
erlang-base \
erlang-eunit \
erlang-dev \
erlang-tools \
rebar
RUN apt-get update && apt-get install -y --no-install-recommends \
`# Haskell dependencies` \
ghc \
cabal-install \
`# Haxe dependencies` \
neko \
neko-dev \
libneko0
RUN apt-get update && apt-get install -y --no-install-recommends \
`# Node.js dependencies` \
nodejs \
nodejs-dev \
nodejs-legacy \
npm
RUN apt-get update && apt-get install -y --no-install-recommends \
`# CSharp dependencies` \
libmono-system-web2.0-cil \
mono-devel
RUN apt-get update && apt-get install -y --no-install-recommends \
`# D dependencies` \
xdg-utils \
`# Dart dependencies` \
dart \
`# Lua dependencies` \
lua5.2 \
lua5.2-dev \
`# MinGW dependencies` \
mingw32 \
mingw32-binutils \
`# mingw32-runtime` \
nsis \
`# Clean up` \
&& rm -rf /var/cache/apt/* && \
rm -rf /var/lib/apt/lists/* && \
rm -rf /tmp/* && \
rm -rf /var/tmp/*
# Ruby
RUN gem install bundler --no-ri --no-rdoc
# Python optional dependencies
RUN pip2 install -U ipaddress backports.ssl_match_hostname tornado
RUN pip3 install -U backports.ssl_match_hostname tornado
# Go
RUN curl -sSL https://storage.googleapis.com/golang/go1.4.3.linux-amd64.tar.gz | tar -C /usr/local/ -xz
ENV PATH /usr/local/go/bin:$PATH
# Haxe
RUN mkdir -p /usr/lib/haxe && \
curl http://haxe.org/website-content/downloads/3.2.0/downloads/haxe-3.2.0-linux64.tar.gz | \
tar -C /usr/lib/haxe --strip-components=1 -xz && \
ln -s /usr/lib/haxe/haxe /usr/bin/haxe && \
ln -s /usr/lib/haxe/haxelib /usr/bin/haxelib && \
mkdir -p /usr/lib/haxe/lib && \
chmod -R 777 /usr/lib/haxe/lib && \
haxelib setup /usr/lib/haxe/lib && \
haxelib install hxcpp
# D
RUN curl -sSL http://downloads.dlang.org/releases/2.x/2.070.0/dmd_2.070.0-0_amd64.deb -o /tmp/dmd_2.070.0-0_amd64.deb && \
dpkg -i /tmp/dmd_2.070.0-0_amd64.deb && \
rm /tmp/dmd_2.070.0-0_amd64.deb && \
curl -sSL https://github.com/D-Programming-Deimos/openssl/archive/master.tar.gz| tar xz && \
curl -sSL https://github.com/D-Programming-Deimos/libevent/archive/master.tar.gz| tar xz && \
mkdir -p /usr/include/dmd/druntime/import/deimos /usr/include/dmd/druntime/import/C && \
mv libevent-master/deimos/* openssl-master/deimos/* /usr/include/dmd/druntime/import/deimos/ && \
mv libevent-master/C/* openssl-master/C/* /usr/include/dmd/druntime/import/C/ && \
rm -rf libevent-master openssl-master && \
echo 'gcc -Wl,--no-as-needed $*' > /usr/local/bin/gcc-dmd && \
chmod 755 /usr/local/bin/gcc-dmd && \
echo 'CC=/usr/local/bin/gcc-dmd' >> /etc/dmd.conf
# Dart
ENV PATH /usr/lib/dart/bin:$PATH
# Force utf8 locale to successfully build Haskell tf-random
ENV LC_ALL C.UTF-8
ENV THRIFT_ROOT /thrift
RUN mkdir -p $THRIFT_ROOT/src
COPY Dockerfile $THRIFT_ROOT/
WORKDIR $THRIFT_ROOT/src

View file

@ -0,0 +1,6 @@
#!/bin/sh
set -ev
./bootstrap.sh
./configure $*
make check -j3

View file

@ -0,0 +1,23 @@
#!/bin/sh
set -ev
CMAKE_FLAGS=$*
MAKEPROG=make
if ninja --version >/dev/null 2>&1; then
MAKEPROG=ninja
CMAKE_FLAGS="-GNinja $CMAKE_FLAGS"
fi
mkdir -p cmake_build && cd cmake_build
cmake $CMAKE_FLAGS ..
for LIB in $BUILD_LIBS; do
if ! grep "^BUILD_${LIB}:BOOL=ON$" CMakeCache.txt ; then
echo "failed to configure $LIB"
exit 1
fi
done
$MAKEPROG -j3
cpack
ctest -VV
# was: -E "(concurrency_test|processor_test)"

View file

@ -0,0 +1,16 @@
#!/bin/sh
set -ev
./bootstrap.sh
./configure --enable-tutorial=no
make -j3 precross
set +e
make cross$1
RET=$?
if [ $RET -ne 0 ]; then
cat test/log/unexpected_failures.log
fi
exit $RET

View file

@ -0,0 +1,5 @@
#!/bin/sh
set -ev
dpkg-buildpackage -tc -us -uc
ls -al ..

View file

@ -0,0 +1,9 @@
#!/bin/sh
set -ev
./bootstrap.sh
./configure $*
make dist
tar xvf thrift-*.tar.gz
cd thrift-*
./build/docker/scripts/cmake.sh

View file

@ -0,0 +1,209 @@
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Apache Thrift Docker build environment for Centos
#
# Known missing client libraries:
# - None
FROM buildpack-deps:trusty-scm
MAINTAINER Apache Thrift <dev@thrift.apache.org>
ENV DEBIAN_FRONTEND noninteractive
# Add apt sources
# Erlang
RUN echo 'deb http://packages.erlang-solutions.com/debian trusty contrib' > /etc/apt/sources.list.d/erlang_solutions.list && \
curl -sSL https://packages.erlang-solutions.com/debian/erlang_solutions.asc | apt-key add -
# Dart
RUN curl https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \
curl https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > /etc/apt/sources.list.d/dart_stable.list && \
sed -i /etc/apt/sources.list.d/dart_stable.list -e 's/https:/http:/g'
# Consider using mirror nearby when building locally
# TODO: Provide option via --build-arg=...
# RUN sed -i /etc/apt/sources.list -e 's!http://archive.ubuntu.com/ubuntu/!http://your/mirror/!g'
RUN apt-get update && apt-get install -y --no-install-recommends \
`# General dependencies` \
bison \
build-essential \
clang \
cmake \
debhelper \
flex \
ninja-build \
pkg-config \
`# Included in buildpack-deps` \
`# autoconf` \
`# automake` \
`# g++` \
`# git` \
`# libtool` \
`# make`
RUN apt-get update && apt-get install -y --no-install-recommends \
`# C++ dependencies` \
`# libevent and OpenSSL are needed by D too` \
libboost-dev \
libboost-filesystem-dev \
libboost-program-options-dev \
libboost-system-dev \
libboost-test-dev \
libboost-thread-dev \
libevent-dev \
libssl-dev \
qt5-default \
qtbase5-dev \
qtbase5-dev-tools
RUN apt-get update && apt-get install -y --no-install-recommends \
`# Java dependencies` \
ant \
ant-optional \
openjdk-7-jdk \
maven
RUN apt-get update && apt-get install -y --no-install-recommends \
`# Python dependencies` \
`# TODO:` \
`# Install twisted and zope.interface via pip. we need twisted at ./configure time, otherwise` \
`# py.twisted tests are skipped.` \
python-all \
python-all-dbg \
python-all-dev \
python-pip \
python-setuptools \
python-twisted \
python-zope.interface \
python3-all \
python3-all-dbg \
python3-all-dev \
python3-setuptools \
python3-pip
RUN apt-get update && apt-get install -y --no-install-recommends \
`# Ruby dependencies` \
ruby \
ruby-bundler \
ruby-dev \
`# Perl dependencies` \
libbit-vector-perl \
libclass-accessor-class-perl \
libcrypt-ssleay-perl \
libio-socket-ssl-perl \
libnet-ssleay-perl
RUN apt-get update && apt-get install -y --no-install-recommends \
`# Php dependencies` \
php5 \
php5-dev \
php5-cli \
php-pear \
re2c \
phpunit \
`# GlibC dependencies` \
libglib2.0-dev
RUN apt-get update && apt-get install -y --no-install-recommends \
`# Erlang dependencies` \
erlang-base \
erlang-eunit \
erlang-dev \
erlang-tools \
rebar
RUN apt-get update && apt-get install -y --no-install-recommends \
`# Haskell dependencies` \
ghc \
cabal-install \
`# Haxe dependencies` \
neko \
neko-dev \
libneko0
RUN apt-get update && apt-get install -y --no-install-recommends \
`# Node.js dependencies` \
nodejs \
nodejs-dev \
nodejs-legacy
RUN apt-get update && apt-get install -y --no-install-recommends \
`# CSharp dependencies` \
libmono-system-web2.0-cil \
mono-devel
RUN apt-get update && apt-get install -y --no-install-recommends \
`# D dependencies` \
xdg-utils \
`# Dart dependencies` \
dart \
`# Lua dependencies` \
lua5.2 \
lua5.2-dev \
`# MinGW dependencies` \
mingw32 \
mingw32-binutils \
mingw32-runtime \
nsis \
`# Clean up` \
&& rm -rf /var/cache/apt/* && \
rm -rf /var/lib/apt/lists/* && \
rm -rf /tmp/* && \
rm -rf /var/tmp/*
# Ruby
RUN gem install bundler --no-ri --no-rdoc
# Python optional dependencies
RUN pip2 install -U ipaddress backports.ssl_match_hostname tornado
RUN pip3 install -U backports.ssl_match_hostname tornado
# Go
RUN curl -sSL https://storage.googleapis.com/golang/go1.4.3.linux-amd64.tar.gz | tar -C /usr/local/ -xz
ENV PATH /usr/local/go/bin:$PATH
# Haxe
RUN mkdir -p /usr/lib/haxe && \
curl http://haxe.org/website-content/downloads/3.2.0/downloads/haxe-3.2.0-linux64.tar.gz | \
tar -C /usr/lib/haxe --strip-components=1 -xz && \
ln -s /usr/lib/haxe/haxe /usr/bin/haxe && \
ln -s /usr/lib/haxe/haxelib /usr/bin/haxelib && \
mkdir -p /usr/lib/haxe/lib && \
chmod -R 777 /usr/lib/haxe/lib && \
haxelib setup /usr/lib/haxe/lib && \
haxelib install hxcpp
# Node.js
RUN curl -sSL https://www.npmjs.com/install.sh | sh
# D
RUN curl -sSL http://downloads.dlang.org/releases/2.x/2.070.0/dmd_2.070.0-0_amd64.deb -o /tmp/dmd_2.070.0-0_amd64.deb && \
dpkg -i /tmp/dmd_2.070.0-0_amd64.deb && \
rm /tmp/dmd_2.070.0-0_amd64.deb && \
curl -sSL https://github.com/D-Programming-Deimos/openssl/archive/master.tar.gz| tar xz && \
curl -sSL https://github.com/D-Programming-Deimos/libevent/archive/master.tar.gz| tar xz && \
mkdir -p /usr/include/dmd/druntime/import/deimos /usr/include/dmd/druntime/import/C && \
mv libevent-master/deimos/* openssl-master/deimos/* /usr/include/dmd/druntime/import/deimos/ && \
mv libevent-master/C/* openssl-master/C/* /usr/include/dmd/druntime/import/C/ && \
rm -rf libevent-master openssl-master && \
echo 'gcc -Wl,--no-as-needed $*' > /usr/local/bin/gcc-dmd && \
chmod 755 /usr/local/bin/gcc-dmd && \
echo 'CC=/usr/local/bin/gcc-dmd' >> /etc/dmd.conf
# Dart
ENV PATH /usr/lib/dart/bin:$PATH
ENV THRIFT_ROOT /thrift
RUN mkdir -p $THRIFT_ROOT/src
COPY Dockerfile $THRIFT_ROOT/
WORKDIR $THRIFT_ROOT/src

View file

@ -0,0 +1,29 @@
#!/bin/sh
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# Mainly aiming Travis CI's Ubuntu machines for now
# see what we need: http://thrift.apache.org/docs/install/ubuntu
# General dependencies
sudo apt-add-repository "deb http://archive.ubuntu.com/ubuntu/ trusty main restricted" -y
sudo apt-get update -qq
sudo apt-get install -qq libpango-1.0-0 libqt4-dev qtbase5-dev qtbase5-dev-tools qt5-default libboost-dev libboost-test-dev libboost-program-options-dev libboost-system-dev libboost-filesystem-dev libboost-thread-dev libevent-dev automake libtool flex bison pkg-config g++ libssl-dev make cmake git debhelper bc nsis ninja-build
dpkg -S /usr/include/boost/version.hpp

View file

@ -0,0 +1,66 @@
#!/bin/sh
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
SCRIPTPATH=$( cd $(dirname $0) ; pwd -P )
# Mainly aiming Travis CI's Ubuntu machines for now
# see what we need: http://thrift.apache.org/docs/install/ubuntu
# Java dependencies
sudo apt-get install -qq ant openjdk-7-jdk
sudo update-java-alternatives -s java-1.7.0-openjdk-amd64
# Python dependencies
sudo apt-get install -qq python-all python-all-dev python-all-dbg python-setuptools python-support python-twisted python-six python3-six
# Ruby dependencies
sudo apt-get install -qq ruby ruby-dev
sudo gem install bundler rake
# Perl dependencies
sudo apt-get install -qq libbit-vector-perl libclass-accessor-class-perl libio-socket-ssl-perl libnet-ssleay-perl libcrypt-ssleay-perl
# Php dependencies
sudo apt-get install -qq php5 php5-dev php5-cli php-pear re2c
# GlibC dependencies
sudo apt-get install -qq libglib2.0-dev
# Erlang dependencies
sudo apt-get install -qq erlang-base erlang-eunit erlang-dev erlang-tools rebar
# GO dependencies
echo "golang-go golang-go/dashboard boolean false" | debconf-set-selections
sudo apt-get -y install -qq golang golang-go
# Haskell dependencies
sudo add-apt-repository -y ppa:hvr/ghc
sudo apt-get update
sudo apt-get install cabal-install-1.20 ghc-$GHCVER
# Lua dependencies
sudo apt-get install -qq lua5.2 lua5.2-dev
# Node.js dependencies
sudo apt-get install -qq nodejs nodejs-dev npm
sudo update-alternatives --install /usr/bin/node node /usr/bin/nodejs 10
# CSharp
sudo apt-get install -qq mono-gmcs mono-devel libmono-system-web2.0-cil
sudo apt-get install -qq mingw32 mingw32-binutils mingw32-runtime nsis