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.

184 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.1
  10. PKG_RELEASE:=1
  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. # 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:gccversion=$(CONFIG_GCC_VERSION) \
  80. -Dowrt:target_cross='$(TARGET_CROSS)' \
  81. -Dowrt:cflags='$(TARGET_CFLAGS_PERL) $(TARGET_CPPFLAGS_PERL)' \
  82. -Dowrt:ldflags='-rdynamic $(TARGET_LDFLAGS)' \
  83. -Dowrt:libc=$(subst uClibc,uclibc,$(CONFIG_LIBC)) \
  84. -Dowrt:ipv6=$(if $($(CONFIG_IPV6)),define,undef) \
  85. -Dowrt:threads=$(if $(CONFIG_PERL_THREADS),yes,no) \
  86. -Dowrt:staging_dir='$(STAGING_DIR)' \
  87. -Dowrt:host_perl_prefix='$(HOST_PERL_PREFIX)' \
  88. files/version.config \
  89. files/base.config \
  90. files/$(patsubst i386,i486,$(ARCH)).config \
  91. files/architecture.config \
  92. files/signal.config \
  93. files/threads.config \
  94. files/libc.config \
  95. files/misc.config \
  96. > $(PKG_BUILD_DIR)/config.sh
  97. (cd $(PKG_BUILD_DIR) && ./Configure -S)
  98. install -m 0644 $(PKG_BUILD_DIR)/config.h $(PKG_BUILD_DIR)/xconfig.h
  99. endef
  100. define Build/Compile
  101. +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)
  102. endef
  103. define Build/InstallDev
  104. $(INSTALL_DIR) $(1)/usr/lib/perl5/$(PERL_VERSION)
  105. $(CP) $(PKG_INSTALL_DIR)/usr/lib/perl5/$(PERL_VERSION) $(1)/usr/lib/perl5/
  106. endef
  107. define Package/perl/install
  108. $(INSTALL_DIR) $(1)/usr/bin
  109. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/perl$(PKG_VERSION) $(1)/usr/bin
  110. ln -nsf perl$(PKG_VERSION) $(1)/usr/bin/perl
  111. $(INSTALL_DIR) $(1)/usr/lib/perl5/$(PERL_VERSION)/CORE
  112. $(CP) $(PKG_INSTALL_DIR)/usr/lib/perl5/$(PERL_VERSION)/CORE/libperl.so $(1)/usr/lib/perl5/$(PERL_VERSION)/CORE/
  113. endef
  114. $(eval $(call RequireCommand,rsync, \
  115. $(PKG_NAME) requires rsync installed on the host-system. \
  116. ))
  117. $(eval $(call BuildPackage,perl))
  118. $(eval $(call HostBuild))
  119. -include perlbase.mk
  120. # A helper package that includes all sort of supplementary files for tests
  121. define Package/perl-tests-common
  122. $(call Package/perlbase-template)
  123. TITLE:=Common test support files
  124. DEPENDS:=@PERL_TESTS
  125. endef
  126. define Package/perl-tests-common/install
  127. $(INSTALL_DIR) $(1)/$(PERL_TESTSDIR)
  128. $(INSTALL_DIR) $(1)/$(PERL_TESTSDIR)/Porting
  129. $(INSTALL_DIR) $(1)/$(PERL_TESTSDIR)/regen
  130. $(INSTALL_DIR) $(1)/$(PERL_TESTSDIR)/lib
  131. $(INSTALL_DIR) $(1)/usr/lib/perl5/$(PERL_VERSION)/XS
  132. $(INSTALL_DIR) $(1)/usr/lib/perl5/$(PERL_VERSION)/auto/XS
  133. $(INSTALL_DIR) $(1)/usr/lib/perl5/$(PERL_VERSION)/unicore
  134. $(CP) $(PKG_BUILD_DIR)/t $(1)/$(PERL_TESTSDIR)
  135. $(CP) $(PKG_BUILD_DIR)/Porting $(1)/$(PERL_TESTSDIR)
  136. $(CP) $(PKG_BUILD_DIR)/regen $(1)/$(PERL_TESTSDIR)
  137. $(CP) $(PKG_BUILD_DIR)/MANIFEST $(1)/$(PERL_TESTSDIR)
  138. $(CP) $(PKG_BUILD_DIR)/TestInit.pm $(1)/$(PERL_TESTSDIR)
  139. $(CP) $(PKG_BUILD_DIR)/vutil.c $(1)/$(PERL_TESTSDIR)
  140. $(CP) $(PKG_BUILD_DIR)/vxs.inc $(1)/$(PERL_TESTSDIR)
  141. $(CP) $(PKG_BUILD_DIR)/lib/XS $(1)/usr/lib/perl5/$(PERL_VERSION)/
  142. $(CP) $(PKG_BUILD_DIR)/lib/auto/XS $(1)/usr/lib/perl5/$(PERL_VERSION)/auto
  143. $(CP) $(PKG_BUILD_DIR)/lib/vmsish.pm $(1)/usr/lib/perl5/$(PERL_VERSION)/
  144. $(CP) $(PKG_BUILD_DIR)/lib/vmsish.t $(1)/$(PERL_TESTSDIR)/lib
  145. $(CP) $(PKG_BUILD_DIR)/lib/Internals.t $(1)/$(PERL_TESTSDIR)/lib
  146. $(CP) $(PKG_BUILD_DIR)/lib/unicore/TestProp.pl $(1)/usr/lib/perl5/$(PERL_VERSION)/unicore
  147. $(CP) files/perl-run_tests.sh $(1)/$(PERL_TESTSDIR)/run_tests.sh
  148. sed \
  149. -e 's!%%PERL_DISABLEDTESTS%%!$(PERL_DISABLEDTESTS)!' \
  150. -e 's!%%PERL_VERSION%%!$(PERL_VERSION)!' \
  151. -i $(1)/$(PERL_TESTSDIR)/run_tests.sh
  152. $(CP) $(PKG_BUILD_DIR)/config_h.SH $(1)/$(PERL_TESTSDIR)
  153. $(CP) $(PKG_BUILD_DIR)/perl.h $(1)/$(PERL_TESTSDIR)
  154. endef
  155. $(eval $(call BuildPackage,perl-tests-common))