sys-libs/libcxxrt: Required gcc-6+ for tests
authorMichał Górny <mgorny@gentoo.org>
Fri, 8 Dec 2017 14:40:10 +0000 (15:40 +0100)
committerMichał Górny <mgorny@gentoo.org>
Fri, 8 Dec 2017 14:50:43 +0000 (15:50 +0100)
Closes: https://bugs.gentoo.org/635528

sys-libs/libcxxrt/libcxxrt-0.0_p20170515.ebuild
sys-libs/libcxxrt/libcxxrt-9999.ebuild

index 8d68b661f0c3e945bb585189023efb84f6316e04..3eff48dfd4e0d406fc5497b0f981be2bcc49bf98 100644 (file)
@@ -25,7 +25,7 @@ if [ "${PV%9999}" = "${PV}" ] ; then
 else
        KEYWORDS=""
 fi
-IUSE="+libunwind +static-libs"
+IUSE="+libunwind +static-libs test"
 
 RDEPEND="libunwind? ( || ( >=sys-libs/libunwind-1.0.1-r1[static-libs?,${MULTILIB_USEDEP}]
                sys-libs/llvm-libunwind[static-libs?,${MULTILIB_USEDEP}] ) )"
@@ -34,6 +34,22 @@ DEPEND="${RDEPEND}
 
 DOCS=( AUTHORS COPYRIGHT README )
 
+gcc_check() {
+       if tc-is-gcc && [[ $(gcc-major-version) -lt 6 ]] && use test; then
+               eerror "At least gcc-6 is required to run tests. Please switch to a newer"
+               eerror "compiler before proceeding."
+               die "gcc-6 required for tests"
+       fi
+}
+
+pkg_pretend() {
+       gcc_check
+}
+
+pkg_setup() {
+       gcc_check
+}
+
 src_prepare() {
        cp "${FILESDIR}/Makefile" src/ || die
        cp "${FILESDIR}/Makefile.test" test/Makefile || die
index 8d68b661f0c3e945bb585189023efb84f6316e04..1b4a9c67f1f44fa874af63ff1499edbb5e836eab 100644 (file)
@@ -34,6 +34,22 @@ DEPEND="${RDEPEND}
 
 DOCS=( AUTHORS COPYRIGHT README )
 
+gcc_check() {
+       if tc-is-gcc && [[ $(gcc-major-version) -lt 6 ]] && use test; then
+               eerror "At least gcc-6 is required to run tests. Please switch to a newer"
+               eerror "compiler before proceeding."
+               die "gcc-6 required for tests"
+       fi
+}
+
+pkg_pretend() {
+       gcc_check
+}
+
+pkg_setup() {
+       gcc_check
+}
+
 src_prepare() {
        cp "${FILESDIR}/Makefile" src/ || die
        cp "${FILESDIR}/Makefile.test" test/Makefile || die