winpty-git: First working version

This commit is contained in:
martell
2014-09-13 23:55:44 +01:00
parent 031156cf33
commit a502bf45e0
5 changed files with 149 additions and 20 deletions

View File

@@ -1,40 +1,40 @@
From af7fcf0c3b5bad57b7e80e5c1c9d0d376f3282af Mon Sep 17 00:00:00 2001
From 65a5f605c0aa706e7385954af298dbfa3ea6c649 Mon Sep 17 00:00:00 2001
From: martell <martellmalone@gmail.com>
Date: Sat, 13 Sep 2014 21:32:08 +0100
Subject: [PATCH] Added Support for MSYS2
Subject: [PATCH 1/4] Added Support for MSYS2
---
configure | 23 ++++++++++++++++++++++-
1 file changed, 22 insertions(+), 1 deletion(-)
diff --git a/configure b/configure
index 7df110d..65f21cb 100755
index 7df110d..702ef9e 100755
--- a/configure
+++ b/configure
@@ -79,8 +79,29 @@ case $(uname -s) in
# msys-1.0.dll, but no gcc or stdc++ DLL.
UNIX_LDFLAGS_STATIC_LIBSTDCXX=
;;
+ MSYS*)
+ MSYS*|MINGW*)
+ echo 'uname -s identifies a Msys2 environment.'
+ IS_MSYS=1
+ case $(uname -m) in
+ i686)
+ echo 'uname -m identifies a i686 environment.'
+ UNIX_GPP=i686-pc-msys-g++
+ MINGW_GPP="i686-pc-mingw32-g++ /mingw32/bin/i686-w64-mingw32-g++"
+ UNIX_GPP=i686-pc-msys-g++ /usr/bin/i686-pc-msys-g++
+ MINGW_GPP="i686-w64-mingw32-g++ /mingw32/bin/i686-w64-mingw32-g++"
+ ;;
+ x86_64)
+ echo 'uname -m identifies a x86_64 environment.'
+ UNIX_GPP=x86_64-pc-msys-g++
+ MINGW_GPP="x86_64-pc-mingw32-g++ /mingw64/bin/x86_64-w64-mingw32-g++"
+ UNIX_GPP="x86_64-pc-msys-g++ /usr/bin/x86_64-pc-msys-g++"
+ MINGW_GPP="x86_64-w64-mingw32-g++ /mingw64/bin/x86_64-w64-mingw32-g++"
+ ;;
+ *)
+ echo 'Error: uname -m did not match either i686 or x86_64.'
+ exit 1
+ ;;
+ esac
+ UNIX_LDFLAGS_STATIC_LIBSTDCXX=""
+ UNIX_LDFLAGS_STATIC_LIBSTDCXX="-static-libgcc -static-libstdc++ "
+ ;;
*)
- echo 'Error: uname -s did not match either CYGWIN* or MINGW*.'

View File

@@ -0,0 +1,32 @@
From 808631e64e8256a686bf6d67621b8b32e1532c8f Mon Sep 17 00:00:00 2001
From: martell <martellmalone@gmail.com>
Date: Sat, 13 Sep 2014 22:25:49 +0100
Subject: [PATCH 2/4] remove mingw.org case
---
configure | 9 ---------
1 file changed, 9 deletions(-)
diff --git a/configure b/configure
index 702ef9e..53dfbae 100755
--- a/configure
+++ b/configure
@@ -70,15 +70,6 @@ case $(uname -s) in
esac
UNIX_LDFLAGS_STATIC_LIBSTDCXX="-static-libgcc -static-libstdc++"
;;
- MINGW*)
- echo 'uname -s identifies a MSYS environment.'
- IS_MSYS=1
- UNIX_GPP=i686-pc-msys-g++
- MINGW_GPP=mingw32-g++
- # The MSYS compiler does not recognize -static-libstdc++. There is a
- # msys-1.0.dll, but no gcc or stdc++ DLL.
- UNIX_LDFLAGS_STATIC_LIBSTDCXX=
- ;;
MSYS*|MINGW*)
echo 'uname -s identifies a Msys2 environment.'
IS_MSYS=1
--
2.1.0

View File

@@ -0,0 +1,30 @@
From 95824f5edd6941bfa7b8a582a1998b70d29e090f Mon Sep 17 00:00:00 2001
From: martell <martellmalone@gmail.com>
Date: Sat, 13 Sep 2014 22:37:30 +0100
Subject: [PATCH 3/4] Fix path convert for MSYS2 (hacky)
---
unix-adapter/main.cc | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/unix-adapter/main.cc b/unix-adapter/main.cc
index bd9281f..dcceabd 100644
--- a/unix-adapter/main.cc
+++ b/unix-adapter/main.cc
@@ -217,6 +217,13 @@ static void setFdNonBlock(int fd)
fcntl(fd, F_SETFL, status | O_NONBLOCK);
}
+extern "C" int
+cygwin_conv_to_win32_path (const char path, char win32_path)
+{
+return cygwin_conv_path (CCP_POSIX_TO_WIN_A | CCP_RELATIVE, path, win32_path,
+MAX_PATH);
+}
+
// Convert the path to a Win32 path if it is a POSIX path, and convert slashes
// to backslashes.
static std::string convertPosixPathToWin(const std::string &path)
--
2.1.0

View File

@@ -0,0 +1,64 @@
From 30836d4c58b63fbc0a25735905097d21f5446858 Mon Sep 17 00:00:00 2001
From: martell <martellmalone@gmail.com>
Date: Sat, 13 Sep 2014 22:48:27 +0100
Subject: [PATCH 4/4] attempt again to parse path
---
unix-adapter/main.cc | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/unix-adapter/main.cc b/unix-adapter/main.cc
index dcceabd..783e8a7 100644
--- a/unix-adapter/main.cc
+++ b/unix-adapter/main.cc
@@ -217,19 +217,19 @@ static void setFdNonBlock(int fd)
fcntl(fd, F_SETFL, status | O_NONBLOCK);
}
-extern "C" int
-cygwin_conv_to_win32_path (const char path, char win32_path)
-{
-return cygwin_conv_path (CCP_POSIX_TO_WIN_A | CCP_RELATIVE, path, win32_path,
-MAX_PATH);
-}
+//extern "C" int
+//cygwin_conv_to_win32_path (const char path, char win32_path)
+//{
+//return cygwin_conv_path (CCP_POSIX_TO_WIN_A | CCP_RELATIVE, path, win32_path,
+//MAX_PATH);
+//}
// Convert the path to a Win32 path if it is a POSIX path, and convert slashes
// to backslashes.
static std::string convertPosixPathToWin(const std::string &path)
{
char *tmp;
-#if !defined(__MSYS__) && CYGWIN_VERSION_API_MINOR >= 181
+//#if !defined(__MSYS__) && CYGWIN_VERSION_API_MINOR >= 181
ssize_t newSize = cygwin_conv_path(CCP_POSIX_TO_WIN_A | CCP_RELATIVE,
path.c_str(), NULL, 0);
assert(newSize >= 0);
@@ -237,16 +237,16 @@ static std::string convertPosixPathToWin(const std::string &path)
ssize_t success = cygwin_conv_path(CCP_POSIX_TO_WIN_A | CCP_RELATIVE,
path.c_str(), tmp, newSize + 1);
assert(success == 0);
-#else
+//#else
// In the current Cygwin header file, this API is documented as deprecated
// because it's restricted to paths of MAX_PATH length. In the CVS version
// of MSYS, the newer API doesn't exist, and this older API is implemented
// using msys_p2w, which seems like it would handle paths larger than
// MAX_PATH, but there's no way to query how large the new path is.
// Hopefully, this is large enough.
- tmp = new char[MAX_PATH + path.size()];
- cygwin_conv_to_win32_path(path.c_str(), tmp);
-#endif
+// tmp = new char[MAX_PATH + path.size()];
+// cygwin_conv_to_win32_path(path.c_str(), tmp);
+//#endif
for (int i = 0; tmp[i] != '\0'; ++i) {
if (tmp[i] == '/')
tmp[i] = '\\';
--
2.1.0

View File

@@ -16,19 +16,19 @@ conflicts=("${_realname}")
options=('staticlibs' 'strip')
source=("${_realname}"::"git+https://github.com/rprichard/winpty.git"
"0001-Added-Support-for-MSYS2.patch")
# "0002-Use-CT_FindRelativePath-for-gcc-and-gmp.patch"
# "0003-Modify-config-to-support-correct-Mingw64-Triplet-Nam.patch"
# "0004-AC_SEARCH_LIBS-more-libs-for-build-on-MSYS2-Cygwin-M.patch"
"0001-Added-Support-for-MSYS2.patch"
"0002-remove-mingw.org-case.patch"
"0003-Fix-path-convert-for-MSYS2-hacky.patch"
"0004-attempt-again-to-parse-path.patch")
# "0005-Change-both-fs-case-sensitivity-Aborts-to-Log-Warns.patch"
# "0006-CT_DoForceRmdir-added-support-for-MSYS-and-MINGW.patch")
md5sums=('SKIP'
'SKIP'
'SKIP'
'SKIP'
'SKIP')
# 'SKIP'
# 'SKIP'
# 'SKIP'
# 'SKIP'
# 'SKIP')
#pkgver() {
@@ -41,9 +41,9 @@ prepare() {
cd "$srcdir/$_realname"
git am "$srcdir/0001-Added-Support-for-MSYS2.patch"
#git am "$srcdir/0002-Use-CT_FindRelativePath-for-gcc-and-gmp.patch"
#git am "$srcdir/0003-Modify-config-to-support-correct-Mingw64-Triplet-Nam.patch"
#git am "$srcdir/0004-AC_SEARCH_LIBS-more-libs-for-build-on-MSYS2-Cygwin-M.patch"
git am "$srcdir/0002-remove-mingw.org-case.patch"
git am "$srcdir/0003-Fix-path-convert-for-MSYS2-hacky.patch"
git am "$srcdir/0004-attempt-again-to-parse-path.patch"
#git am "$srcdir/0005-Change-both-fs-case-sensitivity-Aborts-to-Log-Warns.patch"
#git am "$srcdir/0006-CT_DoForceRmdir-added-support-for-MSYS-and-MINGW.patch"
}
@@ -58,5 +58,8 @@ build() {
package() {
cd "$srcdir/$_realname"
make DESTDIR=${pkgdir} install
make PREFIX=${pkgdir}/usr install
#mkdir -p ${pkgdir}/usr/lib/p11-kit
#cp -f sbin/update-ca-trust ${pkgdir}/usr/lib/p11-kit/p11-kit-extract-trust
}