public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/proj/guru:dev commit in: dev-libs/lsquic/files/, dev-libs/lsquic/
@ 2023-07-06 16:19 Okamura Kazuya
  0 siblings, 0 replies; 4+ messages in thread
From: Okamura Kazuya @ 2023-07-06 16:19 UTC (permalink / raw
  To: gentoo-commits

commit:     56e6e1b83e5f1b39393aa6b9caae2b500ee49786
Author:     Okamura Kazuya <gentoo-guru <AT> danceylove <DOT> net>
AuthorDate: Thu Jul  6 16:16:00 2023 +0000
Commit:     Okamura Kazuya <trakrailysurely <AT> danceylove <DOT> net>
CommitDate: Thu Jul  6 16:16:00 2023 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=56e6e1b8

dev-libs/lsquic: new package, add 3.2.0

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

 .../files/lsquic-disable-build-deps-libs.patch     |  57 ++++++++
 .../files/lsquic-link-boringssl-static-libs.patch  | 152 +++++++++++++++++++++
 dev-libs/lsquic/lsquic-3.2.0.ebuild                |  54 ++++++++
 dev-libs/lsquic/metadata.xml                       |  11 ++
 4 files changed, 274 insertions(+)

diff --git a/dev-libs/lsquic/files/lsquic-disable-build-deps-libs.patch b/dev-libs/lsquic/files/lsquic-disable-build-deps-libs.patch
new file mode 100644
index 000000000..1f8f2ce97
--- /dev/null
+++ b/dev-libs/lsquic/files/lsquic-disable-build-deps-libs.patch
@@ -0,0 +1,57 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 984f38f..4c7b181 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -268,7 +268,7 @@ ELSE()
+     MESSAGE(STATUS "zlib not found")
+ ENDIF()
+ 
+-SET(LIBS lsquic ${BORINGSSL_LIB_ssl} ${BORINGSSL_LIB_crypto} ${ZLIB_LIB} ${LIBS})
++SET(LIBS lsquic ls-hpack ls-qpack ${BORINGSSL_LIB_ssl} ${BORINGSSL_LIB_crypto} ${ZLIB_LIB} ${LIBS})
+ 
+ IF (LSQUIC_BIN)
+     FIND_PATH(EVENT_INCLUDE_DIR NAMES event2/event.h)
+diff --git a/src/liblsquic/CMakeLists.txt b/src/liblsquic/CMakeLists.txt
+index fe6307e..be9a432 100644
+--- a/src/liblsquic/CMakeLists.txt
++++ b/src/liblsquic/CMakeLists.txt
+@@ -1,6 +1,5 @@
+ # Copyright (c) 2017 - 2022 LiteSpeed Technologies Inc.  See LICENSE.
+ SET(lsquic_STAT_SRCS
+-    ls-qpack/lsqpack.c
+     lsquic_adaptive_cc.c
+     lsquic_alarmset.c
+     lsquic_arr.c
+@@ -91,18 +90,13 @@ IF(NOT MSVC)
+     IF (HAS_NO_IMPLICIT_FALLTHROUGH)
+         SET(QPACK_FLAGS "${QPACK_FLAGS} -Wno-implicit-fallthrough")
+     ENDIF()
+-set_source_files_properties(ls-qpack/lsqpack.c PROPERTIES COMPILE_FLAGS ${QPACK_FLAGS})
+ ENDIF()
+ 
+-include_directories(ls-qpack)
+-
+ IF(PROJECT_NAME STREQUAL "openlitespeed")
+     INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src/spdy)
+ ELSE()
+-    INCLUDE_DIRECTORIES(../lshpack)
+     SET(lsquic_STAT_SRCS ${lsquic_STAT_SRCS}
+         lsquic_xxhash.c
+-        ../lshpack/lshpack.c
+     )
+ ENDIF()
+ 
+diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
+index fab22d3..06c39b3 100644
+--- a/tests/CMakeLists.txt
++++ b/tests/CMakeLists.txt
+@@ -17,9 +17,6 @@ ELSE()
+     ENDIF()
+ ENDIF()
+ 
+-include_directories(../src/liblsquic/ls-qpack)
+-INCLUDE_DIRECTORIES(../src/lshpack)
+-
+ SET(TESTS
+     ack
+     ackgen_gquic_be

diff --git a/dev-libs/lsquic/files/lsquic-link-boringssl-static-libs.patch b/dev-libs/lsquic/files/lsquic-link-boringssl-static-libs.patch
new file mode 100644
index 000000000..868accf29
--- /dev/null
+++ b/dev-libs/lsquic/files/lsquic-link-boringssl-static-libs.patch
@@ -0,0 +1,152 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 4c7b181..723a075 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -152,77 +152,6 @@ ELSE()
+     ENDIF()
+ ENDIF()
+ 
+-IF (NOT DEFINED BORINGSSL_INCLUDE AND DEFINED BORINGSSL_DIR)
+-    FIND_PATH(BORINGSSL_INCLUDE NAMES openssl/ssl.h
+-                PATHS ${BORINGSSL_DIR}/include
+-                NO_DEFAULT_PATH)
+-ENDIF()
+-# This must be done before adding other include directories to take
+-# precedence over header files from other SSL installs.
+-
+-IF (BORINGSSL_INCLUDE)
+-    MESSAGE(STATUS "BoringSSL include directory ${BORINGSSL_INCLUDE}")
+-    INCLUDE_DIRECTORIES(${BORINGSSL_INCLUDE})
+-ELSE()
+-    MESSAGE(FATAL_ERROR "BoringSSL headers not found")
+-ENDIF()
+-
+-IF (NOT DEFINED BORINGSSL_LIB AND DEFINED BORINGSSL_DIR)
+-    FOREACH(LIB_NAME ssl crypto)
+-        IF (CMAKE_SYSTEM_NAME STREQUAL Windows)
+-            FIND_LIBRARY(BORINGSSL_LIB_${LIB_NAME}
+-                NAMES ${LIB_NAME}
+-                PATHS ${BORINGSSL_DIR}/${LIB_NAME}
+-		PATH_SUFFIXES Debug Release MinSizeRel RelWithDebInfo
+-                NO_DEFAULT_PATH)
+-        ELSE()
+-            FIND_LIBRARY(BORINGSSL_LIB_${LIB_NAME}
+-                NAMES lib${LIB_NAME}${LIB_SUFFIX}
+-                PATHS ${BORINGSSL_DIR}/${LIB_NAME}
+-                NO_DEFAULT_PATH)
+-        ENDIF()
+-        IF(BORINGSSL_LIB_${LIB_NAME})
+-            MESSAGE(STATUS "Found ${LIB_NAME} library: ${BORINGSSL_LIB_${LIB_NAME}}")
+-        ELSE()
+-            MESSAGE(STATUS "${LIB_NAME} library not found")
+-        ENDIF()
+-    ENDFOREACH()
+-
+-ELSE()
+-
+-
+-    FOREACH(LIB_NAME ssl crypto)
+-        # If BORINGSSL_LIB is defined, try find each lib. Otherwise, user should define BORINGSSL_LIB_ssl,
+-        # BORINGSSL_LIB_crypto and so on explicitly. For example, including boringssl and lsquic both via
+-        # add_subdirectory:
+-        #   add_subdirectory(third_party/boringssl)
+-        #   set(BORINGSSL_LIB_ssl ssl)
+-        #   set(BORINGSSL_LIB_crypto crypto)
+-        #   add_subdirectory(third_party/lsquic)
+-        IF (DEFINED BORINGSSL_LIB)
+-            IF (CMAKE_SYSTEM_NAME STREQUAL Windows)
+-                FIND_LIBRARY(BORINGSSL_LIB_${LIB_NAME}
+-                    NAMES ${LIB_NAME}
+-                    PATHS ${BORINGSSL_LIB}
+-                    PATH_SUFFIXES Debug Release MinSizeRel RelWithDebInfo
+-                    NO_DEFAULT_PATH)
+-            ELSE()
+-                FIND_LIBRARY(BORINGSSL_LIB_${LIB_NAME}
+-                    NAMES lib${LIB_NAME}${LIB_SUFFIX}
+-                    PATHS ${BORINGSSL_LIB}
+-                    PATH_SUFFIXES ${LIB_NAME}
+-                    NO_DEFAULT_PATH)
+-            ENDIF()
+-        ENDIF()
+-        IF(BORINGSSL_LIB_${LIB_NAME})
+-            MESSAGE(STATUS "Found ${LIB_NAME} library: ${BORINGSSL_LIB_${LIB_NAME}}")
+-        ELSE()
+-            MESSAGE(FATAL_ERROR "BORINGSSL_LIB_${LIB_NAME} library not found")
+-        ENDIF()
+-    ENDFOREACH()
+-
+-ENDIF()
+-
+ SET(CMAKE_INCLUDE_CURRENT_DIR ON)
+ INCLUDE_DIRECTORIES(include)
+ IF(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR CMAKE_SYSTEM_NAME STREQUAL "Darwin")
+@@ -268,7 +197,7 @@ ELSE()
+     MESSAGE(STATUS "zlib not found")
+ ENDIF()
+ 
+-SET(LIBS lsquic ls-hpack ls-qpack ${BORINGSSL_LIB_ssl} ${BORINGSSL_LIB_crypto} ${ZLIB_LIB} ${LIBS})
++SET(LIBS lsquic ls-hpack ls-qpack ssl crypto ${ZLIB_LIB} ${LIBS})
+ 
+ IF (LSQUIC_BIN)
+     FIND_PATH(EVENT_INCLUDE_DIR NAMES event2/event.h)
+diff --git a/src/liblsquic/CMakeLists.txt b/src/liblsquic/CMakeLists.txt
+index be9a432..0bc806d 100644
+--- a/src/liblsquic/CMakeLists.txt
++++ b/src/liblsquic/CMakeLists.txt
+@@ -1,4 +1,7 @@
+ # Copyright (c) 2017 - 2022 LiteSpeed Technologies Inc.  See LICENSE.
++
++add_subdirectory(boringssl)
++
+ SET(lsquic_STAT_SRCS
+     lsquic_adaptive_cc.c
+     lsquic_alarmset.c
+@@ -83,6 +86,8 @@ SET(lsquic_STAT_SRCS
+     lsquic_version.c
+ )
+ 
++include_directories(boringssl/include)
++
+ IF(NOT MSVC)
+     SET(QPACK_FLAGS "-Wno-uninitialized")
+     INCLUDE(CheckCCompilerFlag)
+@@ -119,7 +124,7 @@ endif()
+ 
+ IF(LSQUIC_SHARED_LIB)
+   add_library(lsquic SHARED ${lsquic_STAT_SRCS})
+-  TARGET_LINK_LIBRARIES(lsquic PRIVATE ${BORINGSSL_LIB_ssl} ${BORINGSSL_LIB_crypto} ${ZLIB_LIB})
++  TARGET_LINK_LIBRARIES(lsquic PRIVATE ssl crypto ${ZLIB_LIB})
+   IF(MSVC)
+     SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DLSQUIC_EXPORTS")
+   TARGET_LINK_LIBRARIES(lsquic PRIVATE ws2_32.lib)
+diff --git a/src/liblsquic/boringssl/CMakeLists.txt b/src/liblsquic/boringssl/CMakeLists.txt
+index aac5f0d..37cbfa3 100644
+--- a/src/liblsquic/boringssl/CMakeLists.txt
++++ b/src/liblsquic/boringssl/CMakeLists.txt
+@@ -3,6 +3,8 @@ cmake_minimum_required(VERSION 3.10)
+ # Defer enabling C and CXX languages.
+ project(BoringSSL NONE)
+ 
++set(BUILD_SHARED_LIBS OFF)
++
+ # Don't install BoringSSL to system directories by default; it has no stable
+ # ABI. Instead, default to an "install" directory under the source.
+ if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
+@@ -36,7 +38,7 @@ if(CMAKE_VERSION VERSION_LESS "3.14")
+ endif()
+ 
+ # Wrap the CMake install function so we can disable it.
+-set(INSTALL_ENABLED 1)
++set(INSTALL_ENABLED 0)
+ function(install_if_enabled)
+   if(INSTALL_ENABLED)
+     install(${ARGV})
+@@ -139,7 +141,7 @@ set(CMAKE_C_STANDARD_REQUIRED ON)
+ if(CMAKE_COMPILER_IS_GNUCXX OR CLANG)
+   # Note clang-cl is odd and sets both CLANG and MSVC. We base our configuration
+   # primarily on our normal Clang one.
+-  set(C_CXX_FLAGS "-Werror -Wformat=2 -Wsign-compare -Wmissing-field-initializers -Wwrite-strings -Wvla -Wshadow -Wtype-limits")
++  set(C_CXX_FLAGS "-Wformat=2 -Wsign-compare -Wmissing-field-initializers -Wwrite-strings -Wvla -Wshadow -Wtype-limits")
+   if(MSVC)
+     # clang-cl sets different default warnings than clang. It also treats -Wall
+     # as -Weverything, to match MSVC. Instead -W3 is the alias for -Wall.

diff --git a/dev-libs/lsquic/lsquic-3.2.0.ebuild b/dev-libs/lsquic/lsquic-3.2.0.ebuild
new file mode 100644
index 000000000..01894c125
--- /dev/null
+++ b/dev-libs/lsquic/lsquic-3.2.0.ebuild
@@ -0,0 +1,54 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake git-r3
+
+DESCRIPTION="LiteSpeed QUIC (LSQUIC) Library"
+HOMEPAGE="https://github.com/litespeedtech/lsquic/"
+
+# LSQUIC
+EGIT_LSQUIC_REPO_URI="https://github.com/litespeedtech/lsquic/"
+EGIT_LSQUIC_COMMIT="3bbf683f25ab84826951350c57ae226c88c54422"
+EGIT_LSQUIC_CHECKOUT_DIR="${WORKDIR}/${P}/"
+
+# BoringSSL
+EGIT_BORINGSSL_REPO_URI="https://github.com/google/boringssl"
+EGIT_BORINGSSL_BRANCH="fips-20230428"
+EGIT_BORINGSSL_CHECKOUT_DIR="${WORKDIR}/${P}/src/liblsquic/boringssl"
+
+EGIT_SUBMODULES=()
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="bin static-libs test"
+
+DEPEND="
+	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
+)
+
+src_unpack() {
+	# Checkout LSQUIC Sources
+	git-r3_fetch ${EGIT_LSQUIC_REPO_URI} ${EGIT_LSQUIC_COMMIT}
+	git-r3_checkout ${EGIT_LSQUIC_REPO_URI} ${EGIT_LSQUIC_CHECKOUT_DIR}
+	# Checkout BoringSSL Sources
+	git-r3_fetch ${EGIT_BORINGSSL_REPO_URI} ${EGIT_BORINGSSL_BRANCH}
+	git-r3_checkout ${EGIT_BORINGSSL_REPO_URI} ${EGIT_BORINGSSL_CHECKOUT_DIR}
+}
+
+src_configure() {
+	local mycmakeargs=(
+		-DLSQUIC_SHARED_LIB=$(usex !static-libs)
+		-DLSQUIC_TESTS=$(usex test)
+		-DLSQUIC_BIN=$(usex bin)
+	)
+	cmake_src_configure
+}

diff --git a/dev-libs/lsquic/metadata.xml b/dev-libs/lsquic/metadata.xml
new file mode 100644
index 000000000..5813d666a
--- /dev/null
+++ b/dev-libs/lsquic/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+  <maintainer type="person">
+    <email>trakrailysurely@danceylove.net</email>
+    <name>Okamura Kazuya</name>
+  </maintainer>
+  <upstream>
+    <remote-id type="github">litespeedtech/lsquic</remote-id>
+  </upstream>
+</pkgmetadata>


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-commits] repo/proj/guru:dev commit in: dev-libs/lsquic/files/, dev-libs/lsquic/
@ 2024-04-27 16:40 Okamura Kazuya
  0 siblings, 0 replies; 4+ messages in thread
From: Okamura Kazuya @ 2024-04-27 16:40 UTC (permalink / raw
  To: gentoo-commits

commit:     407f734c8bd5887dac0fa7b92efed40a4a86d350
Author:     Okamura Kazuya <gentoo-guru <AT> danceylove <DOT> net>
AuthorDate: Sat Apr 27 16:37:41 2024 +0000
Commit:     Okamura Kazuya <trakrailysurely <AT> danceylove <DOT> net>
CommitDate: Sat Apr 27 16:37:41 2024 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=407f734c

dev-libs/lsquic: bump 4.0.8

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

 dev-libs/lsquic/Manifest                           |  1 +
 .../files/lsquic-disable-override-flags.patch      | 20 +++++++++
 dev-libs/lsquic/lsquic-4.0.8.ebuild                | 50 ++++++++++++++++++++++
 3 files changed, 71 insertions(+)

diff --git a/dev-libs/lsquic/Manifest b/dev-libs/lsquic/Manifest
index 6610c44ada..936273a0a7 100644
--- a/dev-libs/lsquic/Manifest
+++ b/dev-libs/lsquic/Manifest
@@ -1,2 +1,3 @@
 DIST boringssl-fips-20230428.tar.gz 32288205 BLAKE2B 50588024cfd985b23be6f780197d092beae4b97bb2b5e01a6aca1477b0f5f0ffd0b6ac9558bd42fb5b4de4898a8987326afbe28422bb6dafbfc2104660958a83 SHA512 afdf94a4bbf4e92082ddcdb798c7b13e489f63ad50d9a79ee0f7222c0c830dd75a313cb8e3220816f1dc6872fe7493522938797c18c728e41a7c8f77bd597fc1
 DIST lsquic-3.2.0.tar.gz 1911754 BLAKE2B 50832d44f01419fe78e965b632aa3f3c1a39c4cb36f1183031bdfecb8aad48ce094bf0e59736c9a408542b1d3977cb93e1908a86cffe3ad2cdbbad7a12257f33 SHA512 1b9b499c854e60d07b8f32215bf65dc8f678dd216689a4dcaa150e962357ed75087c2cc31a1f9f0bcd2f168ef63625ed0f5c0a88d16a6cec5fa02b75e782e3d0
+DIST lsquic-4.0.8.tar.gz 1928212 BLAKE2B 4a4011fe86183ae0ac34f92a4695d18a8d635330e638038d7a78e9b04ebf49de657c666f523f4967163f81c77f033d856712bb04efc1c50fa8f50040d066a585 SHA512 45789e2024b60dbb2593b8708067b3aa833f818228c8b1d37840b6c8cb968d446cb74b5c9ace4a805b9dd5e91b5ad22fbf07e832b15b8f7ae480cfaafd67601b

diff --git a/dev-libs/lsquic/files/lsquic-disable-override-flags.patch b/dev-libs/lsquic/files/lsquic-disable-override-flags.patch
new file mode 100644
index 0000000000..9e054dd52b
--- /dev/null
+++ b/dev-libs/lsquic/files/lsquic-disable-override-flags.patch
@@ -0,0 +1,20 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index e9ca3d8..6ee1e9d 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -59,7 +59,6 @@ IF(LSQUIC_FIU)
+ ENDIF()
+ 
+ IF(CMAKE_BUILD_TYPE STREQUAL "Debug")
+-    SET(MY_CMAKE_FLAGS "${MY_CMAKE_FLAGS} -O0 -g3")
+     IF(CMAKE_C_COMPILER MATCHES "clang" AND
+                         NOT "$ENV{TRAVIS}" MATCHES "^true$" AND
+                         NOT "$ENV{EXTRA_CFLAGS}" MATCHES "-fsanitize")
+@@ -69,7 +68,6 @@ IF(CMAKE_BUILD_TYPE STREQUAL "Debug")
+     # Uncomment to enable cleartext protocol mode (no crypto):
+     #SET (MY_CMAKE_FLAGS "${MY_CMAKE_FLAGS} -DLSQUIC_ENABLE_HANDSHAKE_DISABLE=1")
+ ELSE()
+-    SET(MY_CMAKE_FLAGS "${MY_CMAKE_FLAGS} -O3 -g0")
+     # Comment out the following line to compile out debug messages:
+     #SET(MY_CMAKE_FLAGS "${MY_CMAKE_FLAGS} -DLSQUIC_LOWEST_LOG_LEVEL=LSQ_LOG_INFO")
+ ENDIF()

diff --git a/dev-libs/lsquic/lsquic-4.0.8.ebuild b/dev-libs/lsquic/lsquic-4.0.8.ebuild
new file mode 100644
index 0000000000..8f3bce3297
--- /dev/null
+++ b/dev-libs/lsquic/lsquic-4.0.8.ebuild
@@ -0,0 +1,50 @@
+# 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
+)
+
+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
+}


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-commits] repo/proj/guru:dev commit in: dev-libs/lsquic/files/, dev-libs/lsquic/
@ 2024-04-29  1:32 Okamura Kazuya
  0 siblings, 0 replies; 4+ messages in thread
From: Okamura Kazuya @ 2024-04-29  1:32 UTC (permalink / raw
  To: gentoo-commits

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
+}


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-commits] repo/proj/guru:dev commit in: dev-libs/lsquic/files/, dev-libs/lsquic/
@ 2024-05-25 11:59 Okamura Kazuya
  0 siblings, 0 replies; 4+ messages in thread
From: Okamura Kazuya @ 2024-05-25 11:59 UTC (permalink / raw
  To: gentoo-commits

commit:     fbcf6093c61e2084bb7ef6f6ba57a78dff0f8d07
Author:     Okamura Kazuya <gentoo-guru <AT> danceylove <DOT> net>
AuthorDate: Sat May 25 11:46:53 2024 +0000
Commit:     Okamura Kazuya <trakrailysurely <AT> danceylove <DOT> net>
CommitDate: Sat May 25 11:57:49 2024 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=fbcf6093

dev-libs/lsquic: fix misses package(s) in RDEPEND
and replace the statically linked boringssl with the lsquic recommended version.

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

 dev-libs/lsquic/Manifest                           |   1 +
 .../lsquic-link-boringssl-static-libs-9fc1c.patch  | 154 +++++++++++++++++++++
 dev-libs/lsquic/lsquic-4.0.8-r2.ebuild             |  55 ++++++++
 3 files changed, 210 insertions(+)

diff --git a/dev-libs/lsquic/Manifest b/dev-libs/lsquic/Manifest
index 23c1be528..e65bbcc47 100644
--- a/dev-libs/lsquic/Manifest
+++ b/dev-libs/lsquic/Manifest
@@ -1,2 +1,3 @@
+DIST boringssl-9fc1c.tar.gz 35071632 BLAKE2B b90468dcf260915189f614bf83717e34e7905e83086322b78ad19d77f7fe24f6c2f739c634f67de1ef09d5de23e966fc20e2214d9ef7843dbf32ede968d08f93 SHA512 cbc3ca154a6abe53e3c4f46bdd0205195d7120efced061558c05e8a8ae5ba5aee2b4c9eb5fe4c590d87ede11ff8f2e45b06e37595359a300447ed3dc9390f500
 DIST boringssl-fips-20230428.tar.gz 32288205 BLAKE2B 50588024cfd985b23be6f780197d092beae4b97bb2b5e01a6aca1477b0f5f0ffd0b6ac9558bd42fb5b4de4898a8987326afbe28422bb6dafbfc2104660958a83 SHA512 afdf94a4bbf4e92082ddcdb798c7b13e489f63ad50d9a79ee0f7222c0c830dd75a313cb8e3220816f1dc6872fe7493522938797c18c728e41a7c8f77bd597fc1
 DIST lsquic-4.0.8.tar.gz 1928212 BLAKE2B 4a4011fe86183ae0ac34f92a4695d18a8d635330e638038d7a78e9b04ebf49de657c666f523f4967163f81c77f033d856712bb04efc1c50fa8f50040d066a585 SHA512 45789e2024b60dbb2593b8708067b3aa833f818228c8b1d37840b6c8cb968d446cb74b5c9ace4a805b9dd5e91b5ad22fbf07e832b15b8f7ae480cfaafd67601b

diff --git a/dev-libs/lsquic/files/lsquic-link-boringssl-static-libs-9fc1c.patch b/dev-libs/lsquic/files/lsquic-link-boringssl-static-libs-9fc1c.patch
new file mode 100644
index 000000000..50d5cce8c
--- /dev/null
+++ b/dev-libs/lsquic/files/lsquic-link-boringssl-static-libs-9fc1c.patch
@@ -0,0 +1,154 @@
+Modify the BoringSSL library to be included internally during LSQUIC construction, so that the BoringSSL library does not need to be installed by itself on the system.
+BoringSSL must always be built as static, so we intentionally removed the code that builds it as shared.
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 4c7b181..723a075 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -152,77 +152,6 @@ ELSE()
+     ENDIF()
+ ENDIF()
+ 
+-IF (NOT DEFINED BORINGSSL_INCLUDE AND DEFINED BORINGSSL_DIR)
+-    FIND_PATH(BORINGSSL_INCLUDE NAMES openssl/ssl.h
+-                PATHS ${BORINGSSL_DIR}/include
+-                NO_DEFAULT_PATH)
+-ENDIF()
+-# This must be done before adding other include directories to take
+-# precedence over header files from other SSL installs.
+-
+-IF (BORINGSSL_INCLUDE)
+-    MESSAGE(STATUS "BoringSSL include directory ${BORINGSSL_INCLUDE}")
+-    INCLUDE_DIRECTORIES(${BORINGSSL_INCLUDE})
+-ELSE()
+-    MESSAGE(FATAL_ERROR "BoringSSL headers not found")
+-ENDIF()
+-
+-IF (NOT DEFINED BORINGSSL_LIB AND DEFINED BORINGSSL_DIR)
+-    FOREACH(LIB_NAME ssl crypto)
+-        IF (CMAKE_SYSTEM_NAME STREQUAL Windows)
+-            FIND_LIBRARY(BORINGSSL_LIB_${LIB_NAME}
+-                NAMES ${LIB_NAME}
+-                PATHS ${BORINGSSL_DIR}/${LIB_NAME}
+-		PATH_SUFFIXES Debug Release MinSizeRel RelWithDebInfo
+-                NO_DEFAULT_PATH)
+-        ELSE()
+-            FIND_LIBRARY(BORINGSSL_LIB_${LIB_NAME}
+-                NAMES lib${LIB_NAME}${LIB_SUFFIX}
+-                PATHS ${BORINGSSL_DIR}/${LIB_NAME}
+-                NO_DEFAULT_PATH)
+-        ENDIF()
+-        IF(BORINGSSL_LIB_${LIB_NAME})
+-            MESSAGE(STATUS "Found ${LIB_NAME} library: ${BORINGSSL_LIB_${LIB_NAME}}")
+-        ELSE()
+-            MESSAGE(STATUS "${LIB_NAME} library not found")
+-        ENDIF()
+-    ENDFOREACH()
+-
+-ELSE()
+-
+-
+-    FOREACH(LIB_NAME ssl crypto)
+-        # If BORINGSSL_LIB is defined, try find each lib. Otherwise, user should define BORINGSSL_LIB_ssl,
+-        # BORINGSSL_LIB_crypto and so on explicitly. For example, including boringssl and lsquic both via
+-        # add_subdirectory:
+-        #   add_subdirectory(third_party/boringssl)
+-        #   set(BORINGSSL_LIB_ssl ssl)
+-        #   set(BORINGSSL_LIB_crypto crypto)
+-        #   add_subdirectory(third_party/lsquic)
+-        IF (DEFINED BORINGSSL_LIB)
+-            IF (CMAKE_SYSTEM_NAME STREQUAL Windows)
+-                FIND_LIBRARY(BORINGSSL_LIB_${LIB_NAME}
+-                    NAMES ${LIB_NAME}
+-                    PATHS ${BORINGSSL_LIB}
+-                    PATH_SUFFIXES Debug Release MinSizeRel RelWithDebInfo
+-                    NO_DEFAULT_PATH)
+-            ELSE()
+-                FIND_LIBRARY(BORINGSSL_LIB_${LIB_NAME}
+-                    NAMES lib${LIB_NAME}${LIB_SUFFIX}
+-                    PATHS ${BORINGSSL_LIB}
+-                    PATH_SUFFIXES ${LIB_NAME}
+-                    NO_DEFAULT_PATH)
+-            ENDIF()
+-        ENDIF()
+-        IF(BORINGSSL_LIB_${LIB_NAME})
+-            MESSAGE(STATUS "Found ${LIB_NAME} library: ${BORINGSSL_LIB_${LIB_NAME}}")
+-        ELSE()
+-            MESSAGE(FATAL_ERROR "BORINGSSL_LIB_${LIB_NAME} library not found")
+-        ENDIF()
+-    ENDFOREACH()
+-
+-ENDIF()
+-
+ SET(CMAKE_INCLUDE_CURRENT_DIR ON)
+ INCLUDE_DIRECTORIES(include)
+ IF(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR CMAKE_SYSTEM_NAME STREQUAL "Darwin")
+@@ -268,7 +197,7 @@ ELSE()
+     MESSAGE(STATUS "zlib not found")
+ ENDIF()
+ 
+-SET(LIBS lsquic ls-hpack ls-qpack ${BORINGSSL_LIB_ssl} ${BORINGSSL_LIB_crypto} ${ZLIB_LIB} ${LIBS})
++SET(LIBS lsquic ls-hpack ls-qpack ssl crypto ${ZLIB_LIB} ${LIBS})
+ 
+ IF (LSQUIC_BIN)
+     FIND_PATH(EVENT_INCLUDE_DIR NAMES event2/event.h)
+diff --git a/src/liblsquic/CMakeLists.txt b/src/liblsquic/CMakeLists.txt
+index be9a432..0bc806d 100644
+--- a/src/liblsquic/CMakeLists.txt
++++ b/src/liblsquic/CMakeLists.txt
+@@ -1,4 +1,7 @@
+ # Copyright (c) 2017 - 2022 LiteSpeed Technologies Inc.  See LICENSE.
++
++add_subdirectory(boringssl)
++
+ SET(lsquic_STAT_SRCS
+     lsquic_adaptive_cc.c
+     lsquic_alarmset.c
+@@ -83,6 +86,8 @@ SET(lsquic_STAT_SRCS
+     lsquic_version.c
+ )
+ 
++include_directories(boringssl/include)
++
+ IF(NOT MSVC)
+     SET(QPACK_FLAGS "-Wno-uninitialized")
+     INCLUDE(CheckCCompilerFlag)
+@@ -119,7 +124,7 @@ endif()
+ 
+ IF(LSQUIC_SHARED_LIB)
+   add_library(lsquic SHARED ${lsquic_STAT_SRCS})
+-  TARGET_LINK_LIBRARIES(lsquic PRIVATE ${BORINGSSL_LIB_ssl} ${BORINGSSL_LIB_crypto} ${ZLIB_LIB})
++  TARGET_LINK_LIBRARIES(lsquic PRIVATE ssl crypto ${ZLIB_LIB})
+   IF(MSVC)
+     SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DLSQUIC_EXPORTS")
+   TARGET_LINK_LIBRARIES(lsquic PRIVATE ws2_32.lib)
+diff --git a/src/liblsquic/boringssl/CMakeLists.txt b/src/liblsquic/boringssl/CMakeLists.txt
+index aac5f0d..37cbfa3 100644
+--- a/src/liblsquic/boringssl/CMakeLists.txt
++++ b/src/liblsquic/boringssl/CMakeLists.txt
+@@ -3,6 +3,8 @@ cmake_minimum_required(VERSION 3.10)
+ # Defer enabling C and CXX languages.
+ project(BoringSSL NONE)
+ 
++set(BUILD_SHARED_LIBS OFF)
++
+ # Don't install BoringSSL to system directories by default; it has no stable
+ # ABI. Instead, default to an "install" directory under the source.
+ if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
+@@ -36,7 +38,7 @@ if(CMAKE_VERSION VERSION_LESS "3.14")
+ endif()
+ 
+ # Wrap the CMake install function so we can disable it.
+-set(INSTALL_ENABLED 1)
++set(INSTALL_ENABLED 0)
+ function(install_if_enabled)
+   if(INSTALL_ENABLED)
+     install(${ARGV})
+@@ -139,7 +141,7 @@ set(CMAKE_C_STANDARD_REQUIRED ON)
+   # Note clang-cl is odd and sets both CLANG and MSVC. We base our configuration
+   # primarily on our normal Clang one.
+   # TODO(bbe) took out -Wmissing-field-initializers for pki - fix and put back or disable only for pki
+-  set(C_CXX_FLAGS "-Werror -Wformat=2 -Wsign-compare -Wwrite-strings -Wvla -Wshadow -Wtype-limits")
++  set(C_CXX_FLAGS "-Wformat=2 -Wsign-compare -Wwrite-strings -Wvla -Wshadow -Wtype-limits -fPIC")
+   if(MSVC)
+     # clang-cl sets different default warnings than clang. It also treats -Wall
+     # as -Weverything, to match MSVC. Instead -W3 is the alias for -Wall.

diff --git a/dev-libs/lsquic/lsquic-4.0.8-r2.ebuild b/dev-libs/lsquic/lsquic-4.0.8-r2.ebuild
new file mode 100644
index 000000000..72c6f8ad4
--- /dev/null
+++ b/dev-libs/lsquic/lsquic-4.0.8-r2.ebuild
@@ -0,0 +1,55 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake
+
+BORINGSSL_COMMIT="9fc1c33e9c21439ce5f87855a6591a9324e569fd"
+
+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-9fc1c.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=]
+"
+RDEPEND="
+	${DEPEND}
+	sys-libs/zlib
+"
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-disable-build-deps-libs.patch
+	"${FILESDIR}"/${PN}-link-boringssl-static-libs-9fc1c.patch
+	"${FILESDIR}"/${PN}-disable-override-flags.patch
+	"${FILESDIR}"/${PN}-disable-boring-override-flags.patch
+)
+
+src_unpack() {
+	unpack ${P}.tar.gz
+	unpack boringssl-9fc1c.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
+}


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-05-25 11:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-29  1:32 [gentoo-commits] repo/proj/guru:dev commit in: dev-libs/lsquic/files/, dev-libs/lsquic/ Okamura Kazuya
  -- strict thread matches above, loose matches on Subject: below --
2024-05-25 11:59 Okamura Kazuya
2024-04-27 16:40 Okamura Kazuya
2023-07-06 16:19 Okamura Kazuya

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox