[oe-commits] org.oe.dev cpan_build.bbclass: The existing cpan.bbclass works for perl modules that

lenehan commit openembedded-commits at lists.openembedded.org
Tue Sep 26 07:51:42 UTC 2006


cpan_build.bbclass: The existing cpan.bbclass works for perl modules that
uses the old Makefile.PL based build ssytem. This class is for perl modules
that use the new Build.PL based build system (not widely used yet but
starting to appear). Again this use site_perl instead of vendor_perl since
vender_perl is not being setup by the perl build.

Author: lenehan at openembedded.org
Branch: org.openembedded.dev
Revision: 87190a9308ede176f2f880b0f61b9f2ae6f12f2d
ViewMTN: http://monotone.openembedded.org/revision.psp?id=87190a9308ede176f2f880b0f61b9f2ae6f12f2d
Files:
1
classes/cpan_build.bbclass
Diffs:

#
# mt diff -r2ae64e9d4514b3db2e07b3ed4a38383b9fd81057 -r87190a9308ede176f2f880b0f61b9f2ae6f12f2d
#
# 
# 
# add_file "classes/cpan_build.bbclass"
#  content [a17d70b85cf5a13dc3d5bd250ffb3593a92b8075]
# 
============================================================
--- classes/cpan_build.bbclass	a17d70b85cf5a13dc3d5bd250ffb3593a92b8075
+++ classes/cpan_build.bbclass	a17d70b85cf5a13dc3d5bd250ffb3593a92b8075
@@ -0,0 +1,44 @@
+INHIBIT_NATIVE_STAGE_INSTALL = "1"
+FILES_${PN} += '${libdir}/perl5'
+
+def is_crosscompiling(d):
+    import bb
+    if not bb.data.inherits_class('native', d):
+        return "yes"
+    return "no"
+
+cpan_build_do_configure () {
+	if [ ${@is_crosscompiling(d)} == "yes" ]; then
+		# build for target
+		. ${STAGING_DIR}/${TARGET_SYS}/perl/config.sh
+		perl Build.PL --installdirs vendor \
+			--destdir ${D} \
+			--install_path lib="${libdir}/perl5/site_perl/${version}" \
+			--install_path arch="${libdir}/perl5/site_perl/${version}/${TARGET_SYS}" \
+			--install_path script=${bindir} \
+			--install_path bin=${bindir} \
+			--install_path bindoc=${mandir}/man1 \
+			--install_path libdoc=${mandir}/man3
+	else
+		# build for host
+		perl Build.PL --installdirs site
+	fi
+}
+
+cpan_build_do_compile () {
+        perl Build
+}
+
+cpan_build_do_install () {
+	if [ ${@is_crosscompiling(d)} == "yes" ]; then
+		perl Build install
+	fi
+}
+
+do_stage_append () {
+	if [ ${@is_crosscompiling(d)} == "no" ]; then
+		perl Build install
+	fi
+}
+
+EXPORT_FUNCTIONS do_configure do_compile do_install






More information about the Openembedded-commits mailing list