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.

147 lines
5.3 KiB

  1. # Copyright (C) 2019-2020 Jerônimo Cordoni Pellegrini <j_p@aleph0.info>
  2. #
  3. # This file is free software, licensed under the GNU General Public License v3
  4. # or later.
  5. # See /LICENSE for details
  6. #
  7. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=chicken-scheme
  9. PKG_VERSION:=5.2.0
  10. PKG_RELEASE:=2
  11. PKG_BUILD_DIR:=$(BUILD_DIR)/chicken-$(PKG_VERSION)
  12. PKG_SOURCE:=chicken-$(PKG_VERSION).tar.gz
  13. PKG_SOURCE_URL:=https://code.call-cc.org/releases/$(PKG_VERSION)/
  14. PKG_HASH:=819149c8ce7303a9b381d3fdc1d5765c5f9ac4dee6f627d1652f47966a8780fa
  15. PKG_MAINTAINER:=Jeronimo Pellegrini <j_p@aleph0.info>
  16. PKG_LICENSE:=BSD-3-Clause
  17. PKG_LICENSE_FILES:=LICENSE
  18. include $(INCLUDE_DIR)/package.mk
  19. define Package/chicken-scheme/Default
  20. SECTION:=lang
  21. CATEGORY:=Languages
  22. URL:=https://call-cc.org
  23. ABI_VERSION:=11
  24. endef
  25. ##
  26. ## chicken-scheme-interpreter
  27. ##
  28. define Package/chicken-scheme-interpreter
  29. $(call Package/chicken-scheme/Default)
  30. TITLE:=Chicken Scheme -- interpreter only
  31. SECTION:=lang
  32. CATEGORY:=Languages
  33. endef
  34. define Package/chicken-scheme-interpreter/description
  35. Chicken is an implementation of the Scheme language. It is portable, efficient, and supports
  36. the R5RS and R7RS (work in progress) standards, and many extensions.
  37. Chicken can be used as a scripting language to automate tasks.
  38. This package contains the interpreter, 'csi', only --
  39. the compiler and the package installer are not included because they depend on a C compiler.
  40. For more information, please refer to the Chicken Scheme website at https://call-cc.org.
  41. endef
  42. MAKE_FLAGS += PLATFORM=linux C_COMPILER=$(TARGET_CC) LINKER=$(TARGET_CC) PREFIX=/usr C_COMPILER_OPTIMIZATION_OPTIONS="$(TARGET_CFLAGS)"
  43. # not installed:
  44. # - csc and chicken, the compiler
  45. # - the include dir (only useful with the compiler)
  46. # - install, uninstall, status, and chicken-do, which deal with modules
  47. # (installation of more modules depends on the compiler)
  48. # - profiler
  49. # - feathers, the debugger
  50. # - libchicken.a, the static library
  51. define Package/chicken-scheme-interpreter/install
  52. $(INSTALL_DIR) $(1)/usr/bin
  53. $(INSTALL_DIR) $(1)/usr/lib/chicken/$(ABI_VERSION)
  54. $(INSTALL_BIN) $(PKG_BUILD_DIR)/csi $(1)/usr/bin/
  55. $(CP) $(PKG_BUILD_DIR)/libchicken.so.$(ABI_VERSION) $(1)/usr/lib/
  56. $(CP) $(PKG_BUILD_DIR)/libchicken.so $(1)/usr/lib/
  57. $(CP) $(PKG_BUILD_DIR)/*.import.so $(1)/usr/lib/chicken/$(ABI_VERSION)/
  58. $(CP) $(PKG_BUILD_DIR)/types.db $(1)/usr/lib/chicken/$(ABI_VERSION)/
  59. endef
  60. $(eval $(call BuildPackage,chicken-scheme-interpreter))
  61. ##
  62. ## chicken-scheme-full
  63. ##
  64. # mips-openwrt-linux-musl-gcc dowsn't seem to link with libchicken.so.
  65. # already tried -lchicken and passing /usr/lib/libchicken.so on the command
  66. # line.
  67. # also tried -Wl,-R/usr/lib,-R/usr/lib/chicken/$(ABI_VERSION)
  68. #
  69. # current solution: we do not strip binaries in chicken-scheme-full
  70. # we do this by unsetting STRIP and RSTRIP, *and* reloading rules.mk
  71. #
  72. STRIP:=:
  73. RSTRIP:=:
  74. include $(TOPDIR)/rules.mk
  75. define Package/chicken-scheme-full
  76. $(call Package/chicken-scheme/Default)
  77. TITLE:=Chicken Scheme -- full package
  78. SECTION:=lang
  79. CATEGORY:=Languages
  80. # csc depends on gcc; chicken-install uses the 'install' command from coreutils
  81. EXTRA_DEPENDS:= gcc, coreutils-install
  82. endef
  83. define Package/chicken-scheme-full/description
  84. Chicken is an implementation of the Scheme language. It is portable, efficient, and supports
  85. the R5RS and R7RS (work in progress) standards, and many extensions.
  86. Chicken can be used as a scripting language to automate tasks.
  87. This package contains the interpreter, 'csi'; the compiler, 'csc';
  88. the tools for installing and removing eggs (modules); the profiler and
  89. the debugger.
  90. Note that this package depends on gcc, which is quite large (more than 100Mb).
  91. For more information, please refer to the Chicken Scheme website at https://call-cc.org.
  92. endef
  93. # not installed:
  94. # - libchicken.a, the static library
  95. define Package/chicken-scheme-full/install
  96. $(INSTALL_DIR) $(1)/usr/bin
  97. $(INSTALL_DIR) $(1)/usr/lib/chicken/$(ABI_VERSION)
  98. $(INSTALL_DIR) $(1)/usr/include/chicken
  99. $(INSTALL_DIR) $(1)/usr/share/chicken
  100. $(INSTALL_BIN) $(PKG_BUILD_DIR)/csi $(1)/usr/bin/
  101. $(CP) $(PKG_BUILD_DIR)/libchicken.so.$(ABI_VERSION) $(1)/usr/lib/
  102. $(CP) $(PKG_BUILD_DIR)/libchicken.so $(1)/usr/lib/
  103. $(CP) $(PKG_BUILD_DIR)/*.import.so $(1)/usr/lib/chicken/$(ABI_VERSION)/
  104. $(CP) $(PKG_BUILD_DIR)/types.db $(1)/usr/lib/chicken/$(ABI_VERSION)/
  105. # csc
  106. $(INSTALL_BIN) $(PKG_BUILD_DIR)/csc $(1)/usr/bin/
  107. $(INSTALL_BIN) $(PKG_BUILD_DIR)/chicken $(1)/usr/bin/
  108. $(INSTALL_DATA) $(PKG_BUILD_DIR)/chicken.h $(1)/usr/include/chicken/
  109. $(INSTALL_DATA) $(PKG_BUILD_DIR)/chicken-config.h $(1)/usr/include/chicken/
  110. # chicken-install
  111. $(INSTALL_BIN) $(PKG_BUILD_DIR)/chicken-install $(1)/usr/bin/
  112. $(INSTALL_BIN) $(PKG_BUILD_DIR)/chicken-uninstall $(1)/usr/bin/
  113. $(INSTALL_BIN) $(PKG_BUILD_DIR)/chicken-status $(1)/usr/bin/
  114. $(INSTALL_BIN) $(PKG_BUILD_DIR)/chicken-do $(1)/usr/bin/
  115. $(INSTALL_DATA) $(PKG_BUILD_DIR)/setup.defaults $(1)/usr/share/chicken/
  116. # profile
  117. $(INSTALL_BIN) $(PKG_BUILD_DIR)/chicken-profile $(1)/usr/bin/
  118. # feathers
  119. $(INSTALL_BIN) $(PKG_BUILD_DIR)/feathers.tcl $(1)/usr/share/chicken/
  120. $(INSTALL_BIN) $(PKG_BUILD_DIR)/feathers $(1)/usr/bin/
  121. endef
  122. $(eval $(call BuildPackage,chicken-scheme-full))