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.

118 lines
3.2 KiB

  1. #
  2. # Copyright (C) 2006-2018 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:=tcl
  9. TCL_MAJOR_VERSION:=8.6
  10. PKG_VERSION:=${TCL_MAJOR_VERSION}.11
  11. PKG_RELEASE:=$(AUTORELEASE)
  12. PKG_SOURCE:=$(PKG_NAME)$(PKG_VERSION)-src.tar.gz
  13. PKG_SOURCE_URL:=@SF/$(PKG_NAME)
  14. PKG_HASH:=8c0486668586672c5693d7d95817cb05a18c5ecca2f40e2836b9578064088258
  15. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)$(PKG_VERSION)
  16. HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/$(PKG_NAME)$(PKG_VERSION)
  17. PKG_MAINTAINER:=Joe Mistachkin <joe@mistachkin.com>
  18. PKG_LICENSE:=TCL
  19. PKG_LICENSE_FILES:=license.terms
  20. PKG_CPE_ID:=cpe:/a:tcl_tk:tcl_tk
  21. PKG_BUILD_DEPENDS:=HOST_OS_MACOS:fakeuname/host
  22. PKG_FIXUP:=autoreconf
  23. PKG_INSTALL:=1
  24. PKG_BUILD_PARALLEL:=1
  25. HOST_BUILD_PARALLEL:=1
  26. include $(INCLUDE_DIR)/host-build.mk
  27. include $(INCLUDE_DIR)/package.mk
  28. ifeq ($(CONFIG_HOST_OS_MACOS),y)
  29. include ../../utils/fakeuname/fakeuname.mk
  30. endif
  31. define Package/tcl
  32. SUBMENU:=Tcl
  33. SECTION:=lang
  34. CATEGORY:=Languages
  35. DEPENDS:=+libpthread +zlib
  36. TITLE:=The Tcl language
  37. URL:=https://www.tcl.tk/
  38. endef
  39. define Package/tcl/description
  40. Tcl, or Tool Command Language, is a an elegant, versatile, feature-rich,
  41. simple-to-learn yet very powerful industrial-strength open-source
  42. programming language and development platform. It is renowned for its
  43. stability and utility, and its emphasis on providing a cross-platform
  44. programming API makes it an ideal choice for an enormous variety of
  45. programming jobs.
  46. endef
  47. CONFIGURE_PATH := unix
  48. CONFIGURE_VARS += \
  49. $(if $(CONFIG_HOST_OS_MACOS),PATH=$(FAKEUNAME_PATH):$(PATH)) \
  50. tcl_cv_strtod_unbroken=ok
  51. CONFIGURE_ARGS += \
  52. --enable-threads
  53. MAKE_PATH := unix
  54. define Build/Prepare
  55. $(call Build/Prepare/Default)
  56. rm -rf $(PKG_BUILD_DIR)/pkgs/*
  57. endef
  58. define Build/InstallDev
  59. $(INSTALL_DIR) $(1)/usr/include
  60. $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/
  61. $(INSTALL_DIR) $(1)/usr/lib
  62. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libtcl*.{a,so*} $(1)/usr/lib/
  63. $(CP) $(PKG_INSTALL_DIR)/usr/lib/tclConfig.sh $(1)/usr/lib/
  64. $(CP) $(PKG_INSTALL_DIR)/usr/lib/tclooConfig.sh $(1)/usr/lib/
  65. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  66. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/tcl.pc \
  67. $(1)/usr/lib/pkgconfig
  68. $(SED) 's,/usr/include,$$$${prefix}/include,g' $(1)/usr/lib/pkgconfig/tcl.pc
  69. $(SED) 's,/usr/lib,$$$${prefix}/lib,g' $(1)/usr/lib/pkgconfig/tcl.pc
  70. endef
  71. define Package/tcl/install
  72. $(INSTALL_DIR) $(1)/usr/lib
  73. $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so $(1)/usr/lib
  74. $(INSTALL_DIR) $(1)/usr/bin
  75. $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin
  76. $(CP) -a $(PKG_INSTALL_DIR)/usr/lib/tcl8 $(1)/usr/lib/
  77. $(CP) -a $(PKG_INSTALL_DIR)/usr/lib/tcl$(TCL_MAJOR_VERSION) $(1)/usr/lib/
  78. $(LN) tclsh$(TCL_MAJOR_VERSION) $(1)/usr/bin/tclsh
  79. endef
  80. define Host/Configure
  81. $(call Host/Configure/Default,$(1),$(2),$(CONFIGURE_PATH)/$(3))
  82. endef
  83. define Host/Compile
  84. +$(HOST_MAKE_VARS) \
  85. $(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR)/$(MAKE_PATH) \
  86. $(HOST_MAKE_FLAGS) \
  87. $(1)
  88. endef
  89. define Host/Install
  90. $(call Host/Compile,install)
  91. (cd $(HOST_BUILD_PREFIX)/bin; test -f tclsh || ln -s tclsh$(TCL_MAJOR_VERSION) tclsh)
  92. endef
  93. $(eval $(call HostBuild))
  94. $(eval $(call BuildPackage,tcl))