You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

185 lines
6.9 KiB

  1. #
  2. # Copyright (C) 2006-2016 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=perl
  9. PKG_VERSION:=5.22.1
  10. PKG_RELEASE:=4
  11. PKG_SOURCE_URL:=ftp://ftp.cpan.org/pub/CPAN/src/5.0 \
  12. http://www.cpan.org/src/5.0 \
  13. ftp://ftp.mpi-sb.mpg.de/pub/perl/CPAN/src/5.0 \
  14. http://ftp.mpi-sb.mpg.de/pub/perl/CPAN/src/5.0 \
  15. ftp://ftp.gmd.de/mirrors/CPAN/src/5.0 \
  16. http://ftp5.gwdg.de/pub/languages/perl/CPAN/src/ \
  17. ftp://ftp.funet.fi/pub/languages/perl/CPAN/src/5.0 \
  18. http://ftp.funet.fi/pub/languages/perl/CPAN/src/5.0
  19. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  20. PKG_MD5SUM:=19295bbb775a3c36123161b9bf4892f1
  21. PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
  22. PKG_LICENSE_FILES:=Copying Artistic README
  23. PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>, \
  24. Philip Prindeville <philipp@redfish-solutions.com>
  25. # Build settings
  26. PKG_BUILD_DIR:=$(BUILD_DIR)/perl/$(PKG_NAME)-$(PKG_VERSION)
  27. HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/perl/$(PKG_NAME)-$(PKG_VERSION)
  28. PKG_INSTALL:=1
  29. PKG_BUILD_DEPENDS:=perl/host
  30. PKG_BUILD_PARALLEL:=1
  31. HOST_BUILD_PARALLEL:=1
  32. # Variables used during configuration/build
  33. HOST_PERL_PREFIX:=$(STAGING_DIR_HOSTPKG)/usr
  34. # Filter -g3, it will break Compress-Raw-Zlib
  35. TARGET_CFLAGS_PERL:=$(patsubst -g3,-g,$(TARGET_CFLAGS))
  36. TARGET_CPPFLAGS_PERL:=$(patsubst -g3,-g,$(TARGET_CPPFLAGS))
  37. # A list of disabled tests
  38. # ExtUtils tests are disabled for now as we don't support building
  39. # native extensions on the target machine at the moment
  40. PERL_DISABLEDTESTS:=cpan/ExtUtils-Constant cpan/ExtUtils-MakeMaker
  41. # We're on Linux, so don't even package them
  42. PERL_DISABLEDTESTS+=cpan/Win32API-File cpan/Win32 ext/VMS-DCLsym ext/VMS-Filespec ext/VMS-Stdio ext/Win32CORE os2/
  43. # NDBM and ODBM not supported
  44. PERL_DISABLEDTESTS+=ext/NDBM_File ext/ODBM_File
  45. include $(INCLUDE_DIR)/package.mk
  46. include $(INCLUDE_DIR)/host-build.mk
  47. include perlmod.mk
  48. define Package/perl
  49. SUBMENU:=Perl
  50. SECTION:=lang
  51. CATEGORY:=Languages
  52. TITLE:=The Perl intepreter
  53. URL:=http://www.perl.com/
  54. DEPENDS:=+USE_GLIBC:libbsd +PERL_THREADS:libpthread
  55. endef
  56. define Package/perl/description
  57. Perl is a stable, cross platform programming language.
  58. It is used for mission critical projects in the public and private sectors
  59. and is widely used to program web applications of all needs.
  60. endef
  61. define Package/perl/config
  62. source "$(SOURCE)/Config.in"
  63. endef
  64. # Static host perl
  65. define Host/Configure
  66. ( cd $(HOST_BUILD_DIR); ./Configure -der -Uusedl -Duserelocatableinc -Dprefix=$(HOST_PERL_PREFIX) $(if $(CONFIG_PERL_THREADS),-Dusethreads,))
  67. endef
  68. define Host/Install
  69. ( cd $(HOST_BUILD_DIR); ./miniperl installperl )
  70. $(INSTALL_DIR) $(HOST_PERL_PREFIX)/bin/
  71. $(CP) $(HOST_BUILD_DIR)/generate_uudmap $(HOST_PERL_PREFIX)/bin/
  72. # Link any possibly installed static extension in
  73. $(MAKE) -C $(HOST_BUILD_DIR)/relink clean || true
  74. ( cd $(HOST_BUILD_DIR)/relink && $(HOST_PERL_PREFIX)/bin/perl Makefile.PL )
  75. $(call perlmod/host/relink,$(HOST_BUILD_DIR)/relink)
  76. endef
  77. # Target perl
  78. define Build/Configure
  79. $(PERL_CMD) files/perlconfig.pl -Dowrt:target_cc='$(TARGET_CC)' \
  80. -Dowrt:gccversion=$(CONFIG_GCC_VERSION) \
  81. -Dowrt:target_cross='$(TARGET_CROSS)' \
  82. -Dowrt:cflags='$(TARGET_CFLAGS_PERL) $(TARGET_CPPFLAGS_PERL)' \
  83. -Dowrt:ldflags='-rdynamic $(TARGET_LDFLAGS)' \
  84. -Dowrt:libc=$(subst uClibc,uclibc,$(CONFIG_LIBC)) \
  85. -Dowrt:ipv6=$(if $($(CONFIG_IPV6)),define,undef) \
  86. -Dowrt:threads=$(if $(CONFIG_PERL_THREADS),yes,no) \
  87. -Dowrt:staging_dir='$(STAGING_DIR)' \
  88. -Dowrt:host_perl_prefix='$(HOST_PERL_PREFIX)' \
  89. files/version.config \
  90. files/base.config \
  91. files/$(patsubst i386,i486,$(ARCH)).config \
  92. files/architecture.config \
  93. files/signal.config \
  94. files/threads.config \
  95. files/libc.config \
  96. files/misc.config \
  97. > $(PKG_BUILD_DIR)/config.sh
  98. (cd $(PKG_BUILD_DIR) && ./Configure -S)
  99. install -m 0644 $(PKG_BUILD_DIR)/config.h $(PKG_BUILD_DIR)/xconfig.h
  100. endef
  101. define Build/Compile
  102. +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)
  103. endef
  104. define Build/InstallDev
  105. $(INSTALL_DIR) $(1)/usr/lib/perl5/$(PERL_VERSION)
  106. $(CP) $(PKG_INSTALL_DIR)/usr/lib/perl5/$(PERL_VERSION) $(1)/usr/lib/perl5/
  107. endef
  108. define Package/perl/install
  109. $(INSTALL_DIR) $(1)/usr/bin
  110. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/perl$(PKG_VERSION) $(1)/usr/bin
  111. ln -nsf perl$(PKG_VERSION) $(1)/usr/bin/perl
  112. $(INSTALL_DIR) $(1)/usr/lib/perl5/$(PERL_VERSION)/CORE
  113. $(CP) $(PKG_INSTALL_DIR)/usr/lib/perl5/$(PERL_VERSION)/CORE/libperl.so $(1)/usr/lib/perl5/$(PERL_VERSION)/CORE/
  114. endef
  115. $(eval $(call RequireCommand,rsync, \
  116. $(PKG_NAME) requires rsync installed on the host-system. \
  117. ))
  118. $(eval $(call BuildPackage,perl))
  119. $(eval $(call HostBuild))
  120. -include perlbase.mk
  121. # A helper package that includes all sort of supplementary files for tests
  122. define Package/perl-tests-common
  123. $(call Package/perlbase-template)
  124. TITLE:=Common test support files
  125. DEPENDS:=@PERL_TESTS
  126. endef
  127. define Package/perl-tests-common/install
  128. $(INSTALL_DIR) $(1)/$(PERL_TESTSDIR)
  129. $(INSTALL_DIR) $(1)/$(PERL_TESTSDIR)/Porting
  130. $(INSTALL_DIR) $(1)/$(PERL_TESTSDIR)/regen
  131. $(INSTALL_DIR) $(1)/$(PERL_TESTSDIR)/lib
  132. $(INSTALL_DIR) $(1)/usr/lib/perl5/$(PERL_VERSION)/XS
  133. $(INSTALL_DIR) $(1)/usr/lib/perl5/$(PERL_VERSION)/auto/XS
  134. $(INSTALL_DIR) $(1)/usr/lib/perl5/$(PERL_VERSION)/unicore
  135. $(CP) $(PKG_BUILD_DIR)/t $(1)/$(PERL_TESTSDIR)
  136. $(CP) $(PKG_BUILD_DIR)/Porting $(1)/$(PERL_TESTSDIR)
  137. $(CP) $(PKG_BUILD_DIR)/regen $(1)/$(PERL_TESTSDIR)
  138. $(CP) $(PKG_BUILD_DIR)/MANIFEST $(1)/$(PERL_TESTSDIR)
  139. $(CP) $(PKG_BUILD_DIR)/TestInit.pm $(1)/$(PERL_TESTSDIR)
  140. $(CP) $(PKG_BUILD_DIR)/vutil.c $(1)/$(PERL_TESTSDIR)
  141. $(CP) $(PKG_BUILD_DIR)/vxs.inc $(1)/$(PERL_TESTSDIR)
  142. $(CP) $(PKG_BUILD_DIR)/lib/XS $(1)/usr/lib/perl5/$(PERL_VERSION)/
  143. $(CP) $(PKG_BUILD_DIR)/lib/auto/XS $(1)/usr/lib/perl5/$(PERL_VERSION)/auto
  144. $(CP) $(PKG_BUILD_DIR)/lib/vmsish.pm $(1)/usr/lib/perl5/$(PERL_VERSION)/
  145. $(CP) $(PKG_BUILD_DIR)/lib/vmsish.t $(1)/$(PERL_TESTSDIR)/lib
  146. $(CP) $(PKG_BUILD_DIR)/lib/Internals.t $(1)/$(PERL_TESTSDIR)/lib
  147. $(CP) $(PKG_BUILD_DIR)/lib/unicore/TestProp.pl $(1)/usr/lib/perl5/$(PERL_VERSION)/unicore
  148. $(CP) files/perl-run_tests.sh $(1)/$(PERL_TESTSDIR)/run_tests.sh
  149. sed \
  150. -e 's!%%PERL_DISABLEDTESTS%%!$(PERL_DISABLEDTESTS)!' \
  151. -e 's!%%PERL_VERSION%%!$(PERL_VERSION)!' \
  152. -i $(1)/$(PERL_TESTSDIR)/run_tests.sh
  153. $(CP) $(PKG_BUILD_DIR)/config_h.SH $(1)/$(PERL_TESTSDIR)
  154. $(CP) $(PKG_BUILD_DIR)/perl.h $(1)/$(PERL_TESTSDIR)
  155. endef
  156. $(eval $(call BuildPackage,perl-tests-common))