2014-09-30 16:24:58 +00:00
|
|
|
#
|
2016-05-28 17:35:52 +00:00
|
|
|
# Copyright (C) 2013-2016 OpenWrt.org
|
2014-09-30 16:24:58 +00:00
|
|
|
#
|
|
|
|
# This is free software, licensed under the GNU General Public License v2.
|
|
|
|
# See /LICENSE for more information.
|
|
|
|
#
|
|
|
|
|
|
|
|
include $(TOPDIR)/rules.mk
|
|
|
|
|
|
|
|
PKG_NAME:=zsh
|
2022-05-17 18:43:06 +00:00
|
|
|
PKG_VERSION:=5.9
|
2023-10-10 10:29:49 +00:00
|
|
|
PKG_RELEASE:=2
|
2014-09-30 16:24:58 +00:00
|
|
|
|
2018-09-12 21:20:57 +00:00
|
|
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
2014-09-30 16:24:58 +00:00
|
|
|
PKG_SOURCE_URL:=@SF/zsh
|
2022-05-17 18:43:06 +00:00
|
|
|
PKG_HASH:=9b8d1ecedd5b5e81fbf1918e876752a7dd948e05c1a0dba10ab863842d45acd5
|
2018-09-12 21:20:57 +00:00
|
|
|
|
2015-10-03 10:15:56 +00:00
|
|
|
PKG_MAINTAINER:=Vadim A. Misbakh-Soloviov <openwrt-zsh@mva.name>
|
2014-09-30 16:24:58 +00:00
|
|
|
PKG_LICENSE:=ZSH
|
2018-09-12 21:20:57 +00:00
|
|
|
PKG_LICENSE_FILES:=LICENCE
|
|
|
|
PKG_CPE_ID:=cpe:/a:zsh_project:zsh
|
2014-09-30 16:24:58 +00:00
|
|
|
|
2023-10-04 21:46:57 +00:00
|
|
|
PKG_FIXUP:=autoreconf
|
2018-09-12 21:20:57 +00:00
|
|
|
PKG_BUILD_PARALLEL:=1
|
2014-09-30 16:24:58 +00:00
|
|
|
PKG_INSTALL:=1
|
2023-03-23 08:27:01 +00:00
|
|
|
PKG_BUILD_FLAGS:=gc-sections lto
|
2014-09-30 16:24:58 +00:00
|
|
|
|
2023-10-04 21:46:57 +00:00
|
|
|
# zsh include custom macro in the default aclocal.m4
|
|
|
|
# When autoreconf PKG_FIXUP is used, if PKG_REMOVE_FILES
|
|
|
|
# is not defined, it's set to remove the file aclocak.m4
|
|
|
|
# by default resulting in problem with the custom macro
|
|
|
|
# AC_PROG_LN
|
|
|
|
# To prevent this, declare empty PKG_REMOVE_FILES
|
|
|
|
PKG_REMOVE_FILES:=
|
|
|
|
|
2014-09-30 16:24:58 +00:00
|
|
|
include $(INCLUDE_DIR)/package.mk
|
|
|
|
|
|
|
|
define Package/zsh
|
|
|
|
SECTION:=utils
|
|
|
|
CATEGORY:=Utilities
|
2016-10-23 15:56:06 +00:00
|
|
|
SUBMENU:=Shells
|
2014-09-30 16:24:58 +00:00
|
|
|
TITLE:=The Z shell
|
2023-10-10 10:29:49 +00:00
|
|
|
DEPENDS:=+libcap +libncurses +libncursesw +libpcre2 +librt
|
2018-09-12 21:20:57 +00:00
|
|
|
URL:=https://www.zsh.org/
|
2014-09-30 16:24:58 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/zsh/description
|
|
|
|
Zsh is a UNIX command interpreter (shell) usable as an interactive
|
|
|
|
login shell and as a shell script command processor. Of the standard
|
|
|
|
shells, zsh most closely resembles ksh but includes many enhancements.
|
|
|
|
Zsh has command line editing, builtin spelling correction, programmable
|
|
|
|
command completion, shell functions (with autoloading), a history
|
|
|
|
mechanism, and a host of other features.
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Build/Configure
|
|
|
|
$(call Build/Configure/Default, \
|
|
|
|
--disable-etcdir \
|
|
|
|
--disable-gdbm \
|
2019-01-13 07:43:37 +00:00
|
|
|
$(if $(CONFIG_USE_MUSL),--enable-libc-musl) \
|
2014-09-30 16:24:58 +00:00
|
|
|
--enable-pcre \
|
2017-10-23 11:10:57 +00:00
|
|
|
--enable-cap \
|
2014-09-30 16:24:58 +00:00
|
|
|
--enable-multibyte \
|
2017-10-23 11:10:57 +00:00
|
|
|
--enable-unicode9 \
|
|
|
|
--enable-runhelpdir=$(CONFIGURE_PREFIX)/share/zsh/$(PKG_VERSION)/help \
|
|
|
|
--enable-fndir=$(CONFIGURE_PREFIX)/share/zsh/$(PKG_VERSION)/functions \
|
|
|
|
--enable-site-fndir=$(CONFIGURE_PREFIX)/share/zsh/site-functions \
|
2014-09-30 16:24:58 +00:00
|
|
|
--enable-function-subdirs \
|
|
|
|
--with-tcsetpgrp \
|
|
|
|
--with-term-lib="ncursesw", \
|
2017-10-23 11:10:57 +00:00
|
|
|
zsh_cv_shared_environ=yes \
|
|
|
|
zsh_cv_sys_dynamic_clash_ok=yes\
|
|
|
|
zsh_cv_sys_dynamic_execsyms=yes \
|
|
|
|
zsh_cv_sys_dynamic_rtld_global=yes \
|
|
|
|
zsh_cv_sys_dynamic_strip_exe=yes \
|
|
|
|
zsh_cv_sys_dynamic_strip_lib=yes \
|
2014-09-30 16:24:58 +00:00
|
|
|
zsh_cv_sys_nis=no \
|
|
|
|
zsh_cv_sys_nis_plus=no \
|
|
|
|
)
|
|
|
|
# Do not install these functions:
|
|
|
|
$(SED) 's, Completion/AIX/\*/\*,,g' $(PKG_BUILD_DIR)/config.modules
|
|
|
|
$(SED) 's, Completion/BSD/\*/\*,,g' $(PKG_BUILD_DIR)/config.modules
|
|
|
|
$(SED) 's, Completion/Cygwin/\*/\*,,g' $(PKG_BUILD_DIR)/config.modules
|
|
|
|
$(SED) 's, Completion/Darwin/\*/\*,,g' $(PKG_BUILD_DIR)/config.modules
|
|
|
|
$(SED) 's, Completion/Debian/\*/\*,,g' $(PKG_BUILD_DIR)/config.modules
|
|
|
|
$(SED) 's, Completion/Mandriva/\*/\*,,g' $(PKG_BUILD_DIR)/config.modules
|
|
|
|
$(SED) 's, Completion/Redhat/\*/\*,,g' $(PKG_BUILD_DIR)/config.modules
|
|
|
|
$(SED) 's, Completion/Solaris/\*/\*,,g' $(PKG_BUILD_DIR)/config.modules
|
|
|
|
$(SED) 's, Completion/X/\*/\*,,g' $(PKG_BUILD_DIR)/config.modules
|
|
|
|
$(SED) 's, Completion/openSUSE/\*/\*,,g' $(PKG_BUILD_DIR)/config.modules
|
|
|
|
# After mucking with 'config.modules', one must call
|
|
|
|
$(MAKE) -C $(PKG_BUILD_DIR) DESTDIR="$(PKG_INSTALL_DIR)" prep
|
|
|
|
endef
|
|
|
|
|
2023-03-23 08:27:01 +00:00
|
|
|
TARGET_CFLAGS += $(FPIC)
|
|
|
|
TARGET_LDFLAGS += $(FPIC)
|
2019-01-13 07:43:37 +00:00
|
|
|
|
2014-09-30 16:24:58 +00:00
|
|
|
define Package/zsh/postinst
|
|
|
|
#!/bin/sh
|
|
|
|
grep zsh $${IPKG_INSTROOT}/etc/shells || \
|
2017-10-23 11:10:57 +00:00
|
|
|
echo "/usr/bin/zsh" >> $${IPKG_INSTROOT}/etc/shells
|
|
|
|
|
2019-12-18 08:57:23 +00:00
|
|
|
# Backwards compatibility
|
2019-12-19 09:32:25 +00:00
|
|
|
if [ -e /bin/zsh ] && { [ ! -L /bin/zsh ] || [ "$(readlink -fn $${IPKG_INSTROOT}/bin/zsh)" != "../$(CONFIGURE_PREFIX)/bin/zsh" ]; }; then
|
2019-12-18 08:57:23 +00:00
|
|
|
ln -fs "../$(CONFIGURE_PREFIX)/bin/zsh" "$${IPKG_INSTROOT}/bin/zsh"
|
|
|
|
fi
|
2014-09-30 16:24:58 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/zsh/install
|
|
|
|
$(INSTALL_DIR) $(1)/bin
|
2017-10-23 11:10:57 +00:00
|
|
|
$(INSTALL_DIR) $(1)/$(CONFIGURE_PREFIX)/bin
|
|
|
|
$(INSTALL_DIR) $(1)/$(CONFIGURE_PREFIX)/share/zsh/$(PKG_VERSION)
|
2019-12-13 03:52:00 +00:00
|
|
|
$(INSTALL_DIR) $(1)/$(CONFIGURE_PREFIX)/lib/zsh/$(PKG_VERSION)/zsh
|
|
|
|
$(INSTALL_DIR) $(1)/$(CONFIGURE_PREFIX)/lib/zsh/$(PKG_VERSION)/zsh/net
|
|
|
|
$(INSTALL_DIR) $(1)/$(CONFIGURE_PREFIX)/lib/zsh/$(PKG_VERSION)/zsh/param
|
2017-10-23 11:10:57 +00:00
|
|
|
|
|
|
|
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/$(CONFIGURE_PREFIX)/bin/zsh $(1)/$(CONFIGURE_PREFIX)/bin/
|
|
|
|
$(CP) $(PKG_INSTALL_DIR)/$(CONFIGURE_PREFIX)/share/zsh/$(PKG_VERSION)/* $(1)/$(CONFIGURE_PREFIX)/share/zsh/$(PKG_VERSION)/
|
2019-12-13 03:52:00 +00:00
|
|
|
$(CP) $(PKG_INSTALL_DIR)/$(CONFIGURE_PREFIX)/lib/zsh/$(PKG_VERSION)/zsh/* $(1)/$(CONFIGURE_PREFIX)/lib/zsh/$(PKG_VERSION)/zsh/
|
|
|
|
$(CP) $(PKG_INSTALL_DIR)/$(CONFIGURE_PREFIX)/lib/zsh/$(PKG_VERSION)/zsh/net/* $(1)/$(CONFIGURE_PREFIX)/lib/zsh/$(PKG_VERSION)/zsh/net/
|
|
|
|
$(CP) $(PKG_INSTALL_DIR)/$(CONFIGURE_PREFIX)/lib/zsh/$(PKG_VERSION)/zsh/param/* $(1)/$(CONFIGURE_PREFIX)/lib/zsh/$(PKG_VERSION)/zsh/param/
|
2017-10-23 11:10:57 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/zsh/postrm
|
2019-12-18 08:57:23 +00:00
|
|
|
#!/bin/sh
|
2019-12-13 03:52:00 +00:00
|
|
|
rm -rf "$${IPKG_INSTROOT}/$(CONFIGURE_PREFIX)/share/zsh/$(PKG_VERSION)" \
|
|
|
|
"$${IPKG_INSTROOT}/$(CONFIGURE_PREFIX)/lib/zsh/$(PKG_VERSION)"
|
2014-09-30 16:24:58 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
$(eval $(call BuildPackage,zsh))
|