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.

190 lines
4.7 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:=3
  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 onig pcre \
  22. png 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-onig
  58. $(call Package/libslang2/Default)
  59. TITLE+= (onig module)
  60. DEPENDS:=+oniguruma
  61. endef
  62. define Package/libslang2-mod-pcre
  63. $(call Package/libslang2/Default)
  64. TITLE+= (pcre module)
  65. DEPENDS:=+libpcre
  66. endef
  67. define Package/libslang2-mod-png
  68. $(call Package/libslang2/Default)
  69. TITLE+= (png module)
  70. DEPENDS:=+libpng
  71. endef
  72. define Package/libslang2-mod-zlib
  73. $(call Package/libslang2/Default)
  74. TITLE+= (zlib module)
  75. DEPENDS:=+zlib
  76. endef
  77. define Package/slsh
  78. SECTION:=lang
  79. CATEGORY:=Languages
  80. TITLE:=S-Lang shell
  81. URL:=https://www.jedsoft.org/slang/slsh.html
  82. DEPENDS:=+libslang2 +libslang2-modules
  83. endef
  84. define Package/slsh/description
  85. This is a shell which is mostly just a wrapper around the S-Lang Interpreter,
  86. which is part of the S-Lang Library.
  87. endef
  88. TARGET_CFLAGS+= $(FPIC)
  89. CONFIGURE_ARGS+= \
  90. --enable-largefile \
  91. --enable-warnings \
  92. --with-terminfo=default \
  93. --with-readline=slang \
  94. --with-iconv="$(ICONV_PREFIX)" \
  95. --with-onig="$(STAGING_DIR)/usr" \
  96. --with-pcre="$(STAGING_DIR)/usr" \
  97. --with-png="$(STAGING_DIR)/usr" \
  98. --with-z="$(STAGING_DIR)/usr" \
  99. --without-x
  100. define Build/Compile
  101. $(call Build/Compile/Default,)
  102. $(call Build/Compile/Default,static)
  103. endef
  104. # Default install last, so that the dynamic slsh is installed
  105. define Build/Install
  106. $(call Build/Install/Default,install-static)
  107. $(call Build/Install/Default,)
  108. endef
  109. define Build/InstallDev
  110. $(INSTALL_DIR) $(1)/usr/include
  111. $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/
  112. $(INSTALL_DIR) $(1)/usr/lib
  113. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libslang.{a,so*} $(1)/usr/lib/
  114. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  115. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/slang.pc $(1)/usr/lib/pkgconfig/
  116. endef
  117. define Package/libslang2/install
  118. $(INSTALL_DIR) $(1)/usr/lib
  119. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libslang.so* $(1)/usr/lib/
  120. endef
  121. Package/libslang2-modules/install:=:
  122. define Package/slsh/install
  123. $(INSTALL_DIR) $(1)/etc
  124. $(CP) $(PKG_INSTALL_DIR)/etc/slsh.rc $(1)/etc/
  125. $(INSTALL_DIR) $(1)/usr/bin
  126. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/slsh $(1)/usr/bin/
  127. $(INSTALL_DIR) $(1)/usr/share
  128. $(CP) $(PKG_INSTALL_DIR)/usr/share/slsh/ $(1)/usr/share/
  129. endef
  130. define BuildModule
  131. ifndef Package/libslang2-mod-$(1)
  132. define Package/libslang2-mod-$(1)
  133. $$(call Package/libslang2/Default)
  134. TITLE+= ($(1) module)
  135. endef
  136. endif
  137. define Package/libslang2-mod-$(1)/description
  138. $$(call Package/libslang2/Default/description)
  139. This contains the $(1) module.
  140. endef
  141. define Package/libslang2-mod-$(1)/install
  142. $$(INSTALL_DIR) $$(1)/usr/lib/slang/v2/modules
  143. $$(CP) $$(PKG_INSTALL_DIR)/usr/lib/slang/v2/modules/$(1)-module.so $$(1)/usr/lib/slang/v2/modules/
  144. endef
  145. $$(eval $$(call BuildPackage,libslang2-mod-$(1)))
  146. endef
  147. $(foreach mod,$(SLANG_MODULES),$(eval $(call BuildModule,$(mod))))
  148. $(eval $(call BuildPackage,libslang2))
  149. $(eval $(call BuildPackage,libslang2-modules))
  150. $(eval $(call BuildPackage,slsh))