From f500a097ab1c1f9ddf5516b3ae54d7e0b3e96c9c Mon Sep 17 00:00:00 2001 From: Cary Phillips Date: Sun, 14 Apr 2024 19:12:11 -0700 Subject: [PATCH] v14 Signed-off-by: Cary Phillips --- .github/workflows/python-wheels.yml | 8 +++++++ share/ci/scripts/install_pybind11.sh | 33 ++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100755 share/ci/scripts/install_pybind11.sh diff --git a/.github/workflows/python-wheels.yml b/.github/workflows/python-wheels.yml index 516af01390..fd241866d8 100644 --- a/.github/workflows/python-wheels.yml +++ b/.github/workflows/python-wheels.yml @@ -49,6 +49,14 @@ jobs: with: python-version: '3.x' + - name: Setup ext environment + run: | + EXT_PATH=/usr/local + echo "EXT_PATH=$EXT_PATH" >> $GITHUB_ENV + + - name: Install pybind11 + run: share/ci/scripts/install_pybind11.sh 2.9.2 $EXT_PATH + - name: Create sdist # Only create it once. if: ${{ matrix.os == 'ubuntu-latest' }} diff --git a/share/ci/scripts/install_pybind11.sh b/share/ci/scripts/install_pybind11.sh new file mode 100755 index 0000000000..db44c0ee58 --- /dev/null +++ b/share/ci/scripts/install_pybind11.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +# SPDX-License-Identifier: BSD-3-Clause +# Copyright Contributors to the OpenColorIO Project. + +set -ex + +PYBIND11_VERSION="$1" +INSTALL_TARGET="$2" + +git clone https://github.com/pybind/pybind11.git +cd pybind11 + +if [ "$PYBIND11_VERSION" == "latest" ]; then + LATEST_TAG=$(git describe --abbrev=0 --tags) + git checkout tags/${LATEST_TAG} -b ${LATEST_TAG} +else + git checkout tags/v${PYBIND11_VERSION} -b v${PYBIND11_VERSION} +fi + +mkdir build +cd build +cmake -DCMAKE_BUILD_TYPE=Release \ + ${INSTALL_TARGET:+"-DCMAKE_INSTALL_PREFIX="${INSTALL_TARGET}""} \ + -DPYBIND11_INSTALL=ON \ + -DPYBIND11_TEST=OFF \ + ../. +cmake --build . \ + --target install \ + --config Release \ + --parallel 2 + +cd ../.. +rm -rf pybind11