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.

184 lines
4.6 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:=2
  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:=0
  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. include $(INCLUDE_DIR)/nls.mk
  25. define Package/libslang2/Default
  26. SECTION:=libs
  27. CATEGORY:=Libraries
  28. TITLE:=S-Lang Programmer's Library
  29. URL:=https://www.jedsoft.org/slang/
  30. endef
  31. define Package/libslang2/Default/description
  32. Multi-platform programmer's library providing facilities for interactive
  33. applications. Includes such things as display/screen management,
  34. keyboard input, keymaps, etc. Includes the embeddable S-Lang interpreter.
  35. endef
  36. define Package/libslang2
  37. $(call Package/libslang2/Default)
  38. DEPENDS:=+terminfo
  39. endef
  40. define Package/libslang2/description
  41. $(call Package/libslang2/Default/description)
  42. endef
  43. define Package/libslang2-modules
  44. $(call Package/libslang2/Default)
  45. TITLE+= (all modules)
  46. DEPENDS:=$(foreach mod,$(SLANG_MODULES),+libslang2-mod-$(mod))
  47. endef
  48. define Package/libslang2-modules/description
  49. $(call Package/libslang2/Default/description)
  50. This installs all of S-Lang's bundled modules.
  51. endef
  52. define Package/libslang2-mod-iconv
  53. $(call Package/libslang2/Default)
  54. TITLE+= (iconv module)
  55. DEPENDS:=$(ICONV_DEPENDS)
  56. endef
  57. define Package/libslang2-mod-pcre
  58. $(call Package/libslang2/Default)
  59. TITLE+= (pcre module)
  60. DEPENDS:=+libpcre
  61. endef
  62. define Package/libslang2-mod-png
  63. $(call Package/libslang2/Default)
  64. TITLE+= (png module)
  65. DEPENDS:=+libpng
  66. endef
  67. define Package/libslang2-mod-zlib
  68. $(call Package/libslang2/Default)
  69. TITLE+= (zlib module)
  70. DEPENDS:=+zlib
  71. endef
  72. define Package/slsh
  73. SECTION:=lang
  74. CATEGORY:=Languages
  75. TITLE:=S-Lang shell
  76. URL:=https://www.jedsoft.org/slang/slsh.html
  77. DEPENDS:=+libslang2 +libslang2-modules
  78. endef
  79. define Package/slsh/description
  80. This is a shell which is mostly just a wrapper around the S-Lang Interpreter,
  81. which is part of the S-Lang Library.
  82. endef
  83. TARGET_CFLAGS+= $(FPIC)
  84. CONFIGURE_ARGS+= \
  85. --enable-largefile \
  86. --enable-warnings \
  87. --with-terminfo=default \
  88. --with-readline=slang \
  89. --with-iconv="$(ICONV_PREFIX)" \
  90. --with-pcre="$(STAGING_DIR)/usr" \
  91. --with-png="$(STAGING_DIR)/usr" \
  92. --with-z="$(STAGING_DIR)/usr" \
  93. --without-onig \
  94. --without-x
  95. define Build/Compile
  96. $(call Build/Compile/Default,)
  97. $(call Build/Compile/Default,static)
  98. endef
  99. # Default install last, so that the dynamic slsh is installed
  100. define Build/Install
  101. $(call Build/Install/Default,install-static)
  102. $(call Build/Install/Default,)
  103. endef
  104. define Build/InstallDev
  105. $(INSTALL_DIR) $(1)/usr/include
  106. $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/
  107. $(INSTALL_DIR) $(1)/usr/lib
  108. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libslang.{a,so*} $(1)/usr/lib/
  109. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  110. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/slang.pc $(1)/usr/lib/pkgconfig/
  111. endef
  112. define Package/libslang2/install
  113. $(INSTALL_DIR) $(1)/usr/lib
  114. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libslang.so* $(1)/usr/lib/
  115. endef
  116. Package/libslang2-modules/install:=:
  117. define Package/slsh/install
  118. $(INSTALL_DIR) $(1)/etc
  119. $(CP) $(PKG_INSTALL_DIR)/etc/slsh.rc $(1)/etc/
  120. $(INSTALL_DIR) $(1)/usr/bin
  121. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/slsh $(1)/usr/bin/
  122. $(INSTALL_DIR) $(1)/usr/share
  123. $(CP) $(PKG_INSTALL_DIR)/usr/share/slsh/ $(1)/usr/share/
  124. endef
  125. define BuildModule
  126. ifndef Package/libslang2-mod-$(1)
  127. define Package/libslang2-mod-$(1)
  128. $$(call Package/libslang2/Default)
  129. TITLE+= ($(1) module)
  130. endef
  131. endif
  132. define Package/libslang2-mod-$(1)/description
  133. $$(call Package/libslang2/Default/description)
  134. This contains the $(1) module.
  135. endef
  136. define Package/libslang2-mod-$(1)/install
  137. $$(INSTALL_DIR) $$(1)/usr/lib/slang/v2/modules
  138. $$(CP) $$(PKG_INSTALL_DIR)/usr/lib/slang/v2/modules/$(1)-module.so $$(1)/usr/lib/slang/v2/modules/
  139. endef
  140. $$(eval $$(call BuildPackage,libslang2-mod-$(1)))
  141. endef
  142. $(foreach mod,$(SLANG_MODULES),$(eval $(call BuildModule,$(mod))))
  143. $(eval $(call BuildPackage,libslang2))
  144. $(eval $(call BuildPackage,libslang2-modules))
  145. $(eval $(call BuildPackage,slsh))