From c1bcda555924063567423c3071b02161b5002900 Mon Sep 17 00:00:00 2001 From: Peiyuan Song Date: Wed, 13 Jan 2021 21:29:07 +0800 Subject: [PATCH] make zpty module work --- zsh/PKGBUILD | 13 ++++++++----- zsh/fix-zpty-module.patch | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 5 deletions(-) create mode 100644 zsh/fix-zpty-module.patch diff --git a/zsh/PKGBUILD b/zsh/PKGBUILD index a24758cec85a..f88ed9331b5a 100644 --- a/zsh/PKGBUILD +++ b/zsh/PKGBUILD @@ -3,7 +3,7 @@ pkgbase=zsh pkgname=('zsh' 'zsh-doc') pkgver=5.8 -pkgrel=3 +pkgrel=4 arch=('i686' 'x86_64') url='https://www.zsh.org/' license=('custom') @@ -18,20 +18,22 @@ source=("https://www.zsh.org/pub/zsh-${pkgver}.tar.xz"{,.asc} add-pwd-W-option.patch msysize.patch zsh-5.0.6-1.patch - msys-symlink-hack.patch) + msys-symlink-hack.patch + fix-zpty-module.patch) sha256sums=('dcc4b54cc5565670a65581760261c163d720991f0d06486da61f8d839b52de27' 'SKIP' '9b4e939593cb5a76564d2be2e2bfbb6242509c0c56fd9ba52f5dba6cf06fdcc4' 'SKIP' - 'c081ced2d645e3b107fbf864529cc0e5954399a09b87a4f1d300470854b6dea4' - 'f08fe8f207c0fa6d722312774c28365024682333f5547c8192d0547957b000af' + 'a41df3c465f3704faf331f052c4c3975f656436902d1778e81e16b5b511fb5ed' + 'd15bed73e5596867e584b20fc21b1c5a1a84203b25f50fddd543b77a3e8d1876' '230832038c3b8f67fdb1b284ac5f68d709cdb7f1bc752b0e60657b9b9d091045' '06c05faa800cb7385b606fd2b3c9aa24cfac07d1dde7f0d2f017c11ede9b2ac8' '971e48433ec40e0c2fb64584b5555367b4f997156aa9acbd06c67d7bdacd6c59' 'b3f74a10a27eff498124adc96bc8c5cced7bb15e18c2603d7c3490a81e3c2e48' 'b879d33cc60fc0c44361189eef1ee95a3bd0b8f9e8b32c81e439950483c151aa' '336a8e6e93b778e7aec27348619b7200e0a75e5cf14dce720afd9dd6f836ea2c' - 'de515b0d86c13c29a663b4ba0fdb338dea83f82f145cf8c4da78d30369f963e4') + 'de515b0d86c13c29a663b4ba0fdb338dea83f82f145cf8c4da78d30369f963e4' + 'deadee502c562d80ddbe2be717b7dfeb5e47ad9f61ef25e1011539c4053cbc0f') validpgpkeys=('F7B2754C7DE2830914661F0EA71D9A9D4BDB27B3' 'E96646BE08C0AF0AA0F90788A5FEEE3AC7937444' '7CA7ECAAF06216B90F894146ACF8146CAE8CBBC4') @@ -43,6 +45,7 @@ prepare() { patch -p1 -i "${srcdir}/msysize.patch" patch -p1 -i "${srcdir}/zsh-5.0.6-1.patch" patch -p1 -i "${srcdir}/msys-symlink-hack.patch" + patch -p1 -i "${srcdir}/fix-zpty-module.patch" autoreconf -fiv diff --git a/zsh/fix-zpty-module.patch b/zsh/fix-zpty-module.patch new file mode 100644 index 000000000000..7ac350bed8fe --- /dev/null +++ b/zsh/fix-zpty-module.patch @@ -0,0 +1,33 @@ +diff --git a/Src/Modules/zpty.c b/Src/Modules/zpty.c +index 45fd15ee0..eadb7ceac 100644 +--- a/Src/Modules/zpty.c ++++ b/Src/Modules/zpty.c +@@ -428,6 +428,7 @@ newptycmd(char *nam, char *pname, char **args, int echo, int nblock) + mypid = 0; /* trick to ensure we _exit() */ + zexit(lastval, ZEXIT_NORMAL); + } ++#ifndef __CYGWIN__ + master = movefd(master); + if (master == -1) { + zerrnam(nam, "cannot duplicate fd %d: %e", master, errno); +@@ -435,6 +436,7 @@ newptycmd(char *nam, char *pname, char **args, int echo, int nblock) + ineval = oineval; + return 1; + } ++#endif + + p = (Ptycmd) zalloc(sizeof(*p)); + +diff --git a/configure.ac b/configure.ac +index bd1b40225..3b0cc1f53 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -2504,7 +2504,7 @@ if test x$ac_cv_have_dev_ptmx = xyes -o x$ac_cv_func_posix_openpt = xyes && \ + test x$ac_cv_func_ptsname = xyes; then + AC_CACHE_CHECK([if /dev/ptmx is usable], + ac_cv_use_dev_ptmx, +- [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#ifdef __linux ++ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#if definde(__linux) || defined(__CYGWIN__) + #define _GNU_SOURCE 1 + #endif + #include