diff --git a/media-libs/x265/patches/x265-2.4.patchset b/media-libs/x265/patches/x265-2.4.patchset new file mode 100644 index 000000000..c0ec7d20e --- /dev/null +++ b/media-libs/x265/patches/x265-2.4.patchset @@ -0,0 +1,100 @@ +From b2a16767983618709903e175f6f3d94a36e35832 Mon Sep 17 00:00:00 2001 +From: Timothy Gu +Date: Sun, 28 Dec 2014 07:11:55 +0000 +Subject: Check if threading library needs to be linked separately + +--- + source/CMakeLists.txt | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt +index acdeb7b..0e8d824 100644 +--- a/source/CMakeLists.txt ++++ b/source/CMakeLists.txt +@@ -79,7 +79,8 @@ else() + endif() + + if(UNIX) +- list(APPEND PLATFORM_LIBS pthread) ++ find_package(Threads) ++ list(APPEND PLATFORM_LIBS ${CMAKE_THREAD_LIBS_INIT}) + find_library(LIBRT rt) + if(LIBRT) + list(APPEND PLATFORM_LIBS rt) +-- +2.12.2 + + +From 3649a1e872b18b9e5b2562e12d581d43be916e6a Mon Sep 17 00:00:00 2001 +From: Timothy Gu +Date: Sun, 28 Dec 2014 07:13:56 +0000 +Subject: Add an option to adjust headers installation path + +--- + source/CMakeLists.txt | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt +index 0e8d824..ed3c9a8 100644 +--- a/source/CMakeLists.txt ++++ b/source/CMakeLists.txt +@@ -332,6 +332,7 @@ endif() + # Build options + set(LIB_INSTALL_DIR lib CACHE STRING "Install location of libraries") + set(BIN_INSTALL_DIR bin CACHE STRING "Install location of executables") ++set(INCLUDE_INSTALL_DIR include CACHE STRING "Install location of headers") + set(EXTRA_LIB "" CACHE STRING "Extra libraries to link against") + set(EXTRA_LINK_FLAGS "" CACHE STRING "Extra link flags") + if(EXTRA_LINK_FLAGS) +@@ -525,7 +526,8 @@ endif() + install(TARGETS x265-static + LIBRARY DESTINATION ${LIB_INSTALL_DIR} + ARCHIVE DESTINATION ${LIB_INSTALL_DIR}) +-install(FILES x265.h "${PROJECT_BINARY_DIR}/x265_config.h" DESTINATION include) ++install(FILES x265.h "${PROJECT_BINARY_DIR}/x265_config.h" ++ DESTINATION "${INCLUDE_INSTALL_DIR}") + + if(CMAKE_RC_COMPILER) + # The resource compiler does not need CFLAGS or macro defines. It +-- +2.12.2 + + +From 524b178975d953535acb23fcc9f240b3c5742ce0 Mon Sep 17 00:00:00 2001 +From: Timothy Gu +Date: Sun, 28 Dec 2014 07:14:34 +0000 +Subject: Add Haiku version of adjusting thread priority + +--- + source/common/threadpool.cpp | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/source/common/threadpool.cpp b/source/common/threadpool.cpp +index f6509b7..b031a8e 100644 +--- a/source/common/threadpool.cpp ++++ b/source/common/threadpool.cpp +@@ -57,6 +57,10 @@ + + #endif + ++#if defined(__HAIKU__) ++#include ++#endif ++ + /* TODO FIX: Macro __MACH__ ideally should be part of MacOS definition, but adding to Cmake + behaving is not as expected, need to fix this. */ + +@@ -117,7 +121,10 @@ void WorkerThread::threadMain() + + #if _WIN32 + SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_BELOW_NORMAL); +-#else ++#elif defined(__HAIKU__) ++ __attribute__((unused)) status_t ++ val = set_thread_priority(find_thread(NULL), B_LOW_PRIORITY); ++ #else + __attribute__((unused)) int val = nice(10); + #endif + +-- +2.12.2 diff --git a/media-libs/x265/x265-2.4.recipe b/media-libs/x265/x265-2.4.recipe new file mode 100644 index 000000000..334b9d75f --- /dev/null +++ b/media-libs/x265/x265-2.4.recipe @@ -0,0 +1,71 @@ +SUMMARY="H.265/HEVC video encoder" +DESCRIPTION="x265 is a full-fledged video encoder for the HEVC video format \ +(also known as High Efficiency Video Coding, ISO/IEC 23008-2, MPEG-H Part 2, \ +and ITU-T H.265). HEVC is a direct successor to the earlier H.264/MPEG-4 AVC \ +video compression standard, aiming to achieve the same video quality at half \ +the bit rate. x265 is a free software project implementing that standard." +HOMEPAGE="http://x265.org/" +COPYRIGHT="2013-2017 x265 Project" +LICENSE="GNU GPL v2" +REVISION="1" +SOURCE_URI="https://bitbucket.org/multicoreware/x265/downloads/x265_$portVersion.tar.gz" +CHECKSUM_SHA256="9c2aa718d78f6fecdd783f08ab83b98d3169e5f670404da4c16439306907d729" +SOURCE_DIR="x265_$portVersion" +PATCHES="x265-$portVersion.patchset" + +ARCHITECTURES="!x86_gcc2 ?x86 ?x86_64" +SECONDARY_ARCHITECTURES="!x86_gcc2 ?x86" + +PROVIDES=" + x265$secondaryArchSuffix = $portVersion + cmd:x265 = $portVersion + lib:libx265$secondaryArchSuffix = 89 + " +REQUIRES=" + haiku$secondaryArchSuffix + " + +PROVIDES_devel=" + x265${secondaryArchSuffix}_devel = $portVersion + devel:libx265$secondaryArchSuffix = 89 + " +REQUIRES_devel=" + x265$secondaryArchSuffix == $portVersion base + " + +BUILD_REQUIRES=" + haiku${secondaryArchSuffix}_devel + " +BUILD_PREREQUIRES=" + cmd:cmake + cmd:gcc$secondaryArchSuffix + cmd:make + cmd:yasm + " + +BUILD() +{ + # Can't put this in SOURCE_DIR as cmake uses a file in the root + # directory to find out the version of x265 + cd source + + cmake \ + -DCMAKE_INSTALL_PREFIX:PATH=$prefix \ + -DLIB_INSTALL_DIR:PATH=$relativeLibDir \ + -DBIN_INSTALL_DIR:PATH=bin \ + -DINCLUDE_INSTALL_DIR:PATH=$relativeIncludeDir + make $jobArgs VERBOSE=1 +} + +INSTALL() +{ + cd source + make install + + prepareInstalledDevelLibs libx265 + fixPkgconfig + + # devel package + packageEntries devel \ + $developDir +}