diff options
author | Sam James <sam@gentoo.org> | 2021-04-17 00:02:58 +0100 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2021-04-21 20:00:42 +0100 |
commit | dae595bdae48513b52a6436e3e5e7c99e7268963 (patch) | |
tree | c5fdeb22ee6fc5e23417786cf9e48f8bdb5a836e /sys-libs/libhugetlbfs | |
parent | sys-power/iasl: eutils->edos2unix (diff) | |
download | gentoo-dae595bdae48513b52a6436e3e5e7c99e7268963.tar.gz gentoo-dae595bdae48513b52a6436e3e5e7c99e7268963.tar.bz2 gentoo-dae595bdae48513b52a6436e3e5e7c99e7268963.zip |
sys-libs/libhugetlbfs: multilib--, tidy up ebuild
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'sys-libs/libhugetlbfs')
-rw-r--r-- | sys-libs/libhugetlbfs/libhugetlbfs-2.22.ebuild | 26 | ||||
-rw-r--r-- | sys-libs/libhugetlbfs/libhugetlbfs-2.23.ebuild | 30 |
2 files changed, 36 insertions, 20 deletions
diff --git a/sys-libs/libhugetlbfs/libhugetlbfs-2.22.ebuild b/sys-libs/libhugetlbfs/libhugetlbfs-2.22.ebuild index a6cbf04d56aa..8b11ae28651f 100644 --- a/sys-libs/libhugetlbfs/libhugetlbfs-2.22.ebuild +++ b/sys-libs/libhugetlbfs/libhugetlbfs-2.22.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 @@ -56,10 +56,10 @@ src_install() { } 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} \ && \ @@ -71,7 +71,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 @@ -91,6 +91,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 @@ -106,7 +107,9 @@ src_test() { einfo "Starting allocation" 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=$? @@ -123,6 +126,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 @@ -133,6 +137,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=$? @@ -147,8 +152,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 # --------------------------------------------------------- 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 # --------------------------------------------------------- |