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.

114 lines
3.9 KiB

  1. #
  2. # Copyright (C) 2013-2016 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=zsh
  9. PKG_VERSION:=5.6.2
  10. PKG_RELEASE:=3
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
  12. PKG_SOURCE_URL:=@SF/zsh
  13. PKG_HASH:=a50bd66c0557e8eca3b8fa24e85d0de533e775d7a22df042da90488623752e9e
  14. PKG_MAINTAINER:=Vadim A. Misbakh-Soloviov <openwrt-zsh@mva.name>
  15. PKG_LICENSE:=ZSH
  16. PKG_LICENSE_FILES:=LICENCE
  17. PKG_CPE_ID:=cpe:/a:zsh_project:zsh
  18. PKG_BUILD_PARALLEL:=1
  19. PKG_INSTALL:=1
  20. include $(INCLUDE_DIR)/package.mk
  21. define Package/zsh
  22. SECTION:=utils
  23. CATEGORY:=Utilities
  24. SUBMENU:=Shells
  25. TITLE:=The Z shell
  26. DEPENDS:=+libcap +libncurses +libncursesw +libpcre +librt
  27. URL:=https://www.zsh.org/
  28. endef
  29. define Package/zsh/description
  30. Zsh is a UNIX command interpreter (shell) usable as an interactive
  31. login shell and as a shell script command processor. Of the standard
  32. shells, zsh most closely resembles ksh but includes many enhancements.
  33. Zsh has command line editing, builtin spelling correction, programmable
  34. command completion, shell functions (with autoloading), a history
  35. mechanism, and a host of other features.
  36. endef
  37. define Build/Configure
  38. $(call Build/Configure/Default, \
  39. --disable-etcdir \
  40. --disable-gdbm \
  41. --disable-dynamic \
  42. $(if $(CONFIG_USE_MUSL),--enable-libc-musl) \
  43. --enable-pcre \
  44. --enable-cap \
  45. --enable-multibyte \
  46. --enable-unicode9 \
  47. --enable-runhelpdir=$(CONFIGURE_PREFIX)/share/zsh/$(PKG_VERSION)/help \
  48. --enable-fndir=$(CONFIGURE_PREFIX)/share/zsh/$(PKG_VERSION)/functions \
  49. --enable-site-fndir=$(CONFIGURE_PREFIX)/share/zsh/site-functions \
  50. --enable-function-subdirs \
  51. --with-tcsetpgrp \
  52. --with-term-lib="ncursesw", \
  53. zsh_cv_shared_environ=yes \
  54. zsh_cv_sys_dynamic_clash_ok=yes\
  55. zsh_cv_sys_dynamic_execsyms=yes \
  56. zsh_cv_sys_dynamic_rtld_global=yes \
  57. zsh_cv_sys_dynamic_strip_exe=yes \
  58. zsh_cv_sys_dynamic_strip_lib=yes \
  59. zsh_cv_sys_nis=no \
  60. zsh_cv_sys_nis_plus=no \
  61. )
  62. # Do not install these functions:
  63. $(SED) 's, Completion/AIX/\*/\*,,g' $(PKG_BUILD_DIR)/config.modules
  64. $(SED) 's, Completion/BSD/\*/\*,,g' $(PKG_BUILD_DIR)/config.modules
  65. $(SED) 's, Completion/Cygwin/\*/\*,,g' $(PKG_BUILD_DIR)/config.modules
  66. $(SED) 's, Completion/Darwin/\*/\*,,g' $(PKG_BUILD_DIR)/config.modules
  67. $(SED) 's, Completion/Debian/\*/\*,,g' $(PKG_BUILD_DIR)/config.modules
  68. $(SED) 's, Completion/Mandriva/\*/\*,,g' $(PKG_BUILD_DIR)/config.modules
  69. $(SED) 's, Completion/Redhat/\*/\*,,g' $(PKG_BUILD_DIR)/config.modules
  70. $(SED) 's, Completion/Solaris/\*/\*,,g' $(PKG_BUILD_DIR)/config.modules
  71. $(SED) 's, Completion/X/\*/\*,,g' $(PKG_BUILD_DIR)/config.modules
  72. $(SED) 's, Completion/openSUSE/\*/\*,,g' $(PKG_BUILD_DIR)/config.modules
  73. # After mucking with 'config.modules', one must call
  74. $(MAKE) -C $(PKG_BUILD_DIR) DESTDIR="$(PKG_INSTALL_DIR)" prep
  75. endef
  76. TARGET_CFLAGS += -ffunction-sections -fdata-sections -flto
  77. TARGET_LDFLAGS += -Wl,--gc-sections -flto
  78. define Package/zsh/postinst
  79. #!/bin/sh
  80. grep zsh $${IPKG_INSTROOT}/etc/shells || \
  81. echo "/usr/bin/zsh" >> $${IPKG_INSTROOT}/etc/shells
  82. # Backwards compatibility
  83. if [ -e /bin/zsh ] && { [ ! -L /bin/zsh ] || [ "$(readlink -fn $${IPKG_INSTROOT}/bin/zsh)" != "../$(CONFIGURE_PREFIX)/bin/zsh" ]; }; then
  84. ln -fs "../$(CONFIGURE_PREFIX)/bin/zsh" "$${IPKG_INSTROOT}/bin/zsh"
  85. fi
  86. endef
  87. define Package/zsh/install
  88. $(INSTALL_DIR) $(1)/bin
  89. $(INSTALL_DIR) $(1)/$(CONFIGURE_PREFIX)/bin
  90. $(INSTALL_DIR) $(1)/$(CONFIGURE_PREFIX)/share/zsh/$(PKG_VERSION)
  91. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/$(CONFIGURE_PREFIX)/bin/zsh $(1)/$(CONFIGURE_PREFIX)/bin/
  92. $(CP) $(PKG_INSTALL_DIR)/$(CONFIGURE_PREFIX)/share/zsh/$(PKG_VERSION)/* $(1)/$(CONFIGURE_PREFIX)/share/zsh/$(PKG_VERSION)/
  93. endef
  94. define Package/zsh/postrm
  95. #!/bin/sh
  96. rm -rf "$${IPKG_INSTROOT}/$(CONFIGURE_PREFIX)/share/zsh/$(PKG_VERSION)"
  97. endef
  98. $(eval $(call BuildPackage,zsh))