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

WIP: buildenv/1.3.x/centos-ermine: add gRPC #62

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
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
28 changes: 28 additions & 0 deletions buildenv/1.3.x/centos-ermine/benchmark.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/env mumble-build
# Copyright 2013-2015 The 'mumble-releng' Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that
# can be found in the LICENSE file in the source tree or at
# <http://mumble.info/mumble-releng/LICENSE>.

urls=(
"http://releng-distfiles.mumble.info/releng-distfiles/benchmark-1.2.0.tar.gz"
"https://github.com/google/benchmark/archive/v1.2.0.tar.gz#fn=benchmark-1.2.0.tar.gz"
)

digests=(
)

function extract {
tar -zxf benchmark-1.2.0.tar.gz
cd benchmark-1.2.0
}

function build {
BUILD_TYPE="RelWithDebInfo"
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DCMAKE_INSTALL_PREFIX=${MUMBLE_PREFIX} -DCMAKE_INSTALL_RPATH=${MUMBLE_PREFIX}/lib
make
}

function install {
make install
}
6 changes: 6 additions & 0 deletions buildenv/1.3.x/centos-ermine/build-all.bash
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@
./patchelf.build
./linuxdeployqt.build

# gRPC
./c-ares.build
./benchmark.build
./gflags.build
./grpc.build

if [ -n "${MUMBLE_BUILD_FETCHMODE}" ]; then
exit 0
fi
Expand Down
36 changes: 36 additions & 0 deletions buildenv/1.3.x/centos-ermine/c-ares.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/usr/bin/env mumble-build
# Copyright 2013-2017 The 'mumble-releng' Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that
# can be found in the LICENSE file in the source tree or at
# <http://mumble.info/mumble-releng/LICENSE>.

function fetch {
if [ -d c-ares ]; then
cd c-ares
git reset --hard cares-1_13_0
git clean -dfx
else
git clone https://github.com/c-ares/c-ares.git
cd c-ares
git fetch origin
git checkout cares-1_13_0
fi
}

function extract {
:
}

function verify {
:
}

function build {
BUILD_TYPE="RelWithDebInfo"
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DCMAKE_INSTALL_PREFIX=${MUMBLE_PREFIX} -DCMAKE_INSTALL_RPATH=${MUMBLE_PREFIX}/lib
make
}

function install {
make install
}
28 changes: 28 additions & 0 deletions buildenv/1.3.x/centos-ermine/gflags.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/env mumble-build
# Copyright 2013-2015 The 'mumble-releng' Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that
# can be found in the LICENSE file in the source tree or at
# <http://mumble.info/mumble-releng/LICENSE>.

urls=(
"http://releng-distfiles.mumble.info/releng-distfiles/gflags-2.2.1.tar.gz"
"https://github.com/gflags/gflags/archive/v2.2.1.tar.gz#fn=gflags-2.2.1.tar.gz"
)

digests=(
)

function extract {
tar -zxf gflags-2.2.1.tar.gz
cd gflags-2.2.1
}

function build {
BUILD_TYPE="RelWithDebInfo"
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DCMAKE_INSTALL_PREFIX=${MUMBLE_PREFIX} -DCMAKE_INSTALL_RPATH=${MUMBLE_PREFIX}/lib
make
}

function install {
make install
}
28 changes: 28 additions & 0 deletions buildenv/1.3.x/centos-ermine/googletest.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/env mumble-build
# Copyright 2013-2015 The 'mumble-releng' Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that
# can be found in the LICENSE file in the source tree or at
# <http://mumble.info/mumble-releng/LICENSE>.

urls=(
"http://releng-distfiles.mumble.info/releng-distfiles/googletest-1.8.0.tar.gz"
"https://github.com/google/googletest/archive/release-1.8.0.tar.gz#fn=googletest-1.8.0.tar.gz"
)

digests=(
)

function extract {
tar -zxf googletest-1.8.0.tar.gz
cd googletest-release-1.8.0 # yuck
}

function build {
BUILD_TYPE="RelWithDebInfo"
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DCMAKE_INSTALL_PREFIX=${MUMBLE_PREFIX} -DCMAKE_INSTALL_RPATH=${MUMBLE_PREFIX}/lib
make
}

function install {
make install
}
32 changes: 32 additions & 0 deletions buildenv/1.3.x/centos-ermine/grpc.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/usr/bin/env mumble-build
# Copyright 2013-2015 The 'mumble-releng' Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that
# can be found in the LICENSE file in the source tree or at
# <http://mumble.info/mumble-releng/LICENSE>.

urls=(
"http://releng-distfiles.mumble.info/releng-distfiles/grpc-1.4.2.tar.gz"
"https://github.com/grpc/grpc/archive/v1.4.2.tar.gz#fn=grpc-1.4.2.tar.gz"
)

digests=(
)

function extract {
tar -zxf grpc-1.4.2.tar.gz
cd grpc-1.4.2
}

function prepare {
patch -p1 < ${MUMBLE_BUILDENV_ROOT}/patches/grpc-1.4.2-work-with-upstream-cares.patch
}

function build {
BUILD_TYPE="RelWithDebInfo"
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DCMAKE_PREFIX_PATH=${MUMBLE_PREFIX} -DCMAKE_INSTALL_PREFIX=${MUMBLE_PREFIX} -DCMAKE_INSTALL_RPATH=${MUMBLE_PREFIX}/lib -DgRPC_ZLIB_PROVIDER=package -DgRPC_CARES_PROVIDER=package -DgRPC_SSL_PROVIDER=package -DgRPC_PROTOBUF_PROVIDER=package -DgRPC_PROTOBUF_PACKAGE_TYPE=CONFIG -DgRPC_GFLAGS_PROVIDER=package -DgRPC_BENCHMARK_PROVIDER=package -DgRPC_USE_PROTO_LITE=1
make
}

function install {
make install
}
28 changes: 28 additions & 0 deletions buildenv/1.3.x/centos-ermine/gtest.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/env mumble-build
# Copyright 2013-2015 The 'mumble-releng' Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that
# can be found in the LICENSE file in the source tree or at
# <http://mumble.info/mumble-releng/LICENSE>.

urls=(
"http://releng-distfiles.mumble.info/releng-distfiles/benchmark-1.2.0.tar.gz"
"https://github.com/google/benchmark/archive/v1.2.0.tar.gz#fn=benchmark-1.2.0.tar.gz"
)

digests=(
)

function extract {
tar -zxf benchmark-1.2.0.tar.gz
cd benchmark-1.2.0
}

function build {
BUILD_TYPE="RelWithDebInfo"
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DCMAKE_INSTALL_PREFIX=${MUMBLE_PREFIX} -DCMAKE_INSTALL_RPATH=${MUMBLE_PREFIX}/lib
make
}

function install {
make install
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
--- ./CMakeLists.txt
+++ ./CMakeLists.txt
@@ -150,11 +150,10 @@ if("${gRPC_CARES_PROVIDER}" STREQUAL "mo
message(WARNING "gRPC_CARES_PROVIDER is \"module\" but CARES_ROOT_DIR is wrong")
endif()
elseif("${gRPC_CARES_PROVIDER}" STREQUAL "package")
- find_package(CARES)
- if(TARGET CARES::CARES)
- set(_gRPC_CARES_LIBRARIES CARES::CARES)
+ find_package(c-ares)
+ if(TARGET c-ares::cares)
+ set(_gRPC_CARES_LIBRARIES c-ares::cares)
endif()
- set(_gRPC_FIND_CARES "if(NOT CARES_FOUND)\n find_package(CARES)\nendif()")
endif()

if("${gRPC_PROTOBUF_PROVIDER}" STREQUAL "module")
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
From 668712c58fe518fdc997cc2103b848b043adceb6 Mon Sep 17 00:00:00 2001
From: Axel Huebl <[email protected]>
Date: Fri, 21 Jul 2017 18:57:07 +0200
Subject: [PATCH 1/2] CMake: Install .pc Files

Adds pkg-config (`.pc`) files for CMake based installs.
---
cmake/install.cmake | 7 +++++++
cmake/protobuf-lite.pc.cmake | 11 +++++++++++
cmake/protobuf.pc.cmake | 11 +++++++++++
3 files changed, 29 insertions(+)
create mode 100644 cmake/protobuf-lite.pc.cmake
create mode 100644 cmake/protobuf.pc.cmake

diff --git a/cmake/install.cmake b/cmake/install.cmake
index 28dc90dc3f..441bf5532a 100644
--- a/cmake/install.cmake
+++ b/cmake/install.cmake
@@ -1,5 +1,10 @@
include(GNUInstallDirs)

+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/protobuf.pc.cmake
+ ${CMAKE_CURRENT_BINARY_DIR}/protobuf.pc @ONLY)
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/protobuf-lite.pc.cmake
+ ${CMAKE_CURRENT_BINARY_DIR}/protobuf-lite.pc @ONLY)
+
foreach(_library
libprotobuf-lite
libprotobuf
@@ -17,6 +22,8 @@ endforeach()
install(TARGETS protoc EXPORT protobuf-targets
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT protoc)

+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/protobuf.pc ${CMAKE_CURRENT_BINARY_DIR}/protobuf-lite.pc DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
+
file(STRINGS extract_includes.bat.in _extract_strings
REGEX "^copy")
foreach(_extract_string ${_extract_strings})
diff --git a/cmake/protobuf-lite.pc.cmake b/cmake/protobuf-lite.pc.cmake
new file mode 100644
index 0000000000..cbe5426afa
--- /dev/null
+++ b/cmake/protobuf-lite.pc.cmake
@@ -0,0 +1,11 @@
+prefix=@CMAKE_INSTALL_PREFIX@
+exec_prefix=@CMAKE_INSTALL_PREFIX@
+libdir=@CMAKE_INSTALL_FULL_LIBDIR@
+includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
+
+Name: Protocol Buffers
+Description: Google's Data Interchange Format
+Version: @protobuf_VERSION@
+Libs: -L${libdir} -lprotobuf-lite @CMAKE_THREAD_LIBS_INIT@
+Cflags: -I${includedir} @CMAKE_THREAD_LIBS_INIT@
+Conflicts: protobuf
diff --git a/cmake/protobuf.pc.cmake b/cmake/protobuf.pc.cmake
new file mode 100644
index 0000000000..d33e98cca8
--- /dev/null
+++ b/cmake/protobuf.pc.cmake
@@ -0,0 +1,11 @@
+prefix=@CMAKE_INSTALL_PREFIX@
+exec_prefix=@CMAKE_INSTALL_PREFIX@
+libdir=@CMAKE_INSTALL_FULL_LIBDIR@
+includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
+
+Name: Protocol Buffers
+Description: Google's Data Interchange Format
+Version: @protobuf_VERSION@
+Libs: -L${libdir} -lprotobuf @CMAKE_THREAD_LIBS_INIT@
+Cflags: -I${includedir} @CMAKE_THREAD_LIBS_INIT@
+Conflicts: protobuf-lite

24 changes: 17 additions & 7 deletions buildenv/1.3.x/centos-ermine/protobuf.build
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,35 @@
# <http://mumble.info/mumble-releng/LICENSE>.

urls=(
"http://releng-distfiles.mumble.info/releng-distfiles/protobuf-2.6.1.tar.bz2"
"https://github.com/google/protobuf/releases/download/v2.6.1/protobuf-2.6.1.tar.bz2"
"http://releng-distfiles.mumble.info/releng-distfiles/protobuf-cpp-3.2.0.tar.gz"
"https://github.com/google/protobuf/releases/download/v3.2.0/protobuf-cpp-3.2.0.tar.gz"
)

digests=(
"sha1:6421ee86d8fb4e39f21f56991daa892a3e8d314b"
"sha256:ee445612d544d885ae240ffbcbf9267faa9f593b7b101f21d58beceb92661910"
"sha1:7518aef2471e7398ebd0d85a53836d6a076222d5"
"sha256:51d773e4297238b282eaa4c1dd317099675b12eef2b414732b851c00459225c6"
)

function extract {
tar -jxf protobuf-2.6.1.tar.bz2
cd protobuf-2.6.1
tar -zxf protobuf-cpp-3.2.0.tar.gz
cd protobuf-3.2.0
}

function prepare {
patch -p1 < ${MUMBLE_BUILDENV_ROOT}/patches/protobuf-3.2.0-install-pkg-config-files-for-cmake-build.patch
}

function build {
./configure --prefix=${MUMBLE_PREFIX}
BUILD_TYPE="RelWithDebInfo"
cd cmake
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DCMAKE_INSTALL_PREFIX=${MUMBLE_PREFIX}
make
}

function testsuite {
make check
}

function install {
make install
}