From defc9cb1167242fec08fa918245f2c96e9ddbe65 Mon Sep 17 00:00:00 2001 From: ngn Date: Sun, 25 Aug 2024 06:18:50 +0300 Subject: [PATCH] fix: zsh compile issues --- src/zsh/pkg.sh | 38 +++++++++------ ...5.9-avoid-incompatible-pointer-types.patch | 48 +++++++++++++++++++ 2 files changed, 72 insertions(+), 14 deletions(-) create mode 100644 src/zsh/zsh-5.9-avoid-incompatible-pointer-types.patch diff --git a/src/zsh/pkg.sh b/src/zsh/pkg.sh index 349f746..41b4615 100644 --- a/src/zsh/pkg.sh +++ b/src/zsh/pkg.sh @@ -1,22 +1,29 @@ NAME="zsh" DESC="Z shell" VERSION="5.9" + FILES=( - "https://www.zsh.org/pub/zsh-$VERSION.tar.xz" - "https://www.zsh.org/pub/zsh-$VERSION-doc.tar.xz" + "https://www.zsh.org/pub/zsh-${VERSION}.tar.xz" + "https://www.zsh.org/pub/zsh-${VERSION}-doc.tar.xz" + "zsh-${VERSION}-avoid-incompatible-pointer-types.patch" ) HASHES=( "182e37ca3fe3fa6a44f69ad462c5c30e" "8db53446f613521fb4f9b0bd9f6adda1" + "984c804bfa4c7c9b1ddba9f18bbd29846bf6f2b3171f39bb775c11c8b1c7b5ad2c68d2922a59265c58f6e83016d6d440d64862c529d82f90cad308fd2af757ce" ) -DEPENDS=() + +DEPENDS=("gdbm" "libcap" "pcre2" "grep") # grep needed for INSTALL +BUILD=() PACKAGE() { - tar xf $NAME-$VERSION.tar.xz - cd $NAME-$VERSION + tar xf "${NAME}-${VERSION}.tar.xz" + cd "${NAME}-${VERSION}" - tar --strip-components=1 -xvf ../zsh-$VERSION-doc.tar.xz - ./configure --prefix=/usr \ + patch -Np1 < "../zsh-${VERSION}-avoid-incompatible-pointer-types.patch" + + tar --strip-components=1 -xvf "../zsh-${VERSION}-doc.tar.xz" + ./configure --prefix=/usr \ --sysconfdir=/etc/zsh \ --enable-etcdir=/etc/zsh \ --enable-cap \ @@ -27,16 +34,19 @@ PACKAGE() { makeinfo Doc/zsh.texi --html -o Doc/html makeinfo Doc/zsh.texi --html --no-split --no-headers -o Doc/zsh.html - make DESTDIR=${ROOTDIR} install - make DESTDIR=${ROOTDIR} infodir=/usr/share/info install.info + make DESTDIR="${ROOTDIR}" install + make DESTDIR="${ROOTDIR}" infodir=/usr/share/info install.info - install -v -m755 -d ${ROOTDIR}/usr/share/doc/zsh-$VERSION/html - install -v -m644 Doc/html/* ${ROOTDIR}/usr/share/doc/zsh-$VERSION/html - install -v -m644 Doc/zsh.{html,txt} ${ROOTDIR}/usr/share/doc/zsh-$VERSION + install -v -m755 -d "${ROOTDIR}/usr/share/doc/zsh-${VERSION}/html" + install -v -m644 Doc/html/* "${ROOTDIR}/usr/share/doc/zsh-${VERSION}/html" + install -v -m644 Doc/zsh.{html,txt} "${ROOTDIR}/usr/share/doc/zsh-${VERSION}" - cd .. && rm -rf $NAME-$VERSION + cd .. && rm -rf "${NAME}-${VERSION}" } INSTALL(){ - echo /bin/zsh >> /etc/shells + # add zsh to /etc/shells if not already exists + if ! grep -q "/bin/zsh" "/etc/shells"; then + echo /bin/zsh >> /etc/shells + fi } diff --git a/src/zsh/zsh-5.9-avoid-incompatible-pointer-types.patch b/src/zsh/zsh-5.9-avoid-incompatible-pointer-types.patch new file mode 100644 index 0000000..1a9d32d --- /dev/null +++ b/src/zsh/zsh-5.9-avoid-incompatible-pointer-types.patch @@ -0,0 +1,48 @@ +From 4c89849c98172c951a9def3690e8647dae76308f Mon Sep 17 00:00:00 2001 +From: Florian Weimer +Date: Fri, 8 Dec 2023 21:58:07 +0100 +Subject: [PATCH] 52383: Avoid incompatible pointer types in terminfo global + variable checks + +--- + configure.ac | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 2a8221e1f..2871dcb7c 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1768,27 +1768,27 @@ if test x$zsh_cv_path_term_header != xnone; then + fi + + AC_MSG_CHECKING(if boolcodes is available) +- AC_LINK_IFELSE([AC_LANG_PROGRAM([[$term_includes]], [[char **test = boolcodes; puts(*test);]])],[AC_DEFINE(HAVE_BOOLCODES) boolcodes=yes],[boolcodes=no]) ++ AC_LINK_IFELSE([AC_LANG_PROGRAM([[$term_includes]], [[char **test = (char **)boolcodes; puts(*test);]])],[AC_DEFINE(HAVE_BOOLCODES) boolcodes=yes],[boolcodes=no]) + AC_MSG_RESULT($boolcodes) + + AC_MSG_CHECKING(if numcodes is available) +- AC_LINK_IFELSE([AC_LANG_PROGRAM([[$term_includes]], [[char **test = numcodes; puts(*test);]])],[AC_DEFINE(HAVE_NUMCODES) numcodes=yes],[numcodes=no]) ++ AC_LINK_IFELSE([AC_LANG_PROGRAM([[$term_includes]], [[char **test = (char **)numcodes; puts(*test);]])],[AC_DEFINE(HAVE_NUMCODES) numcodes=yes],[numcodes=no]) + AC_MSG_RESULT($numcodes) + + AC_MSG_CHECKING(if strcodes is available) +- AC_LINK_IFELSE([AC_LANG_PROGRAM([[$term_includes]], [[char **test = strcodes; puts(*test);]])],[AC_DEFINE(HAVE_STRCODES) strcodes=yes],[strcodes=no]) ++ AC_LINK_IFELSE([AC_LANG_PROGRAM([[$term_includes]], [[char **test = (char **)strcodes; puts(*test);]])],[AC_DEFINE(HAVE_STRCODES) strcodes=yes],[strcodes=no]) + AC_MSG_RESULT($strcodes) + + AC_MSG_CHECKING(if boolnames is available) +- AC_LINK_IFELSE([AC_LANG_PROGRAM([[$term_includes]], [[char **test = boolnames; puts(*test);]])],[AC_DEFINE(HAVE_BOOLNAMES) boolnames=yes],[boolnames=no]) ++ AC_LINK_IFELSE([AC_LANG_PROGRAM([[$term_includes]], [[char **test = (char **)boolnames; puts(*test);]])],[AC_DEFINE(HAVE_BOOLNAMES) boolnames=yes],[boolnames=no]) + AC_MSG_RESULT($boolnames) + + AC_MSG_CHECKING(if numnames is available) +- AC_LINK_IFELSE([AC_LANG_PROGRAM([[$term_includes]], [[char **test = numnames; puts(*test);]])],[AC_DEFINE(HAVE_NUMNAMES) numnames=yes],[numnames=no]) ++ AC_LINK_IFELSE([AC_LANG_PROGRAM([[$term_includes]], [[char **test = (char **)numnames; puts(*test);]])],[AC_DEFINE(HAVE_NUMNAMES) numnames=yes],[numnames=no]) + AC_MSG_RESULT($numnames) + + AC_MSG_CHECKING(if strnames is available) +- AC_LINK_IFELSE([AC_LANG_PROGRAM([[$term_includes]], [[char **test = strnames; puts(*test);]])],[AC_DEFINE(HAVE_STRNAMES) strnames=yes],[strnames=no]) ++ AC_LINK_IFELSE([AC_LANG_PROGRAM([[$term_includes]], [[char **test = (char **)strnames; puts(*test);]])],[AC_DEFINE(HAVE_STRNAMES) strnames=yes],[strnames=no]) + AC_MSG_RESULT($strnames) + + dnl There are apparently defective terminal library headers on some