diff --git a/dev-libs/s2n-tls/Manifest b/dev-libs/s2n-tls/Manifest new file mode 100644 index 0000000000000..e5cc0832fbe2a --- /dev/null +++ b/dev-libs/s2n-tls/Manifest @@ -0,0 +1 @@ +DIST s2n-tls-1.6.0.tar.gz 5108926 BLAKE2B 3ba2e31607bf9807caa715f526171e930c10e8a308b7b5a451b737ec19c43688ab2641d82e201e584daa7273da88f7288d2e44b1c814cf016f922eb008b92973 SHA512 6675edc33284c04e9d2197079dcfec3c4327dcc54b9c330509fc3080b5fa699da2e28239939ef135f2d1c567d304ce5c604f78dde7b6ee483bd33e0efb920ba6 diff --git a/dev-libs/s2n-tls/files/s2n-tls-1.6.0-cmake_LDFLAGS.patch b/dev-libs/s2n-tls/files/s2n-tls-1.6.0-cmake_LDFLAGS.patch new file mode 100644 index 0000000000000..1351e425a5468 --- /dev/null +++ b/dev-libs/s2n-tls/files/s2n-tls-1.6.0-cmake_LDFLAGS.patch @@ -0,0 +1,13 @@ +--- s2n-tls-1.6.0.o/CMakeLists.txt 2025-11-09 18:51:50.702558827 +0200 ++++ s2n-tls-1.6.0/CMakeLists.txt 2025-11-09 19:58:52.216551406 +0200 +@@ -176,10 +176,6 @@ + endif() + endif() + +-if(NOT APPLE) +- set(CMAKE_SHARED_LINKER_FLAGS -Wl,-z,noexecstack,-z,relro,-z,now) +-endif() +- + # Whether to fail the build when compiling s2n's portable C code with non-portable assembly optimizations. Doing this + # can lead to runtime crashes if build artifacts are built on modern hardware, but deployed to older hardware without + # newer CPU instructions. s2n, by default, should be backwards compatible with older CPU types so this flag should be diff --git a/dev-libs/s2n-tls/files/s2n-tls-1.6.0-cmake_version.patch b/dev-libs/s2n-tls/files/s2n-tls-1.6.0-cmake_version.patch new file mode 100644 index 0000000000000..c2517a813efa5 --- /dev/null +++ b/dev-libs/s2n-tls/files/s2n-tls-1.6.0-cmake_version.patch @@ -0,0 +1,12 @@ +From: Jaco Kroon + +Upstream report: https://github.com/aws/s2n-tls/issues/5607 + +--- s2n-tls-1.6.0.o/CMakeLists.txt 2025-11-09 13:01:09.058447600 +0200 ++++ s2n-tls-1.6.0/CMakeLists.txt 2025-11-09 13:02:29.498612435 +0200 +@@ -1,4 +1,4 @@ +-cmake_minimum_required (VERSION 3.9) ++cmake_minimum_required (VERSION 3.10..3.31) + project (s2n C) + + if(POLICY CMP0077) diff --git a/dev-libs/s2n-tls/metadata.xml b/dev-libs/s2n-tls/metadata.xml new file mode 100644 index 0000000000000..2862214012509 --- /dev/null +++ b/dev-libs/s2n-tls/metadata.xml @@ -0,0 +1,11 @@ + + + + + jkroon@gentoo.org + Jaco Kroon + + + aws/s2n-tls + + diff --git a/dev-libs/s2n-tls/s2n-tls-1.6.0.ebuild b/dev-libs/s2n-tls/s2n-tls-1.6.0.ebuild new file mode 100644 index 0000000000000..6112c2e65adc9 --- /dev/null +++ b/dev-libs/s2n-tls/s2n-tls-1.6.0.ebuild @@ -0,0 +1,35 @@ +# Copyright 2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DESCRIPTION="s2n-tls is a C99 implementation of the TLS/SSL protocols" +HOMEPAGE="https://github.com/aws/s2n-tls" +SRC_URI="https://github.com/aws/s2n-tls/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz" + +inherit cmake + +LICENSE="Apache-2.0" +SLOT="$(ver_cut 1)" +KEYWORDS="~amd64" + +IUSE="test" + +DEPEND="dev-libs/openssl:=" +RDEPEND="${DEPEND}" + +RESTRICT="!test? ( test )" + +PATCHES=( + "${FILESDIR}/s2n-tls-1.6.0-cmake_version.patch" + "${FILESDIR}/s2n-tls-1.6.0-cmake_LDFLAGS.patch" +) + +src_configure() +{ + local mycmakeargs=( + -DBUILD_TESTING=$(usex test ON OFF) + ) + + cmake_src_configure +}