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.

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