blender: fix on darwin

This commit is contained in:
Dmitry Kalinkin 2020-11-26 14:51:18 -05:00
parent d9d8c8a7fc
commit 492f3b80ab
No known key found for this signature in database
GPG Key ID: 5157B3EC8B2CA333
2 changed files with 30 additions and 73 deletions

View File

@ -1,24 +1,26 @@
diff a/build_files/cmake/platform/platform_apple.cmake b/build_files/cmake/platform/platform_apple.cmake diff a/build_files/cmake/platform/platform_apple.cmake b/build_files/cmake/platform/platform_apple.cmake
--- a/build_files/cmake/platform/platform_apple.cmake --- a/build_files/cmake/platform/platform_apple.cmake
+++ b/build_files/cmake/platform/platform_apple.cmake +++ b/build_files/cmake/platform/platform_apple.cmake
@@ -35,7 +35,6 @@ else() @@ -80,7 +80,6 @@ else()
message(STATUS "Using pre-compiled LIBDIR: ${LIBDIR}") message(STATUS "Using pre-compiled LIBDIR: ${LIBDIR}")
endif() endif()
if(NOT EXISTS "${LIBDIR}/") if(NOT EXISTS "${LIBDIR}/")
- message(FATAL_ERROR "Mac OSX requires pre-compiled libs at: '${LIBDIR}'") - message(FATAL_ERROR "Mac OSX requires pre-compiled libs at: '${LIBDIR}'")
endif() endif()
if(WITH_OPENAL) # -------------------------------------------------------------------------
@@ -86,7 +85,7 @@ endif() @@ -112,10 +111,6 @@ if(WITH_CODEC_SNDFILE)
if(WITH_CODEC_SNDFILE) find_library(_sndfile_VORBIS_LIBRARY NAMES vorbis HINTS ${LIBDIR}/ffmpeg/lib)
set(LIBSNDFILE ${LIBDIR}/sndfile) find_library(_sndfile_VORBISENC_LIBRARY NAMES vorbisenc HINTS ${LIBDIR}/ffmpeg/lib)
set(LIBSNDFILE_INCLUDE_DIRS ${LIBSNDFILE}/include) list(APPEND LIBSNDFILE_LIBRARIES
- set(LIBSNDFILE_LIBRARIES sndfile FLAC ogg vorbis vorbisenc) - ${_sndfile_FLAC_LIBRARY}
+ set(LIBSNDFILE_LIBRARIES sndfile) - ${_sndfile_OGG_LIBRARY}
set(LIBSNDFILE_LIBPATH ${LIBSNDFILE}/lib ${LIBDIR}/ffmpeg/lib) # TODO, deprecate - ${_sndfile_VORBIS_LIBRARY}
endif() - ${_sndfile_VORBISENC_LIBRARY}
)
@@ -97,7 +96,7 @@ if(WITH_PYTHON) print_found_status("SndFile libraries" "${LIBSNDFILE_LIBRARIES}")
@@ -132,7 +127,7 @@ if(WITH_PYTHON)
# normally cached but not since we include them with blender # normally cached but not since we include them with blender
set(PYTHON_INCLUDE_DIR "${LIBDIR}/python/include/python${PYTHON_VERSION}m") set(PYTHON_INCLUDE_DIR "${LIBDIR}/python/include/python${PYTHON_VERSION}m")
set(PYTHON_EXECUTABLE "${LIBDIR}/python/bin/python${PYTHON_VERSION}m") set(PYTHON_EXECUTABLE "${LIBDIR}/python/bin/python${PYTHON_VERSION}m")
@ -27,40 +29,18 @@ diff a/build_files/cmake/platform/platform_apple.cmake b/build_files/cmake/platf
set(PYTHON_LIBPATH "${LIBDIR}/python/lib/python${PYTHON_VERSION}") set(PYTHON_LIBPATH "${LIBDIR}/python/lib/python${PYTHON_VERSION}")
# set(PYTHON_LINKFLAGS "-u _PyMac_Error") # won't build with this enabled # set(PYTHON_LINKFLAGS "-u _PyMac_Error") # won't build with this enabled
else() else()
@@ -162,10 +161,7 @@ if(WITH_CODEC_FFMPEG) @@ -173,9 +168,7 @@ endif()
set(FFMPEG_INCLUDE_DIRS ${FFMPEG}/include) if(WITH_CODEC_FFMPEG)
set(FFMPEG_LIBRARIES set(FFMPEG_FIND_COMPONENTS
avcodec avdevice avformat avutil avcodec avdevice avformat avutil
- mp3lame swscale x264 xvidcore - mp3lame ogg opus swresample swscale
- theora theoradec theoraenc - theora theoradec theoraenc vorbis vorbisenc
- vorbis vorbisenc vorbisfile ogg opus - vorbisfile vpx x264 xvidcore)
- vpx swresample) + swresample swscale)
+ swscale swresample) find_package(FFmpeg)
set(FFMPEG_LIBPATH ${FFMPEG}/lib)
endif() endif()
@@ -206,14 +202,14 @@ if(WITH_OPENCOLLADA) @@ -266,7 +259,6 @@ if(WITH_BOOST)
set(OPENCOLLADA ${LIBDIR}/opencollada)
set(OPENCOLLADA_INCLUDE_DIRS
- ${LIBDIR}/opencollada/include/COLLADAStreamWriter
- ${LIBDIR}/opencollada/include/COLLADABaseUtils
- ${LIBDIR}/opencollada/include/COLLADAFramework
- ${LIBDIR}/opencollada/include/COLLADASaxFrameworkLoader
- ${LIBDIR}/opencollada/include/GeneratedSaxParser
+ ${LIBDIR}/opencollada/include/opencollada/COLLADAStreamWriter
+ ${LIBDIR}/opencollada/include/opencollada/COLLADABaseUtils
+ ${LIBDIR}/opencollada/include/opencollada/COLLADAFramework
+ ${LIBDIR}/opencollada/include/opencollada/COLLADASaxFrameworkLoader
+ ${LIBDIR}/opencollada/include/opencollada/GeneratedSaxParser
)
- set(OPENCOLLADA_LIBPATH ${OPENCOLLADA}/lib)
+ set(OPENCOLLADA_LIBPATH ${OPENCOLLADA}/lib/opencollada)
set(OPENCOLLADA_LIBRARIES
OpenCOLLADASaxFrameworkLoader
-lOpenCOLLADAFramework
@@ -277,14 +273,13 @@ if(WITH_BOOST)
endif() endif()
if(WITH_INTERNATIONAL OR WITH_CODEC_FFMPEG) if(WITH_INTERNATIONAL OR WITH_CODEC_FFMPEG)
@ -68,25 +48,8 @@ diff a/build_files/cmake/platform/platform_apple.cmake b/build_files/cmake/platf
endif() endif()
if(WITH_OPENIMAGEIO) if(WITH_OPENIMAGEIO)
set(OPENIMAGEIO ${LIBDIR}/openimageio) @@ -439,7 +431,7 @@ else()
set(OPENIMAGEIO_INCLUDE_DIRS ${OPENIMAGEIO}/include) set(CMAKE_CXX_FLAGS_RELEASE "-O2 -mdynamic-no-pic")
set(OPENIMAGEIO_LIBRARIES
- ${OPENIMAGEIO}/lib/libOpenImageIO.a
+ ${OPENIMAGEIO}/lib/libOpenImageIO.dylib
${PNG_LIBRARIES}
${JPEG_LIBRARIES}
${TIFF_LIBRARY}
@@ -307,7 +302,7 @@ endif()
if(WITH_OPENCOLORIO)
set(OPENCOLORIO ${LIBDIR}/opencolorio)
set(OPENCOLORIO_INCLUDE_DIRS ${OPENCOLORIO}/include)
- set(OPENCOLORIO_LIBRARIES OpenColorIO tinyxml yaml-cpp)
+ set(OPENCOLORIO_LIBRARIES OpenColorIO)
set(OPENCOLORIO_LIBPATH ${OPENCOLORIO}/lib)
endif()
@@ -443,7 +438,7 @@ else()
set(CMAKE_CXX_FLAGS_RELEASE "-mdynamic-no-pic -fno-strict-aliasing")
endif() endif()
-if(${XCODE_VERSION} VERSION_EQUAL 5 OR ${XCODE_VERSION} VERSION_GREATER 5) -if(${XCODE_VERSION} VERSION_EQUAL 5 OR ${XCODE_VERSION} VERSION_GREATER 5)

View File

@ -8,7 +8,7 @@
, cudaSupport ? config.cudaSupport or false, cudatoolkit , cudaSupport ? config.cudaSupport or false, cudatoolkit
, colladaSupport ? true, opencollada , colladaSupport ? true, opencollada
, makeWrapper , makeWrapper
, pugixml, SDL, Cocoa, CoreGraphics, ForceFeedback, OpenAL, OpenGL , pugixml, llvmPackages, SDL, Cocoa, CoreGraphics, ForceFeedback, OpenAL, OpenGL
, embree, gmp , embree, gmp
}: }:
@ -47,7 +47,7 @@ stdenv.mkDerivation rec {
openvdb openvdb
] ]
else [ else [
pugixml SDL Cocoa CoreGraphics ForceFeedback OpenAL OpenGL pugixml llvmPackages.openmp SDL Cocoa CoreGraphics ForceFeedback OpenAL OpenGL
]) ])
++ optional jackaudioSupport libjack2 ++ optional jackaudioSupport libjack2
++ optional cudaSupport cudatoolkit ++ optional cudaSupport cudatoolkit
@ -61,7 +61,9 @@ stdenv.mkDerivation rec {
: > build_files/cmake/platform/platform_apple_xcode.cmake : > build_files/cmake/platform/platform_apple_xcode.cmake
substituteInPlace source/creator/CMakeLists.txt \ substituteInPlace source/creator/CMakeLists.txt \
--replace '${"$"}{LIBDIR}/python' \ --replace '${"$"}{LIBDIR}/python' \
'${python}' '${python}' \
--replace '${"$"}{LIBDIR}/openmp' \
'${llvmPackages.openmp}'
substituteInPlace build_files/cmake/platform/platform_apple.cmake \ substituteInPlace build_files/cmake/platform/platform_apple.cmake \
--replace 'set(PYTHON_VERSION 3.7)' \ --replace 'set(PYTHON_VERSION 3.7)' \
'set(PYTHON_VERSION ${python.pythonVersion})' \ 'set(PYTHON_VERSION ${python.pythonVersion})' \
@ -72,15 +74,7 @@ stdenv.mkDerivation rec {
--replace '${"$"}{LIBDIR}/opencollada' \ --replace '${"$"}{LIBDIR}/opencollada' \
'${opencollada}' \ '${opencollada}' \
--replace '${"$"}{PYTHON_LIBPATH}/site-packages/numpy' \ --replace '${"$"}{PYTHON_LIBPATH}/site-packages/numpy' \
'${python3Packages.numpy}/${python.sitePackages}/numpy' \ '${python3Packages.numpy}/${python.sitePackages}/numpy'
--replace 'set(OPENJPEG_INCLUDE_DIRS ' \
'set(OPENJPEG_INCLUDE_DIRS "'$(echo ${openjpeg.dev}/include/openjpeg-*)'") #' \
--replace 'set(OPENJPEG_LIBRARIES ' \
'set(OPENJPEG_LIBRARIES "${openjpeg}/lib/libopenjp2.dylib") #' \
--replace 'set(OPENIMAGEIO ' \
'set(OPENIMAGEIO "${openimageio2.out}") #' \
--replace 'set(OPENEXR_INCLUDE_DIRS ' \
'set(OPENEXR_INCLUDE_DIRS "${openexr.dev}/include/OpenEXR") #'
'' else '' '' else ''
substituteInPlace extern/clew/src/clew.c --replace '"libOpenCL.so"' '"${ocl-icd}/lib/libOpenCL.so"' substituteInPlace extern/clew/src/clew.c --replace '"libOpenCL.so"' '"${ocl-icd}/lib/libOpenCL.so"'
''); '');