summaryrefslogtreecommitdiffstats
path: root/meta/classes/cpan.bbclass
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2022-08-10 14:35:29 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-08-12 15:27:17 +0100
commitfd1517e2b51a170f2427122c6b95396db251d827 (patch)
treedabfe3e631339c2fc99a9ee7febb0f9c128e325e /meta/classes/cpan.bbclass
parent10317912ee319ccf7f83605d438b5cbf9663f296 (diff)
downloadpoky-fd1517e2b51a170f2427122c6b95396db251d827.tar.gz
classes: Update classes to match new bitbake class scope functionality
Move classes to classes-global or classes-recipe as appropriate to take advantage of new bitbake functionality to check class scope/usage. (From OE-Core rev: f5c128008365e141082c129417eb72d2751e8045) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/cpan.bbclass')
-rw-r--r--meta/classes/cpan.bbclass71
1 files changed, 0 insertions, 71 deletions
diff --git a/meta/classes/cpan.bbclass b/meta/classes/cpan.bbclass
deleted file mode 100644
index bb76a5b326..0000000000
--- a/meta/classes/cpan.bbclass
+++ /dev/null
@@ -1,71 +0,0 @@
1#
2# Copyright OpenEmbedded Contributors
3#
4# SPDX-License-Identifier: MIT
5#
6
7#
8# This is for perl modules that use the old Makefile.PL build system
9#
10inherit cpan-base perlnative
11
12EXTRA_CPANFLAGS ?= ""
13EXTRA_PERLFLAGS ?= ""
14
15# Env var which tells perl if it should use host (no) or target (yes) settings
16export PERLCONFIGTARGET = "${@is_target(d)}"
17
18# Env var which tells perl where the perl include files are
19export PERL_INC = "${STAGING_LIBDIR}${PERL_OWN_DIR}/perl5/${@get_perl_version(d)}/${@get_perl_arch(d)}/CORE"
20export PERL_LIB = "${STAGING_LIBDIR}${PERL_OWN_DIR}/perl5/${@get_perl_version(d)}"
21export PERL_ARCHLIB = "${STAGING_LIBDIR}${PERL_OWN_DIR}/perl5/${@get_perl_version(d)}/${@get_perl_arch(d)}"
22export PERLHOSTLIB = "${STAGING_LIBDIR_NATIVE}/perl5/${@get_perl_version(d)}/"
23export PERLHOSTARCHLIB = "${STAGING_LIBDIR_NATIVE}/perl5/${@get_perl_version(d)}/${@get_perl_hostarch(d)}/"
24
25cpan_do_configure () {
26 yes '' | perl ${EXTRA_PERLFLAGS} Makefile.PL INSTALLDIRS=vendor NO_PERLLOCAL=1 NO_PACKLIST=1 PERL=$(which perl) ${EXTRA_CPANFLAGS}
27
28 # Makefile.PLs can exit with success without generating a
29 # Makefile, e.g. in cases of missing configure time
30 # dependencies. This is considered a best practice by
31 # cpantesters.org. See:
32 # * http://wiki.cpantesters.org/wiki/CPANAuthorNotes
33 # * http://www.nntp.perl.org/group/perl.qa/2008/08/msg11236.html
34 [ -e Makefile ] || bbfatal "No Makefile was generated by Makefile.PL"
35
36 if [ "${BUILD_SYS}" != "${HOST_SYS}" ]; then
37 . ${STAGING_LIBDIR}${PERL_OWN_DIR}/perl5/config.sh
38 # Use find since there can be a Makefile generated for each Makefile.PL
39 for f in `find -name Makefile.PL`; do
40 f2=`echo $f | sed -e 's/.PL//'`
41 test -f $f2 || continue
42 sed -i -e "s:\(PERL_ARCHLIB = \).*:\1${PERL_ARCHLIB}:" \
43 -e 's/perl.real/perl/' \
44 -e "s|^\(CCFLAGS =.*\)|\1 ${CFLAGS}|" \
45 $f2
46 done
47 fi
48}
49
50do_configure:append:class-target() {
51 find . -name Makefile | xargs sed -E -i \
52 -e 's:LD_RUN_PATH ?= ?"?[^"]*"?::g'
53}
54
55do_configure:append:class-nativesdk() {
56 find . -name Makefile | xargs sed -E -i \
57 -e 's:LD_RUN_PATH ?= ?"?[^"]*"?::g'
58}
59
60cpan_do_compile () {
61 oe_runmake PASTHRU_INC="${CFLAGS}" LD="${CCLD}"
62}
63
64cpan_do_install () {
65 oe_runmake DESTDIR="${D}" install_vendor
66 for PERLSCRIPT in `grep -rIEl '#! *${bindir}/perl-native.*/perl' ${D}`; do
67 sed -i -e 's|${bindir}/perl-native.*/perl|/usr/bin/env nativeperl|' $PERLSCRIPT
68 done
69}
70
71EXPORT_FUNCTIONS do_configure do_compile do_install