diff --git a/media-gfx/blender/blender-2.79.recipe b/media-gfx/blender/blender-2.79.recipe index 9fbf6f81c..865f9ad48 100644 --- a/media-gfx/blender/blender-2.79.recipe +++ b/media-gfx/blender/blender-2.79.recipe @@ -10,17 +10,16 @@ benefit from its unified pipeline and responsive development process." HOMEPAGE="http://www.blender.org/" COPYRIGHT="2002-2017 Blender Foundation" LICENSE="GNU GPL v2" -REVISION="1" +REVISION="2" SOURCE_URI="http://download.blender.org/source/blender-$portVersion.tar.gz" CHECKSUM_SHA256="a9de03e769a2a4a0bf92186556896c4f4d32fd9ac4480915ae92d7f95b25c899" PATCHES="blender-$portVersion.patchset" ADDITIONAL_FILES="blender.rdef.in" -ARCHITECTURES="!x86_gcc2 !x86 x86_64" +ARCHITECTURES="!x86_gcc2 ?x86 x86_64" +SECONDARY_ARCHITECTURES="?x86" PYTHON_VERSION="3.6" -PORT_SUBFOLDER=`echo $portVersion | sed 's/.$//'` -INSTALL_PATH="$appsDir/Blender" PROVIDES=" blender = $portVersion @@ -29,123 +28,137 @@ PROVIDES=" cmd:cycles " REQUIRES=" - haiku - lib:libavcodec - lib:libboost_atomic - lib:libboost_chrono - lib:libboost_date_time - lib:libboost_filesystem - lib:libboost_locale - lib:libboost_regex - lib:libboost_system - lib:libboost_thread - lib:libfftw3 - lib:libfreetype - lib:libgcc_s -# lib:libgflags - lib:libgl - lib:libglew -# lib:libglog - lib:libglu - lib:libgomp -# lib:libgtest - lib:libhalf - lib:libhdf5 - lib:libiconv - lib:libiex_2_2 - lib:libilmimf_2_2 - lib:libilmthread_2_2 - lib:libimath_2_2 - lib:libjpeg - lib:libllvm_4.0 - lib:liblzma - lib:liblzo2 - lib:libopencolorio - lib:libopenimageio - lib:libopenjp2 - lib:libpng16 + haiku$secondaryArchSuffix + lib:libavcodec$secondaryArchSuffix + lib:libboost_atomic$secondaryArchSuffix + lib:libboost_chrono$secondaryArchSuffix + lib:libboost_date_time$secondaryArchSuffix + lib:libboost_filesystem$secondaryArchSuffix + lib:libboost_locale$secondaryArchSuffix + lib:libboost_regex$secondaryArchSuffix + lib:libboost_system$secondaryArchSuffix + lib:libboost_thread$secondaryArchSuffix +# lib:libexecinfo$secondaryArchSuffix + lib:libfftw3$secondaryArchSuffix + lib:libfreetype$secondaryArchSuffix + lib:libgcc_s$secondaryArchSuffix +# lib:libgflags$secondaryArchSuffix + lib:libgl$secondaryArchSuffix + lib:libglew$secondaryArchSuffix +# lib:libglog$secondaryArchSuffix + lib:libglu$secondaryArchSuffix + lib:libgomp$secondaryArchSuffix +# lib:libgtest$secondaryArchSuffix + lib:libhalf$secondaryArchSuffix + lib:libhdf5$secondaryArchSuffix + lib:libiconv$secondaryArchSuffix + lib:libiex_2_2$secondaryArchSuffix + lib:libilmimf_2_2$secondaryArchSuffix + lib:libilmthread_2_2$secondaryArchSuffix + lib:libimath_2_2$secondaryArchSuffix + lib:libjpeg$secondaryArchSuffix + lib:libllvm_4.0$secondaryArchSuffix + lib:liblzma$secondaryArchSuffix + lib:liblzo2$secondaryArchSuffix + lib:libopenal$secondaryArchSuffix + lib:libopencolorio$secondaryArchSuffix + lib:libopenimageio$secondaryArchSuffix + lib:libopenjp2$secondaryArchSuffix + lib:libpng16$secondaryArchSuffix lib:libpython${PYTHON_VERSION}m - lib:libsdl2_2.0 - lib:libsndfile - lib:libtinyxml - lib:libtiff - lib:libxml2 - lib:libz + lib:libsdl2_2.0$secondaryArchSuffix + lib:libsndfile$secondaryArchSuffix + lib:libtinyxml$secondaryArchSuffix + lib:libtiff$secondaryArchSuffix + lib:libxml2$secondaryArchSuffix + lib:libyaml_cpp$secondaryArchSuffix + lib:libz$secondaryArchSuffix + python3_numpy " BUILD_REQUIRES=" - haiku_devel -# devel:eigen - devel:libavcodec - devel:libboost_atomic - devel:libboost_chrono - devel:libboost_date_time - devel:libboost_filesystem - devel:libboost_locale - devel:libboost_regex - devel:libboost_system - devel:libboost_thread - devel:libfftw3 - devel:libfreetype -# devel:libgflags - devel:libgl - devel:libglew -# devel:libglog - devel:libglu - devel:libgomp -# devel:libgtest - devel:libhalf - devel:libhdf5 - devel:libiconv - devel:libiex_2_2 - devel:libilmimf_2_2 - devel:libilmthread_2_2 - devel:libimath_2_2 - devel:libjpeg - devel:libllvm_4.0 - devel:liblzma - devel:liblzo2 - devel:libopencolorio - devel:libopenimageio - devel:libopenjp2 - devel:libpng16 + haiku${secondaryArchSuffix}_devel + devel:eigen$secondaryArchSuffix + devel:libavcodec$secondaryArchSuffix + devel:libboost_atomic$secondaryArchSuffix + devel:libboost_chrono$secondaryArchSuffix + devel:libboost_date_time$secondaryArchSuffix + devel:libboost_filesystem$secondaryArchSuffix + devel:libboost_locale$secondaryArchSuffix + devel:libboost_regex$secondaryArchSuffix + devel:libboost_system$secondaryArchSuffix + devel:libboost_thread$secondaryArchSuffix +# devel:libexecinfo$secondaryArchSuffix + devel:libfftw3$secondaryArchSuffix + devel:libfreetype$secondaryArchSuffix +# devel:libgflags$secondaryArchSuffix + devel:libgl$secondaryArchSuffix + devel:libglew$secondaryArchSuffix +# devel:libglog$secondaryArchSuffix + devel:libglu$secondaryArchSuffix + devel:libgomp$secondaryArchSuffix +# devel:libgtest$secondaryArchSuffix + devel:libhalf$secondaryArchSuffix + devel:libhdf5$secondaryArchSuffix + devel:libiconv$secondaryArchSuffix + devel:libiex_2_2$secondaryArchSuffix + devel:libilmimf_2_2$secondaryArchSuffix + devel:libilmthread_2_2$secondaryArchSuffix + devel:libimath_2_2$secondaryArchSuffix + devel:libjpeg$secondaryArchSuffix + devel:libllvm_4.0$secondaryArchSuffix + devel:liblzma$secondaryArchSuffix + devel:liblzo2$secondaryArchSuffix + devel:libopenal$secondaryArchSuffix + devel:libopencolorio$secondaryArchSuffix + devel:libopenimageio$secondaryArchSuffix + devel:libopenjp2$secondaryArchSuffix + devel:libpng16$secondaryArchSuffix devel:libpython${PYTHON_VERSION}m - devel:libsdl2_2.0 - devel:libsndfile - devel:libtinyxml - devel:libtiff - devel:libxml2 - devel:libz + devel:libsdl2_2.0$secondaryArchSuffix + devel:libsndfile$secondaryArchSuffix + devel:libtinyxml$secondaryArchSuffix + devel:libtiff$secondaryArchSuffix + devel:libxml2$secondaryArchSuffix + devel:libyaml_cpp$secondaryArchSuffix + devel:libz$secondaryArchSuffix " BUILD_PREREQUIRES=" cmd:cmake cmd:git - cmd:gcc - cmd:ld + cmd:gcc$secondaryArchSuffix + cmd:find + cmd:ld$secondaryArchSuffix cmd:make cmd:python${PYTHON_VERSION} cmd:sed - llvm - #python3_numpy + llvm$secondaryArchSuffix + python3_numpy #python3_requests #maybe later " BUILD() { + PY_VENDOR_DIR=`finddir B_SYSTEM_LIB_DIRECTORY`/python${PYTHON_VERSION}/vendor-packages + NUMPY_FOLDER=`find $PY_VENDOR_DIR -maxdepth 1 -type d |grep numpy` + PORT_SUBFOLDER=`echo $portVersion | sed 's/.$//'` + INSTALL_PATH="$appsDir/Blender" + mkdir -p build_haiku cd build_haiku cmake .. \ + -DCMAKE_INSTALL_PREFIX:PATH=$INSTALL_PATH \ -DPYTHON_VERSION=${PYTHON_VERSION} \ - -DPYTHON_INCLUDE_DIR=/system/develop/headers/python${PYTHON_VERSION}m/ \ - -DPYTHON_LIBRARY=/system/lib/libpython${PYTHON_VERSION}m.so.1.0 \ + -DPYTHON_INCLUDE_DIR=`finddir B_SYSTEM_HEADERS_DIRECTORY`/python${PYTHON_VERSION}m/ \ + -DPYTHON_LIBRARY=`finddir B_SYSTEM_LIB_DIRECTORY`/libpython${PYTHON_VERSION}m.so.1.0 \ -DPYTHON_EXECUTABLE=/bin/python${PYTHON_VERSION} \ -DWITH_PYTHON_INSTALL:BOOL=ON \ + -DPYTHON_NUMPY_PATH=$NUMPY_FOLDER \ -DWITH_PYTHON_INSTALL_NUMPY:BOOL=OFF \ -DWITH_PYTHON_INSTALL_REQUESTS:BOOL=OFF \ -DWITH_BOOST:BOOL=ON \ -DWITH_CYCLES:BOOL=ON \ - -DCMAKE_INSTALL_PREFIX:PATH=$INSTALL_PATH \ -DWITH_SDL:BOOL=ON \ -DWITH_GHOST_SDL:BOOL=ON \ -DWITH_GAMEENGINE_DECKLINK:BOOL=OFF \ @@ -154,19 +167,18 @@ BUILD() -DWITH_FFTW3:BOOL=ON \ -DWITH_CODEC_SNDFILE:BOOL=ON \ -DWITH_SYSTEM_OPENJPEG:BOOL=ON \ - -DWITH_SYSTEM_EIGEN3:BOOL=OFF \ + -DWITH_SYSTEM_EIGEN3:BOOL=ON \ -DWITH_SYSTEM_LZO:BOOL=ON \ -DWITH_SYSTEM_GLOG:BOOL=OFF \ -DWITH_GTESTS:BOOL=OFF \ -DWITH_SYSTEM_GFLAGS:BOOL=OFF \ -DWITH_IMAGE_OPENEXR:BOOL=ON \ -DWITH_LLVM:BOOL=ON \ - -DWITH_SDL_DYNLOAD:BOOL=ON \ -DWITH_CODEC_FFMPEG:BOOL=ON \ + -DWITH_CYCLES_NATIVE_ONLY:BOOL=ON \ -DWITH_CYCLES_STANDALONE:BOOL=ON \ -DWITH_CYCLES_STANDALONE_GUI:BOOL=ON \ -DWITH_RAYOPTIMIZATION:BOOL=ON \ - -DWITH_CYCLES_NATIVE_ONLY:BOOL=ON \ -Wno-dev make $jobArgs @@ -209,3 +221,14 @@ INSTALL() addAppDeskbarSymlink $INSTALL_PATH/Blender Blender } + +TEST() +{ + cd build_haiku + # the whole testcase is around 1GB and not included. + # Get it from here: + # svn checkout https://svn.blender.org/svnroot/bf-blender/trunk/lib/tests + # and put it in "work-2.xx/sources/lib" + # without theese some test will fail. + make test +} diff --git a/media-gfx/blender/patches/blender-2.79.patchset b/media-gfx/blender/patches/blender-2.79.patchset index 49702a6a9..0b3fafacd 100644 --- a/media-gfx/blender/patches/blender-2.79.patchset +++ b/media-gfx/blender/patches/blender-2.79.patchset @@ -1,11 +1,11 @@ -From 41ec906196e265f144d30df0293c5326d7f0ea92 Mon Sep 17 00:00:00 2001 +From 5639109c264a7f27107a3046911b2fdb24a02b0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Mizsei?= -Date: Sun, 17 Sep 2017 13:03:51 +0200 -Subject: Haiku supporting patches +Date: Tue, 19 Sep 2017 23:03:48 +0200 +Subject: Haiku patchset diff --git a/CMakeLists.txt b/CMakeLists.txt -index 0423781..207f5ba 100644 +index 0423781..0704c5e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -195,7 +195,7 @@ endif() @@ -17,216 +17,17 @@ index 0423781..207f5ba 100644 set(WITH_X11 ON) endif() -@@ -791,7 +791,7 @@ set(CC_REMOVE_STRICT_FLAGS) +@@ -791,7 +791,9 @@ set(CC_REMOVE_STRICT_FLAGS) # libraries to link the binary with passed to target_link_libraries() # known as LLIBS to scons -set(PLATFORM_LINKLIBS "") ++if(HAIKU) +set(PLATFORM_LINKLIBS "-lnetwork") ++endif() # Added to linker flags in setup_liblinks # - CMAKE_EXE_LINKER_FLAGS -diff --git a/build_files/cmake/Modules/FindEigen3.cmake b/build_files/cmake/Modules/FindEigen3.cmake -index 400e8eb..fdd7936 100644 ---- a/build_files/cmake/Modules/FindEigen3.cmake -+++ b/build_files/cmake/Modules/FindEigen3.cmake -@@ -29,6 +29,8 @@ SET(_eigen3_SEARCH_DIRS - /sw # Fink - /opt/local # DarwinPorts - /opt/csw # Blastwave -+ /system/lib # Haiku -+ /system/develop/headers # Haiku - ) - - FIND_PATH(EIGEN3_INCLUDE_DIR -@@ -38,7 +40,7 @@ FIND_PATH(EIGEN3_INCLUDE_DIR - HINTS - ${_eigen3_SEARCH_DIRS} - PATH_SUFFIXES -- include/eigen3 -+ include/eigen3 Eigen - ) - - # handle the QUIETLY and REQUIRED arguments and set EIGEN3_FOUND to TRUE if -diff --git a/build_files/cmake/Modules/FindFftw3.cmake b/build_files/cmake/Modules/FindFftw3.cmake -index 197d4aa..bb51040 100644 ---- a/build_files/cmake/Modules/FindFftw3.cmake -+++ b/build_files/cmake/Modules/FindFftw3.cmake -@@ -33,6 +33,8 @@ SET(_fftw3_SEARCH_DIRS - /sw # Fink - /opt/local # DarwinPorts - /opt/csw # Blastwave -+ /system/lib # Haiku -+ /system/develop/headers # Haiku - ) - - FIND_PATH(FFTW3_INCLUDE_DIR -diff --git a/build_files/cmake/Modules/FindGLEW.cmake b/build_files/cmake/Modules/FindGLEW.cmake -index 2f098d5..6910661 100644 ---- a/build_files/cmake/Modules/FindGLEW.cmake -+++ b/build_files/cmake/Modules/FindGLEW.cmake -@@ -30,6 +30,8 @@ ENDIF() - SET(_glew_SEARCH_DIRS - ${GLEW_ROOT_DIR} - /usr/local -+ /system/lib # Haiku -+ /system/develop/headers # Haiku - ) - - FIND_PATH(GLEW_INCLUDE_DIR -diff --git a/build_files/cmake/Modules/FindHDF5.cmake b/build_files/cmake/Modules/FindHDF5.cmake -index 56ceda8..990a594 100644 ---- a/build_files/cmake/Modules/FindHDF5.cmake -+++ b/build_files/cmake/Modules/FindHDF5.cmake -@@ -31,6 +31,8 @@ SET(_hdf5_SEARCH_DIRS - /opt/local # DarwinPorts - /opt/csw # Blastwave - /opt/lib/hdf5 -+ /system/lib # Haiku -+ /system/develop/headers # Haiku - ) - - FIND_LIBRARY(HDF5_LIBRARY -diff --git a/build_files/cmake/Modules/FindIcuLinux.cmake b/build_files/cmake/Modules/FindIcuLinux.cmake -index e0e5873..cca1026 100644 ---- a/build_files/cmake/Modules/FindIcuLinux.cmake -+++ b/build_files/cmake/Modules/FindIcuLinux.cmake -@@ -36,6 +36,8 @@ SET(_icu_SEARCH_DIRS - /sw # Fink - /opt/local # DarwinPorts - /opt/csw # Blastwave -+ /system/lib # Haiku -+ /system/develop/headers # Haiku - ) - - # We don't need includes, only libs to link against... -diff --git a/build_files/cmake/Modules/FindLZO.cmake b/build_files/cmake/Modules/FindLZO.cmake -index a21aa0a..9086456 100644 ---- a/build_files/cmake/Modules/FindLZO.cmake -+++ b/build_files/cmake/Modules/FindLZO.cmake -@@ -33,6 +33,8 @@ SET(_lzo_SEARCH_DIRS - /sw # Fink - /opt/local # DarwinPorts - /opt/csw # Blastwave -+ /system/lib # Haiku -+ /system/develop/headers # Haiku - ) - - FIND_PATH(LZO_INCLUDE_DIR lzo/lzo1x.h -diff --git a/build_files/cmake/Modules/FindOpenColorIO.cmake b/build_files/cmake/Modules/FindOpenColorIO.cmake -index bd1ecac..e7495c7 100644 ---- a/build_files/cmake/Modules/FindOpenColorIO.cmake -+++ b/build_files/cmake/Modules/FindOpenColorIO.cmake -@@ -40,6 +40,8 @@ SET(_opencolorio_SEARCH_DIRS - /opt/local # DarwinPorts - /opt/csw # Blastwave - /opt/lib/ocio -+ /system/lib # Haiku -+ /system/develop/headers # Haiku - ) - - FIND_PATH(OPENCOLORIO_INCLUDE_DIR -diff --git a/build_files/cmake/Modules/FindOpenEXR.cmake b/build_files/cmake/Modules/FindOpenEXR.cmake -index 41e60a7..021d9de 100644 ---- a/build_files/cmake/Modules/FindOpenEXR.cmake -+++ b/build_files/cmake/Modules/FindOpenEXR.cmake -@@ -52,6 +52,8 @@ SET(_openexr_SEARCH_DIRS - /opt/local # DarwinPorts - /opt/csw # Blastwave - /opt/lib/openexr -+ /system/lib # Haiku -+ /system/develop/headers # Haiku - ) - - FIND_PATH(OPENEXR_INCLUDE_DIR -diff --git a/build_files/cmake/Modules/FindOpenImageIO.cmake b/build_files/cmake/Modules/FindOpenImageIO.cmake -index d59f9cf..c60463f 100644 ---- a/build_files/cmake/Modules/FindOpenImageIO.cmake -+++ b/build_files/cmake/Modules/FindOpenImageIO.cmake -@@ -36,6 +36,8 @@ SET(_openimageio_SEARCH_DIRS - /opt/local # DarwinPorts - /opt/csw # Blastwave - /opt/lib/oiio -+ /system/lib # Haiku -+ /system/develop/headers # Haiku - ) - - FIND_PATH(OPENIMAGEIO_INCLUDE_DIR -diff --git a/build_files/cmake/Modules/FindOpenJPEG.cmake b/build_files/cmake/Modules/FindOpenJPEG.cmake -index d765103..48bd9e1 100644 ---- a/build_files/cmake/Modules/FindOpenJPEG.cmake -+++ b/build_files/cmake/Modules/FindOpenJPEG.cmake -@@ -33,6 +33,8 @@ SET(_openjpeg_SEARCH_DIRS - /sw # Fink - /opt/local # DarwinPorts - /opt/csw # Blastwave -+ /system/lib # Haiku -+ /system/develop/headers # Haiku - ) - - FIND_PATH(OPENJPEG_INCLUDE_DIR -diff --git a/build_files/cmake/Modules/FindPCRE.cmake b/build_files/cmake/Modules/FindPCRE.cmake -index ff4b726..999d404 100644 ---- a/build_files/cmake/Modules/FindPCRE.cmake -+++ b/build_files/cmake/Modules/FindPCRE.cmake -@@ -33,6 +33,8 @@ SET(_pcre_SEARCH_DIRS - /sw # Fink - /opt/local # DarwinPorts - /opt/csw # Blastwave -+ /system/lib # Haiku -+ /system/develop/headers # Haiku - ) - - FIND_PATH(PCRE_INCLUDE_DIR pcre.h -diff --git a/build_files/cmake/Modules/FindSDL2.cmake b/build_files/cmake/Modules/FindSDL2.cmake -index 2a835cf..75de7c6 100644 ---- a/build_files/cmake/Modules/FindSDL2.cmake -+++ b/build_files/cmake/Modules/FindSDL2.cmake -@@ -35,6 +35,9 @@ SET(_sdl2_SEARCH_DIRS - /sw # Fink - /opt/local # DarwinPorts - /opt/csw # Blastwave -+ /system/lib # Haiku -+ /system/develop/headers # Haiku -+ - ) - - FIND_PATH(SDL2_INCLUDE_DIR -@@ -43,7 +46,7 @@ FIND_PATH(SDL2_INCLUDE_DIR - HINTS - ${_sdl2_SEARCH_DIRS} - PATH_SUFFIXES -- include/SDL2 include -+ include/SDL2 include SDL2 - ) - - FIND_LIBRARY(SDL2_LIBRARY -diff --git a/build_files/cmake/Modules/FindSndFile.cmake b/build_files/cmake/Modules/FindSndFile.cmake -index 1b685ea..a7c2022 100644 ---- a/build_files/cmake/Modules/FindSndFile.cmake -+++ b/build_files/cmake/Modules/FindSndFile.cmake -@@ -33,6 +33,8 @@ SET(_sndfile_SEARCH_DIRS - /sw # Fink - /opt/local # DarwinPorts - /opt/csw # Blastwave -+ /system/lib # Haiku -+ /system/develop/headers # Haiku - ) - - FIND_PATH(SNDFILE_INCLUDE_DIR sndfile.h -diff --git a/build_files/cmake/Modules/FindXML2.cmake b/build_files/cmake/Modules/FindXML2.cmake -index 40cc332..09237ee 100644 ---- a/build_files/cmake/Modules/FindXML2.cmake -+++ b/build_files/cmake/Modules/FindXML2.cmake -@@ -33,6 +33,8 @@ SET(_xml2_SEARCH_DIRS - /sw # Fink - /opt/local # DarwinPorts - /opt/csw # Blastwave -+ /system/lib # Haiku -+ /system/develop/headers # Haiku - ) - - FIND_PATH(XML2_INCLUDE_DIR libxml2/libxml/xpath.h diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake index 6303119..2083683 100644 --- a/build_files/cmake/macros.cmake @@ -249,7 +50,7 @@ index 6303119..2083683 100644 "The 'WITH_PYTHON_INSTALL_${_upper_package}' option will be ignored when installing Python.\n" "The build will be usable, only add-ons that depend on this package won't be functional." diff --git a/build_files/cmake/platform/platform_unix.cmake b/build_files/cmake/platform/platform_unix.cmake -index 62e0caa..5beba82 100644 +index 62e0caa..9eb6985 100644 --- a/build_files/cmake/platform/platform_unix.cmake +++ b/build_files/cmake/platform/platform_unix.cmake @@ -358,7 +358,11 @@ if(WITH_OPENSUBDIV OR WITH_CYCLES_OPENSUBDIV) @@ -258,13 +59,130 @@ index 62e0caa..5beba82 100644 # OpenSuse needs lutil, ArchLinux not, for now keep, can avoid by using --as-needed -list(APPEND PLATFORM_LINKLIBS -lutil -lc -lm) +if(HAIKU) -+ list(APPEND PLATFORM_LINKLIBS -lm -lnetwork) ++ list(APPEND PLATFORM_LINKLIBS -lnetwork) +else() + list(APPEND PLATFORM_LINKLIBS -lutil -lc -lm) +endif() find_package(Threads REQUIRED) list(APPEND PLATFORM_LINKLIBS ${CMAKE_THREAD_LIBS_INIT}) +diff --git a/intern/guardedalloc/intern/mallocn_intern.h b/intern/guardedalloc/intern/mallocn_intern.h +index a292a2e..9a5848c 100644 +--- a/intern/guardedalloc/intern/mallocn_intern.h ++++ b/intern/guardedalloc/intern/mallocn_intern.h +@@ -63,6 +63,9 @@ + #elif defined(WIN32) + # include + # define malloc_usable_size _msize ++#elif defined(__HAIKU__) ++# include ++size_t malloc_usable_size(void *ptr); + #else + # pragma message "We don't know how to use malloc_usable_size on your platform" + # undef USE_MALLOC_USABLE_SIZE +diff --git a/intern/libmv/libmv/numeric/numeric.h b/intern/libmv/libmv/numeric/numeric.h +index 1a23d65..6312b4e 100644 +--- a/intern/libmv/libmv/numeric/numeric.h ++++ b/intern/libmv/libmv/numeric/numeric.h +@@ -35,7 +35,8 @@ + + #if !defined(__MINGW64__) + # if defined(_WIN32) || defined(__APPLE__) || \ +- defined(__FreeBSD__) || defined(__NetBSD__) ++ defined(__FreeBSD__) || defined(__NetBSD__) || \ ++ defined(__HAIKU__) + inline void sincos(double x, double *sinx, double *cosx) { + *sinx = sin(x); + *cosx = cos(x); +diff --git a/source/blender/blenlib/BLI_sys_types.h b/source/blender/blenlib/BLI_sys_types.h +index 9477f61..95c0227 100644 +--- a/source/blender/blenlib/BLI_sys_types.h ++++ b/source/blender/blenlib/BLI_sys_types.h +@@ -47,7 +47,7 @@ + extern "C" { + #endif + +-#if defined(__linux__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD_kernel__) || defined(__GNU__) ++#if defined(__linux__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD_kernel__) || defined(__GNU__) || defined(__HAIKU__) + + /* Linux-i386, Linux-Alpha, Linux-ppc */ + #include +diff --git a/source/blender/blenlib/intern/fileops.c b/source/blender/blenlib/intern/fileops.c +index 1df7f6f..0978420 100644 +--- a/source/blender/blenlib/intern/fileops.c ++++ b/source/blender/blenlib/intern/fileops.c +@@ -614,6 +614,11 @@ static int recursive_operation(const char *startfrom, const char *startto, + for (i = 0; i < n; i++) { + const struct dirent * const dirent = dirlist[i]; + ++#ifdef __HAIKU__ ++ struct stat st; ++ char filename[512]; ++#endif ++ + if (FILENAME_IS_CURRPAR(dirent->d_name)) + continue; + +@@ -621,7 +626,13 @@ static int recursive_operation(const char *startfrom, const char *startto, + if (to) + join_dirfile_alloc(&to_path, &to_alloc_len, to, dirent->d_name); + ++#ifdef __HAIKU__ ++ snprintf(filename, sizeof(filename), "%s/%s", startfrom, dirent->d_name); ++ lstat(filename, &st); ++ if (S_ISDIR(st.st_mode)) { ++#else + if (dirent->d_type == DT_DIR) { ++#endif + /* recursively dig into a subfolder */ + ret = recursive_operation(from_path, to_path, callback_dir_pre, callback_file, callback_dir_post); + } +diff --git a/source/blender/blenlib/intern/storage.c b/source/blender/blenlib/intern/storage.c +index b819c51..9fb3fbf 100644 +--- a/source/blender/blenlib/intern/storage.c ++++ b/source/blender/blenlib/intern/storage.c +@@ -37,7 +37,7 @@ + + #include + +-#if defined(__NetBSD__) || defined(__DragonFly__) || defined(__sun__) || defined(__sun) ++#if defined(__NetBSD__) || defined(__DragonFly__) || defined(__sun__) || defined(__sun) || defined(__HAIKU__) + /* Other modern unix os's should probably use this also */ + # include + # define USE_STATFS_STATVFS +-- +2.14.1 + + +From c6ab784647b736fe25523c024ff6194465ad8490 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Zolt=C3=A1n=20Mizsei?= +Date: Tue, 19 Sep 2017 23:15:20 +0200 +Subject: Haiku SDL2 check fix + + +diff --git a/build_files/cmake/Modules/FindSDL2.cmake b/build_files/cmake/Modules/FindSDL2.cmake +index 2a835cf..61b7dee 100644 +--- a/build_files/cmake/Modules/FindSDL2.cmake ++++ b/build_files/cmake/Modules/FindSDL2.cmake +@@ -43,7 +43,7 @@ FIND_PATH(SDL2_INCLUDE_DIR + HINTS + ${_sdl2_SEARCH_DIRS} + PATH_SUFFIXES +- include/SDL2 include ++ include/SDL2 include SDL2 + ) + + FIND_LIBRARY(SDL2_LIBRARY +-- +2.14.1 + + +From ff451389f3739d7917d3041a67174e8c9d138a81 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Zolt=C3=A1n=20Mizsei?= +Date: Tue, 19 Sep 2017 23:52:27 +0200 +Subject: In-tree glog supporting patches + + diff --git a/extern/glog/src/config.h b/extern/glog/src/config.h index f5c9c0b..2703b7b 100644 --- a/extern/glog/src/config.h @@ -278,7 +196,7 @@ index f5c9c0b..2703b7b 100644 #endif diff --git a/extern/glog/src/config_haiku.h b/extern/glog/src/config_haiku.h new file mode 100644 -index 0000000..7d19272 +index 0000000..4e6703b --- /dev/null +++ b/extern/glog/src/config_haiku.h @@ -0,0 +1,172 @@ @@ -289,7 +207,7 @@ index 0000000..7d19272 +#define GOOGLE_NAMESPACE google + +/* Define if you have the `dladdr' function */ -+/* #undef HAVE_DLADDR */ ++#define HAVE_DLADDR 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 @@ -307,7 +225,7 @@ index 0000000..7d19272 +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the `pthread' library (-lpthread). */ -+/* #undef HAVE_LIBPTHREAD */ ++#define HAVE_LIBPTHREAD 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_LIBUNWIND_H */ @@ -412,13 +330,13 @@ index 0000000..7d19272 +#define PACKAGE_NAME "glog" + +/* Define to the full name and version of this package. */ -+#define PACKAGE_STRING "glog 0.3.2" ++#define PACKAGE_STRING "glog 0.3.4" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "glog" + +/* Define to the version of this package. */ -+#define PACKAGE_VERSION "0.3.2" ++#define PACKAGE_VERSION "0.3.4" + +/* How to access the PC from a struct ucontext */ +/* #define PC_FROM_UCONTEXT uc_mcontext.gregs[REG_RIP] */ @@ -441,7 +359,7 @@ index 0000000..7d19272 +#define TEST_SRC_DIR "." + +/* Version number of package */ -+#define VERSION "0.3.2" ++#define VERSION "0.3.4" + +/* Stops putting the code inside the Google namespace */ +#define _END_GOOGLE_NAMESPACE_ } @@ -454,305 +372,6 @@ index 0000000..7d19272 +#ifdef __clang__ +# define NO_FRAME_POINTER +#endif -diff --git a/intern/guardedalloc/intern/mallocn_intern.h b/intern/guardedalloc/intern/mallocn_intern.h -index a292a2e..9a5848c 100644 ---- a/intern/guardedalloc/intern/mallocn_intern.h -+++ b/intern/guardedalloc/intern/mallocn_intern.h -@@ -63,6 +63,9 @@ - #elif defined(WIN32) - # include - # define malloc_usable_size _msize -+#elif defined(__HAIKU__) -+# include -+size_t malloc_usable_size(void *ptr); - #else - # pragma message "We don't know how to use malloc_usable_size on your platform" - # undef USE_MALLOC_USABLE_SIZE -diff --git a/intern/libmv/libmv/numeric/numeric.h b/intern/libmv/libmv/numeric/numeric.h -index 1a23d65..6312b4e 100644 ---- a/intern/libmv/libmv/numeric/numeric.h -+++ b/intern/libmv/libmv/numeric/numeric.h -@@ -35,7 +35,8 @@ - - #if !defined(__MINGW64__) - # if defined(_WIN32) || defined(__APPLE__) || \ -- defined(__FreeBSD__) || defined(__NetBSD__) -+ defined(__FreeBSD__) || defined(__NetBSD__) || \ -+ defined(__HAIKU__) - inline void sincos(double x, double *sinx, double *cosx) { - *sinx = sin(x); - *cosx = cos(x); -diff --git a/source/blender/blenkernel/intern/bvhutils.c b/source/blender/blenkernel/intern/bvhutils.c -index 7754993..08819e5 100644 ---- a/source/blender/blenkernel/intern/bvhutils.c -+++ b/source/blender/blenkernel/intern/bvhutils.c -@@ -51,6 +51,16 @@ static ThreadRWMutex cache_rwlock = BLI_RWLOCK_INITIALIZER; - /* -------------------------------------------------------------------- */ - /** \name Local Callbacks - * \{ */ -+ -+#ifdef __HAIKU__ -+static pthread_once_t sInitOnce = PTHREAD_ONCE_INIT; -+ -+static void -+init_cache_rwlock() -+{ -+ pthread_rwlock_init(&cache_rwlock, NULL); -+} -+#endif - - /* Math stuff for ray casting on mesh faces and for nearest surface */ - -@@ -1332,6 +1342,9 @@ void bvhcache_insert(BVHCache **cache_p, BVHTree *tree, int type) - */ - void bvhcache_init(BVHCache **cache_p) - { -+#ifdef __HAIKU__ -+ pthread_once(&sInitOnce, &init_cache_rwlock); -+#endif - *cache_p = NULL; - } - -diff --git a/source/blender/blenkernel/intern/font.c b/source/blender/blenkernel/intern/font.c -index 401fed7..446ecb7 100644 ---- a/source/blender/blenkernel/intern/font.c -+++ b/source/blender/blenkernel/intern/font.c -@@ -64,6 +64,16 @@ - - static ThreadRWMutex vfont_rwlock = BLI_RWLOCK_INITIALIZER; - -+#ifdef __HAIKU__ -+static pthread_once_t sInitOnce = PTHREAD_ONCE_INIT; -+ -+static void -+init_vfont_rwlock() -+{ -+ pthread_rwlock_init(&vfont_rwlock, NULL); -+} -+#endif -+ - /* The vfont code */ - void BKE_vfont_free_data(struct VFont *vfont) - { -@@ -655,6 +665,10 @@ bool BKE_vfont_to_curve_ex(Main *bmain, Object *ob, int mode, ListBase *r_nubase - - BLI_assert(ob->type == OB_FONT); - -+#ifdef __HAIKU__ -+ pthread_once(&sInitOnce, &init_vfont_rwlock); -+#endif -+ - /* Set font data */ - vfont = cu->vfont; - -diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c -index 9ee4562..38a0878 100644 ---- a/source/blender/blenkernel/intern/particle_system.c -+++ b/source/blender/blenkernel/intern/particle_system.c -@@ -105,6 +105,16 @@ - - static ThreadRWMutex psys_bvhtree_rwlock = BLI_RWLOCK_INITIALIZER; - -+#ifdef __HAIKU__ -+static pthread_once_t sInitOnce = PTHREAD_ONCE_INIT; -+ -+static void -+init_psys_bvhtree_rwlock() -+{ -+ pthread_rwlock_init(&psys_bvhtree_rwlock, NULL); -+} -+#endif -+ - /************************************************/ - /* Reacting to system events */ - /************************************************/ -@@ -4162,6 +4172,10 @@ void particle_system_update(Scene *scene, Object *ob, ParticleSystem *psys, cons - ParticleSettings *part = psys->part; - float cfra; - -+#ifdef __HAIKU__ -+ pthread_once(&sInitOnce, &init_psys_bvhtree_rwlock); -+#endif -+ - /* drawdata is outdated after ANY change */ - if (psys->pdd) psys->pdd->flag &= ~PARTICLE_DRAW_DATA_UPDATED; - -diff --git a/source/blender/blenkernel/intern/subsurf_ccg.c b/source/blender/blenkernel/intern/subsurf_ccg.c -index ff06822..8884fe2 100644 ---- a/source/blender/blenkernel/intern/subsurf_ccg.c -+++ b/source/blender/blenkernel/intern/subsurf_ccg.c -@@ -91,6 +91,17 @@ - static ThreadRWMutex loops_cache_rwlock = BLI_RWLOCK_INITIALIZER; - static ThreadRWMutex origindex_cache_rwlock = BLI_RWLOCK_INITIALIZER; - -+#ifdef __HAIKU__ -+static pthread_once_t sInitOnce = PTHREAD_ONCE_INIT; -+ -+static void -+init_cache_rwlock() -+{ -+ pthread_rwlock_init(&loops_cache_rwlock, NULL); -+ pthread_rwlock_init(&origindex_cache_rwlock, NULL); -+} -+#endif -+ - static CCGDerivedMesh *getCCGDerivedMesh(CCGSubSurf *ss, - int drawInteriorEdges, - int useSubsurfUv, -@@ -4660,6 +4671,10 @@ static void set_ccgdm_all_geometry(CCGDerivedMesh *ccgdm, - MPoly *mpoly = NULL; - bool has_edge_cd; - -+#ifdef __HAIKU__ -+ pthread_once(&sInitOnce, &init_cache_rwlock); -+#endif -+ - edgeSize = ccgSubSurf_getEdgeSize(ss); - gridSize = ccgSubSurf_getGridSize(ss); - gridFaces = gridSize - 1; -diff --git a/source/blender/blenlib/BLI_sys_types.h b/source/blender/blenlib/BLI_sys_types.h -index 9477f61..95c0227 100644 ---- a/source/blender/blenlib/BLI_sys_types.h -+++ b/source/blender/blenlib/BLI_sys_types.h -@@ -47,7 +47,7 @@ - extern "C" { - #endif - --#if defined(__linux__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD_kernel__) || defined(__GNU__) -+#if defined(__linux__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD_kernel__) || defined(__GNU__) || defined(__HAIKU__) - - /* Linux-i386, Linux-Alpha, Linux-ppc */ - #include -diff --git a/source/blender/blenlib/BLI_threads.h b/source/blender/blenlib/BLI_threads.h -index 0b1b4d8..a302506 100644 ---- a/source/blender/blenlib/BLI_threads.h -+++ b/source/blender/blenlib/BLI_threads.h -@@ -127,7 +127,11 @@ void BLI_spin_end(SpinLock *spin); - #define THREAD_LOCK_READ 1 - #define THREAD_LOCK_WRITE 2 - -+#ifdef __HAIKU__ -+#define BLI_RWLOCK_INITIALIZER {} -+#else - #define BLI_RWLOCK_INITIALIZER PTHREAD_RWLOCK_INITIALIZER -+#endif - - typedef pthread_rwlock_t ThreadRWMutex; - -diff --git a/source/blender/blenlib/intern/fileops.c b/source/blender/blenlib/intern/fileops.c -index 1df7f6f..24d4090 100644 ---- a/source/blender/blenlib/intern/fileops.c -+++ b/source/blender/blenlib/intern/fileops.c -@@ -614,6 +614,11 @@ static int recursive_operation(const char *startfrom, const char *startto, - for (i = 0; i < n; i++) { - const struct dirent * const dirent = dirlist[i]; - -+#ifdef __HAIKU__ -+ struct stat st; -+ char filename[512]; -+#endif -+ - if (FILENAME_IS_CURRPAR(dirent->d_name)) - continue; - -@@ -621,7 +626,14 @@ static int recursive_operation(const char *startfrom, const char *startto, - if (to) - join_dirfile_alloc(&to_path, &to_alloc_len, to, dirent->d_name); - -+#ifdef __HAIKU__ -+ snprintf(filename, sizeof(filename), "%s/%s", startfrom, dirent->d_name); -+ lstat(filename, &st); -+ if (S_ISDIR(st.st_mode)) { -+#else -+ - if (dirent->d_type == DT_DIR) { -+#endif - /* recursively dig into a subfolder */ - ret = recursive_operation(from_path, to_path, callback_dir_pre, callback_file, callback_dir_post); - } -diff --git a/source/blender/blenlib/intern/storage.c b/source/blender/blenlib/intern/storage.c -index b819c51..9fb3fbf 100644 ---- a/source/blender/blenlib/intern/storage.c -+++ b/source/blender/blenlib/intern/storage.c -@@ -37,7 +37,7 @@ - - #include - --#if defined(__NetBSD__) || defined(__DragonFly__) || defined(__sun__) || defined(__sun) -+#if defined(__NetBSD__) || defined(__DragonFly__) || defined(__sun__) || defined(__sun) || defined(__HAIKU__) - /* Other modern unix os's should probably use this also */ - # include - # define USE_STATFS_STATVFS --- -2.14.1 - - -From 6c18376d4069c11efe3662c9f2303decee7e03d4 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Zolt=C3=A1n=20Mizsei?= -Date: Sun, 17 Sep 2017 20:21:42 +0200 -Subject: Haiku build fix - - -diff --git a/extern/sdlew/include/SDL2/SDL_syswm.h b/extern/sdlew/include/SDL2/SDL_syswm.h -index 7c4bc31..f3597d5 100644 ---- a/extern/sdlew/include/SDL2/SDL_syswm.h -+++ b/extern/sdlew/include/SDL2/SDL_syswm.h -@@ -13,6 +13,10 @@ - extern "C" { - #endif - -+#ifdef __HAIKU__ -+struct SDL_SysWMinfo; -+#else -+ - #ifdef SDL_PROTOTYPES_ONLY - struct SDL_SysWMinfo; - #else -@@ -36,6 +40,7 @@ struct SDL_SysWMinfo; - #undef Cursor - #endif - -+#endif - #endif - - #if defined(SDL_VIDEO_DRIVER_DIRECTFB) -diff --git a/intern/ghost/intern/GHOST_SystemSDL.cpp b/intern/ghost/intern/GHOST_SystemSDL.cpp -index e9768e4..1fb3289 100644 ---- a/intern/ghost/intern/GHOST_SystemSDL.cpp -+++ b/intern/ghost/intern/GHOST_SystemSDL.cpp -@@ -282,9 +282,11 @@ convertSDLKey(SDL_Scancode key) - static SDL_Window *SDL_GetWindowFromID_fallback(Uint32 id) - { - SDL_Window *sdl_win = SDL_GetWindowFromID(id); -+ #ifndef __HAIKU__ - if (sdl_win == NULL) { - sdl_win = SDL_GL_GetCurrentWindow(); - } -+ #endif - return sdl_win; - } - -diff --git a/intern/ghost/intern/GHOST_WindowSDL.cpp b/intern/ghost/intern/GHOST_WindowSDL.cpp -index aeb6188..eac82fb 100644 ---- a/intern/ghost/intern/GHOST_WindowSDL.cpp -+++ b/intern/ghost/intern/GHOST_WindowSDL.cpp -@@ -573,9 +573,16 @@ GHOST_WindowSDL::getDPIHint() - } - - float ddpi; -+ -+#ifndef __HAIKU__ -+// SDL_GetDisplayDPI undeclared on Haiku -+ - if (SDL_GetDisplayDPI(displayIndex, &ddpi, NULL, NULL) != 0) { - return 96; - } -+#else -+ddpi = 96; -+#endif - - return (int)ddpi; - } -- 2.14.1