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.

120 lines
3.6 KiB

  1. #
  2. # Copyright (C) 2006-2014 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.20.0
  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/perl-5.20.0.tar.gz \
  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:=406ec049ebe3afcc80d9c76ec78ca4f8
  21. PKG_LICENSE:=GPLv1+ ARTISTIC
  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. PKG_INSTALL:=1
  27. PKG_BUILD_DEPENDS:=perl/host
  28. PKG_BUILD_PARALLEL:=1
  29. HOST_BUILD_PARALLEL:=1
  30. # Variables used during configuration/build
  31. HOST_PERL_PREFIX:=$(STAGING_DIR_HOST)/usr
  32. ifneq ($(CONFIG_USE_EGLIBC),)
  33. EXTRA_LIBS:=bsd
  34. EXTRA_LIBDIRS:=$(STAGING_DIR)/lib
  35. endif
  36. # Filter -g3, it will break Compress-Raw-Zlib
  37. TARGET_CFLAGS_PERL:=$(patsubst -g3,-g,$(TARGET_CFLAGS))
  38. TARGET_CPPFLAGS_PERL:=$(patsubst -g3,-g,$(TARGET_CPPFLAGS))
  39. include $(INCLUDE_DIR)/package.mk
  40. include $(INCLUDE_DIR)/host-build.mk
  41. define Package/perl
  42. SUBMENU:=Perl
  43. SECTION:=lang
  44. CATEGORY:=Languages
  45. TITLE:=The Perl intepreter
  46. URL:=http://www.perl.com/
  47. DEPENDS:=+USE_EGLIBC:libbsd
  48. endef
  49. define Package/perl/description
  50. Perl is a stable, cross platform programming language.
  51. It is used for mission critical projects in the public and private sectors
  52. and is widely used to program web applications of all needs.
  53. endef
  54. # Static host perl
  55. define Host/Configure
  56. ( cd $(HOST_BUILD_DIR); ./Configure -der -Uusedl -Duserelocatableinc -Dprefix=$(HOST_PERL_PREFIX) )
  57. endef
  58. define Host/Install
  59. ( cd $(HOST_BUILD_DIR); ./miniperl installperl )
  60. $(CP) $(HOST_BUILD_DIR)/generate_uudmap $(HOST_PERL_PREFIX)/bin/
  61. endef
  62. # Target perl
  63. define Build/Configure
  64. sed \
  65. -e 's!%%CC%%!$(TARGET_CC)!g' \
  66. -e 's!%%CFLAGS%%!$(TARGET_CFLAGS_PERL) $(TARGET_CPPFLAGS_PERL)!g' \
  67. -e 's!%%CPP%%!$(TARGET_CROSS)gcc -E!g' \
  68. -e 's!%%AR%%!$(TARGET_CROSS)ar!g' \
  69. -e 's!%%LD%%!$(TARGET_CROSS)gcc!g' \
  70. -e 's!%%LDFLAGS%%!-rdynamic $(TARGET_LDFLAGS)!g' \
  71. -e 's!%%LIBDIRS%%!$(STAGING_DIR)/lib $(STAGING_DIR)/usr/lib!g' \
  72. -e 's!%%INCDIRS%%!$(STAGING_DIR)/include $(STAGING_DIR)/usr/include!g' \
  73. -e 's!%%EXTRA_PERLLIBS%%!$(EXTRA_LIBS:%=-l%)!g' \
  74. -e 's!%%EXTRA_PERLLIBDIRS%%!$(EXTRA_LIBDIRS:%=-L%)!g' \
  75. -e 's!%%IPV6%%!$(if $($(CONFIG_IPV6)),define,undef)!g' \
  76. -e 's!%%HOSTMINIPERL%%!$(HOST_PERL_PREFIX)/bin/perl!g' \
  77. -e 's!%%HOSTGENERATE%%!$(HOST_PERL_PREFIX)/bin/generate_uudmap!g' \
  78. files/config.sh-$(patsubst i386,i486,$(ARCH)).in \
  79. > $(PKG_BUILD_DIR)/config.sh
  80. (cd $(PKG_BUILD_DIR) && ./Configure -S)
  81. install -m 0644 $(PKG_BUILD_DIR)/config.h $(PKG_BUILD_DIR)/xconfig.h
  82. endef
  83. define Build/Compile
  84. +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)
  85. endef
  86. define Build/InstallDev
  87. $(INSTALL_DIR) $(1)/usr/lib/perl5/5.20/CORE
  88. $(CP) $(PKG_INSTALL_DIR)/usr/lib/perl5/5.20/CORE/*.h $(1)/usr/lib/perl5/5.20/CORE/
  89. endef
  90. define Package/perl/install
  91. $(INSTALL_DIR) $(1)/usr/bin
  92. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/perl$(PKG_VERSION) $(1)/usr/bin
  93. ln -nsf perl$(PKG_VERSION) $(1)/usr/bin/perl
  94. endef
  95. $(eval $(call RequireCommand,rsync, \
  96. $(PKG_NAME) requires rsync installed on the host-system. \
  97. ))
  98. $(eval $(call BuildPackage,perl))
  99. $(eval $(call HostBuild))
  100. include perlmod.mk
  101. -include perlbase.mk