From 0633fab808943a841183d6160267b9377ff28a62 Mon Sep 17 00:00:00 2001 From: Brian Pugh Date: Mon, 26 Feb 2024 15:42:55 -0800 Subject: [PATCH] jklasdflkasd --- .github/workflows/build_wheels.yaml | 25 ++++++++++++---- scripts/install_zlib.ps1 | 44 +++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+), 6 deletions(-) create mode 100644 scripts/install_zlib.ps1 diff --git a/.github/workflows/build_wheels.yaml b/.github/workflows/build_wheels.yaml index c430870..de0d198 100644 --- a/.github/workflows/build_wheels.yaml +++ b/.github/workflows/build_wheels.yaml @@ -62,8 +62,9 @@ jobs: submodules: "recursive" - name: Install ZLIB - run: choco install zlib shell: pwsh + run: | + scripts/install_zlib.ps1 1.2.11 - name: Set up python 3.12 uses: actions/setup-python@v4 @@ -151,11 +152,23 @@ jobs: CIBW_ARCHS: ${{ matrix.cibw_archs }} CIBW_BUILD: ${{ matrix.cibw_build }} CIBW_BEFORE_ALL: mkdir openexr/build && cd openexr/build && cmake .. -DCMAKE_INSTALL_PREFIX=../../openexr-install && make all install - CIBW_ENVIRONMENT: REPAIR_LIBRARY_PATH=${GITHUB_WORKSPACE}/openexr-install/lib64:${GITHUB_WORKSPACE}/openexr-install/lib - CIBW_REPAIR_WHEEL_COMMAND_MACOS: > - # https://cibuildwheel.readthedocs.io/en/stable/faq/#macos-passing-dyld_library_path-to-delocate - DYLD_LIBRARY_PATH=$REPAIR_LIBRARY_PATH delocate-listdeps --all {wheel} - DYLD_LIBRARY_PATH=$REPAIR_LIBRARY_PATH delocate-wheel --verbose --require-archs {delocate_archs} -w {dest_dir} {wheel} + CIBW_ENVIRONMENT: LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/openexr-install/lib64:${GITHUB_WORKSPACE}/openexr-install/lib + CIBW_REPAIR_WHEEL_COMMAND: | + echo "Target delocate archs: {delocate_archs}" + + ORIGINAL_WHEEL={wheel} + + echo "Running delocate-listdeps to list linked original wheel dependencies" + delocate-listdeps --all $ORIGINAL_WHEEL + + echo "Running delocate-wheel command on $ORIGINAL_WHEEL" + delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v $ORIGINAL_WHEEL + + echo "Running delocate-listdeps to list linked wheel dependencies" + WHEEL_SIMPLE_FILENAME="${ORIGINAL_WHEEL##*/}" + delocate-listdeps --all {dest_dir}/$WHEEL_SIMPLE_FILENAME + + echo "DONE." - uses: actions/upload-artifact@v3 with: diff --git a/scripts/install_zlib.ps1 b/scripts/install_zlib.ps1 new file mode 100644 index 0000000..78d75bf --- /dev/null +++ b/scripts/install_zlib.ps1 @@ -0,0 +1,44 @@ +$homeDir = (pwd) + +$zlibVersion = $Args[0] +$zlibMajorMinor = [io.path]::GetFileNameWithoutExtension("$zlibVersion") +$zlibVersionConcise = $zlibVersion -replace '[.]','' +$zlibArchive = "https://www.zlib.net/zlib${zlibVersionConcise}.zip" + +$zlibRoot = "C:\" +$zlibBuildPath = "${zlibRoot}\zlib-${zlibVersion}" +$zlibInstallPath = "C:\_zlib" +$msbuild = "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\msbuild.exe" + +Write-Host "Retrieving ${zlibArchive}" +Invoke-WebRequest "${zlibArchive}" -OutFile "${zlibRoot}\zlib-${zlibVersion}.zip" +Write-Host "Expanding archive ${zlibRoot}\zlib-${zlibVersion}.zip" +Expand-Archive "${zlibRoot}\zlib-${zlibVersion}.zip" -DestinationPath "${zlibRoot}" + +cd $zlibBuildPath +mkdir _build +cd _build +cmake .. -G"Visual Studio 16 2019" -DCMAKE_INSTALL_PREFIX="${zlibInstallPath}" + +Write-Host "Building ${zlibBuildPath}\_build\INSTALL.vcxproj" -foregroundcolor green +& "${msbuild}" "${zlibBuildPath}\_build\INSTALL.vcxproj" /P:Configuration=Release + +cd $zlibInstallPath +Write-Host "ls ${zlibInstallPath}" +& ls + +Write-Host "ls bin" +& ls bin +Write-Host "ls include" +& ls include +Write-Host "ls lib" +& ls lib +Write-Host "ls share" +& ls share + +cd $homeDir + +Write-Host "##vso[task.prependpath]${zlibInstallPath}" +Write-Host "##vso[task.prependpath]${zlibInstallPath}\bin" +Write-Host "##vso[task.prependpath]${zlibInstallPath}\include" +Write-Host "##vso[task.prependpath]${zlibInstallPath}\lib"