X265: bump (#6728)

* x265: bump

* Cleanup

* Make Haiku known

* PROVIDES fix

* renamed 3.4 recipe
This commit is contained in:
extrowerk
2022-08-27 09:25:37 +00:00
committed by GitHub
parent fcd743263a
commit 23c712e401
4 changed files with 218 additions and 95 deletions

View File

@@ -1,14 +1,14 @@
From 88b7b60132aa62864b55f06865bb7c0b6ae09c1e Mon Sep 17 00:00:00 2001
From e258ac00b93ebaaab0a185fb546b132ac49ef07e Mon Sep 17 00:00:00 2001
From: Timothy Gu <timothygu99@gmail.com>
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 c019c2e..7386c73 100644
index a407271..ab67056 100755
--- a/source/CMakeLists.txt
+++ b/source/CMakeLists.txt
@@ -79,7 +79,8 @@ else()
@@ -85,7 +85,8 @@ else()
endif()
if(UNIX)
@@ -19,20 +19,20 @@ index c019c2e..7386c73 100644
if(LIBRT)
list(APPEND PLATFORM_LIBS rt)
--
2.23.0
2.30.2
From 7e65fd92030b80aa75c769de100f7f0734f9ebf5 Mon Sep 17 00:00:00 2001
From ffe5ed29a6dccd02ce124f868a03f7868c735361 Mon Sep 17 00:00:00 2001
From: Timothy Gu <timothygu99@gmail.com>
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 7386c73..c67236d 100644
index ab67056..790829d 100755
--- a/source/CMakeLists.txt
+++ b/source/CMakeLists.txt
@@ -355,6 +355,7 @@ endif()
@@ -373,6 +373,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")
@@ -41,21 +41,21 @@ index 7386c73..c67236d 100644
set(EXTRA_LINK_FLAGS "" CACHE STRING "Extra link flags")
if(EXTRA_LINK_FLAGS)
--
2.23.0
2.30.2
From bea6a228a5542d3446962c8a3f77553cc65ee1ce Mon Sep 17 00:00:00 2001
From 555165a153df3969e55903d6c9a3c568662341eb Mon Sep 17 00:00:00 2001
From: Timothy Gu <timothygu99@gmail.com>
Date: Sun, 28 Dec 2014 07:14:34 +0000
Subject: Add Haiku version of adjusting thread priority
diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt
index c67236d..a8a32da 100644
index 790829d..c4ca46e 100755
--- a/source/CMakeLists.txt
+++ b/source/CMakeLists.txt
@@ -579,7 +579,8 @@ if(SVTHEVC_FOUND)
install(FILES "${SVT_HEVC_LIBRARY}" DESTINATION ${BIN_INSTALL_DIR})
@@ -600,7 +600,8 @@ if(SVTHEVC_FOUND)
install(FILES "${SVT_HEVC_LIBRARY}" DESTINATION ${LIB_INSTALL_DIR})
endif()
-install(FILES x265.h "${PROJECT_BINARY_DIR}/x265_config.h" DESTINATION include)
@@ -65,17 +65,17 @@ index c67236d..a8a32da 100644
if(MSVC_IDE)
install(FILES "${PROJECT_BINARY_DIR}/Debug/x265.pdb" DESTINATION ${BIN_INSTALL_DIR} CONFIGURATIONS Debug)
--
2.23.0
2.30.2
From b27bd0f8bc15b7fef2a2968d2bf956b75623bfb4 Mon Sep 17 00:00:00 2001
From d431805269baccde5d0ec7be699eb2e9cf68df31 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Fri, 25 Oct 2019 21:18:33 +0200
Subject: avoid using nice.
diff --git a/source/common/threadpool.cpp b/source/common/threadpool.cpp
index f359d80..174d004 100644
index 2db7a14..0df90c8 100644
--- a/source/common/threadpool.cpp
+++ b/source/common/threadpool.cpp
@@ -118,7 +118,9 @@ void WorkerThread::threadMain()
@@ -89,5 +89,51 @@ index f359d80..174d004 100644
m_pool.setCurrentThreadAffinity();
--
2.23.0
2.30.2
From 6c724ef1432bcd50ab7b1a6ff884044b8a775943 Mon Sep 17 00:00:00 2001
From: Elio Blanca <eblanca76@users.sourceforge.net>
Date: Mon, 28 Feb 2022 23:29:47 +0000
Subject: fix detection of cpu cores
diff --git a/source/common/threadpool.cpp b/source/common/threadpool.cpp
index 0df90c8..52b3435 100644
--- a/source/common/threadpool.cpp
+++ b/source/common/threadpool.cpp
@@ -636,7 +636,7 @@ int ThreadPool::getCpuCount()
/* Return the number of processors configured by OS. Because, most embedded linux distributions
* uses only one processor as the scheduler doesn't have enough work to utilize all processors */
return sysconf(_SC_NPROCESSORS_CONF);
-#elif __unix__
+#elif defined(__unix__) || defined(__HAIKU__)
return sysconf(_SC_NPROCESSORS_ONLN);
#elif MACOS && __MACH__
int nm[2];
--
2.30.2
From c6b64f98234f09e905c685ed20971772ec5c549f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zolt=C3=A1n=20Mizsei?= <zmizsei@extrowerk.com>
Date: Tue, 15 Mar 2022 21:59:51 +0100
Subject: Add Haiku to the known OS list
diff --git a/source/common/version.cpp b/source/common/version.cpp
index 42a6b1d..9a626f4 100644
--- a/source/common/version.cpp
+++ b/source/common/version.cpp
@@ -67,6 +67,8 @@
#define ONOS "[Cygwin]"
#elif __APPLE__
#define ONOS "[Mac OS X]"
+#elif __HAIKU__
+#define ONOS "[HAIKU]"
#else
#define ONOS "[Unk-OS]"
#endif
--
2.30.2

View File

@@ -0,0 +1,147 @@
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-2021 x265 Project"
LICENSE="GNU GPL v2"
REVISION="1"
SOURCE_URI="https://bitbucket.org/multicoreware/x265_git/get/$portVersion.tar.gz"
CHECKSUM_SHA256="5ca3403c08de4716719575ec56c686b1eb55b078c0fe50a064dcf1ac20af1618"
# BitBucket sucks
SOURCE_DIR="multicoreware-x265_git-f0c1022b6be1"
PATCHES="x265-$portVersion.patchset"
ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="!x86_gcc2 x86"
libVersion="199"
libVersionCompat="$libVersion compat >= ${libVersion}"
PROVIDES="
x265$secondaryArchSuffix = $portVersion
lib:libx265$secondaryArchSuffix = $libVersionCompat
"
REQUIRES="
haiku$secondaryArchSuffix
"
PROVIDES_devel="
x265${secondaryArchSuffix}_devel = $portVersion
devel:libx265$secondaryArchSuffix = $libVersionCompat
"
REQUIRES_devel="
x265$secondaryArchSuffix == $portVersion base
"
PROVIDES_bin="
x265${secondaryArchSuffix}_bin = $portVersion
cmd:x265 = $portVersion
"
REQUIRES_bin="
x265$secondaryArchSuffix == $portVersion base
haiku$secondaryArchSuffix
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
"
BUILD_PREREQUIRES="
cmd:cmake
cmd:gcc$secondaryArchSuffix
# cmd:git
cmd:make
cmd:nasm
"
defineDebugInfoPackage x265$secondaryArchSuffix \
"$libDir"/libx265.so.$libVersion \
"$(getPackagePrefix bin)/$relativeBinDir"/x265$secondaryArchSuffix
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
# By default, the library and the encoder is configured for only one output bit
# depth. Meaning, one has to rebuild libx265 if (s)he wants to produce HEVC
# files with a different bit depth, which is annoying. However, upstream
# supports proper namespacing for 8bits, 10bits & 12bits HEVC and linking all
# that together so that the resulting library can produce all three of them
# instead of only one.
# The API requires the bit depth parameter, so that libx265 can then chose which
# variant of the encoder to use.
# To achieve this, we have to build one (static) library for each non-main
# variant, and link it into the main library.
# Upstream documents using the 8bit variant as main library, hence we do not
# allow disabling it: "main" *MUST* come last in the following list.
# 12 bit #################
echo "Configuring variant: 12 bit"
cmake \
-S. \
-B build/12bit \
-DCMAKE_BUILD_TYPE=Release \
-DHIGH_BIT_DEPTH=ON \
-DEXPORT_C_API=OFF \
-DENABLE_SHARED=OFF \
-DENABLE_CLI=OFF \
-DMAIN12=ON \
-DENABLE_ASSEMBLY=OFF
make $jobArgs -C build/12bit
cp ./build/12bit/libx265.a ./libx265_12b.a
#10 bit #################
echo "Configuring variant: 10 bit"
cmake \
-S. \
-B build/10bit \
-DCMAKE_BUILD_TYPE=Release \
-DHIGH_BIT_DEPTH=ON \
-DEXPORT_C_API=OFF \
-DENABLE_SHARED=OFF \
-DENABLE_CLI=OFF \
-DENABLE_HDR10_PLUS=ON \
-DENABLE_ASSEMBLY=OFF
make $jobArgs -C build/10bit
cp ./build/10bit/libx265.a ./libx265_10b.a
cp ./build/10bit/libhdr10plus.a ./libhdr10plus.a
#8 bit #################
echo "Configuring variant: 8 bit"
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DGIT_ARCHETYPE=1 \
-DENABLE_SHARED=ON \
-DEXTRA_LIB="libx265_12b.a;libx265_10b.a;libhdr10plus.a" \
-DEXTRA_LINK_FLAGS=-L. \
-DLINKED_10BIT=ON \
-DLINKED_12BIT=ON \
-DCMAKE_INSTALL_PREFIX:PATH=$prefix \
-DLIB_INSTALL_DIR:PATH=$relativeLibDir \
-DBIN_INSTALL_DIR:PATH=$relativeBinDir \
-DINCLUDE_INSTALL_DIR:PATH=$relativeIncludeDir
make $jobArgs
}
INSTALL()
{
cd source
make install
rm -f $libDir/libx265.a
prepareInstalledDevelLibs libx265
fixPkgconfig
# bin package
packageEntries bin \
$binDir
# devel package
packageEntries devel \
$developDir
}

View File

@@ -1,60 +0,0 @@
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-2019 x265 Project"
LICENSE="GNU GPL v2"
REVISION="1"
SOURCE_URI="https://bitbucket.org/multicoreware/x265/get/$portVersion.tar.bz2"
CHECKSUM_SHA256="9e0099dea6c4e87ff74910fa231fb8f12b0fd2421be8df503d22f023e29a4409"
# BitBucket sucks
SOURCE_DIR="multicoreware-x265-353572437201"
PATCHES="x265-$portVersion.patchset"
ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="!x86_gcc2 x86"
PROVIDES="
x265_179$secondaryArchSuffix = $portVersion
lib:libx265$secondaryArchSuffix = 179
"
REQUIRES="
haiku$secondaryArchSuffix
"
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
rm -rf $prefix/bin $developDir
}

View File

@@ -7,7 +7,7 @@ the bit rate. x265 is a free software project implementing that standard."
HOMEPAGE="http://x265.org/"
COPYRIGHT="2013-2020 x265 Project"
LICENSE="GNU GPL v2"
REVISION="3"
REVISION="1"
SOURCE_URI="https://bitbucket.org/multicoreware/x265_git/get/$portVersion.tar.gz"
CHECKSUM_SHA256="7f2771799bea0f53b5ab47603d5bea46ea2a221e047a7ff398115e9976fd5f86"
# BitBucket sucks
@@ -18,22 +18,13 @@ ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="!x86_gcc2 x86"
PROVIDES="
x265$secondaryArchSuffix = $portVersion
cmd:x265 = $portVersion
x265_3.4$secondaryArchSuffix = $portVersion
lib:libx265$secondaryArchSuffix = 192
"
REQUIRES="
haiku$secondaryArchSuffix
"
PROVIDES_devel="
x265${secondaryArchSuffix}_devel = $portVersion
devel:libx265$secondaryArchSuffix = 192
"
REQUIRES_devel="
x265$secondaryArchSuffix == $portVersion base
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
"
@@ -50,12 +41,15 @@ BUILD()
# directory to find out the version of x265
cd source
cmake -DCMAKE_INSTALL_PREFIX:PATH=$prefix \
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX:PATH=$prefix \
-DLIB_INSTALL_DIR:PATH=$relativeLibDir \
-DBIN_INSTALL_DIR:PATH=bin \
-DINCLUDE_INSTALL_DIR:PATH=$relativeIncludeDir
make $jobArgs VERBOSE=1
make $jobArgs
}
INSTALL()
@@ -63,12 +57,8 @@ INSTALL()
cd source
make install
rm -f $libDir/libx265.a
prepareInstalledDevelLibs libx265
fixPkgconfig
# devel package
packageEntries devel \
$developDir
rm -rf $binDir $developDir
}