summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sys-libs/libhugetlbfs/libhugetlbfs-2.23.ebuild')
-rw-r--r--sys-libs/libhugetlbfs/libhugetlbfs-2.23.ebuild30
1 files changed, 20 insertions, 10 deletions
diff --git a/sys-libs/libhugetlbfs/libhugetlbfs-2.23.ebuild b/sys-libs/libhugetlbfs/libhugetlbfs-2.23.ebuild
index 94988481f11a..ce5da82ddfcd 100644
--- a/sys-libs/libhugetlbfs/libhugetlbfs-2.23.ebuild
+++ b/sys-libs/libhugetlbfs/libhugetlbfs-2.23.ebuild
@@ -1,13 +1,13 @@
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
PYTHON_COMPAT=( python3_{7,8,9} )
-inherit multilib toolchain-funcs python-any-r1
+inherit toolchain-funcs python-any-r1
-DESCRIPTION="easy hugepage access"
+DESCRIPTION="Easy hugepage access"
HOMEPAGE="https://github.com/libhugetlbfs/libhugetlbfs"
SRC_URI="https://github.com/libhugetlbfs/libhugetlbfs/archive/${PV}.tar.gz -> ${P}.tar.gz"
@@ -17,7 +17,7 @@ KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~s390 ~x86"
IUSE="static-libs test"
RESTRICT="!test? ( test )"
-DEPEND="test? ( ${PYTHON_DEPS} )"
+BDEPEND="test? ( ${PYTHON_DEPS} )"
PATCHES=(
"${FILESDIR}"/${PN}-2.6-fixup-testsuite.patch
@@ -26,6 +26,7 @@ PATCHES=(
src_prepare() {
default
+
sed -i \
-e '/^PREFIX/s:/local::' \
-e '1iBUILDTYPE = NATIVEONLY' \
@@ -35,6 +36,7 @@ src_prepare() {
-e '/^CC\(32\|64\)/s:=.*:= $(CC):' \
-e 's@^\(ARCH\) ?=@\1 =@' \
Makefile || die "sed failed"
+
if [ "$(get_libdir)" == "lib64" ]; then
sed -i \
-e "/^LIB\(32\)/s:=.*:= lib32:" \
@@ -53,14 +55,16 @@ src_compile() {
src_install() {
default
+
use static-libs || rm -f "${ED}"/usr/$(get_libdir)/*.a
}
src_test_alloc_one() {
- hugeadm="$1"
- sign="$2"
- pagesize="$3"
- pagecount="$4"
+ hugeadm="${1}"
+ sign="${2}"
+ pagesize="${3}"
+ pagecount="${4}"
+
${hugeadm} \
--pool-pages-max ${pagesize}:${sign}${pagecount} \
&& \
@@ -72,7 +76,7 @@ src_test_alloc_one() {
# die is NOT allowed in this src_test block after the marked point, so that we
# can clean up memory allocation. You'll leak at LEAST 64MiB per run otherwise.
src_test() {
- [[ $UID -eq 0 ]] || die "Need FEATURES=-userpriv to run this testsuite"
+ [[ ${UID} -eq 0 ]] || die "Need FEATURES=-userpriv to run this testsuite"
einfo "Building testsuite"
emake -j1 tests
@@ -92,6 +96,7 @@ src_test() {
mkdir -p /var/lib/hugetlbfs/pagesize-${pagesize}
addwrite /var/lib/hugetlbfs/pagesize-${pagesize}
done
+
addwrite /proc/sys/vm/
addwrite /proc/sys/kernel/shmall
addwrite /proc/sys/kernel/shmmax
@@ -108,8 +113,10 @@ src_test() {
for pagesize in ${PAGESIZES} ; do
pagecount=$((${MIN_HUGEPAGE_RAM}/${pagesize}))
einfo " ${pagecount} @ ${pagesize}"
+
addwrite /var/lib/hugetlbfs/pagesize-${pagesize}
src_test_alloc_one "${hugeadm}" "+" "${pagesize}" "${pagecount}"
+
rc=$?
if [[ ${rc} -eq 0 ]]; then
allocated="${allocated} ${pagesize}:${pagecount}"
@@ -124,6 +131,7 @@ src_test() {
if [[ -n "${allocated}" ]]; then
# All our allocations worked, so time to run.
einfo "Starting tests"
+
cd "${S}"/tests || die
local TESTOPTS="-t func"
case ${ARCH} in
@@ -134,6 +142,7 @@ src_test() {
TESTOPTS="${TESTOPTS} -b 32"
;;
esac
+
# This needs a bit of work to give a nice exit code still.
./run_tests.py ${TESTOPTS}
rc=$?
@@ -148,8 +157,9 @@ src_test() {
for alloc in ${allocated} ; do
pagesize="${alloc/:*}"
pagecount="${alloc/*:}"
+
einfo " ${pagecount} @ ${pagesize}"
- src_test_alloc_one "$hugeadm" "-" "${pagesize}" "${pagecount}"
+ src_test_alloc_one "${hugeadm}" "-" "${pagesize}" "${pagecount}"
done
# ---------------------------------------------------------