Skip to content

Commit

Permalink
Configure fixed for compilation with TLRENDER_NET under macOS.
Browse files Browse the repository at this point in the history
  • Loading branch information
ggarra13 committed Jun 4, 2024
1 parent 9fd3f1a commit c117e22
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 31 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ jobs:
run: brew install gnu-sed

- name: Install Python dependencies
run: brew install libb2 libffi readline sqlite3 xz zlib
run: brew install libb2 libffi openssl readline sqlite3 xz zlib

- name: Install pyFLTK dependencies
run: brew install subversion swig
Expand Down Expand Up @@ -174,14 +174,21 @@ jobs:
# ./bin/upload_sourceforge.sh


macos-m1-python-build:
macos-14-python-build:
runs-on: macos-14

env:
CMAKE_OSX_DEPLOYMENT_TARGET: 14.0

steps:

- uses: actions/checkout@v4
with:
submodules: recursive

- name: Get machine name
run: |
echo "Machine name: $RUNNER_NAME"
- name: Install ninja-build
run: brew install ninja
Expand All @@ -193,7 +200,7 @@ jobs:
run: brew install gnu-sed

- name: Install Python dependencies
run: brew install libb2 libffi readline sqlite3 xz zlib
run: brew install libb2 libffi openssl readline sqlite3 xz zlib

- name: Install pyFLTK dependencies
run: brew install subversion swig
Expand Down
16 changes: 8 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ if(UNIX AND NOT APPLE)
include( cmake/Modules/Buildlibbacktrace.cmake )
endif()

set( PYBIND11_DEP )
if( MRV2_PYBIND11 )
set(PYBIND11_DEP )
if(MRV2_PYBIND11 )
include( cmake/Modules/Buildpybind11.cmake )
endif()

Expand All @@ -158,22 +158,22 @@ endif()
# building Python's _ssl module.
if(TLRENDER_NET AND NOT WIN32)
if (BUILD_PYTHON)
add_dependencies( Python OpenSSL)
add_dependencies(Python OpenSSL)
endif()
endif()


set( POCO_DEP )
if( MRV2_NETWORK )
set(POCO_DEP )
if(MRV2_NETWORK)
include( cmake/Modules/BuildPoco.cmake )
endif()

set( LibHaru_DEP )
if( MRV2_PDF )
set(LibHaru_DEP )
if(MRV2_PDF)
include( cmake/Modules/BuildLibHaru.cmake )
endif()

if( BUILD_MRV2 )
if(BUILD_MRV2)
include( cmake/Modules/Buildmrv2.cmake )
endif()

17 changes: 16 additions & 1 deletion cmake/Modules/BuildPython.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,23 @@ if(APPLE)
if(CMAKE_OSX_DEPLOYMENT_TARGET)
set( Python_C_FLAGS "-mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET} ${CMAKE_C_FLAGS}")
endif()

if(TLRENDER_NET)
set(_openssl_LOC ${CMAKE_PREFIX_PATH})
else()
execute_process(
COMMAND brew --prefix openssl
OUTPUT_VARIABLE _openssl_LOC
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_VARIABLE openssl_prefix_error
)

if(openssl_prefix_error)
message(FATAL_ERROR "Could not located openssl with 'brew --prefix openssl'. Error: ${openssl_prefix_error}")
endif()
endif()

set( Python_CONFIGURE ${CMAKE_COMMAND} -E env "CFLAGS=${Python_C_FLAGS}" "CPPFLAGS=${Python_C_FLAGS}" "CXXFLAGS=${Python_CXX_FLAGS}" "LDFLAGS=${Python_LD_FLAGS}" -- ./configure --enable-optimizations --enable-shared --with-openssl=${CMAKE_PREFIX_PATH} --prefix=${CMAKE_INSTALL_PREFIX}
set( Python_CONFIGURE ${CMAKE_COMMAND} -E env "CFLAGS=${Python_C_FLAGS}" "CPPFLAGS=${Python_C_FLAGS}" "CXXFLAGS=${Python_CXX_FLAGS}" "LDFLAGS=${Python_LD_FLAGS}" -- ./configure --enable-optimizations --enable-shared --with-openssl="${_openssl_LOC}" --prefix=${CMAKE_INSTALL_PREFIX}
)
set( Python_BUILD make -j ${NPROCS} )
set( Python_INSTALL make -j ${NPROCS} install )
Expand Down
7 changes: 2 additions & 5 deletions etc/build_dir.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,19 +67,16 @@ get_compiler_version
#
# For Darwin, when building amd64, we make it compatible with macOS 11.0
#
osx_target=11.0

export CMAKE_OSX_DEPLOYMENT_TARGET=11.0

if [[ $KERNEL == *Darwin* ]]; then
export PATH="/usr/local/opt/gnu-sed/libexec/gnubin:${PATH}"
if [[ $ARCH == arm64 ]]; then
export CMAKE_OSX_ARCHITECTURES=$ARCH
osx_target=11.3
export CMAKE_OSX_DEPLOYMENT_TARGET=11.3
else
osx_target=11.0
export CMAKE_OSX_ARCHITECTURES="x86_64"
fi
export CMAKE_FLAGS="-DCMAKE_OSX_DEPLOYMENT_TARGET=${osx_target} ${CMAKE_FLAGS}"
fi

if [[ $FLAGS == "" ]]; then
Expand Down
14 changes: 0 additions & 14 deletions etc/configure-macos-python.sh

This file was deleted.

1 change: 1 addition & 0 deletions etc/runme_nolog.sh
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ cmd="cmake -G '${CMAKE_GENERATOR}'
-D CMAKE_INSTALL_PREFIX=$PWD/install
-D CMAKE_PREFIX_PATH=$PWD/install
-D CMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES}
-D CMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET}
-D BUILD_PYTHON=${BUILD_PYTHON}
-D BUILD_X11=${BUILD_X11}
Expand Down
1 change: 1 addition & 0 deletions mrv2/docs/HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ v1.1.9
- Improved -pythonScript functionality. It is now possible to change OCIO
settings, load clips and save out a new movie file with baked OCIO, all
from a Python script.
- Fixed building mrv2 without TLRENDER_NET and with BUILD_PYTHON ON on macOS.
- Consolidated Python commands to all use "filename" instead of "file".
- Added bakeOCIO.py demo script with arguments.
- Added -pythonArgs command-line string to pass a string of separated arguments
Expand Down

0 comments on commit c117e22

Please sign in to comment.