commit:     e6ef88c4ce96c90cfb0a0ed891265880e20b4e78
Author:     David Seifert <soap <AT> gentoo <DOT> org>
AuthorDate: Mon May 16 08:12:06 2022 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Mon May 16 08:12:06 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e6ef88c4

app-arch/pxz: [QA] use tc-check-openmp correctly

Signed-off-by: David Seifert <soap <AT> gentoo.org>

 ...151029.ebuild => pxz-5.0_pre20151029-r1.ebuild} | 29 ++++++++++++--------
 app-arch/pxz/pxz-9999.ebuild                       | 32 ++++++++++++++--------
 2 files changed, 38 insertions(+), 23 deletions(-)

diff --git a/app-arch/pxz/pxz-5.0_pre20151029.ebuild 
b/app-arch/pxz/pxz-5.0_pre20151029-r1.ebuild
similarity index 66%
rename from app-arch/pxz/pxz-5.0_pre20151029.ebuild
rename to app-arch/pxz/pxz-5.0_pre20151029-r1.ebuild
index 64175e6452fa..c9ad43cebe99 100644
--- a/app-arch/pxz/pxz-5.0_pre20151029.ebuild
+++ b/app-arch/pxz/pxz-5.0_pre20151029-r1.ebuild
@@ -1,7 +1,7 @@
 # Copyright 1999-2022 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI="6"
+EAPI=8
 
 inherit toolchain-funcs vcs-snapshot
 
@@ -12,22 +12,29 @@ 
SRC_URI="https://github.com/jnovy/pxz/archive/fcfea93957d96b7661d1439cf4b767ecfd
 LICENSE="GPL-2"
 SLOT="0"
 KEYWORDS="amd64 ~arm64 ~ppc64 x86 ~amd64-linux"
-IUSE=""
 
 # needs the library from xz-utils
-# needs the libgomp library from gcc at runtime
-RDEPEND="app-arch/xz-utils
-       sys-devel/gcc:*[openmp]"
+RDEPEND="app-arch/xz-utils"
 DEPEND="${RDEPEND}"
 
+pkg_pretend() {
+       [[ ${MERGE_TYPE} != binary ]] && tc-check-openmp
+}
+
+pkg_setup() {
+       [[ ${MERGE_TYPE} != binary ]] && tc-check-openmp
+}
+
 src_prepare() {
-       tc-check-openmp
-       tc-export CC
-       export BINDIR="${EPREFIX}"/usr/bin
-       export MANDIR="${EPREFIX}"/usr/share/man
-       default_src_prepare
+       default
 
        if use elibc_musl ; then
-           sed -i -e '/<error.h>/c\#define error(R,E,S,...) fprintf(stderr, S 
"\\n", ##__VA_ARGS__); exit(R)' pxz.c
+               sed -i -e '/<error.h>/c\#define error(R,E,S,...) 
fprintf(stderr, S "\\n", ##__VA_ARGS__); exit(R)' pxz.c || die
        fi
 }
+
+src_configure() {
+       tc-export CC
+       export BINDIR="${EPREFIX}"/usr/bin
+       export MANDIR="${EPREFIX}"/usr/share/man
+}

diff --git a/app-arch/pxz/pxz-9999.ebuild b/app-arch/pxz/pxz-9999.ebuild
index 895c02be50d0..f67a5e51ae6a 100644
--- a/app-arch/pxz/pxz-9999.ebuild
+++ b/app-arch/pxz/pxz-9999.ebuild
@@ -1,11 +1,11 @@
 # Copyright 1999-2022 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=6
+EAPI=8
 
-inherit toolchain-funcs flag-o-matic
+inherit toolchain-funcs
 
-if [[ ${PV} == "9999" ]] ; then
+if [[ ${PV} == *9999 ]] ; then
        EGIT_REPO_URI="https://github.com/jnovy/pxz.git";
        inherit git-r3
 else
@@ -27,19 +27,27 @@ SLOT="0"
 IUSE=""
 
 # needs the library from xz-utils
-# needs the libgomp library from gcc at runtime
-DEPEND="app-arch/xz-utils
-       sys-devel/gcc:*[openmp]"
+DEPEND="app-arch/xz-utils"
 RDEPEND="${DEPEND}"
 
+pkg_pretend() {
+       [[ ${MERGE_TYPE} != binary ]] && tc-check-openmp
+}
+
+pkg_setup() {
+       [[ ${MERGE_TYPE} != binary ]] && tc-check-openmp
+}
+
 src_prepare() {
-       tc-check-openmp
-       tc-export CC
-       export BINDIR="${EPREFIX}"/usr/bin
-       export MANDIR="${EPREFIX}"/usr/share/man
-       default_src_prepare
+       default
 
        if use elibc_musl ; then
-           sed -i -e '/<error.h>/c\#define error(R,E,S,...) fprintf(stderr, S 
"\\n", ##__VA_ARGS__); exit(R)' pxz.c
+               sed -i -e '/<error.h>/c\#define error(R,E,S,...) 
fprintf(stderr, S "\\n", ##__VA_ARGS__); exit(R)' pxz.c || die
        fi
 }
+
+src_configure() {
+       tc-export CC
+       export BINDIR="${EPREFIX}"/usr/bin
+       export MANDIR="${EPREFIX}"/usr/share/man
+}

Reply via email to