Files
MINGW-packages/mingw-w64-python-winkerberos/0001-fix-mingw-build.patch
Biswapriyo Nath 43a36f6215 python-winkerberos: update to 0.8.0
Add patch file from upstream pull request
2022-02-08 14:14:11 +05:30

65 lines
1.9 KiB
Diff

From 536113b7f45f9caeefa3a65ca669e16e6101c4d3 Mon Sep 17 00:00:00 2001
From: Biswapriyo Nath <nathbappai@gmail.com>
Date: Sun, 6 Feb 2022 08:35:44 +0530
Subject: [PATCH 1/3] setup: Fix build in mingw
MINGW_CHOST is specific to msys2 build and packaging environment.
Instead, check sys.version which is available in any python env.
Also remove SecPkgContext_Bindings definition which has been added
in mingw-w64 headers.
---
setup.py | 17 +++++++----------
src/kerberos_sspi.h | 7 -------
2 files changed, 7 insertions(+), 17 deletions(-)
diff --git a/setup.py b/setup.py
index a595c4b..e912bf9 100644
--- a/setup.py
+++ b/setup.py
@@ -89,20 +89,17 @@ def run(self):
tests_require = ["pymongo >= 2.9"]
-chost = os.environ.get("MINGW_CHOST") #ie: i686-w64-mingw32
-if chost:
- #mingw build
- libpath = os.environ.get("MINGW_PREFIX", "/mingw32")+"/"+chost+"/lib"
- extra_link_args = ["-lssl", "-lcrypto", "-fPIC",
- "%s/libcrypt32.a" % libpath,
- "%s/libsecur32.a" % libpath,
- "%s/libshlwapi.a" % libpath,
- ]
-else:
+if 'MSC' in sys.version:
#msvc:
extra_link_args = ['crypt32.lib', 'secur32.lib', 'Shlwapi.lib',
'/NXCOMPAT', '/DYNAMICBASE',
]
+else:
+ #mingw:
+ extra_link_args = ['-lcrypt32',
+ '-lsecur32',
+ '-lshlwapi']
+
setup(
name="winkerberos",
version="0.8.0",
diff --git a/src/kerberos_sspi.h b/src/kerberos_sspi.h
index ab89f50..96d94ec 100644
--- a/src/kerberos_sspi.h
+++ b/src/kerberos_sspi.h
@@ -21,13 +21,6 @@
#include <Windows.h>
#include <sspi.h>
-#ifdef __MINGW32__
-typedef struct _SecPkgContext_Bindings {
- unsigned long BindingsLength;
- SEC_CHANNEL_BINDINGS *Bindings;
-} SecPkgContext_Bindings, *PSecPkgContext_Bindings;
-#endif
-
#define AUTH_GSS_ERROR -1
#define AUTH_GSS_COMPLETE 1
#define AUTH_GSS_CONTINUE 0