net-libs/kcgi: add 0.13.0

Signed-off-by: Anna (cybertailor) Vyalkova <cyber+gentoo@sysrq.in>
This commit is contained in:
Anna (cybertailor) Vyalkova
2021-11-10 09:52:12 +05:00
parent 8b3c9be2bc
commit 9eacd2a39b
3 changed files with 152 additions and 1 deletions

View File

@@ -1 +1,2 @@
DIST kcgi-0.12.5.tgz 247454 BLAKE2B 1aebd9d62977e22a6a6538b591c40efab53282fd6f28809330c34bfb825798b837003cf0b492f3c3bc79c2ebf3054b466b9e290c156aceee553ef8af6e0a7f07 SHA512 61c28f165b0c1024e4b22fd4e725d79c4e2800b0c6a7fae1473e33608b3299b5ad8630d87ccccaab3e12358dfb6d1c3cd0eb0ed20fa0da1bcc35cc6df8106440
DIST kcgi-0.13.0.tgz 243127 BLAKE2B e3f4f42450cf3ba5b7f3199e11d1ee57bd2b16f55d662c6989f486811fb49fb1dcba62864320ee1962db5b0cde026db832d6935c14a79f43d4b19383a630f392 SHA512 b07168d87ad55a403120bfe79ac37e29803047bf663bb50ead0a758a1636b9fc77fd3aba45eb52b2f80cd103f1878e861d99e22bc6eefd2dd742ac82f4dbc969

View File

@@ -0,0 +1,142 @@
# Copyright 2019-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit flag-o-matic multilib multiprocessing toolchain-funcs
DESCRIPTION="Minimal CGI library for web applications"
HOMEPAGE="https://kristaps.bsd.lv/kcgi/"
if [[ ${PV} == 9999 ]]; then
inherit git-r3
EGIT_REPO_URI="https://github.com/kristapsdz/${PN}"
else
SRC_URI="https://kristaps.bsd.lv/${PN}/snapshots/${P}.tgz"
KEYWORDS="~amd64 ~x86"
fi
LICENSE="ISC"
SLOT="0"
IUSE="static-libs test"
RESTRICT="!test? ( test )"
BDEPEND="sys-devel/bmake"
RDEPEND="
app-crypt/libmd
virtual/libcrypt
"
DEPEND="${RDEPEND}
test? ( net-misc/curl[static-libs(-)] )
"
PATCHES=( "${FILESDIR}"/${PN}-0.12-ldflags.patch )
_get_version_component_count() {
local cnt=( $(ver_rs 1- ' ') )
echo ${#cnt[@]} || die
}
static_to_shared() {
local libstatic=${1}
shift
local libname=$(basename ${libstatic%.a})
local soname=${libname}$(get_libname $(ver_cut 1-2))
local libdir=$(dirname ${libstatic})
einfo "Making ${soname} from ${libstatic}"
if [[ ${CHOST} == *-darwin* ]] ; then
${LINK:-$(tc-getCC)} ${LDFLAGS} \
-dynamiclib -install_name "${EPREFIX}"/usr/lib/"${soname}" \
-Wl,-all_load -Wl,${libstatic} \
"$@" -o ${libdir}/${soname} || die "${soname} failed"
else
${LINK:-$(tc-getCC)} ${LDFLAGS} \
-shared -Wl,-soname=${soname} \
-Wl,--whole-archive ${libstatic} -Wl,--no-whole-archive \
"$@" -o ${libdir}/${soname} || die "${soname} failed"
if [[ $(_get_version_component_count) -ge 1 ]] ; then
ln -s ${soname} ${libdir}/${libname}$(get_libname $(ver_cut 1)) || die
fi
ln -s ${soname} ${libdir}/${libname}$(get_libname) || die
fi
}
src_prepare() {
default
# ld: multiple definition of `dummy'
local deselect=( sandbox-{capsicum,darwin,pledge,seccomp-filter}.o )
case ${CHOST} in
*-linux-*)
deselect=( "${deselect[@]/sandbox-seccomp-filter.o}" )
;;
*-darwin*)
deselect=( "${deselect[@]/sandbox-darwin.o}" )
;;
*-freebsd*)
deselect=( "${deselect[@]/sandbox-capsicum.o}" )
;;
*-openbsd*)
deselect=( "${deselect[@]/sandbox-pledge.o}" )
;;
esac
for obj in "${deselect[@]}"; do
# elements are not deleted completely from the array
if [[ -n "${obj}" ]]; then
sed "/${obj}/d" -i Makefile || die
fi
done
}
src_configure() {
tc-export CC AR
append-cflags -fPIC
append-cppflags -DENABLE_SECCOMP_FILTER=1
append-cppflags -DSANDBOX_SECCOMP_DEBUG # seccomp may cause problems
# note: not an autoconf configure script
conf_args=(
CPPFLAGS="${CPPFLAGS}"
LDFLAGS="${LDFLAGS}"
PREFIX="${EPREFIX}"/usr
MANDIR="${EPREFIX}"/usr/share/man
LIBDIR="${EPREFIX}"/usr/$(get_libdir)
SBINDIR="${EPREFIX}"/usr/sbin
)
./configure "${conf_args[@]}" || die
}
src_compile() {
bmake -j$(makeopts_jobs) || die
static_to_shared libkcgi.a -lz -lmd
static_to_shared libkcgihtml.a
static_to_shared libkcgijson.a -lm
static_to_shared libkcgiregress.a
static_to_shared libkcgixml.a
}
src_test() {
# TODO: add `afl` tests
bmake -j$(makeopts_jobs) regress || die
}
src_install() {
bmake -j$(makeopts_jobs) \
DESTDIR="${D}" \
DATADIR="${EPREFIX}/usr/share/doc/${PF}/examples" \
install || die
dolib.so lib*$(get_libname)*
if ! use static-libs; then
find "${ED}" -name '*.a' -delete || die
fi
einstalldocs
}

View File

@@ -1,8 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>gentoo@aisha.cc</email>
<name>Aisha Tammy</name>
</maintainer>
<upstream>
<remote-id type="github">kristapsdz/kcgi</remote-id>
<bugs-to>https://github.com/kristapsdz/kcgi/issues</bugs-to>
<maintainer>
<name>Kristaps Džonsons</name>
<email>kristaps@bsd.lv</email>
</maintainer>
</upstream>
</pkgmetadata>