Skip to content

Commit

Permalink
v3.4.3
Browse files Browse the repository at this point in the history
  • Loading branch information
cgohlke committed May 25, 2023
0 parents commit 765a309
Show file tree
Hide file tree
Showing 9 changed files with 4,944 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.diff binary
100 changes: 100 additions & 0 deletions .github/workflows/wheel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
name: Build python-ldap wheels for Windows

on:
workflow_dispatch:

env:
OPENSSL_VER: openssl-1.1.1t
OPENLDAP_VER: openldap-2.4.59
PYTHONLDAP_VER: python-ldap-3.4.3
CIBW_TEST_COMMAND: python -c"import ldap;print(ldap.__version__)"
CIBW_SKIP: "pp* cp36*"
MSBUILDTREATHIGHERTOOLSVERSIONASCURRENT: 1

jobs:
build_amd64:
name: Build AMD64 wheels
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-2022]
env:
VS_PLATFORM: x64
OPENSSL_CONFIG: VC-WIN64A-masm
steps:
- uses: actions/checkout@v3
- uses: microsoft/setup-msbuild@v1.1
with:
msbuild-architecture: x64
- uses: ilammy/msvc-dev-cmd@v1
with:
arch: amd64
- run: build_openssl.cmd
shell: cmd
- run: build_openldap.cmd
shell: cmd
- run: build_python-ldap.cmd
shell: cmd
- uses: pypa/cibuildwheel@v2.12.3
env:
CIBW_ARCHS_WINDOWS: AMD64
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl
build_x86:
name: Build x86 wheels
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-2022]
env:
VS_PLATFORM: Win32
OPENSSL_CONFIG: VC-WIN32
steps:
- uses: actions/checkout@v3
- uses: microsoft/setup-msbuild@v1.1
with:
msbuild-architecture: x86
- uses: ilammy/msvc-dev-cmd@v1
with:
arch: amd64_x86
- uses: ilammy/setup-nasm@v1
- run: build_openssl.cmd
shell: cmd
- run: build_openldap.cmd
shell: cmd
- run: build_python-ldap.cmd
shell: cmd
- uses: pypa/cibuildwheel@v2.12.3
env:
CIBW_ARCHS_WINDOWS: x86
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl
# ARM64 wheel is broken
# build_arm64:
# name: Build ARM64 wheels
# runs-on: ${{ matrix.os }}
# strategy:
# matrix:
# os: [windows-2022]
# env:
# VS_PLATFORM: ARM64
# OPENSSL_CONFIG: VC-WIN64-ARM
# steps:
# - uses: actions/checkout@v3
# - uses: microsoft/setup-msbuild@v1.1
# with:
# msbuild-architecture: arm64
# - uses: ilammy/msvc-dev-cmd@v1
# with:
# arch: amd64_arm64
# - run: build.cmd
# shell: cmd
# - uses: pypa/cibuildwheel@v2.12.3
# env:
# CIBW_SKIP: "pp* cp36* cp37* cp38* cp39* cp310*"
# CIBW_ARCHS_WINDOWS: ARM64
# - uses: actions/upload-artifact@v3
# with:
# path: ./wheelhouse/*.whl
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# python-ldap-build
Build [python-ldap](https://github.com/python-ldap/python-ldap) wheels for Windows.
34 changes: 34 additions & 0 deletions build_openldap.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
:: Download and build OpenLDAP
@echo on
setlocal

:: set OPENLDAP_VER=openldap-2.4.59
:: set VS_PLATFORM=x64

curl -L -o %OPENLDAP_VER%.tgz https://www.openldap.org/software/download/OpenLDAP/openldap-release/%OPENLDAP_VER%.tgz
if errorlevel 1 exit /B 1

tar -xf %OPENLDAP_VER%.tgz
if errorlevel 1 exit /B 1

git apply -p1 --verbose --directory=%OPENLDAP_VER% openldap.diff
if errorlevel 1 exit /B 1

cd %OPENLDAP_VER%
if errorlevel 1 exit /B 1

xcopy include ..\include\ /E /H /C /R /Q /Y
if errorlevel 1 exit /B 1

set INCLUDE=%INCLUDE%;%~dp0\include
set LIB=%LIB%;%~dp0\lib

msbuild win32\vc17\liblber.sln /m /t:Clean;Rebuild /p:UseEnv=true /p:Configuration=Release /p:Platform=%VS_PLATFORM%
if errorlevel 1 exit /B 1

copy /Y /B Release\*.lib ..\lib
if errorlevel 1 exit /B 1

cd ..

endlocal
41 changes: 41 additions & 0 deletions build_openssl.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
:: Download and build OpenSSL
@echo on
setlocal

:: set OPENSSL_VER=openssl-1.1.1t
:: set OPENSSL_CONFIG=VC-WIN64A-masm
:: set PATH=%PATH%;X:\Perl\bin

curl -L -o %OPENSSL_VER%.tar.gz https://www.openssl.org/source/%OPENSSL_VER%.tar.gz
if errorlevel 1 exit /B 1

tar -xf %OPENSSL_VER%.tar.gz
if errorlevel 1 exit /B 1

git apply -p1 --verbose --directory=%OPENSSL_VER% openssl.diff
if errorlevel 1 exit /B 1

cd %OPENSSL_VER%
if errorlevel 1 exit /B 1

perl Configure %OPENSSL_CONFIG% no-shared no-makedepend no-zlib --prefix=%~dp0 --openssldir=openssl
if errorlevel 1 exit /B 1

perl configdata.pm --dump
if errorlevel 1 exit /B 1

nmake /nologo build_all_generated
if errorlevel 1 exit /B 1

nmake /nologo PERL=no-perl
if errorlevel 1 exit /B 1

nmake /nologo install_sw
if errorlevel 1 exit /B 1

nmake /nologo install_ssldirs
if errorlevel 1 exit /B 1

cd ..

endlocal
16 changes: 16 additions & 0 deletions build_python-ldap.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
:: Download python-ldap
@echo on
setlocal

:: set PYTHONLDAP_VER=python-ldap-3.4.3

curl -L -o %PYTHONLDAP_VER%.tar.gz https://github.com/python-ldap/python-ldap/archive/refs/tags/%PYTHONLDAP_VER%.tar.gz
if errorlevel 1 exit /B 1

tar -xf %PYTHONLDAP_VER%.tar.gz --strip-components=1
if errorlevel 1 exit /B 1

git apply python-ldap.diff
if errorlevel 1 exit /B 1

endlocal
Loading

0 comments on commit 765a309

Please sign in to comment.