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

Rely on our libevent, build all with CMake, general clean-up #72

Merged
merged 22 commits into from
Jun 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
89bc8b6
recipe cosmetics
h-vetinari May 24, 2023
3998088
rebase patch, put it in separate folder, simplify it
h-vetinari May 24, 2023
013bf25
remove obsolete openssl-distinction of wrapper output
h-vetinari May 24, 2023
520432f
depend on conda-forge's libevent also on windows
h-vetinari May 24, 2023
8e38502
remove deprecated CMake option
h-vetinari May 24, 2023
1c4ff43
switch to pure CMake build on unix
h-vetinari May 24, 2023
ca23e20
remove duplicate invocation of CMake in build.sh
h-vetinari May 24, 2023
e6143ba
harmonize build & install invocations through CMake
h-vetinari May 24, 2023
c8855c3
prettify windows build scripts
h-vetinari May 24, 2023
177642e
bump build number
h-vetinari May 24, 2023
e50eb49
add myself to maintainers
h-vetinari May 24, 2023
5a48e37
MNT: Re-rendered with conda-build 3.24.0, conda-smithy 3.23.1, and co…
h-vetinari May 24, 2023
f43177e
ensure correct installation location on windows
h-vetinari May 24, 2023
6a01d66
clarify and clean up testing
h-vetinari May 24, 2023
34e241f
add CMake integration test
h-vetinari May 24, 2023
51f0539
build from scratch on windows
h-vetinari May 24, 2023
07dd6c5
simplify build deps of outputs
h-vetinari Jun 2, 2023
3e7eeb2
use winflexbison on windows
h-vetinari Jun 2, 2023
9e14d8a
patch in implementation of boost::throw_exception
h-vetinari Jun 2, 2023
82a4933
add a test-dep to pass CMake integration test on windows
h-vetinari Jun 2, 2023
b741254
test artefact presence for all three thrift libs
h-vetinari Jun 3, 2023
dd8e189
add test for pkg-config metadata
h-vetinari Jun 3, 2023
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
7 changes: 0 additions & 7 deletions .ci_support/migrations/libevent2112.yaml

This file was deleted.

2 changes: 2 additions & 0 deletions .ci_support/win_64_.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ channel_targets:
- conda-forge main
cxx_compiler:
- vs2019
libevent:
- 2.1.12
openssl:
- '3'
pin_run_as_build:
Expand Down
2 changes: 1 addition & 1 deletion .github/CODEOWNERS

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 12 additions & 9 deletions README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 11 additions & 23 deletions recipe/bld.bat
Original file line number Diff line number Diff line change
@@ -1,35 +1,24 @@
pushd thirdparty\src\libevent
nmake -f Makefile.nmake
mkdir lib
move *.lib lib\
move WIN32-Code\event2\* include\event2\
move WIN32-Code\nmake\* include\event2\
move WIN32-Code\nmake\event2\* include\event2\
move *.h include\
if errorlevel 1 exit 1

popd
@echo on

set BOOST_ROOT=%PREFIX%
set ZLIB_ROOT=%PREFIX%
set OPENSSL_ROOT=%PREFIX%
set OPENSSL_ROOT_DIR=%PREFIX%

cd %SRC_DIR%\build

:: make thrift/windows/config.h available for the compiler:
SET CL=/I"%SRC_DIR%\lib\cpp\src"
set "CXXFLAGS=%CXXFLAGS% -DNOMINMAX"

:: WITH_SHARED_LIB must be off - the cmake config doesn't support shared libs yet
:: folder "build" exists already
mkdir cmake-build
cd cmake-build

cmake -GNinja ^
-DCMAKE_BUILD_TYPE=Release ^
-DCMAKE_POLICY_DEFAULT_CMP0074=NEW ^
-DBIN_INSTALL_DIR="%LIBRARY_BIN%" ^
-DLIB_INSTALL_DIR="%LIBRARY_LIB%" ^
-DOpenSSL_ROOT="%LIBRARY_PREFIX%" ^
-DOPENSSL_ROOT_DIR="%LIBRARY_PREFIX%" ^
-DLIBEVENT_ROOT="%SRC_DIR%\thirdparty\src\libevent" ^
-DFLEX_EXECUTABLE="%SRC_DIR%\thirdparty\dist\winflexbison\win_flex.exe" ^
-DBISON_EXECUTABLE="%SRC_DIR%\thirdparty\dist\winflexbison\win_bison.exe" ^
-DLIBEVENT_ROOT="%LIBRARY_PREFIX%" ^
-DCMAKE_INSTALL_PREFIX="%LIBRARY_PREFIX%" ^
-DBUILD_PYTHON=OFF ^
-DBUILD_JAVA=OFF ^
Expand All @@ -40,13 +29,12 @@ cmake -GNinja ^
-DBoost_ADDITIONAL_VERSIONS="1.70.0" ^
-DBOOST_ROOT=%LIBRARY_PREFIX% ^
-DBoost_INCLUDE_DIRS=%LIBRARY_PREFIX%\include ^
-DWITH_SHARED_LIB=OFF ^
-DBoost_DEBUG=ON ^
-DBoost_NO_BOOST_CMAKE=ON ^
-DBUILD_TESTING=OFF ^
-DBUILD_SHARED_LIBS=ON ^
"%SRC_DIR%"
if errorlevel 1 exit 1
if %ERRORLEVEL% neq 0 exit 1

ninja
if errorlevel 1 exit 1
cmake --build .
if %ERRORLEVEL% neq 0 exit 1
31 changes: 8 additions & 23 deletions recipe/build.sh
Original file line number Diff line number Diff line change
@@ -1,23 +1,19 @@
#!/bin/env bash
# Get an updated config.sub and config.guess
cp $BUILD_PREFIX/share/libtool/build-aux/config.* .
set -ex

set -e
set -x
# folder "build" exists already
mkdir cmake-build
cd cmake-build

BOOST_ROOT=$PREFIX
ZLIB_ROOT=$PREFIX
LIBEVENT_ROOT=$PREFIX

export OPENSSL_ROOT=$PREFIX
export OPENSSL_ROOT_DIR=$PREFIX
export M4="$(which m4)"

pushd "$SRC_DIR"

mkdir cmake-build
pushd cmake-build
cmake ${CMAKE_ARGS} \
cmake -G Ninja \
${CMAKE_ARGS} \
-DCMAKE_INSTALL_PREFIX=$PREFIX \
-DBUILD_SHARED_LIBS=ON \
-DBUILD_PYTHON=OFF \
Expand All @@ -26,21 +22,10 @@ cmake ${CMAKE_ARGS} \
-DBUILD_JAVASCRIPT=OFF \
-DBUILD_NODEJS=OFF \
-DBUILD_C_GLIB=OFF \
-DBUILD_TUTORIALS=OFF \
-DBUILD_TUTORIALS=OFF \
-DCMAKE_FIND_ROOT_PATH="$PREFIX" \
-DBUILD_TESTING=OFF \
-DBoost_INCLUDE_DIRS=${PREFIX}/include \
-GNinja \
..

# Be explicit about tutorials being unwanted.
# Somehow this gets overriden on first run.
cmake -DBUILD_TUTORIALS=OFF .

# Decrease parallelism a bit as we will otherwise get out-of-memory problems
# This is only necessary on Travis
if [ "$(uname -m)" = "ppc64le" ]; then
ninja -j1
else
ninja
fi
cmake --build .
4 changes: 4 additions & 0 deletions recipe/cmake_test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
project(cf_dummy LANGUAGES C CXX)
cmake_minimum_required(VERSION 3.12)
# make sure package is found
find_package(Thrift REQUIRED)
15 changes: 9 additions & 6 deletions recipe/install.bat
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
cd %SRC_DIR%\build
ninja install
if errorlevel 1 exit 1
@echo on

cd cmake-build

cmake --install .
if %ERRORLEVEL% neq 0 exit 1

if [%PKG_NAME%] == [libthrift] (
del %PREFIX%\Library\bin\thrift.exe
if errorlevel 1 exit 1
if %ERRORLEVEL% neq 0 exit 1
move %PREFIX%\Library\bin\thriftmd.lib %PREFIX%\Library\lib\thriftmd.lib
if errorlevel 1 exit 1
if %ERRORLEVEL% neq 0 exit 1
) else (
del %PREFIX%\Library\bin\thriftmd.lib
if errorlevel 1 exit 1
if %ERRORLEVEL% neq 0 exit 1
)
7 changes: 3 additions & 4 deletions recipe/install.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#!/bin/bash
set -ex

set -exo pipefail

pushd cmake-build
ninja install
cd cmake-build
cmake --install .

if [[ "$PKG_NAME" == libthrift ]]; then
rm $PREFIX/bin/thrift
Expand Down
Loading