2014-07-04 03:18:57 +00:00
|
|
|
#
|
2018-08-07 22:00:19 +00:00
|
|
|
# Copyright (C) 2006-2018 OpenWrt.org
|
2014-07-04 03:18:57 +00:00
|
|
|
#
|
|
|
|
# This is free software, licensed under the GNU General Public License v2.
|
|
|
|
# See /LICENSE for more information.
|
|
|
|
#
|
|
|
|
|
|
|
|
include $(TOPDIR)/rules.mk
|
|
|
|
|
2018-08-07 22:00:19 +00:00
|
|
|
include perlver.mk
|
|
|
|
|
2014-07-04 03:18:57 +00:00
|
|
|
PKG_NAME:=perl
|
2018-08-07 22:00:19 +00:00
|
|
|
PKG_VERSION:=$(PERL_VERSION)
|
2023-05-21 14:11:06 +00:00
|
|
|
PKG_RELEASE:=9
|
2014-07-04 03:18:57 +00:00
|
|
|
|
2017-05-03 19:26:08 +00:00
|
|
|
PKG_SOURCE_URL:=\
|
|
|
|
https://cpan.metacpan.org/src/5.0 \
|
|
|
|
https://cpan.uib.no/src/5.0 \
|
|
|
|
https://mirrors.rit.edu/CPAN/src/5.0 \
|
|
|
|
https://mirror.transip.net/CPAN/src/5.0 \
|
|
|
|
https://mirrors.sonic.net/cpan/src/5.0 \
|
|
|
|
https://www.cpan.org/src/5.0
|
|
|
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
2018-12-02 19:44:42 +00:00
|
|
|
PKG_HASH:=fea7162d4cca940a387f0587b93f6737d884bf74d8a9d7cfd978bc12cd0b202d
|
2014-07-04 03:18:57 +00:00
|
|
|
|
2019-09-02 13:15:08 +00:00
|
|
|
PKG_LICENSE:=GPL-1.0-or-later Artistic-1.0-Perl
|
2014-07-07 22:44:58 +00:00
|
|
|
PKG_LICENSE_FILES:=Copying Artistic README
|
2017-01-03 05:55:17 +00:00
|
|
|
PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>, \
|
|
|
|
Philip Prindeville <philipp@redfish-solutions.com>
|
2019-09-12 12:13:21 +00:00
|
|
|
PKG_CPE_ID:=cpe:/a:perl:perl
|
2014-07-04 03:18:57 +00:00
|
|
|
|
2014-07-19 04:00:58 +00:00
|
|
|
# Build settings
|
2014-07-04 03:18:57 +00:00
|
|
|
PKG_BUILD_DIR:=$(BUILD_DIR)/perl/$(PKG_NAME)-$(PKG_VERSION)
|
2014-08-12 01:27:21 +00:00
|
|
|
HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/perl/$(PKG_NAME)-$(PKG_VERSION)
|
2014-07-19 01:13:48 +00:00
|
|
|
PKG_INSTALL:=1
|
|
|
|
PKG_BUILD_DEPENDS:=perl/host
|
|
|
|
PKG_BUILD_PARALLEL:=1
|
|
|
|
HOST_BUILD_PARALLEL:=1
|
2014-07-04 03:18:57 +00:00
|
|
|
|
2014-07-19 04:00:58 +00:00
|
|
|
# Variables used during configuration/build
|
2017-01-10 14:02:50 +00:00
|
|
|
HOST_PERL_PREFIX:=$(STAGING_DIR_HOSTPKG)/usr
|
2015-02-04 12:56:30 +00:00
|
|
|
|
2023-05-17 08:18:57 +00:00
|
|
|
ifneq ($(CONFIG_USE_MUSL),)
|
|
|
|
TARGET_CFLAGS += -D_LARGEFILE64_SOURCE
|
|
|
|
endif
|
|
|
|
|
2014-07-21 01:16:27 +00:00
|
|
|
# Filter -g3, it will break Compress-Raw-Zlib
|
|
|
|
TARGET_CFLAGS_PERL:=$(patsubst -g3,-g,$(TARGET_CFLAGS))
|
|
|
|
TARGET_CPPFLAGS_PERL:=$(patsubst -g3,-g,$(TARGET_CPPFLAGS))
|
2014-07-04 03:18:57 +00:00
|
|
|
|
2015-02-04 12:56:30 +00:00
|
|
|
# A list of disabled tests
|
2014-08-19 22:32:13 +00:00
|
|
|
# ExtUtils tests are disabled for now as we don't support building
|
|
|
|
# native extensions on the target machine at the moment
|
|
|
|
PERL_DISABLEDTESTS:=cpan/ExtUtils-Constant cpan/ExtUtils-MakeMaker
|
2015-02-04 12:56:30 +00:00
|
|
|
# We're on Linux, so don't even package them
|
2015-07-01 13:46:17 +00:00
|
|
|
PERL_DISABLEDTESTS+=cpan/Win32API-File cpan/Win32 ext/VMS-DCLsym ext/VMS-Filespec ext/VMS-Stdio ext/Win32CORE os2/
|
2014-08-19 22:32:13 +00:00
|
|
|
# NDBM and ODBM not supported
|
|
|
|
PERL_DISABLEDTESTS+=ext/NDBM_File ext/ODBM_File
|
|
|
|
|
2014-08-19 22:31:31 +00:00
|
|
|
|
2014-07-19 04:00:58 +00:00
|
|
|
include $(INCLUDE_DIR)/package.mk
|
|
|
|
include $(INCLUDE_DIR)/host-build.mk
|
2014-08-11 00:18:16 +00:00
|
|
|
include perlmod.mk
|
2014-07-19 04:00:58 +00:00
|
|
|
|
2014-07-19 01:13:48 +00:00
|
|
|
define Package/perl
|
2014-07-04 03:18:57 +00:00
|
|
|
SUBMENU:=Perl
|
|
|
|
SECTION:=lang
|
|
|
|
CATEGORY:=Languages
|
|
|
|
TITLE:=The Perl intepreter
|
|
|
|
URL:=http://www.perl.com/
|
2019-06-02 22:49:58 +00:00
|
|
|
DEPENDS:=+USE_GLIBC:libbsd +PERL_THREADS:libpthread @!arc
|
2014-07-04 03:18:57 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/perl/description
|
2014-07-05 09:06:51 +00:00
|
|
|
Perl is a stable, cross platform programming language.
|
|
|
|
It is used for mission critical projects in the public and private sectors
|
|
|
|
and is widely used to program web applications of all needs.
|
2014-07-04 03:18:57 +00:00
|
|
|
endef
|
|
|
|
|
2014-08-19 22:31:31 +00:00
|
|
|
define Package/perl/config
|
|
|
|
source "$(SOURCE)/Config.in"
|
|
|
|
endef
|
|
|
|
|
2014-07-19 04:00:58 +00:00
|
|
|
# Static host perl
|
2014-07-19 01:13:48 +00:00
|
|
|
define Host/Configure
|
2015-05-02 14:08:00 +00:00
|
|
|
( cd $(HOST_BUILD_DIR); ./Configure -der -Uusedl -Duserelocatableinc -Dprefix=$(HOST_PERL_PREFIX) $(if $(CONFIG_PERL_THREADS),-Dusethreads,))
|
2014-07-19 01:13:48 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Host/Install
|
|
|
|
( cd $(HOST_BUILD_DIR); ./miniperl installperl )
|
2014-08-31 08:07:27 +00:00
|
|
|
$(INSTALL_DIR) $(HOST_PERL_PREFIX)/bin/
|
2014-07-19 03:59:16 +00:00
|
|
|
$(CP) $(HOST_BUILD_DIR)/generate_uudmap $(HOST_PERL_PREFIX)/bin/
|
2014-08-11 00:18:16 +00:00
|
|
|
|
|
|
|
# Link any possibly installed static extension in
|
|
|
|
$(MAKE) -C $(HOST_BUILD_DIR)/relink clean || true
|
|
|
|
( cd $(HOST_BUILD_DIR)/relink && $(HOST_PERL_PREFIX)/bin/perl Makefile.PL )
|
|
|
|
$(call perlmod/host/relink,$(HOST_BUILD_DIR)/relink)
|
2014-07-19 01:13:48 +00:00
|
|
|
endef
|
|
|
|
|
2014-07-19 04:00:58 +00:00
|
|
|
# Target perl
|
2014-07-19 01:13:48 +00:00
|
|
|
define Build/Configure
|
2015-08-10 03:00:49 +00:00
|
|
|
$(PERL_CMD) files/perlconfig.pl -Dowrt:target_cc='$(TARGET_CC)' \
|
2015-11-29 20:49:24 +00:00
|
|
|
-Dowrt:gccversion=$(CONFIG_GCC_VERSION) \
|
2015-08-10 03:00:49 +00:00
|
|
|
-Dowrt:target_cross='$(TARGET_CROSS)' \
|
|
|
|
-Dowrt:cflags='$(TARGET_CFLAGS_PERL) $(TARGET_CPPFLAGS_PERL)' \
|
2020-06-17 23:36:03 +00:00
|
|
|
-Dowrt:ldflags='$(TARGET_LDFLAGS)' \
|
2015-11-30 00:31:37 +00:00
|
|
|
-Dowrt:libc=$(subst uClibc,uclibc,$(CONFIG_LIBC)) \
|
2015-08-10 03:00:49 +00:00
|
|
|
-Dowrt:ipv6=$(if $($(CONFIG_IPV6)),define,undef) \
|
|
|
|
-Dowrt:threads=$(if $(CONFIG_PERL_THREADS),yes,no) \
|
|
|
|
-Dowrt:staging_dir='$(STAGING_DIR)' \
|
|
|
|
-Dowrt:host_perl_prefix='$(HOST_PERL_PREFIX)' \
|
2019-09-26 12:51:13 +00:00
|
|
|
-Dsysroot='$(TOOLCHAIN_DIR)' \
|
2015-08-10 03:00:49 +00:00
|
|
|
files/version.config \
|
|
|
|
files/base.config \
|
|
|
|
files/$(patsubst i386,i486,$(ARCH)).config \
|
|
|
|
files/architecture.config \
|
|
|
|
files/signal.config \
|
|
|
|
files/threads.config \
|
|
|
|
files/libc.config \
|
|
|
|
files/misc.config \
|
|
|
|
> $(PKG_BUILD_DIR)/config.sh
|
2014-07-04 03:18:57 +00:00
|
|
|
(cd $(PKG_BUILD_DIR) && ./Configure -S)
|
2014-07-19 01:13:48 +00:00
|
|
|
install -m 0644 $(PKG_BUILD_DIR)/config.h $(PKG_BUILD_DIR)/xconfig.h
|
2014-07-04 03:18:57 +00:00
|
|
|
endef
|
|
|
|
|
2014-07-19 01:13:48 +00:00
|
|
|
define Build/Compile
|
|
|
|
+$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)
|
2014-07-04 03:18:57 +00:00
|
|
|
endef
|
|
|
|
|
2020-01-04 04:06:40 +00:00
|
|
|
ifeq ($(CONFIG_arc),)
|
2014-07-22 14:14:57 +00:00
|
|
|
define Build/InstallDev
|
2015-06-09 19:31:26 +00:00
|
|
|
$(INSTALL_DIR) $(1)/usr/lib/perl5/$(PERL_VERSION)
|
|
|
|
$(CP) $(PKG_INSTALL_DIR)/usr/lib/perl5/$(PERL_VERSION) $(1)/usr/lib/perl5/
|
2014-07-22 14:14:57 +00:00
|
|
|
endef
|
2020-01-04 04:06:40 +00:00
|
|
|
endif
|
2014-07-22 14:14:57 +00:00
|
|
|
|
2014-07-04 03:18:57 +00:00
|
|
|
define Package/perl/install
|
|
|
|
$(INSTALL_DIR) $(1)/usr/bin
|
|
|
|
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/perl$(PKG_VERSION) $(1)/usr/bin
|
|
|
|
ln -nsf perl$(PKG_VERSION) $(1)/usr/bin/perl
|
2014-08-02 11:27:40 +00:00
|
|
|
|
2015-06-09 19:31:26 +00:00
|
|
|
$(INSTALL_DIR) $(1)/usr/lib/perl5/$(PERL_VERSION)/CORE
|
|
|
|
$(CP) $(PKG_INSTALL_DIR)/usr/lib/perl5/$(PERL_VERSION)/CORE/libperl.so $(1)/usr/lib/perl5/$(PERL_VERSION)/CORE/
|
2014-07-04 03:18:57 +00:00
|
|
|
endef
|
|
|
|
|
2014-07-19 04:00:58 +00:00
|
|
|
|
2014-07-04 03:18:57 +00:00
|
|
|
$(eval $(call RequireCommand,rsync, \
|
|
|
|
$(PKG_NAME) requires rsync installed on the host-system. \
|
|
|
|
))
|
|
|
|
|
|
|
|
$(eval $(call BuildPackage,perl))
|
2014-07-19 01:13:48 +00:00
|
|
|
$(eval $(call HostBuild))
|
2014-07-04 03:18:57 +00:00
|
|
|
|
|
|
|
-include perlbase.mk
|
2014-08-19 22:31:31 +00:00
|
|
|
|
|
|
|
# A helper package that includes all sort of supplementary files for tests
|
|
|
|
define Package/perl-tests-common
|
|
|
|
$(call Package/perlbase-template)
|
|
|
|
TITLE:=Common test support files
|
|
|
|
DEPENDS:=@PERL_TESTS
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/perl-tests-common/install
|
|
|
|
$(INSTALL_DIR) $(1)/$(PERL_TESTSDIR)
|
|
|
|
$(INSTALL_DIR) $(1)/$(PERL_TESTSDIR)/Porting
|
|
|
|
$(INSTALL_DIR) $(1)/$(PERL_TESTSDIR)/regen
|
2015-07-01 13:47:35 +00:00
|
|
|
$(INSTALL_DIR) $(1)/$(PERL_TESTSDIR)/lib
|
2015-06-09 19:31:26 +00:00
|
|
|
$(INSTALL_DIR) $(1)/usr/lib/perl5/$(PERL_VERSION)/XS
|
|
|
|
$(INSTALL_DIR) $(1)/usr/lib/perl5/$(PERL_VERSION)/auto/XS
|
|
|
|
$(INSTALL_DIR) $(1)/usr/lib/perl5/$(PERL_VERSION)/unicore
|
2014-08-19 22:31:31 +00:00
|
|
|
|
|
|
|
$(CP) $(PKG_BUILD_DIR)/t $(1)/$(PERL_TESTSDIR)
|
|
|
|
$(CP) $(PKG_BUILD_DIR)/Porting $(1)/$(PERL_TESTSDIR)
|
|
|
|
$(CP) $(PKG_BUILD_DIR)/regen $(1)/$(PERL_TESTSDIR)
|
|
|
|
$(CP) $(PKG_BUILD_DIR)/MANIFEST $(1)/$(PERL_TESTSDIR)
|
|
|
|
$(CP) $(PKG_BUILD_DIR)/TestInit.pm $(1)/$(PERL_TESTSDIR)
|
|
|
|
$(CP) $(PKG_BUILD_DIR)/vutil.c $(1)/$(PERL_TESTSDIR)
|
|
|
|
$(CP) $(PKG_BUILD_DIR)/vxs.inc $(1)/$(PERL_TESTSDIR)
|
2015-06-09 19:31:26 +00:00
|
|
|
$(CP) $(PKG_BUILD_DIR)/lib/XS $(1)/usr/lib/perl5/$(PERL_VERSION)/
|
|
|
|
$(CP) $(PKG_BUILD_DIR)/lib/auto/XS $(1)/usr/lib/perl5/$(PERL_VERSION)/auto
|
|
|
|
$(CP) $(PKG_BUILD_DIR)/lib/vmsish.pm $(1)/usr/lib/perl5/$(PERL_VERSION)/
|
2015-07-01 13:47:35 +00:00
|
|
|
$(CP) $(PKG_BUILD_DIR)/lib/vmsish.t $(1)/$(PERL_TESTSDIR)/lib
|
|
|
|
$(CP) $(PKG_BUILD_DIR)/lib/Internals.t $(1)/$(PERL_TESTSDIR)/lib
|
2015-06-09 19:31:26 +00:00
|
|
|
$(CP) $(PKG_BUILD_DIR)/lib/unicore/TestProp.pl $(1)/usr/lib/perl5/$(PERL_VERSION)/unicore
|
2014-08-19 22:31:31 +00:00
|
|
|
$(CP) files/perl-run_tests.sh $(1)/$(PERL_TESTSDIR)/run_tests.sh
|
2015-06-09 19:31:26 +00:00
|
|
|
sed \
|
|
|
|
-e 's!%%PERL_DISABLEDTESTS%%!$(PERL_DISABLEDTESTS)!' \
|
|
|
|
-e 's!%%PERL_VERSION%%!$(PERL_VERSION)!' \
|
|
|
|
-i $(1)/$(PERL_TESTSDIR)/run_tests.sh
|
2014-08-19 22:31:31 +00:00
|
|
|
$(CP) $(PKG_BUILD_DIR)/config_h.SH $(1)/$(PERL_TESTSDIR)
|
|
|
|
$(CP) $(PKG_BUILD_DIR)/perl.h $(1)/$(PERL_TESTSDIR)
|
|
|
|
endef
|
|
|
|
|
|
|
|
$(eval $(call BuildPackage,perl-tests-common))
|