2 # Copyright (C) 2006-2018 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR
)/rules.mk
13 PKG_VERSION
:=$(PERL_VERSION
)
17 https
://cpan.metacpan.org
/src
/5.0 \
18 https
://cpan.uib.no
/src
/5.0 \
19 https
://mirrors.rit.edu
/CPAN
/src
/5.0 \
20 https
://mirror.transip.net
/CPAN
/src
/5.0 \
21 https
://mirrors.sonic.net
/cpan
/src
/5.0 \
22 https
://www.cpan.org
/src
/5.0
23 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.xz
24 PKG_HASH
:=fea7162d4cca940a387f0587b93f6737d884bf74d8a9d7cfd978bc12cd0b202d
26 PKG_LICENSE
:=GPL-1.0
-or-later Artistic-1.0
-Perl
27 PKG_LICENSE_FILES
:=Copying Artistic README
28 PKG_MAINTAINER
:=Marcel Denia
<naoir@gmx.net
>, \
29 Philip Prindeville
<philipp@redfish-solutions.com
>
32 PKG_BUILD_DIR
:=$(BUILD_DIR
)/perl
/$(PKG_NAME
)-$(PKG_VERSION
)
33 HOST_BUILD_DIR
:=$(BUILD_DIR_HOST
)/perl
/$(PKG_NAME
)-$(PKG_VERSION
)
35 PKG_BUILD_DEPENDS
:=perl
/host
37 HOST_BUILD_PARALLEL
:=1
39 # Variables used during configuration/build
40 HOST_PERL_PREFIX
:=$(STAGING_DIR_HOSTPKG
)/usr
42 # Filter -g3, it will break Compress-Raw-Zlib
43 TARGET_CFLAGS_PERL
:=$(patsubst -g3
,-g
,$(TARGET_CFLAGS
))
44 TARGET_CPPFLAGS_PERL
:=$(patsubst -g3
,-g
,$(TARGET_CPPFLAGS
))
46 # A list of disabled tests
47 # ExtUtils tests are disabled for now as we don't support building
48 # native extensions on the target machine at the moment
49 PERL_DISABLEDTESTS
:=cpan
/ExtUtils-Constant cpan
/ExtUtils-MakeMaker
50 # We're on Linux, so don't even package them
51 PERL_DISABLEDTESTS
+=cpan
/Win32API-File cpan
/Win32 ext
/VMS-DCLsym ext
/VMS-Filespec ext
/VMS-Stdio ext
/Win32CORE os2
/
52 # NDBM and ODBM not supported
53 PERL_DISABLEDTESTS
+=ext
/NDBM_File ext
/ODBM_File
56 include $(INCLUDE_DIR
)/package.mk
57 include $(INCLUDE_DIR
)/host-build.mk
64 TITLE
:=The Perl intepreter
65 URL
:=http
://www.perl.com
/
66 DEPENDS
:=+USE_GLIBC
:libbsd
+PERL_THREADS
:libpthread @
!arc
69 define Package
/perl
/description
70 Perl is a stable
, cross platform programming language.
71 It is used for mission critical projects in the public and private sectors
72 and is widely used to program web applications of
all needs.
75 define Package
/perl
/config
76 source
"$(SOURCE)/Config.in"
81 ( cd
$(HOST_BUILD_DIR
); .
/Configure
-der
-Uusedl
-Duserelocatableinc
-Dprefix
=$(HOST_PERL_PREFIX
) $(if
$(CONFIG_PERL_THREADS
),-Dusethreads
,))
85 ( cd
$(HOST_BUILD_DIR
); .
/miniperl installperl
)
86 $(INSTALL_DIR
) $(HOST_PERL_PREFIX
)/bin
/
87 $(CP
) $(HOST_BUILD_DIR
)/generate_uudmap
$(HOST_PERL_PREFIX
)/bin
/
89 # Link any possibly installed static extension in
90 $(MAKE
) -C
$(HOST_BUILD_DIR
)/relink
clean || true
91 ( cd
$(HOST_BUILD_DIR
)/relink
&& $(HOST_PERL_PREFIX
)/bin
/perl Makefile.PL
)
92 $(call perlmod
/host
/relink
,$(HOST_BUILD_DIR
)/relink
)
96 define Build
/Configure
97 $(PERL_CMD
) files
/perlconfig.pl
-Dowrt
:target_cc
='$(TARGET_CC)' \
98 -Dowrt
:gccversion
=$(CONFIG_GCC_VERSION
) \
99 -Dowrt
:target_cross
='$(TARGET_CROSS)' \
100 -Dowrt
:cflags='$(TARGET_CFLAGS_PERL) $(TARGET_CPPFLAGS_PERL)' \
101 -Dowrt
:ldflags='$(TARGET_LDFLAGS)' \
102 -Dowrt
:libc
=$(subst uClibc
,uclibc
,$(CONFIG_LIBC
)) \
103 -Dowrt
:ipv6
=$(if
$($(CONFIG_IPV6
)),define,undef
) \
104 -Dowrt
:threads
=$(if
$(CONFIG_PERL_THREADS
),yes
,no
) \
105 -Dowrt
:staging_dir
='$(STAGING_DIR)' \
106 -Dowrt
:host_perl_prefix
='$(HOST_PERL_PREFIX)' \
107 files
/version.config \
109 files
/$(patsubst i386
,i486
,$(ARCH
)).config \
110 files
/architecture.config \
111 files
/signal.config \
112 files
/threads.config \
115 > $(PKG_BUILD_DIR
)/config.sh
116 (cd
$(PKG_BUILD_DIR
) && .
/Configure
-S
)
117 install -m
0644 $(PKG_BUILD_DIR
)/config.h
$(PKG_BUILD_DIR
)/xconfig.h
121 +$(MAKE
) $(PKG_JOBS
) -C
$(PKG_BUILD_DIR
)
124 define Build
/InstallDev
125 $(INSTALL_DIR
) $(1)/usr
/lib
/perl5
/$(PERL_VERSION
)
126 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/perl5
/$(PERL_VERSION
) $(1)/usr
/lib
/perl5
/
129 define Package
/perl
/install
130 $(INSTALL_DIR
) $(1)/usr
/bin
131 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/perl
$(PKG_VERSION
) $(1)/usr
/bin
132 ln
-nsf perl
$(PKG_VERSION
) $(1)/usr
/bin
/perl
134 $(INSTALL_DIR
) $(1)/usr
/lib
/perl5
/$(PERL_VERSION
)/CORE
135 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/perl5
/$(PERL_VERSION
)/CORE
/libperl.so
$(1)/usr
/lib
/perl5
/$(PERL_VERSION
)/CORE
/
139 $(eval
$(call RequireCommand
,rsync
, \
140 $(PKG_NAME
) requires rsync installed on the host-system. \
143 $(eval
$(call BuildPackage
,perl
))
144 $(eval
$(call HostBuild
))
148 # A helper package that includes all sort of supplementary files for tests
149 define Package
/perl-tests-common
150 $(call Package
/perlbase-template
)
151 TITLE
:=Common
test support files
155 define Package
/perl-tests-common
/install
156 $(INSTALL_DIR
) $(1)/$(PERL_TESTSDIR
)
157 $(INSTALL_DIR
) $(1)/$(PERL_TESTSDIR
)/Porting
158 $(INSTALL_DIR
) $(1)/$(PERL_TESTSDIR
)/regen
159 $(INSTALL_DIR
) $(1)/$(PERL_TESTSDIR
)/lib
160 $(INSTALL_DIR
) $(1)/usr
/lib
/perl5
/$(PERL_VERSION
)/XS
161 $(INSTALL_DIR
) $(1)/usr
/lib
/perl5
/$(PERL_VERSION
)/auto
/XS
162 $(INSTALL_DIR
) $(1)/usr
/lib
/perl5
/$(PERL_VERSION
)/unicore
164 $(CP
) $(PKG_BUILD_DIR
)/t
$(1)/$(PERL_TESTSDIR
)
165 $(CP
) $(PKG_BUILD_DIR
)/Porting
$(1)/$(PERL_TESTSDIR
)
166 $(CP
) $(PKG_BUILD_DIR
)/regen
$(1)/$(PERL_TESTSDIR
)
167 $(CP
) $(PKG_BUILD_DIR
)/MANIFEST
$(1)/$(PERL_TESTSDIR
)
168 $(CP
) $(PKG_BUILD_DIR
)/TestInit.pm
$(1)/$(PERL_TESTSDIR
)
169 $(CP
) $(PKG_BUILD_DIR
)/vutil.c
$(1)/$(PERL_TESTSDIR
)
170 $(CP
) $(PKG_BUILD_DIR
)/vxs.inc
$(1)/$(PERL_TESTSDIR
)
171 $(CP
) $(PKG_BUILD_DIR
)/lib
/XS
$(1)/usr
/lib
/perl5
/$(PERL_VERSION
)/
172 $(CP
) $(PKG_BUILD_DIR
)/lib
/auto
/XS
$(1)/usr
/lib
/perl5
/$(PERL_VERSION
)/auto
173 $(CP
) $(PKG_BUILD_DIR
)/lib
/vmsish.pm
$(1)/usr
/lib
/perl5
/$(PERL_VERSION
)/
174 $(CP
) $(PKG_BUILD_DIR
)/lib
/vmsish.t
$(1)/$(PERL_TESTSDIR
)/lib
175 $(CP
) $(PKG_BUILD_DIR
)/lib
/Internals.t
$(1)/$(PERL_TESTSDIR
)/lib
176 $(CP
) $(PKG_BUILD_DIR
)/lib
/unicore
/TestProp.pl
$(1)/usr
/lib
/perl5
/$(PERL_VERSION
)/unicore
177 $(CP
) files
/perl-run_tests.sh
$(1)/$(PERL_TESTSDIR
)/run_tests.sh
179 -e
's!%%PERL_DISABLEDTESTS%%!$(PERL_DISABLEDTESTS)!' \
180 -e
's!%%PERL_VERSION%%!$(PERL_VERSION)!' \
181 -i
$(1)/$(PERL_TESTSDIR
)/run_tests.sh
182 $(CP
) $(PKG_BUILD_DIR
)/config_h.SH
$(1)/$(PERL_TESTSDIR
)
183 $(CP
) $(PKG_BUILD_DIR
)/perl.h
$(1)/$(PERL_TESTSDIR
)
186 $(eval
$(call BuildPackage
,perl-tests-common
))