From 58d7ed5be4bf08600a327a9e34282d89ea560498 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20F=C3=B6rster?= Date: Thu, 11 Jul 2024 17:23:58 +0200 Subject: [PATCH] [dev-db/timescaledb] bump, removing direct openssl linking --- dev-db/timescaledb/Manifest | 1 + .../files/timescaledb-2.15.3-no-openssl.patch | 75 +++++++++++++++++++ dev-db/timescaledb/timescaledb-2.15.3.ebuild | 56 ++++++++++++++ 3 files changed, 132 insertions(+) create mode 100644 dev-db/timescaledb/files/timescaledb-2.15.3-no-openssl.patch create mode 100644 dev-db/timescaledb/timescaledb-2.15.3.ebuild diff --git a/dev-db/timescaledb/Manifest b/dev-db/timescaledb/Manifest index ce8724d..024851f 100644 --- a/dev-db/timescaledb/Manifest +++ b/dev-db/timescaledb/Manifest @@ -1 +1,2 @@ DIST timescaledb-2.14.2.tar.gz 7319288 BLAKE2B aa6d56939a4647f9276743cabece77c33760e7f9d451b90aaa03c9391fcfad94afcd315b65c0c589c7188073884bf7ab65f9c796e35f634b8704f334ffa4ac34 SHA512 5a7ab4df5d89b83d423be5d6770098ab0303b22e29166afd3ab91ac2199571df20e33ec9f40bfa90ddf44829571fe696f311d81d27b46d569f2d75e75970e4f9 +DIST timescaledb-2.15.3.tar.gz 7441097 BLAKE2B 35d6edb31be79045ab8b8b409e4fcd28acac261f96be946dfa079bc544890391a6fe1f4695b0c88c8d56aca674563b4f347bb1f5519923b38aeb992e4a527f1c SHA512 c259bea088a03286a392812b23eda05ba7e5c714f9b52cd25b39ea9a280c5147e43d13a71027c43a5029df03e021a0022feb1ae311baae577ec3c56f1d7dfcae diff --git a/dev-db/timescaledb/files/timescaledb-2.15.3-no-openssl.patch b/dev-db/timescaledb/files/timescaledb-2.15.3-no-openssl.patch new file mode 100644 index 0000000..e462871 --- /dev/null +++ b/dev-db/timescaledb/files/timescaledb-2.15.3-no-openssl.patch @@ -0,0 +1,75 @@ +From 4861ca61a54dc39a9daa26c583d1598623219d37 Mon Sep 17 00:00:00 2001 +From: Sven Klemm +Date: Wed, 26 Jun 2024 12:45:41 +0200 +Subject: [PATCH] Don't link against openssl directly + +This patch changes our build process to no longer link against +openssl directly but instead rely on postgres linking it. +Linking to openssl directly is causing problems when the openssl +version we link against does not match the version postgres links +against. While this is easy to prevent where we fully control the +build process it is repeatedly causing problems e.g. in ABI tests. +This patch changes only changes the behaviour for non-Windows as +we are running into linker problems on Windows with this change. +Until we can find a workaround for those problems Windows binaries +we still link OpenSSL directly. +--- + CMakeLists.txt | 7 +++++-- + src/CMakeLists.txt | 4 +++- + tsl/src/CMakeLists.txt | 3 --- + 3 files changed, 8 insertions(+), 6 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 6888b1eb6ef..da217000d5b 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -596,7 +596,10 @@ if(USE_OPENSSL AND (NOT PG_USE_OPENSSL)) + ) + endif(USE_OPENSSL AND (NOT PG_USE_OPENSSL)) + +-if(USE_OPENSSL) ++# While we dont link directly against OpenSSL on non-Windows, doing this on ++# Windows causes linker errors. So on Windows we link directly against the ++# OpenSSL libraries. ++if(USE_OPENSSL AND MSVC) + # Try to find a local OpenSSL installation + find_package(OpenSSL) + +@@ -635,7 +638,7 @@ if(USE_OPENSSL) + message(STATUS "OpenSSL libraries: ${_path}") + endforeach() + message(STATUS "Using OpenSSL version ${OPENSSL_VERSION}") +-endif(USE_OPENSSL) ++endif(USE_OPENSSL AND MSVC) + + if(CODECOVERAGE) + message(STATUS "Code coverage is enabled.") +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 8c3d72e3e80..a945e5cbcaa 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -104,7 +104,9 @@ if(USE_OPENSSL) + set(TS_USE_OPENSSL ${USE_OPENSSL}) + target_include_directories(${PROJECT_NAME} SYSTEM + PUBLIC ${OPENSSL_INCLUDE_DIR}) +- target_link_libraries(${PROJECT_NAME} ${OPENSSL_LIBRARIES}) ++ if(MSVC) ++ target_link_libraries(${PROJECT_NAME} ${OPENSSL_LIBRARIES}) ++ endif(MSVC) + endif(USE_OPENSSL) + + configure_file(config.h.in config.h) +diff --git a/tsl/src/CMakeLists.txt b/tsl/src/CMakeLists.txt +index 4029c421599..e2524cc5a46 100644 +--- a/tsl/src/CMakeLists.txt ++++ b/tsl/src/CMakeLists.txt +@@ -29,9 +29,6 @@ set_target_properties( + PROPERTIES OUTPUT_NAME ${TSL_LIBRARY_NAME}-${PROJECT_VERSION_MOD} PREFIX "") + + target_include_directories(${TSL_LIBRARY_NAME} PRIVATE ${PG_INCLUDEDIR}) +-if(USE_OPENSSL) +- target_include_directories(${TSL_LIBRARY_NAME} PRIVATE ${OPENSSL_INCLUDE_DIR}) +-endif(USE_OPENSSL) + + target_compile_definitions(${TSL_LIBRARY_NAME} PUBLIC TS_TSL) + target_compile_definitions(${TSL_LIBRARY_NAME} PUBLIC TS_SUBMODULE) diff --git a/dev-db/timescaledb/timescaledb-2.15.3.ebuild b/dev-db/timescaledb/timescaledb-2.15.3.ebuild new file mode 100644 index 0000000..bb8c8ec --- /dev/null +++ b/dev-db/timescaledb/timescaledb-2.15.3.ebuild @@ -0,0 +1,56 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +POSTGRES_COMPAT=( {13..16} ) +POSTGRES_USEDEP="ssl" + +inherit cmake postgres-multi + +DESCRIPTION="Open-source time-series SQL database" +HOMEPAGE="https://www.timescale.com/" +SRC_URI="https://github.com/timescale/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="Apache-2.0 + tsl? ( timescale )" +SLOT="0" +IUSE="+tsl" +KEYWORDS="~amd64 ~x86" +RESTRICT="test" + +DEPEND="${POSTGRES_DEP}" +RDEPEND="${DEPEND}" + +PATCHES=( + "${FILESDIR}/${P}-no-openssl.patch" +) + +src_prepare() { + postgres-multi_src_prepare + postgres-multi_foreach cmake_src_prepare +} + +src_configure() { + pg_src_configure () { + local mycmakeargs=( + -DAPACHE_ONLY=$(usex tsl OFF ON) + -DWARNINGS_AS_ERRORS=OFF + -DSEND_TELEMETRY_DEFAULT=OFF + -DREGRESS_CHECKS=OFF + -DPG_CONFIG=${PG_CONFIG} + ) + cmake_src_configure + } + postgres-multi_foreach pg_src_configure +} + +src_compile() { + postgres-multi_foreach cmake_src_compile +} + +src_install() { + postgres-multi_foreach cmake_src_install + + find "${ED}" -name '*.a' -delete +}