1. 因为这个 ebuild 从 2024 年加入时就没有 `KEYWORDS`,任何架构都装不上,所以补上 `~amd64`。 2. 因为上游的 `ENABLE_SYSTEM_OPENSSL` 和 `ENABLE_SYSTEM_ZLIB` 默认为 OFF、会改编 `third_party` 下自带的副本,所以打开这两个开关,并把 `dev-libs/openssl` 与 `virtual/zlib` 写进依赖。 3. 因为 release tarball 里没有 `.git`,而默认开启的 `ENABLE_GIT_VERSION` 会在源码树里调用 git,所以关掉它。 4. 因为默认开启的 `ENABLE_STATIC_LINK_TO_GCC` 会静态链接 libgcc,所以关掉它。 5. 因为上游在 GNU 分支无条件追加 `-static-libstdc++` 且没有提供开关,libstdc++ 的 ABI 修正就到不了装好的程序,所以在 `src_prepare` 里去掉这个链接选项。 6. 因为 `third_party/fmt` 被无条件编进程序、许可证是 MIT,所以 `LICENSE` 补上 MIT。 7. 因为 cmake.eclass 的 CMake 4 兼容检查报出的文件全在 `third_party` 的 test、example 和 IDE 目录下、没有一个会被 `add_subdirectory`,所以按 eclass 为此提供的 `CMAKE_QA_COMPAT_SKIP` 跳过检测;代价是上游顶层自己的 `cmake_minimum_required(VERSION 3.5)` 警告也一并被压掉,那条得上游改。 Signed-off-by: Zakk <zakk@gentoozh.org>
50 lines
1.5 KiB
Bash
50 lines
1.5 KiB
Bash
# Copyright 2024 Gentoo Authors
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
|
|
EAPI=8
|
|
|
|
# every file the cmake<4 compat check flags sits in a third_party test, example or
|
|
# IDE directory that nothing add_subdirectory's. this also hides upstream's own
|
|
# top-level cmake_minimum_required(VERSION 3.5), which has to be fixed upstream
|
|
CMAKE_QA_COMPAT_SKIP=1
|
|
|
|
inherit cmake
|
|
|
|
DESCRIPTION="Implementation of all proxy protocols using modern c++"
|
|
HOMEPAGE="https://github.com/jackarain/proxy"
|
|
SRC_URI="https://github.com/Jackarain/proxy/archive/refs/tags/v${PV}.tar.gz -> proxy-${PV}.tar.gz"
|
|
S="${WORKDIR}/proxy-${PV}"
|
|
|
|
# MIT covers third_party/fmt, which is built in
|
|
LICENSE="Boost-1.0 MIT"
|
|
SLOT="0"
|
|
KEYWORDS="~amd64"
|
|
|
|
RDEPEND="
|
|
dev-libs/openssl:=
|
|
virtual/zlib:=
|
|
"
|
|
DEPEND="${RDEPEND}"
|
|
|
|
src_prepare() {
|
|
# upstream adds -static-libstdc++ unconditionally and offers no switch for it,
|
|
# so a libstdc++ ABI fix would never reach the installed binary
|
|
sed -i -e 's/ -static-libstdc++//g' CMakeLists.txt || die
|
|
|
|
cmake_src_prepare
|
|
}
|
|
|
|
src_configure() {
|
|
local mycmakeargs=(
|
|
# upstream vendors openssl and zlib under third_party and builds them by
|
|
# default; boost and fmt stay bundled, upstream add_subdirectory's them
|
|
# unconditionally and offers no system switch
|
|
-DENABLE_SYSTEM_OPENSSL=ON
|
|
-DENABLE_SYSTEM_ZLIB=ON
|
|
# a release tarball has no .git, and this would run git in ${S}
|
|
-DENABLE_GIT_VERSION=OFF
|
|
-DENABLE_STATIC_LINK_TO_GCC=OFF
|
|
)
|
|
cmake_src_configure
|
|
}
|