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.

150 lines
5.4 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:=1
  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. # csc calls gcc with "-lm -ldl", but "-lm" doesn't work with musl,
  43. # so we set LIBRARIES=-lm
  44. MAKE_FLAGS += PLATFORM=linux C_COMPILER=$(TARGET_CC) LINKER=$(TARGET_CC) PREFIX=/usr C_COMPILER_OPTIMIZATION_OPTIONS="$(TARGET_CFLAGS)" LIBRARIES=-lm
  45. # not installed:
  46. # - csc and chicken, the compiler
  47. # - the include dir (only useful with the compiler)
  48. # - install, uninstall, status, and chicken-do, which deal with modules
  49. # (installation of more modules depends on the compiler)
  50. # - profiler
  51. # - feathers, the debugger
  52. # - libchicken.a, the static library
  53. define Package/chicken-scheme-interpreter/install
  54. $(INSTALL_DIR) $(1)/usr/bin
  55. $(INSTALL_DIR) $(1)/usr/lib/chicken/$(ABI_VERSION)
  56. $(INSTALL_BIN) $(PKG_BUILD_DIR)/csi $(1)/usr/bin/
  57. $(CP) $(PKG_BUILD_DIR)/libchicken.so.$(ABI_VERSION) $(1)/usr/lib/
  58. $(CP) $(PKG_BUILD_DIR)/libchicken.so $(1)/usr/lib/
  59. $(CP) $(PKG_BUILD_DIR)/*.import.so $(1)/usr/lib/chicken/$(ABI_VERSION)/
  60. $(CP) $(PKG_BUILD_DIR)/types.db $(1)/usr/lib/chicken/$(ABI_VERSION)/
  61. endef
  62. $(eval $(call BuildPackage,chicken-scheme-interpreter))
  63. ##
  64. ## chicken-scheme-full
  65. ##
  66. # mips-openwrt-linux-musl-gcc dowsn't seem to link with libchicken.so.
  67. # already tried -lchicken and passing /usr/lib/libchicken.so on the command
  68. # line.
  69. # also tried -Wl,-R/usr/lib,-R/usr/lib/chicken/$(ABI_VERSION)
  70. #
  71. # current solution: we do not strip binaries in chicken-scheme-full
  72. # we do this by unsetting STRIP and RSTRIP, *and* reloading rules.mk
  73. #
  74. STRIP:=:
  75. RSTRIP:=:
  76. include $(TOPDIR)/rules.mk
  77. define Package/chicken-scheme-full
  78. $(call Package/chicken-scheme/Default)
  79. TITLE:=Chicken Scheme -- full package
  80. SECTION:=lang
  81. CATEGORY:=Languages
  82. # csc depends on gcc; chicken-install uses the 'install' command from coreutils
  83. EXTRA_DEPENDS:= gcc, coreutils-install
  84. endef
  85. define Package/chicken-scheme-full/description
  86. Chicken is an implementation of the Scheme language. It is portable, efficient, and supports
  87. the R5RS and R7RS (work in progress) standards, and many extensions.
  88. Chicken can be used as a scripting language to automate tasks.
  89. This package contains the interpreter, 'csi'; the compiler, 'csc';
  90. the tools for installing and removing eggs (modules); the profiler and
  91. the debugger.
  92. Note that this package depends on gcc, which is quite large (more than 100Mb).
  93. For more information, please refer to the Chicken Scheme website at https://call-cc.org.
  94. endef
  95. # not installed:
  96. # - libchicken.a, the static library
  97. define Package/chicken-scheme-full/install
  98. $(INSTALL_DIR) $(1)/usr/bin
  99. $(INSTALL_DIR) $(1)/usr/lib/chicken/$(ABI_VERSION)
  100. $(INSTALL_DIR) $(1)/usr/include/chicken
  101. $(INSTALL_DIR) $(1)/usr/share/chicken
  102. $(INSTALL_BIN) $(PKG_BUILD_DIR)/csi $(1)/usr/bin/
  103. $(CP) $(PKG_BUILD_DIR)/libchicken.so.$(ABI_VERSION) $(1)/usr/lib/
  104. $(CP) $(PKG_BUILD_DIR)/libchicken.so $(1)/usr/lib/
  105. $(CP) $(PKG_BUILD_DIR)/*.import.so $(1)/usr/lib/chicken/$(ABI_VERSION)/
  106. $(CP) $(PKG_BUILD_DIR)/types.db $(1)/usr/lib/chicken/$(ABI_VERSION)/
  107. # csc
  108. $(INSTALL_BIN) $(PKG_BUILD_DIR)/csc $(1)/usr/bin/
  109. $(INSTALL_BIN) $(PKG_BUILD_DIR)/chicken $(1)/usr/bin/
  110. $(INSTALL_DATA) $(PKG_BUILD_DIR)/chicken.h $(1)/usr/include/chicken/
  111. $(INSTALL_DATA) $(PKG_BUILD_DIR)/chicken-config.h $(1)/usr/include/chicken/
  112. # chicken-install
  113. $(INSTALL_BIN) $(PKG_BUILD_DIR)/chicken-install $(1)/usr/bin/
  114. $(INSTALL_BIN) $(PKG_BUILD_DIR)/chicken-uninstall $(1)/usr/bin/
  115. $(INSTALL_BIN) $(PKG_BUILD_DIR)/chicken-status $(1)/usr/bin/
  116. $(INSTALL_BIN) $(PKG_BUILD_DIR)/chicken-do $(1)/usr/bin/
  117. $(INSTALL_DATA) $(PKG_BUILD_DIR)/setup.defaults $(1)/usr/share/chicken/
  118. # profile
  119. $(INSTALL_BIN) $(PKG_BUILD_DIR)/chicken-profile $(1)/usr/bin/
  120. # feathers
  121. $(INSTALL_BIN) $(PKG_BUILD_DIR)/feathers.tcl $(1)/usr/share/chicken/
  122. $(INSTALL_BIN) $(PKG_BUILD_DIR)/feathers $(1)/usr/bin/
  123. endef
  124. $(eval $(call BuildPackage,chicken-scheme-full))