Skip to content

Commit

Permalink
zsh: make zpty module work
Browse files Browse the repository at this point in the history
  • Loading branch information
SquallATF committed Jan 14, 2021
1 parent 73df257 commit 53a1df8
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 5 deletions.
14 changes: 9 additions & 5 deletions zsh/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -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'
'3aa6a7c2e67bcd51c5bf1890c26b221171e9baae3adfc661e2a2882c302f562a')
validpgpkeys=('F7B2754C7DE2830914661F0EA71D9A9D4BDB27B3'
'E96646BE08C0AF0AA0F90788A5FEEE3AC7937444'
'7CA7ECAAF06216B90F894146ACF8146CAE8CBBC4')
Expand All @@ -43,6 +45,8 @@ 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"
# https://cygwin.com/pipermail/cygwin-developers/2021-January/012030.html
patch -p1 -i "${srcdir}/fix-zpty-module.patch"

autoreconf -fiv

Expand Down
33 changes: 33 additions & 0 deletions zsh/fix-zpty-module.patch
Original file line number Diff line number Diff line change
@@ -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 defined(__linux) || defined(__CYGWIN__)
#define _GNU_SOURCE 1
#endif
#include <stdlib.h>

0 comments on commit 53a1df8

Please sign in to comment.