From b33708c82c512b98ac90631edbc10a4bcb06cce6 Mon Sep 17 00:00:00 2001 From: Kent Fredric Date: Wed, 8 Jul 2020 00:00:12 +1200 Subject: [PATCH] dev-perl/Devel-NYTProf: -r bump fix for bug #724506 - EAPI7 - Add subslot deps for zlib - Ensure CFLAGS passed to make/compiler - Fix problem introduced by -Dcpp=$(tc-getCPP) in dev-lang/perl where Devel-NYTProf incorrectly uses $Config{cpp} instead of $Config{cpprun}, which results in trying to invoke $GCC to pre-process headers for grep-based feature detection, where it *SHOULD* be invoking "$GCC -E", which in turn, leads to trying to compile system headers and in turn, writing precompiled headers to /usr/include, tripping a sandbox violation. Bug: https://bugs.gentoo.org/724506 Bug: https://github.com/timbunce/devel-nytprof/issues/139 Package-Manager: Portage-2.3.100, Repoman-2.3.22 Signed-off-by: Kent Fredric --- .../Devel-NYTProf-6.60.0-r1.ebuild | 56 +++++++++++++++++++ .../files/Devel-NYTProf-6.06-cpprun.patch | 36 ++++++++++++ dev-perl/Devel-NYTProf/metadata.xml | 1 + 3 files changed, 93 insertions(+) create mode 100644 dev-perl/Devel-NYTProf/Devel-NYTProf-6.60.0-r1.ebuild create mode 100644 dev-perl/Devel-NYTProf/files/Devel-NYTProf-6.06-cpprun.patch diff --git a/dev-perl/Devel-NYTProf/Devel-NYTProf-6.60.0-r1.ebuild b/dev-perl/Devel-NYTProf/Devel-NYTProf-6.60.0-r1.ebuild new file mode 100644 index 0000000000000..9771cb81e12c0 --- /dev/null +++ b/dev-perl/Devel-NYTProf/Devel-NYTProf-6.60.0-r1.ebuild @@ -0,0 +1,56 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +DIST_AUTHOR=TIMB +DIST_VERSION=6.06 +DIST_EXAMPLES=("demo/*") +inherit perl-module toolchain-funcs + +DESCRIPTION="Powerful feature-rich perl source code profiler" + +SLOT="0" +KEYWORDS="~amd64 ~ppc ~x86" +IUSE="test" +RESTRICT="!test? ( test )" + +RDEPEND=" + >=dev-perl/File-Which-1.90.0 + virtual/perl-Getopt-Long + dev-perl/JSON-MaybeXS + virtual/perl-Scalar-List-Utils + virtual/perl-XSLoader + sys-libs/zlib:0= +" +DEPEND=" + sys-libs/zlib:0= +" +BDEPEND="${RDEPEND} + virtual/perl-ExtUtils-MakeMaker + test? ( + >=virtual/perl-Test-Simple-0.840.0 + >=dev-perl/Test-Differences-0.60.0 + ) +" +PERL_RM_FILES=( + t/68-hashline.t + t/71-moose.t + t/72-autodie.t + t/90-pod.t + t/91-pod_coverage.t + t/92-file_port.t +) +PATCHES=( + "${FILESDIR}/${PN}-6.06-cpprun.patch" +) +src_configure() { + tc-export CPP + perl-module_src_configure +} +src_compile() { + mymake=( + "OPTIMIZE=${CFLAGS}" + ) + perl-module_src_compile +} diff --git a/dev-perl/Devel-NYTProf/files/Devel-NYTProf-6.06-cpprun.patch b/dev-perl/Devel-NYTProf/files/Devel-NYTProf-6.06-cpprun.patch new file mode 100644 index 0000000000000..786a525a7dcf7 --- /dev/null +++ b/dev-perl/Devel-NYTProf/files/Devel-NYTProf-6.06-cpprun.patch @@ -0,0 +1,36 @@ +From aaa04b28c99e0d2bf244dbcb274b4df6fe6fa50d Mon Sep 17 00:00:00 2001 +From: Kent Fredric +Date: Tue, 7 Jul 2020 23:08:00 +1200 +Subject: Allow CPP override in ENV + +When Perl is built with -Dcpp="$(gc-getCPP)", the end result is: + +- $Config{cpp} = "${CHOST}-gcc" +- $Config{cpprun} = "${CHOST}-gcc -E" + +And of course, Devel-NYTProf uses the former, and so it tries to compile +the damn header instead of just preprocessing it. + +This provides a correction, and an override. + +Bug: https://github.com/timbunce/devel-nytprof/issues/139 +--- + Makefile.PL | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile.PL b/Makefile.PL +index 60025de..6786e29 100644 +--- a/Makefile.PL ++++ b/Makefile.PL +@@ -59,7 +59,7 @@ utime time(), time(), "t/test40pmc.pmc" + + # --- Discover how much of stdio is implemented + +-my $cpp = $Config{cpp} || do { ++my $cpp = $ENV{CPP} || $Config{cpprun} || do { + warn "Warning: cpp not found in your perl config. Falling back to 'cat'\n"; + 'cat'; + }; +-- +2.27.0 + diff --git a/dev-perl/Devel-NYTProf/metadata.xml b/dev-perl/Devel-NYTProf/metadata.xml index c4728df9c2ea4..ccc473b063961 100644 --- a/dev-perl/Devel-NYTProf/metadata.xml +++ b/dev-perl/Devel-NYTProf/metadata.xml @@ -20,5 +20,6 @@ Devel::NYTProf::SubCallInfo Devel::NYTProf::SubInfo Devel::NYTProf::Util + SVG