commit:     6fe9a21e89ec48bd65e8a4647da8ac5ce6d67330
Author:     Okamura Kazuya <gentoo-guru <AT> danceylove <DOT> net>
AuthorDate: Tue Jul  4 12:11:41 2023 +0000
Commit:     Okamura Kazuya <trakrailysurely <AT> danceylove <DOT> net>
CommitDate: Tue Jul  4 12:11:41 2023 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=6fe9a21e

dev-libs/ls-hpack: fix to overwrites CFLAGS/CXXFLAGS and fix install

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

 .../files/ls-hpack-disable-overwrites-flags.patch  | 25 ++++++++++++++
 dev-libs/ls-hpack/ls-hpack-2.3.0-r1.ebuild         | 38 ++++++++++++++++++++++
 2 files changed, 63 insertions(+)

diff --git a/dev-libs/ls-hpack/files/ls-hpack-disable-overwrites-flags.patch 
b/dev-libs/ls-hpack/files/ls-hpack-disable-overwrites-flags.patch
new file mode 100644
index 000000000..182f26787
--- /dev/null
+++ b/dev-libs/ls-hpack/files/ls-hpack-disable-overwrites-flags.patch
@@ -0,0 +1,25 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index e68af65..22830bc 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -37,20 +37,11 @@ ENDIF()
+ IF (CMAKE_C_COMPILER_ID STREQUAL GNU
+       OR CMAKE_C_COMPILER_ID STREQUAL Clang)
+       SET(MY_CMAKE_FLAGS "${MY_CMAKE_FLAGS} -Wall -Wextra 
-Wno-unused-parameter")
+-      SET(MY_CMAKE_FLAGS "${MY_CMAKE_FLAGS} -fno-omit-frame-pointer")
+         INCLUDE(CheckCCompilerFlag)
+         CHECK_C_COMPILER_FLAG(-Wno-implicit-fallthrough 
HAS_NO_IMPLICIT_FALLTHROUGH)
+         IF (HAS_NO_IMPLICIT_FALLTHROUGH)
+             SET(MY_CMAKE_FLAGS "${MY_CMAKE_FLAGS} -Wno-implicit-fallthrough")
+         ENDIF()
+-        IF (PROFILE EQUAL 1)
+-            SET(MY_CMAKE_FLAGS "${MY_CMAKE_FLAGS} -g -pg")
+-        ENDIF()
+-        IF (CMAKE_BUILD_TYPE STREQUAL Release)
+-            SET(MY_CMAKE_FLAGS "${MY_CMAKE_FLAGS} -g0 -O3")
+-        ELSE()
+-            SET(MY_CMAKE_FLAGS "${MY_CMAKE_FLAGS} -g3 -O0 -fsanitize=address")
+-        ENDIF()
+ ENDIF()
+ 
+ IF (NOT CMAKE_BUILD_TYPE STREQUAL Release)

diff --git a/dev-libs/ls-hpack/ls-hpack-2.3.0-r1.ebuild 
b/dev-libs/ls-hpack/ls-hpack-2.3.0-r1.ebuild
new file mode 100644
index 000000000..e435b6304
--- /dev/null
+++ b/dev-libs/ls-hpack/ls-hpack-2.3.0-r1.ebuild
@@ -0,0 +1,38 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake
+
+DESCRIPTION="QPACK compression library for use with HTTP/3"
+HOMEPAGE="https://github.com/litespeedtech/ls-hpack/";
+SRC_URI="https://github.com/litespeedtech/${PN}/archive/v${PV}.tar.gz -> 
${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="static-libs"
+
+PATCHES=(
+       "${FILESDIR}"/${PN}-disable-overwrites-flags.patch
+       "${FILESDIR}"/${PN}-disable-tests.patch
+)
+
+src_configure() {
+       local mycmakeargs=(
+               -DSHARED=$(usex !static-libs 1 0)
+       )
+       cmake_src_configure
+}
+
+src_install() {
+       cp ${S}_build/libls-hpack.* ${S} || die
+       newheader lshpack.h lshpack.h
+       if [[ $(usex static-libs) == "yes" ]] ; then
+               newlib.a libls-hpack.a libls-hpack.a
+       else
+               newlib.so libls-hpack.so libls-hpack.so
+       fi
+       einstalldocs
+}

Reply via email to