Skip to content

Commit

Permalink
jklasdflkasd
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianPugh committed Feb 26, 2024
1 parent 26edac9 commit 0633fab
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 6 deletions.
25 changes: 19 additions & 6 deletions .github/workflows/build_wheels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
44 changes: 44 additions & 0 deletions scripts/install_zlib.ps1
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit 0633fab

Please sign in to comment.