summaryrefslogtreecommitdiff
path: root/package/perl/Makefile
blob: a2c465cbce819139dcf1116bbbf9b8e54e5c78bf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# This file is part of the OpenADK project. OpenADK is copyrighted
# material, please see the LICENCE file in the top-level directory.

include ${ADK_TOPDIR}/rules.mk

PKG_NAME:=		perl
PKG_VERSION:=		5.22.1
PKG_RELEASE:=		1
PKG_HASH:=		2b475d0849d54c4250e9cba4241b7b7291cffb45dfd083b677ca7b5d38118f27
PKG_DESCR:=		perl interpreter
PKG_SECTION:=		dev/lang
PKG_NEEDS:=		threads rt
PKG_URL:=		http://www.perl.org/
PKG_SITES:=		http://www.cpan.org/src/
PKG_NOPARALLEL:=	1

PC_VERSION:=		1.0.2
PC_SITE:=		https://github.com/arsv/perl-cross/releases/download/$(PC_VERSION)

DISTFILES:=		${PKG_NAME}-${PKG_VERSION}.tar.gz

include ${ADK_TOPDIR}/mk/host.mk
include ${ADK_TOPDIR}/mk/package.mk

$(eval $(call HOST_template,PERL,perl,${PKG_VERSION}-${PKG_RELEASE}))
$(eval $(call PKG_template,PERL,perl,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))

HOST_STYLE:=		manual
CONFIG_STYLE:=		minimal
CONFIGURE_ARGS:=	--target=$(GNU_TARGET_NAME) \
			--target-tools-prefix=$(TARGET_CROSS) \
			--prefix=/usr \
			-Dld="$(TARGET_CC)" \
			-Dccflags="$(TARGET_CFLAGS)" \
			-Dldflags="$(TARGET_LDFLAGS) -lm" \
			-Dmydomain="" \
			-Dmyuname="OpenADK" \
			-Dosname=linux \
			-Dosvers=4.0 \
			-Dperladmin=root

host-configure:
	(cd ${WRKBUILD}; ${BASH} ./Configure -des -Duseperlio -Dprefix=${STAGING_HOST_DIR}/usr)

perl-hostinstall:
	(cd ${WRKBUILD} && env CC_FOR_BUILD="gcc" ${HOST_MAKE_ENV} ${MAKE} -f ${MAKE_FILE} \
		${HOST_MAKE_FLAGS} ${HOST_INSTALL_TARGET}) 
	mv ${STAGING_HOST_DIR}/usr/bin/perl ${STAGING_HOST_DIR}/usr/bin/perl-host

pre-configure:
	(if [ ! -f $(DL_DIR)/perl-$(PKG_VERSION)-cross-$(PC_VERSION).tar.gz ]; then \
		cd $(DL_DIR); wget $(PC_SITE)/perl-$(PKG_VERSION)-cross-$(PC_VERSION).tar.gz; \
	fi)
	(cd $(WRKSRC); tar --strip-components=1 -xf $(DL_DIR)/perl-$(PKG_VERSION)-cross-$(PC_VERSION).tar.gz)

perl-install:
	${INSTALL_DIR} ${IDIR_PERL}/usr/bin
	${INSTALL_DIR} ${IDIR_PERL}/usr/lib/perl5/${PKG_VERSION}
	${CP} ${WRKINST}/usr/lib/perl5/${PKG_VERSION}/* \
		${IDIR_PERL}/usr/lib/perl5/${PKG_VERSION}
	${INSTALL_BIN} ${WRKINST}/usr/bin/perl ${IDIR_PERL}/usr/bin/
	touch $(IDIR_PERL)/usr/lib/perl5/$(PKG_VERSION)/$(ADK_TARGET_ARCH)-linux/CORE/patchlevel-debian.h
	rm -rf $(IDIR_PERL)/usr/lib/perl5/pod
	find $(IDIR_PERL)/usr/lib/perl5/ -name 'extralibs.ld' -print0 | xargs -0 rm -f
	find $(IDIR_PERL)/usr/lib/perl5/ -name '*.bs' -print0 | xargs -0 rm -f
	find $(IDIR_PERL)/usr/lib/perl5/ -name '.packlist' -print0 | xargs -0 rm -f

include ${ADK_TOPDIR}/mk/host-bottom.mk
include ${ADK_TOPDIR}/mk/pkg-bottom.mk