merge of 425cf1b391611c169a1c3b78f1fe86df088902b9
[vuplus_openembedded] / packages / perl / perl_5.8.7.bb
1
2 # We need gnugrep (for -I)
3 DEPENDS_append += " grep-native"
4
5 require perl.inc
6
7 SRC_URI += "file://config.sh-armeb-linux \
8             file://config.sh-arm-linux \
9             file://config.sh-i386-linux \
10             file://config.sh-i486-linux \
11             file://config.sh-i586-linux \
12             file://config.sh-i686-linux \
13             file://config.sh-x86_64-linux \
14             file://config.sh-sh3-linux \
15             file://config.sh-sh4-linux"
16
17 # Patches for sh3/sh4, use gcc to link and override generaet.sh to
18 # use PIC mode for compiling shared library objects.
19 SRC_URI_append_sh4 += "file://override-generate-sh.patch;patch=1"
20 SRC_URI_append_sh4 += "file://makefile-usegcc-to-link.patch;patch=1"
21 SRC_URI_append_sh3 += "file://override-generate-sh.patch;patch=1"
22 SRC_URI_append_sh3 += "file://makefile-usegcc-to-link.patch;patch=1"
23
24 PARALLEL_MAKE = ""
25
26 PR = "r21"
27
28 do_configure() {
29         ln -sf ${HOSTPERL} ${STAGING_BINDIR_NATIVE}/hostperl
30         cp ${HOSTPERL} hostperl
31         cd Cross
32         rm -f Makefile.SH.patch
33         cp ${WORKDIR}/Makefile.SH.patch .
34         cp ${WORKDIR}/config.sh-mipsel-linux .
35         cp ${WORKDIR}/config.sh-i386-linux .
36         cp ${WORKDIR}/config.sh-i486-linux .
37         cp ${WORKDIR}/config.sh-i586-linux .
38         cp ${WORKDIR}/config.sh-i686-linux .
39         cp ${WORKDIR}/config.sh-x86_64-linux .
40         cp ${WORKDIR}/config.sh-armeb-linux .
41         cp ${WORKDIR}/config.sh-sh3-linux .
42         cp ${WORKDIR}/config.sh-sh4-linux .
43         #perl insists on an extra config.sh for arm EABI
44         cp config.sh-arm-linux config.sh-arm-linux-gnueabi 
45         # nslu2 LE uclibc builds do not work with the default config.sh
46         if test "${MACHINE}" = nslu2
47         then
48                 rm -f ./config.sh-arm-linux
49                 cp ${WORKDIR}/config.sh-arm-linux .
50         fi
51         for i in config.sh-*-linux; do
52                 a="`echo $i|sed -e 's,^config.sh-,,; s,-linux$,,'`"
53                 newfile="`echo $i|sed -e 's,-linux$,-linux-uclibc,g'`"
54                 cat $i | sed -e "s,${a}-linux,${a}-linux-uclibc,g; \
55                 s,d_sockatmark='define',d_sockatmark='undef',g;" > $newfile
56         done
57         sed -i -e 's,./install_me_here,${D},g' config.sh-${TARGET_ARCH}-${TARGET_OS}
58         sed -i -e "s%/usr/include/%${STAGING_INCDIR}/%g" config.sh-${TARGET_ARCH}-${TARGET_OS}
59
60         #These are strewn all over the source tree
61         for foo in `grep -I -m1 \/usr\/include\/.*\\.h ${WORKDIR}/* -r | cut -f 1 -d ":"` ; do
62                 echo Fixing: $foo
63                 sed -e "s%/usr/include/%${STAGING_INCDIR}/%g" -i $foo
64         done
65         rm -f config
66         echo "ARCH = ${TARGET_ARCH}" > config
67         echo "OS = ${TARGET_OS}" >> config
68         oe_runmake patch
69 }
70
71 do_install_append() {
72         ln -s libperl.so.${PV} ${D}/${libdir}/libperl.so.5
73         sed -i -e "s,${D},,g" ${D}/${libdir}/perl5/${PV}/${TARGET_ARCH}-${TARGET_OS}/Config_heavy.pl
74 }
75
76 # Create a perl-modules package recommending all the other perl
77 # packages (actually the non modules packages and not created too)
78 ALLOW_EMPTY_perl-modules = "1"
79 PACKAGES_append = " perl-modules"
80 RRECOMMENDS_perl-modules = "${PACKAGES}"
81 RPROVIDES_perl-lib = "perl-lib"
82
83
84 require perl-rdepends_${PV}.inc
85
86 # To create/update the perl-rdepends_${PV}.inc use this piece of ugly script (modified for your arch/paths etc):
87 # daka@DaKa2:/home/slug/slugos/tmp/work/perl-5.8.7-r14/install$ egrep -r "use|require" * | grep ";$" | egrep ".pm:use |.pm:require " | grep -v v5.6.0 | grep -v 5.00 | grep -v \$module | sed -e "s, \+, ,g" | cut -f1,2 -d" " | sed -e "s,;, ,g" | sed -e "s,(), ,g" | sed -e "s,::,-,g" | sort | uniq | tr [:upper:] [:lower:] | sed -e "s,/[^ ]\+ , += \"perl-module-,g" | sed -e "s, \?$, \",g" | sed -e "s,_,-,g" | sed -e "s,^,RDEPENDS_,g" | sed -e "s,armeb-linux,\$\{TARGET_ARCH\}-\$\{TARGET_OS\},g" | egrep -v "perl-module-5|perl-module-tk|perl-module-mac-internetconfig|perl-module-ndbm-file|perl-module-html-treebuilder|perl-module-lwp-simple|perl-module-vms-filespec|perl-module-fcgi|perl-module-vms-stdio|perl-module-mac-buildtools" > /home/slug/openembedded/packages/perl/perl-rdepends_5.8.7.inc
88
89 # Some additional dependencies that the above doesn't manage to figure out
90 DEPENDS_perl-module-math-bigint += "perl-module-math-bigint-calc "
91 DEPENDS_perl-module-math-bigint-calc += "perl-module-integer "
92
93 # Some packages changed names in 5.8.7-r14, RPROVIDE them
94 RPROVIDES_perl-module-b-asmdata = "perl-module-${TARGET_SYS}-b-asmdata"
95 RPROVIDES_perl-module-b-assembler = "perl-module-${TARGET_SYS}-b-assembler"
96 RPROVIDES_perl-module-b-bblock = "perl-module-${TARGET_SYS}-b-bblock"
97 RPROVIDES_perl-module-b-bytecode = "perl-module-${TARGET_SYS}-b-bytecode"
98 RPROVIDES_perl-module-b-cc = "perl-module-${TARGET_SYS}-b-cc"
99 RPROVIDES_perl-module-b-concise = "perl-module-${TARGET_SYS}-b-concise"
100 RPROVIDES_perl-module-b-debug = "perl-module-${TARGET_SYS}-b-debug"
101 RPROVIDES_perl-module-b-deparse = "perl-module-${TARGET_SYS}-b-deparse"
102 RPROVIDES_perl-module-b-disassembler = "perl-module-${TARGET_SYS}-b-disassembler"
103 RPROVIDES_perl-module-b-lint = "perl-module-${TARGET_SYS}-b-lint"
104 RPROVIDES_perl-module-b-showlex = "perl-module-${TARGET_SYS}-b-showlex"
105 RPROVIDES_perl-module-b-stackobj = "perl-module-${TARGET_SYS}-b-stackobj"
106 RPROVIDES_perl-module-b-stash = "perl-module-${TARGET_SYS}-b-stash"
107 RPROVIDES_perl-module-b-terse = "perl-module-${TARGET_SYS}-b-terse"
108 RPROVIDES_perl-module-b-xref = "perl-module-${TARGET_SYS}-b-xref"
109 RPROVIDES_perl-module-config = "perl-module-${TARGET_SYS}-config"
110 RPROVIDES_perl-module-config-heavy = "perl-module-${TARGET_SYS}-config-heavy"
111 RPROVIDES_perl-module-encode-alias = "perl-module-${TARGET_SYS}-encode-alias"
112 RPROVIDES_perl-module-encode-cjkconstants = "perl-module-${TARGET_SYS}-encode-cjkconstants"
113 RPROVIDES_perl-module-encode-config = "perl-module-${TARGET_SYS}-encode-config"
114 RPROVIDES_perl-module-encode-encoder = "perl-module-${TARGET_SYS}-encode-encoder"
115 RPROVIDES_perl-module-encode-encoding = "perl-module-${TARGET_SYS}-encode-encoding"
116 RPROVIDES_perl-module-encode-guess = "perl-module-${TARGET_SYS}-encode-guess"
117 RPROVIDES_perl-module-encoding = "perl-module-${TARGET_SYS}-encoding"
118 RPROVIDES_perl-module-errno = "perl-module-${TARGET_SYS}-errno"
119 RPROVIDES_perl-module-io-dir = "perl-module-${TARGET_SYS}-io-dir"
120 RPROVIDES_perl-module-io-file = "perl-module-${TARGET_SYS}-io-file"
121 RPROVIDES_perl-module-io-handle = "perl-module-${TARGET_SYS}-io-handle"
122 RPROVIDES_perl-module-io-pipe = "perl-module-${TARGET_SYS}-io-pipe"
123 RPROVIDES_perl-module-io-poll = "perl-module-${TARGET_SYS}-io-poll"
124 RPROVIDES_perl-module-io-seekable = "perl-module-${TARGET_SYS}-io-seekable"
125 RPROVIDES_perl-module-io-select = "perl-module-${TARGET_SYS}-io-select"
126 RPROVIDES_perl-module-io-socket = "perl-module-${TARGET_SYS}-io-socket"
127 RPROVIDES_perl-module-ipc-msg = "perl-module-${TARGET_SYS}-ipc-msg"
128 RPROVIDES_perl-module-ipc-semaphore = "perl-module-${TARGET_SYS}-ipc-semaphore"
129 RPROVIDES_perl-module-lib = "perl-module-${TARGET_SYS}-lib"
130 RPROVIDES_perl-module-mime-quotedprint = "perl-module-${TARGET_SYS}-mime-quotedprint"
131 RPROVIDES_perl-module-o = "perl-module-${TARGET_SYS}-o"
132 RPROVIDES_perl-module-ops = "perl-module-${TARGET_SYS}-ops"
133 RPROVIDES_perl-module-safe = "perl-module-${TARGET_SYS}-safe"
134 RPROVIDES_perl-module-xsloader = "perl-module-${TARGET_SYS}-xsloader"