diff options
Diffstat (limited to 'dev-util')
| -rw-r--r-- | dev-util/bear/Manifest | 1 | ||||
| -rw-r--r-- | dev-util/bear/bear-3.0.12.ebuild | 86 | ||||
| -rw-r--r-- | dev-util/schroot/files/06zfscloneopts | 44 | ||||
| -rw-r--r-- | dev-util/schroot/files/11gentoo | 61 | ||||
| -rw-r--r-- | dev-util/schroot/files/schroot_prompt.sh | 1 | ||||
| -rw-r--r-- | dev-util/schroot/schroot-1.6.10_p12-r1.ebuild (renamed from dev-util/schroot/schroot-1.6.10_p12.ebuild) | 18 |
6 files changed, 211 insertions, 0 deletions
diff --git a/dev-util/bear/Manifest b/dev-util/bear/Manifest index 07f4962e932e..2f6afc2a104f 100644 --- a/dev-util/bear/Manifest +++ b/dev-util/bear/Manifest @@ -1,2 +1,3 @@ DIST bear-2.4.4.tar.gz 50347 BLAKE2B 73fa332cf97413e55c588f8830806a26c6905299af902c6cf1f39fd576c6261690239c1b502b28b5a2aa24e5ca521c3f1dd58aacd60e00ece4fe1840f5656155 SHA512 4ee3fd5c846149029fe9e4104e2a0d0e318a15215aa80fc5dc376e22ebea510384b02d4d62765495343cab537bacd2b1b0130c00246e081feb4e543761a594e5 DIST bear-3.0.11.tar.gz 118678 BLAKE2B 209d904a84363a87e566798dcd65ffed96cdbf3d2e753af8dc2706adb995d2999bc112eabb88db28791cbb245c373eb330cf9c20d3d886bb2caeb5c01150e65d SHA512 6d362aede911a8ad35be30638a698579582ca5de770a7c3199bb205046f08f355387099261b8d857188d526ab62024f78e3d06a225734c5f9acca03e5dfea1ec +DIST bear-3.0.12.tar.gz 118937 BLAKE2B 4ed41693a92583091b8510dd1ade55a3e5c897825205e59d9e9810aa63e5f17c5049b3b3de509665143083d44aeb6d85c63d944041bb36c6b1d842d0308d88f0 SHA512 e45e842793e9f5f2cd6b13a9795c2b6753c2fffd516e4af9f0362644c9d0952a2b0e505a4a9d53e9a1a4aa063d7368c6466367a78fececb70582ec7c4e8d7f10 diff --git a/dev-util/bear/bear-3.0.12.ebuild b/dev-util/bear/bear-3.0.12.ebuild new file mode 100644 index 000000000000..a39b31cffa6a --- /dev/null +++ b/dev-util/bear/bear-3.0.12.ebuild @@ -0,0 +1,86 @@ +# Copyright 2020-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python3_{6,7,8,9,10} ) + +inherit cmake python-any-r1 + +DESCRIPTION="Build EAR generates a compilation database for clang tooling" +HOMEPAGE="https://github.com/rizsotto/Bear" +SRC_URI="https://github.com/rizsotto/Bear/archive/${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="GPL-3+" +SLOT="0" +KEYWORDS="~amd64 ~ppc64 ~x86" +IUSE="test" + +RDEPEND=" + >=dev-cpp/nlohmann_json-3.7:= + >=dev-db/sqlite-3.14:= + >=dev-libs/libfmt-6.2 + >=dev-libs/spdlog-1.5 + >=net-libs/grpc-1.26:= +" + +DEPEND="${RDEPEND} + test? ( + >=dev-cpp/gtest-1.10 + ) +" + +BDEPEND="test? ( + $(python_gen_any_dep ' + dev-python/lit[${PYTHON_USEDEP}] + ') +)" + +RESTRICT="!test? ( test )" + +S="${WORKDIR}/${P^}" + +pkg_setup() { + use test && python-any-r1_pkg_setup +} + +src_prepare() { + cmake_src_prepare + # Turn off testing before installation + sed -i 's/TEST_BEFORE_INSTALL/TEST_EXCLUDE_FROM_MAIN/g' CMakeLists.txt || die +} + +src_configure() { + local mycmakeargs=( + -DENABLE_UNIT_TESTS="$(usex test ON OFF)" + -DENABLE_FUNC_TESTS="$(usex test ON OFF)" + ) + cmake_src_configure +} + +src_test() { + if has sandbox ${FEATURES}; then + ewarn "\'FEATURES=sandbox\' detected" + ewarn "Bear overrides LD_PRELOAD and conflicts with gentoo sandbox" + ewarn "Skipping tests" + elif + has usersandbox ${FEATURES}; then + ewarn "\'FEATURES=usersandbox\' detected" + ewarn "Skipping tests" + elif + has network-sandbox ${FEATURES}; then + ewarn "\'FEATURES=network-sandbox\' detected" + ewarn "Skipping tests" + elif + has_version -b 'sys-devel/gcc-config[-native-symlinks]'; then + ewarn "\'sys-devel/gcc-config[-native-symlinks]\' detected, tests call /usr/bin/cc directly (hardcoded)" + ewarn "and will fail without generic cc symlink" + ewarn "Skipping tests" + else + einfo "test may use optional tools if found: qmake gfortran valgrind" + # unit tests + cmake_run_in "${BUILD_DIR}/subprojects/Build/BearSource" ctest --verbose + # functional tests + cmake_run_in "${BUILD_DIR}/subprojects/Build/BearTest" ctest --verbose + fi +} diff --git a/dev-util/schroot/files/06zfscloneopts b/dev-util/schroot/files/06zfscloneopts new file mode 100644 index 000000000000..e66f0885e78f --- /dev/null +++ b/dev-util/schroot/files/06zfscloneopts @@ -0,0 +1,44 @@ +#!/bin/sh +# Copyright © 2020 Georgy Yakovlev <gyakovlev@gentoo.org> +# +# schroot is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# schroot is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see +# <http://www.gnu.org/licenses/>. +# +##################################################################### + +set -e + +. "$SETUP_DATA_DIR/common-data" +. "$SETUP_DATA_DIR/common-functions" +. "$SETUP_DATA_DIR/common-config" + +if [ "$CHROOT_TYPE" = "zfs-snapshot" ] && [ -n "$CHROOT_ZFS_CLONE_NAME" ]; then + + if [ $STAGE = "setup-start" ]; then + + if ! zfs list "$CHROOT_ZFS_CLONE_NAME" >/dev/null 2>&1; then + fatal "Dataset '$CHROOT_ZFS_CLONE_NAME' does not exist" + fi + + if [ "${ZFS_CLONE_OPTIONS+set}" = "set" ]; then + if [ "$VERBOSE" = "verbose" ]; then + zfs set $ZFS_CLONE_OPTIONS \ + "$CHROOT_ZFS_CLONE_NAME" + else + zfs set $ZFS_CLONE_OPTIONS \ + "$CHROOT_ZFS_CLONE_NAME" > /dev/null + fi + fi + fi +fi diff --git a/dev-util/schroot/files/11gentoo b/dev-util/schroot/files/11gentoo new file mode 100644 index 000000000000..ddf2df305c68 --- /dev/null +++ b/dev-util/schroot/files/11gentoo @@ -0,0 +1,61 @@ +#!/bin/sh +# Copyright © 2020 Georgy Yakovlev <gyakovlev@gentoo.org> +# +# schroot is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# schroot is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see +# <http://www.gnu.org/licenses/>. +# +##################################################################### + +set -e + +. "$SETUP_DATA_DIR/common-data" +. "$SETUP_DATA_DIR/common-functions" +. "$SETUP_DATA_DIR/common-config" + +if [ "$VERBOSE" = "verbose" ]; then + VERBOSE_OPT="true" +fi + +if [ "${PORTAGE_BASE_TMPDIR+set}" = "set" ] ; then + if [ "$STAGE" = "setup-start" ]; then + if [ ! -d "$PORTAGE_BASE_TMPDIR" ]; then + fatal "$PORTAGE_BASE_TMPDIR does not exist or not a directory" + fi + if [ "x$SESSION_ID" = x ]; then + fatal "SESSION_ID is not set" + fi + if [ ! -d "$PORTAGE_BASE_TMPDIR/schroot-$SESSION_ID" ]; then + mkdir ${VERBOSE_OPT+-v} \ + "$PORTAGE_BASE_TMPDIR/schroot-$SESSION_ID" + fi + mkdir -p ${VERBOSE_OPT+-v} "$CHROOT_MOUNT_LOCATION/var/tmp/portage" + mount --make-private -o bind ${VERBOSE_OPT+-v}\ + "$PORTAGE_BASE_TMPDIR/schroot-$SESSION_ID" \ + "$CHROOT_MOUNT_LOCATION/var/tmp/portage" + + elif [ "$STAGE" = "setup-stop" ]; then + if [ "$CHROOT_SESSION_PURGE" = true ] || \ + [ "${CHROOT_NAME/#*_master/m}" = "m" ]; then + umount ${VERBOSE_OPT+-v} \ + "$CHROOT_MOUNT_LOCATION/var/tmp/portage" + if [ -d "$PORTAGE_BASE_TMPDIR/schroot-$SESSION_ID" ]; then + if [ "x$SESSION_ID" != x ]; then + rm -fr ${VERBOSE_OPT+-v} \ + "$PORTAGE_BASE_TMPDIR/schroot-$SESSION_ID" + fi + fi + fi + + fi +fi diff --git a/dev-util/schroot/files/schroot_prompt.sh b/dev-util/schroot/files/schroot_prompt.sh new file mode 100644 index 000000000000..bd72f2ce5b83 --- /dev/null +++ b/dev-util/schroot/files/schroot_prompt.sh @@ -0,0 +1 @@ +[[ -f /etc/debian_chroot ]] && PS1="chr: $(< /etc/debian_chroot) ${PS1}" diff --git a/dev-util/schroot/schroot-1.6.10_p12.ebuild b/dev-util/schroot/schroot-1.6.10_p12-r1.ebuild index d1292d3caaaf..0a4a39d4ed2f 100644 --- a/dev-util/schroot/schroot-1.6.10_p12.ebuild +++ b/dev-util/schroot/schroot-1.6.10_p12-r1.ebuild @@ -101,6 +101,24 @@ src_test() { src_install() { cmake_src_install + # debian-stype PS1 for chroot + # checks for /etc/debian_chroot file, which is created by schroot + insinto /etc/bash/bashrc.d + doins "${FILESDIR}/schroot_prompt.sh" + + # gentoo /var/tmp/portage handler + # e.g. portage.base.tmpdir=/var/tmp/portage in config file + # will use a subdirectory of hosts $PORTAGE_TMPDIR + exeinto /etc/schroot/setup.d + doexe "${FILESDIR}/11gentoo" + + # support for zfs clone options. + # zfs.clone.options=com.sun:auto-snapshot=false + if use zfs; then + exeinto /etc/schroot/setup.d + doexe "${FILESDIR}/06zfscloneopts" + fi + keepdir /var/lib/schroot/{session,unpack,union/{overlay,underlay}} docinto /usr/share/doc/${PF}/contrib/setup.d |
