commit:     3985e07f8bb54ffdddd942177476db6b6d79005b
Author:     Okamura Kazuya <gentoo-guru <AT> danceylove <DOT> net>
AuthorDate: Mon Apr 29 01:28:23 2024 +0000
Commit:     Okamura Kazuya <trakrailysurely <AT> danceylove <DOT> net>
CommitDate: Mon Apr 29 01:28:23 2024 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=3985e07f

dev-libs/lsquic: Remove overwrites CFLAGS/CXXFLAGS

Signed-off-by: Okamura Kazuya <gentoo-guru <AT> danceylove.net>

 .../lsquic-disable-boring-override-flags.patch     | 26 +++++++++++
 dev-libs/lsquic/lsquic-4.0.8-r1.ebuild             | 51 ++++++++++++++++++++++
 2 files changed, 77 insertions(+)

diff --git a/dev-libs/lsquic/files/lsquic-disable-boring-override-flags.patch 
b/dev-libs/lsquic/files/lsquic-disable-boring-override-flags.patch
new file mode 100644
index 0000000000..e2c58cf12d
--- /dev/null
+++ b/dev-libs/lsquic/files/lsquic-disable-boring-override-flags.patch
@@ -0,0 +1,26 @@
+diff --git a/src/liblsquic/boringssl/CMakeLists.txt 
b/src/liblsquic/boringssl/CMakeLists.txt
+index 39352d684..cc0f9470f 100644
+--- a/src/liblsquic/boringssl/CMakeLists.txt
++++ b/src/liblsquic/boringssl/CMakeLists.txt
+@@ -112,12 +112,6 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CLANG)
+     # See http://llvm.org/viewvc/llvm-project?view=revision&revision=319116
+     set(C_CXX_FLAGS "${C_CXX_FLAGS} -W3 -Wno-unused-parameter 
-fmsc-version=1900")
+   else()
+-    if(EMSCRIPTEN)
+-      # emscripten's emcc/clang does not accept the "-ggdb" flag.
+-      set(C_CXX_FLAGS "${C_CXX_FLAGS} -g")
+-    else()
+-      set(C_CXX_FLAGS "${C_CXX_FLAGS} -ggdb")
+-    endif()
+ 
+     set(C_CXX_FLAGS "${C_CXX_FLAGS} -Wall -fvisibility=hidden -fno-common")
+   endif()
+@@ -271,8 +265,6 @@ if(CFI)
+   # We use Chromium's copy of clang, which requires -fuse-ld=lld if building
+   # with -flto. That, in turn, can't handle -ggdb.
+   set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=lld")
+-  string(REPLACE "-ggdb" "-g" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
+-  string(REPLACE "-ggdb" "-g" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
+   # -flto causes object files to contain LLVM bitcode. Mixing those with
+   # assembly output in the same static library breaks the linker.
+   set(OPENSSL_NO_ASM "1")

diff --git a/dev-libs/lsquic/lsquic-4.0.8-r1.ebuild 
b/dev-libs/lsquic/lsquic-4.0.8-r1.ebuild
new file mode 100644
index 0000000000..0c1518a1e5
--- /dev/null
+++ b/dev-libs/lsquic/lsquic-4.0.8-r1.ebuild
@@ -0,0 +1,51 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake
+
+BORINGSSL_COMMIT="15655052e8701f908937204785eaa8cd4363099f"
+
+DESCRIPTION="LiteSpeed QUIC (LSQUIC) Library"
+HOMEPAGE="https://github.com/litespeedtech/lsquic/";
+SRC_URI="
+       https://github.com/litespeedtech/lsquic/archive/refs/tags/v${PV}.tar.gz 
-> ${P}.tar.gz
+       https://github.com/google/boringssl/archive/${BORINGSSL_COMMIT}.tar.gz 
-> boringssl-fips-20230428.tar.gz
+"
+
+S="${WORKDIR}/lsquic-${PV}"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64"
+
+IUSE="static-libs test"
+RESTRICT="!test? ( test )"
+
+DEPEND="
+       dev-lang/go
+       dev-libs/ls-qpack:=[static-libs=]
+       dev-libs/ls-hpack:=[static-libs=]
+"
+
+PATCHES=(
+       "${FILESDIR}"/${PN}-disable-build-deps-libs.patch
+       "${FILESDIR}"/${PN}-link-boringssl-static-libs.patch
+       "${FILESDIR}"/${PN}-disable-override-flags.patch
+       "${FILESDIR}"/${PN}-disable-boring-override-flags.patch
+)
+
+src_unpack() {
+       unpack ${P}.tar.gz
+       unpack boringssl-fips-20230428.tar.gz
+       mv boringssl-${BORINGSSL_COMMIT} "${S}"/src/liblsquic/boringssl || die
+}
+
+src_configure() {
+       local mycmakeargs=(
+               -DLSQUIC_SHARED_LIB=$(usex !static-libs)
+               -DLSQUIC_TESTS=$(usex test)
+       )
+       cmake_src_configure
+}

Reply via email to