Skip to content

Commit 765a309

Browse files
committed
v3.4.3
0 parents  commit 765a309

File tree

9 files changed

+4944
-0
lines changed

9 files changed

+4944
-0
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.diff binary

.github/workflows/wheel.yml

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
name: Build python-ldap wheels for Windows
2+
3+
on:
4+
workflow_dispatch:
5+
6+
env:
7+
OPENSSL_VER: openssl-1.1.1t
8+
OPENLDAP_VER: openldap-2.4.59
9+
PYTHONLDAP_VER: python-ldap-3.4.3
10+
CIBW_TEST_COMMAND: python -c"import ldap;print(ldap.__version__)"
11+
CIBW_SKIP: "pp* cp36*"
12+
MSBUILDTREATHIGHERTOOLSVERSIONASCURRENT: 1
13+
14+
jobs:
15+
build_amd64:
16+
name: Build AMD64 wheels
17+
runs-on: ${{ matrix.os }}
18+
strategy:
19+
matrix:
20+
os: [windows-2022]
21+
env:
22+
VS_PLATFORM: x64
23+
OPENSSL_CONFIG: VC-WIN64A-masm
24+
steps:
25+
- uses: actions/checkout@v3
26+
- uses: microsoft/[email protected]
27+
with:
28+
msbuild-architecture: x64
29+
- uses: ilammy/msvc-dev-cmd@v1
30+
with:
31+
arch: amd64
32+
- run: build_openssl.cmd
33+
shell: cmd
34+
- run: build_openldap.cmd
35+
shell: cmd
36+
- run: build_python-ldap.cmd
37+
shell: cmd
38+
- uses: pypa/[email protected]
39+
env:
40+
CIBW_ARCHS_WINDOWS: AMD64
41+
- uses: actions/upload-artifact@v3
42+
with:
43+
path: ./wheelhouse/*.whl
44+
build_x86:
45+
name: Build x86 wheels
46+
runs-on: ${{ matrix.os }}
47+
strategy:
48+
matrix:
49+
os: [windows-2022]
50+
env:
51+
VS_PLATFORM: Win32
52+
OPENSSL_CONFIG: VC-WIN32
53+
steps:
54+
- uses: actions/checkout@v3
55+
- uses: microsoft/[email protected]
56+
with:
57+
msbuild-architecture: x86
58+
- uses: ilammy/msvc-dev-cmd@v1
59+
with:
60+
arch: amd64_x86
61+
- uses: ilammy/setup-nasm@v1
62+
- run: build_openssl.cmd
63+
shell: cmd
64+
- run: build_openldap.cmd
65+
shell: cmd
66+
- run: build_python-ldap.cmd
67+
shell: cmd
68+
- uses: pypa/[email protected]
69+
env:
70+
CIBW_ARCHS_WINDOWS: x86
71+
- uses: actions/upload-artifact@v3
72+
with:
73+
path: ./wheelhouse/*.whl
74+
# ARM64 wheel is broken
75+
# build_arm64:
76+
# name: Build ARM64 wheels
77+
# runs-on: ${{ matrix.os }}
78+
# strategy:
79+
# matrix:
80+
# os: [windows-2022]
81+
# env:
82+
# VS_PLATFORM: ARM64
83+
# OPENSSL_CONFIG: VC-WIN64-ARM
84+
# steps:
85+
# - uses: actions/checkout@v3
86+
# - uses: microsoft/[email protected]
87+
# with:
88+
# msbuild-architecture: arm64
89+
# - uses: ilammy/msvc-dev-cmd@v1
90+
# with:
91+
# arch: amd64_arm64
92+
# - run: build.cmd
93+
# shell: cmd
94+
# - uses: pypa/[email protected]
95+
# env:
96+
# CIBW_SKIP: "pp* cp36* cp37* cp38* cp39* cp310*"
97+
# CIBW_ARCHS_WINDOWS: ARM64
98+
# - uses: actions/upload-artifact@v3
99+
# with:
100+
# path: ./wheelhouse/*.whl

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# python-ldap-build
2+
Build [python-ldap](https://github.com/python-ldap/python-ldap) wheels for Windows.

build_openldap.cmd

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
:: Download and build OpenLDAP
2+
@echo on
3+
setlocal
4+
5+
:: set OPENLDAP_VER=openldap-2.4.59
6+
:: set VS_PLATFORM=x64
7+
8+
curl -L -o %OPENLDAP_VER%.tgz https://www.openldap.org/software/download/OpenLDAP/openldap-release/%OPENLDAP_VER%.tgz
9+
if errorlevel 1 exit /B 1
10+
11+
tar -xf %OPENLDAP_VER%.tgz
12+
if errorlevel 1 exit /B 1
13+
14+
git apply -p1 --verbose --directory=%OPENLDAP_VER% openldap.diff
15+
if errorlevel 1 exit /B 1
16+
17+
cd %OPENLDAP_VER%
18+
if errorlevel 1 exit /B 1
19+
20+
xcopy include ..\include\ /E /H /C /R /Q /Y
21+
if errorlevel 1 exit /B 1
22+
23+
set INCLUDE=%INCLUDE%;%~dp0\include
24+
set LIB=%LIB%;%~dp0\lib
25+
26+
msbuild win32\vc17\liblber.sln /m /t:Clean;Rebuild /p:UseEnv=true /p:Configuration=Release /p:Platform=%VS_PLATFORM%
27+
if errorlevel 1 exit /B 1
28+
29+
copy /Y /B Release\*.lib ..\lib
30+
if errorlevel 1 exit /B 1
31+
32+
cd ..
33+
34+
endlocal

build_openssl.cmd

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
:: Download and build OpenSSL
2+
@echo on
3+
setlocal
4+
5+
:: set OPENSSL_VER=openssl-1.1.1t
6+
:: set OPENSSL_CONFIG=VC-WIN64A-masm
7+
:: set PATH=%PATH%;X:\Perl\bin
8+
9+
curl -L -o %OPENSSL_VER%.tar.gz https://www.openssl.org/source/%OPENSSL_VER%.tar.gz
10+
if errorlevel 1 exit /B 1
11+
12+
tar -xf %OPENSSL_VER%.tar.gz
13+
if errorlevel 1 exit /B 1
14+
15+
git apply -p1 --verbose --directory=%OPENSSL_VER% openssl.diff
16+
if errorlevel 1 exit /B 1
17+
18+
cd %OPENSSL_VER%
19+
if errorlevel 1 exit /B 1
20+
21+
perl Configure %OPENSSL_CONFIG% no-shared no-makedepend no-zlib --prefix=%~dp0 --openssldir=openssl
22+
if errorlevel 1 exit /B 1
23+
24+
perl configdata.pm --dump
25+
if errorlevel 1 exit /B 1
26+
27+
nmake /nologo build_all_generated
28+
if errorlevel 1 exit /B 1
29+
30+
nmake /nologo PERL=no-perl
31+
if errorlevel 1 exit /B 1
32+
33+
nmake /nologo install_sw
34+
if errorlevel 1 exit /B 1
35+
36+
nmake /nologo install_ssldirs
37+
if errorlevel 1 exit /B 1
38+
39+
cd ..
40+
41+
endlocal

build_python-ldap.cmd

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
:: Download python-ldap
2+
@echo on
3+
setlocal
4+
5+
:: set PYTHONLDAP_VER=python-ldap-3.4.3
6+
7+
curl -L -o %PYTHONLDAP_VER%.tar.gz https://github.com/python-ldap/python-ldap/archive/refs/tags/%PYTHONLDAP_VER%.tar.gz
8+
if errorlevel 1 exit /B 1
9+
10+
tar -xf %PYTHONLDAP_VER%.tar.gz --strip-components=1
11+
if errorlevel 1 exit /B 1
12+
13+
git apply python-ldap.diff
14+
if errorlevel 1 exit /B 1
15+
16+
endlocal

0 commit comments

Comments
 (0)