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.

183 lines
6.8 KiB

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