From c482c12146dba47d84d6349331468ff9a9dd7d03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milo=C5=A1=20Komar=C4=8Devi=C4=87?= <4973094+kmilos@users.noreply.github.com> Date: Mon, 10 May 2021 16:20:03 +0200 Subject: [PATCH 1/4] Install conda-forge libjpeg-turbo instead of default jpeg --- .github/scripts/build-windows.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/build-windows.ps1 b/.github/scripts/build-windows.ps1 index daae2f8..403b5a4 100644 --- a/.github/scripts/build-windows.ps1 +++ b/.github/scripts/build-windows.ps1 @@ -96,7 +96,7 @@ $env:CONDA_ROOT = $pwd.Path + "\external\miniconda_$env:PYTHON_ARCH" exec { conda update --yes -n base -c defaults conda } -exec { conda create --yes --name pyenv_build python=$env:PYTHON_VERSION numpy=$env:NUMPY_VERSION cython jpeg zlib --force } +exec { conda create --yes --name pyenv_build python=$env:PYTHON_VERSION numpy=$env:NUMPY_VERSION cython zlib conda-forge::libjpeg-turbo --force } exec { conda activate pyenv_build } # Check that we have the expected version and architecture for Python From c56133109605ea82d8be15eab765968ecff9052f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milo=C5=A1=20Komar=C4=8Devi=C4=87?= <4973094+kmilos@users.noreply.github.com> Date: Mon, 10 May 2021 16:23:08 +0200 Subject: [PATCH 2/4] Ensure static jpeg linking on Windows --- setup.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/setup.py b/setup.py index f5fc80e..9f129dc 100644 --- a/setup.py +++ b/setup.py @@ -182,6 +182,11 @@ def windows_libraw_compile(): zlib_flag = '-DZLIB_LIBRARY=' + zlib_static + ' ' else: zlib_flag = '' + jpeg_static = os.path.join(sys.prefix, 'Library', 'lib', 'jpeg-static.lib') + if os.path.exists(jpeg_static): + jpeg_flag = '-DJPEG_LIBRARY=' + jpeg_static + ' ' + else: + jpeg_flag = '' # Important: always use Release build type, otherwise the library will depend on a # debug version of OpenMP which is not what we bundle it with, and then it would fail @@ -194,6 +199,7 @@ def windows_libraw_compile(): '-DENABLE_DEMOSAIC_PACK_GPL3=ON -DDEMOSAIC_PACK_GPL3_RPATH=../../LibRaw-demosaic-pack-GPL3 ' if buildGPLCode else '') +\ zlib_flag +\ + jpeg_flag +\ '-DCMAKE_INSTALL_PREFIX=install', cmake + ' --build . --target install', ] From aaf939e0a2c3dd6a6eedb4f5a1387440a33acd04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milo=C5=A1=20Komar=C4=8Devi=C4=87?= <4973094+kmilos@users.noreply.github.com> Date: Mon, 10 May 2021 16:40:20 +0200 Subject: [PATCH 3/4] Prioritize the conda defaults channel --- .github/scripts/build-windows.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/build-windows.ps1 b/.github/scripts/build-windows.ps1 index 403b5a4..f2b456a 100644 --- a/.github/scripts/build-windows.ps1 +++ b/.github/scripts/build-windows.ps1 @@ -96,7 +96,7 @@ $env:CONDA_ROOT = $pwd.Path + "\external\miniconda_$env:PYTHON_ARCH" exec { conda update --yes -n base -c defaults conda } -exec { conda create --yes --name pyenv_build python=$env:PYTHON_VERSION numpy=$env:NUMPY_VERSION cython zlib conda-forge::libjpeg-turbo --force } +exec { conda create --yes --name pyenv_build -c defaults python=$env:PYTHON_VERSION numpy=$env:NUMPY_VERSION cython zlib conda-forge::libjpeg-turbo --force } exec { conda activate pyenv_build } # Check that we have the expected version and architecture for Python From 0adedb7d5be0297c2106a72782ca43e498c0e459 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milo=C5=A1=20Komar=C4=8Devi=C4=87?= <4973094+kmilos@users.noreply.github.com> Date: Tue, 11 May 2021 10:03:48 +0200 Subject: [PATCH 4/4] Use strict channel priority switch --- .github/scripts/build-windows.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/build-windows.ps1 b/.github/scripts/build-windows.ps1 index f2b456a..d6e30fb 100644 --- a/.github/scripts/build-windows.ps1 +++ b/.github/scripts/build-windows.ps1 @@ -96,7 +96,7 @@ $env:CONDA_ROOT = $pwd.Path + "\external\miniconda_$env:PYTHON_ARCH" exec { conda update --yes -n base -c defaults conda } -exec { conda create --yes --name pyenv_build -c defaults python=$env:PYTHON_VERSION numpy=$env:NUMPY_VERSION cython zlib conda-forge::libjpeg-turbo --force } +exec { conda create --yes --name pyenv_build -c defaults --strict-channel-priority python=$env:PYTHON_VERSION numpy=$env:NUMPY_VERSION cython zlib conda-forge::libjpeg-turbo --force } exec { conda activate pyenv_build } # Check that we have the expected version and architecture for Python