diff --git a/media-libs/x265/patches/x265-1.8_hg.patchset b/media-libs/x265/patches/x265-1.8_hg.patchset new file mode 100644 index 000000000..2f9f095d5 --- /dev/null +++ b/media-libs/x265/patches/x265-1.8_hg.patchset @@ -0,0 +1,115 @@ +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 + + +diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt +index 353003e..6fd2cbe 100644 +--- a/source/CMakeLists.txt ++++ b/source/CMakeLists.txt +@@ -66,7 +66,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.2.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 + + +diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt +index 6fd2cbe..bd6fbdb 100644 +--- a/source/CMakeLists.txt ++++ b/source/CMakeLists.txt +@@ -277,6 +277,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) +@@ -419,7 +420,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.2.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 + + +diff --git a/source/common/threadpool.cpp b/source/common/threadpool.cpp +index 6cb815f..a4b138d 100644 +--- a/source/common/threadpool.cpp ++++ b/source/common/threadpool.cpp +@@ -52,6 +52,9 @@ + + #endif + ++#if defined(__HAIKU__) ++#include ++#endif + #if MACOS + #include + #include +@@ -91,7 +94,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.2.2 + + +From e97a640c2d8c7a76094e4833c45ec21e85a10223 Mon Sep 17 00:00:00 2001 +From: Timothy Gu +Date: Mon, 29 Dec 2014 04:43:42 +0000 +Subject: checkasm-a: Explicitly use PLT relocation for libc symbols + +Fixes linking with PIC (default for all compilation) on Haiku. + +diff --git a/source/test/checkasm-a.asm b/source/test/checkasm-a.asm +index f7b9837..d0d622a 100644 +--- a/source/test/checkasm-a.asm ++++ b/source/test/checkasm-a.asm +@@ -153,7 +153,7 @@ cglobal checkasm_call, 2,15,16,max_args*8+8 + jz .ok + mov r9, rax + lea r0, [error_message] +- call puts ++ call puts wrt ..plt + mov r1, [rsp+max_args*8] + mov dword [r1], 0 + mov rax, r9 +-- +2.2.2 + diff --git a/media-libs/x265/x265-1.8_hg.recipe b/media-libs/x265/x265-1.8_hg.recipe new file mode 100644 index 000000000..f4596a2d4 --- /dev/null +++ b/media-libs/x265/x265-1.8_hg.recipe @@ -0,0 +1,76 @@ +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/" +LICENSE="GNU GPL v2" +COPYRIGHT="2013-2014 x265 Project" +SOURCE_URI="https://bitbucket.org/multicoreware/x265/get/tip.tar.bz2" +CHECKSUM_SHA256="287dd96f772efbd63cf25a8bdf99abdfc4d8a48f025f51f36a4378c7347182e7" +REVISION="1" +ARCHITECTURES="!x86_gcc2 ?x86 ?x86_64" +SECONDARY_ARCHITECTURES="!x86_gcc2 ?x86" + +# BitBucket sucks +SOURCE_DIR='multicoreware-x265-4781e6cef251' + +PROVIDES=" + x265$secondaryArchSuffix = $portVersion + cmd:x265 = $portVersion + lib:libx265$secondaryArchSuffix = 68 + " + +REQUIRES=" + haiku$secondaryArchSuffix + " + +BUILD_REQUIRES=" + haiku${secondaryArchSuffix}_devel + " +BUILD_PREREQUIRES=" + cmd:cmake + cmd:gcc$secondaryArchSuffix + cmd:make + cmd:yasm + " + +PATCHES="x265-$portVersion.patchset" + +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 +} + +# ----- devel package ------------------------------------------------------- + +PROVIDES_devel=" + x265${secondaryArchSuffix}_devel = $portVersion + devel:libx265$secondaryArchSuffix = 68 + " +REQUIRES_devel=" + x265$secondaryArchSuffix == $portVersion base + "