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.

176 lines
4.4 KiB

  1. #
  2. # Copyright (C) 2006-2011 Openwrt.org
  3. # Copyright (C) 2011 SMBPhone Inc.
  4. # Copyright (C) 2019 Jeffery To
  5. #
  6. # This is free software, licensed under the GNU General Public License v2.
  7. # See /LICENSE for more information.
  8. #
  9. include $(TOPDIR)/rules.mk
  10. PKG_NAME:=slang
  11. PKG_VERSION:=2.3.2
  12. PKG_RELEASE:=1
  13. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
  14. PKG_SOURCE_URL:=https://www.jedsoft.org/releases/slang \
  15. https://www.jedsoft.org/releases/slang/old
  16. PKG_HASH:=fc9e3b0fc4f67c3c1f6d43c90c16a5c42d117b8e28457c5b46831b8b5d3ae31a
  17. PKG_LICENSE:=GPL-2.0+
  18. PKG_LICENSE_FILES:=COPYING
  19. PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
  20. PKG_BUILD_PARALLEL:=1
  21. SLANG_MODULES:= base64 chksum csv fcntl fork histogram iconv json pcre png \
  22. rand select slsmg socket stats sysconf termios varray zlib
  23. include $(INCLUDE_DIR)/package.mk
  24. define Package/libslang2/Default
  25. SECTION:=libs
  26. CATEGORY:=Libraries
  27. TITLE:=S-Lang Programmer's Library
  28. URL:=https://www.jedsoft.org/slang/
  29. endef
  30. define Package/libslang2/Default/description
  31. Multi-platform programmer's library providing facilities for interactive
  32. applications. Includes such things as display/screen management,
  33. keyboard input, keymaps, etc. Includes the embeddable S-Lang interpreter.
  34. endef
  35. define Package/libslang2
  36. $(call Package/libslang2/Default)
  37. DEPENDS:=+terminfo
  38. endef
  39. define Package/libslang2/description
  40. $(call Package/libslang2/Default/description)
  41. endef
  42. define Package/libslang2-modules
  43. $(call Package/libslang2/Default)
  44. TITLE+= (all modules)
  45. DEPENDS:=$(foreach mod,$(SLANG_MODULES),+libslang2-mod-$(mod))
  46. endef
  47. define Package/libslang2-modules/description
  48. $(call Package/libslang2/Default/description)
  49. This installs all of S-Lang's bundled modules.
  50. endef
  51. define Package/libslang2-mod-pcre
  52. $(call Package/libslang2/Default)
  53. TITLE+= (pcre module)
  54. DEPENDS:=+libpcre
  55. endef
  56. define Package/libslang2-mod-png
  57. $(call Package/libslang2/Default)
  58. TITLE+= (png module)
  59. DEPENDS:=+libpng
  60. endef
  61. define Package/libslang2-mod-zlib
  62. $(call Package/libslang2/Default)
  63. TITLE+= (zlib module)
  64. DEPENDS:=+zlib
  65. endef
  66. define Package/slsh
  67. SECTION:=lang
  68. CATEGORY:=Languages
  69. TITLE:=S-Lang shell
  70. URL:=https://www.jedsoft.org/slang/slsh.html
  71. DEPENDS:=+libslang2 +libslang2-modules
  72. endef
  73. define Package/slsh/description
  74. This is a shell which is mostly just a wrapper around the S-Lang Interpreter,
  75. which is part of the S-Lang Library.
  76. endef
  77. TARGET_CFLAGS+= $(FPIC)
  78. CONFIGURE_ARGS+= \
  79. --enable-largefile \
  80. --enable-warnings \
  81. --with-terminfo=default \
  82. --with-readline=slang \
  83. --with-pcre="$(STAGING_DIR)/usr" \
  84. --with-png="$(STAGING_DIR)/usr" \
  85. --with-z="$(STAGING_DIR)/usr" \
  86. --without-onig \
  87. --without-x
  88. define Build/Compile
  89. $(call Build/Compile/Default,)
  90. $(call Build/Compile/Default,static)
  91. endef
  92. # Default install last, so that the dynamic slsh is installed
  93. define Build/Install
  94. $(call Build/Install/Default,install-static)
  95. $(call Build/Install/Default,)
  96. endef
  97. define Build/InstallDev
  98. $(INSTALL_DIR) $(1)/usr/include
  99. $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/
  100. $(INSTALL_DIR) $(1)/usr/lib
  101. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libslang.{a,so*} $(1)/usr/lib/
  102. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  103. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/slang.pc $(1)/usr/lib/pkgconfig/
  104. endef
  105. define Package/libslang2/install
  106. $(INSTALL_DIR) $(1)/usr/lib
  107. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libslang.so* $(1)/usr/lib/
  108. endef
  109. Package/libslang2-modules/install:=:
  110. define Package/slsh/install
  111. $(INSTALL_DIR) $(1)/etc
  112. $(CP) $(PKG_INSTALL_DIR)/etc/slsh.rc $(1)/etc/
  113. $(INSTALL_DIR) $(1)/usr/bin
  114. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/slsh $(1)/usr/bin/
  115. $(INSTALL_DIR) $(1)/usr/share
  116. $(CP) $(PKG_INSTALL_DIR)/usr/share/slsh/ $(1)/usr/share/
  117. endef
  118. define BuildModule
  119. ifndef Package/libslang2-mod-$(1)
  120. define Package/libslang2-mod-$(1)
  121. $$(call Package/libslang2/Default)
  122. TITLE+= ($(1) module)
  123. endef
  124. endif
  125. define Package/libslang2-mod-$(1)/description
  126. $$(call Package/libslang2/Default/description)
  127. This contains the $(1) module.
  128. endef
  129. define Package/libslang2-mod-$(1)/install
  130. $$(INSTALL_DIR) $$(1)/usr/lib/slang/v2/modules
  131. $$(CP) $$(PKG_INSTALL_DIR)/usr/lib/slang/v2/modules/$(1)-module.so $$(1)/usr/lib/slang/v2/modules/
  132. endef
  133. $$(eval $$(call BuildPackage,libslang2-mod-$(1)))
  134. endef
  135. $(foreach mod,$(SLANG_MODULES),$(eval $(call BuildModule,$(mod))))
  136. $(eval $(call BuildPackage,libslang2))
  137. $(eval $(call BuildPackage,libslang2-modules))
  138. $(eval $(call BuildPackage,slsh))