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.

129 lines
4.0 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. $(CP) $(HOST_BUILD_DIR)/generate_uudmap $(HOST_PERL_PREFIX)/bin/
  63. # Link any possibly installed static extension in
  64. $(MAKE) -C $(HOST_BUILD_DIR)/relink clean || true
  65. ( cd $(HOST_BUILD_DIR)/relink && $(HOST_PERL_PREFIX)/bin/perl Makefile.PL )
  66. $(call perlmod/host/relink,$(HOST_BUILD_DIR)/relink)
  67. endef
  68. # Target perl
  69. define Build/Configure
  70. sed \
  71. -e 's!%%CC%%!$(TARGET_CC)!g' \
  72. -e 's!%%CFLAGS%%!$(TARGET_CFLAGS_PERL) $(TARGET_CPPFLAGS_PERL)!g' \
  73. -e 's!%%CPP%%!$(TARGET_CROSS)gcc -E!g' \
  74. -e 's!%%AR%%!$(TARGET_CROSS)ar!g' \
  75. -e 's!%%LD%%!$(TARGET_CROSS)gcc!g' \
  76. -e 's!%%LDFLAGS%%!-rdynamic $(TARGET_LDFLAGS)!g' \
  77. -e 's!%%LIBDIRS%%!$(STAGING_DIR)/lib $(STAGING_DIR)/usr/lib!g' \
  78. -e 's!%%INCDIRS%%!$(STAGING_DIR)/include $(STAGING_DIR)/usr/include!g' \
  79. -e 's!%%EXTRA_PERLLIBS%%!$(EXTRA_LIBS:%=-l%)!g' \
  80. -e 's!%%EXTRA_PERLLIBDIRS%%!$(EXTRA_LIBDIRS:%=-L%)!g' \
  81. -e 's!%%IPV6%%!$(if $($(CONFIG_IPV6)),define,undef)!g' \
  82. -e 's!%%HOSTMINIPERL%%!$(HOST_PERL_PREFIX)/bin/perl!g' \
  83. -e 's!%%HOSTGENERATE%%!$(HOST_PERL_PREFIX)/bin/generate_uudmap!g' \
  84. files/config.sh-$(patsubst i386,i486,$(ARCH)).in \
  85. > $(PKG_BUILD_DIR)/config.sh
  86. (cd $(PKG_BUILD_DIR) && ./Configure -S)
  87. install -m 0644 $(PKG_BUILD_DIR)/config.h $(PKG_BUILD_DIR)/xconfig.h
  88. endef
  89. define Build/Compile
  90. +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)
  91. endef
  92. define Build/InstallDev
  93. $(INSTALL_DIR) $(1)/usr/lib/perl5/5.20
  94. $(CP) $(PKG_INSTALL_DIR)/usr/lib/perl5/5.20 $(1)/usr/lib/perl5/
  95. endef
  96. define Package/perl/install
  97. $(INSTALL_DIR) $(1)/usr/bin
  98. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/perl$(PKG_VERSION) $(1)/usr/bin
  99. ln -nsf perl$(PKG_VERSION) $(1)/usr/bin/perl
  100. $(INSTALL_DIR) $(1)/usr/lib/perl5/5.20/CORE
  101. $(CP) $(PKG_INSTALL_DIR)/usr/lib/perl5/5.20/CORE/libperl.so $(1)/usr/lib/perl5/5.20/CORE/
  102. endef
  103. $(eval $(call RequireCommand,rsync, \
  104. $(PKG_NAME) requires rsync installed on the host-system. \
  105. ))
  106. $(eval $(call BuildPackage,perl))
  107. $(eval $(call HostBuild))
  108. -include perlbase.mk