summaryrefslogtreecommitdiff
path: root/media-libs/x265
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2024-08-26 12:00:09 +0100
committerV3n3RiX <venerix@koprulu.sector>2024-08-26 12:00:09 +0100
commitf300354de9fe5d997850456a9e1f400193e6544f (patch)
tree402fd6a7727db790bf57f683894052e8791d389e /media-libs/x265
parent5c42677148c717eb9f4673237db807f74740b4e9 (diff)
gentoo auto-resync : 26:08:2024 - 12:00:09
Diffstat (limited to 'media-libs/x265')
-rw-r--r--media-libs/x265/Manifest20
-rw-r--r--media-libs/x265/files/test-ns.patch55
-rw-r--r--media-libs/x265/files/x265-3.5-r5-cpp-std.patch23
-rw-r--r--media-libs/x265/files/x265-3.5-r5-gcc15.patch29
-rw-r--r--media-libs/x265/files/x265-3.5-r5-test-ns_2.patch11
-rw-r--r--media-libs/x265/files/x265-3.6-test-ns_2.patch30
-rw-r--r--media-libs/x265/files/x265-9999-test-ns.patch157
-rw-r--r--media-libs/x265/metadata.xml1
-rw-r--r--media-libs/x265/x265-3.5-r2.ebuild220
-rw-r--r--media-libs/x265/x265-3.5-r3.ebuild1
-rw-r--r--media-libs/x265/x265-3.5-r4.ebuild1
-rw-r--r--media-libs/x265/x265-3.5-r5.ebuild194
-rw-r--r--media-libs/x265/x265-3.6.ebuild194
-rw-r--r--media-libs/x265/x265-9999.ebuild195
14 files changed, 688 insertions, 443 deletions
diff --git a/media-libs/x265/Manifest b/media-libs/x265/Manifest
index 2e754649e763..358ecdba5a3c 100644
--- a/media-libs/x265/Manifest
+++ b/media-libs/x265/Manifest
@@ -1,13 +1,19 @@
AUX arm-r1.patch 2252 BLAKE2B 86ea85441e4023cf415f57ea6b909e3a9d6c3cc4f35c1e402d4a84632f533e37b3ba8bea07af4cde0218c20c684d59cb4632de1cf73d6f2cc843e048c7a424a9 SHA512 387e8fd56fbc4d56765c0bcad2f5c5a1b43c4d3db51f81d010e0926932a58b16dcaae614e191efdfb0afedcf6ae5981966e8a94258fb0b22e85e003a1cea15ec
AUX neon.patch 677 BLAKE2B 805177f9d3d3f703699adad93b0ca655065b9d093ecc3776600fa4eb3c565962beac47ebbeb35dcdf6fa3d0d19c734310b4032bcda62aeeea8ddc99debe901f1 SHA512 69e3d7c6d987ccbbaa7111eb8efc1e02c1e02096936a0eedfbe7e9e1c1377bed0f50f7b09aec0768e8de31251b8e3d2191aab56f19259c0e4aeda9684ab55bc6
-AUX test-ns.patch 14677 BLAKE2B fa48d03bca5d72b7b3eac7f6ac98c93bde12ec845f9eecdde2c4ed5ed4ac6688d74ea75e11f00d4f901967f81cd80f138eaae662bd6cc1f67948121c3c0b2e34 SHA512 c6d2752027e42403704c68948256c52a237f8b83ee97d4b8e21cc13654964342ed061e5f048984fb649e9980f4899a64931ec97d6dfa1b786db6346134b04281
+AUX test-ns.patch 13886 BLAKE2B acc90ce7878861ee0faf6e5a4081a63c9ace5153895a4f69d1ccdbcfeabb9fd782ab86841d98a05f0bc36566749368b111f00dad4b7fcab4b8fdd347c7fc1579 SHA512 fc9182128855babca12629188221e8b3bb5c7eb8148e83532d16a3e1ef0fcd211d1b55728ce10a510481cd7eb4f47918d644eb6d6b795969545b62a57307af59
AUX tests.patch 650 BLAKE2B 21759b11966e12df1a72a1ed00935ff781ad8b912e734de65cf0872cf92400aef71d4aebbe067dd1059a1d445cd9819cef4dc4b1c7df63ca7b8e97b8e578045e SHA512 a4a3b69fa86e6910ff4f963b9667c8deaea4ff88f3396e8e426e61d036b12cbf550bff7867657da1ba98417f1ccae88db1887b94ea6271604060e01fb8698d79
AUX x265-3.3-ppc64.patch 590 BLAKE2B bbc6f18b8f192424450d2860e33ea6dbba14b46876f05cf9c499412d491127c877c342b1900bb9d06d66126aca2f383da1a4986ce69670ebc392fec0fe9b59a9 SHA512 bb4ace2c4bc899a0ccdd17fb78e63980354f41ff0f201812d47c5df16b23fea6fcdbde086e737d0efd5d8cb8fa571a131c03433bec31999c71ff51bccd754950
+AUX x265-3.5-r5-cpp-std.patch 779 BLAKE2B 815de056af19c721d612fccf8bea233764bdd161d175c0d7f9b0591a91b6607a5e7556e70fe181d7ab02b4e5067b818fe7a8162c2c2ce5fd01779c8f1c641111 SHA512 2ce2c6fa598db565bd5a6acddd0ec9095b68fde28584a23c5a398a16b44a5514b6d4ec2f9b8e4ab9a871320c694f4723958eca55588d90b3fdb5a94244c08729
+AUX x265-3.5-r5-gcc15.patch 1187 BLAKE2B ff951ae974c7df6aaccbb8b0f937564b41b88bbe029a2b6d0e188911a3ce80276fa960d559c86c4d1762a93c448b1862b02e00b5247e7cec83531b5921b9700a SHA512 ed87e6919f0bcd6a719411716c4dbd0016e4d7c23beca4cf7d93d0beca4c7af275c8734e103098f7f358161917fed0a6a0d1301e1eb8de8744a8b4e6b288519f
+AUX x265-3.5-r5-test-ns_2.patch 521 BLAKE2B 987a20dd57642bf5003d138913e39a4efd0a1c3708ba186619777d8854964dcb8415a6fcefcaefe5f2a12741664cf852aea5181cc47179ae6bdb6268c477c1f0 SHA512 f03ed7f48df097ea4f8d92809a4eb68234cb62dc47b66e10616df6c8f6dea06a403bcedb47b54994d81563faa3b0b6a82bea6043dddbbdb75dd584924e90e900
+AUX x265-3.6-test-ns_2.patch 1060 BLAKE2B 19d59ef567fc67bdcab790a29567ddc16c861a5952af5cb32cfe40634920c6c3bbafb0730b5d012922e7dd15b57ad3aeff689a178ce35e46ea1619a4ceddff8d SHA512 aeea732684209e55155d012cf134badc455c598e4540384b765679e5dc91331ccfabd8b2f5b48c132390f103d774424fa547e146eb9e1f498581635b1da3b709
AUX x265-9999-arm.patch 2115 BLAKE2B 92f2225fd23030220531e6bfda7a3d4ce197090a7b1d996fe5995885fe332352e3628ca3fe307d2ae7af2d0342b183c5bbe4337201c51fb4092e273eae2f1308 SHA512 602725dc487397466c48d4d0aa09d8d63b3519fc72cd9538e732c2c82f6f3fa9c959f6f29ff3f810fec82dbdf609d9fd37fe05dd67496fc4c8bbda5f87c9f165
-AUX x265-9999-test-ns.patch 14971 BLAKE2B 8750a3a94eefd78dfe082c46634606a1abe4ae1b9cf89971e5532a1fc8d42e8b406ca71ab2dfd3e77bdc589e553e190c423a12b5c1007eae9fe12d86e7603ef7 SHA512 55baf712622acfb0d76eee3b283ba38905327eacb0ce52f202563e7e6c1c8593bcae84acc876c91f36ac22fcc06950ffa181515b58d199821c8d265f309594e7
+AUX x265-9999-test-ns.patch 15836 BLAKE2B 9dc3384f38654a49c0dc62273ed824b5a556494233d33cba0032e7949c38d095299d7e30fe47046a162ac07ec13cff3ea85322738396c2999f4d873813698f24 SHA512 ec4d47d6b2d7e4ffed3891476811955f4eec420563d02caec27138fb580f3d47173ab9be2be6ddee98eef07e9b878df8a9648e7ffbd4add397e5aaca6616c9a5
+DIST x265-3.6.tar.gz 1655889 BLAKE2B 2598421e2e21974998b0b20895dc7e12dbf6ebe1b6c23bb5a7710b575d3db773335cd1f0b3ef110b79cf4d6dd01e543e9807a0509963497edc25f617f80c29f3 SHA512 570429c3f0b560b2f946ac9baba97d66d7d6485e46eb695b17003b5913028f62d35822477633e911cd3ea60e6ce0ecc7d9d82de7d8257272f9ca7b43761438be
DIST x265_3.5.tar.gz 1537044 BLAKE2B 4fe15b762eda08a4379f69df622bef603fed784a237381d5c95876412020c113d053af829fa1eb66468462a6edc0de32dc597b1a98a63e9aa0250a47f4e76d05 SHA512 230e683239c3e262096ba96246c6f67229a1625d163f86647a411733bb1cf349685858aee3017bce818bb6992448d0abaa9241615a5b620561ce47ecb164f997
-EBUILD x265-3.5-r2.ebuild 6342 BLAKE2B 3a5bf8ebedc877d8d69c3021f925fb77559ea682a423438d734953e9960518d9d96672955bf56d7d11409ba734c38edd43f60f25b1f5b666f68de11591fe4370 SHA512 55e41cc836b62aab1c64da0e2b1d5ea35a204bcee5408b47fc732237af394daf419e965fb963c4cba4814b00f2d40ea9ce707aa14f5695b18f5f8dadb43272c6
-EBUILD x265-3.5-r3.ebuild 6278 BLAKE2B eed60ccfe4d08c4b50fea28409ec6542b4641d312042cd9ea6d4d982483be4013202d7cbd5f2f8b4e70f307f69e597ccc4f7b27bf0285b4f9bfe5e93a2d1a0cd SHA512 45d787b42c2d8ca8f082b0b46137608ada716a011d1a83fe99a1f7a27fb39d3f1bb58e8b8f4d8bbd912b58191907ef8b04d3b0a7879ad1268568f962e38e4ee7
-EBUILD x265-3.5-r4.ebuild 6284 BLAKE2B 711ba48141c743309234a82643f786515a6f3455724175164a990cd51066925afb941255407f615e0090d9d8f8488a3c25ac7768c6d80459195d1b391c8fec17 SHA512 aa54eccb1c21a9c414d232731cbba199acaa39e6030a31f42cb4990fd4ac624b6e792f588bc73f68af880adf028f2eec612aab255bd93cf42d1ab42b17094746
-EBUILD x265-9999.ebuild 6267 BLAKE2B 8c72626a97d64b7f1470625d932f7294ca17d503a0a89a81e567f4f13a1cc04fd41275e4a5ddc9e6e4f4d3ed9b1e7edd56092d10bb57d4e219776a4b8c26fd9c SHA512 0eb5ec91ed93440ebd8cf79724591fc4a8f03405cf42d33b7f9d3d0dad2cc1a018e23c301ec659a2dacc7c97eff199569bb60cfcb90999a3a785f964cf3481a1
-MISC metadata.xml 626 BLAKE2B 59840316bac42695fd0c76baad143fcbdf810d80b48aa0260633b7dd70cd24a064ac0e3284772368bffd05415befd99fc4f224d2c2c7fc44e27ec56759f04b07 SHA512 97ba150042a2f4558c828af03bb489faa4385af6a2c72ed3f7489091e011a94e40330117a3f2edddea8fc73652396fb53e9190bdd00cb2b3d1c8b553ed2d0d7e
+EBUILD x265-3.5-r3.ebuild 6322 BLAKE2B ca7ca9bb3bc5b1b2b9cac87e66c3b9ac6274046f3d9de4bf482b3eb41cc298cb343540aecdd452f76e568adcd81ee448c500ff33b04bebe0538b1ff57ab97381 SHA512 34e8d843a8de25ea41752dc66df2663fb352405d8ea6206bd92d9e8bf6c32ffc567a5e4e06d7e6df589d5da9f6579c8a3e96a93a3d3865961e6f5c3de9958234
+EBUILD x265-3.5-r4.ebuild 6328 BLAKE2B 018ae5f029ced97cc842ab0909a4586ec71c9bd218b08476161468e347694315f186752cc89aa50aae11d3de182b55c7f13b8c9594a3fe2d123812a0a0e7e994 SHA512 649eddcc4c087a23160c2ecbfc305c62010fc5b72a31f82c2f772dfa73b999db93bf791410df78ff843f15f1da9ad4aefa4a830b88989fa8681095291f7ee168
+EBUILD x265-3.5-r5.ebuild 5137 BLAKE2B b57ffbaf26fd9ff55c278d2d13f18120dfc760b9be4d943a35e96e898ebceb471fe63c88f18e9b410c77c849d1fde1cbc9f101d3b030eec41bff4fbdcce6a61e SHA512 bb52e246492bd6ce050716ca5ff73e7865f319f08367068dd932a937a4ed298d008dfd7a34796ce8fb085ce7e57e58c19fed72b09dcd50b02a0addfdac8d1e8d
+EBUILD x265-3.6.ebuild 5164 BLAKE2B 440ae0712a1d9d477b9b1cf3e8441ee6d9cf9724ba8bfc2a0cfe26635fbb1fdb8187a1478239bbff32aed5efa1b96e3b279903c8c0bed9099aa5ebf25602420f SHA512 c92b945df6cc74ca3d02965064ab763ca2cfa6e88e292520e49e3c4153b6b176a2deda8336b4dfa6bb2b6705fea628b545a752f540af5493de36e4f3ab58cdd7
+EBUILD x265-9999.ebuild 5161 BLAKE2B 6a6c948ac735944fd928aa0da10cd592530b3c3326970dffe0e166e48f65de18e852660954962ae2037d755d895967fe268541eaa3622b84a0a91c7c1b85de18 SHA512 9967cce944d9e7746ef5882c20cfbaf51eca203d932e34a53042fe5481dbd55d93fa4cd09eba5277a0e308b977ba9238f60d07bda6b55d2d22c3cf5c55bdffc1
+MISC metadata.xml 541 BLAKE2B 4509c092fe30d689d4f18d077d429bbd0c05f704fa2027dd400d3686a35f1d39631480abce2357cb7cec8f468b2eeed2a08156f8830938171016c6e77d3f2a73 SHA512 d80b09241e28cffdab81e21f40d81f4da4814574f3e56109684f654887767a671c111bdc9f44566b0e7ab7c8cca949a5718d8afb20f0a43e73c2e6b878bd28a7
diff --git a/media-libs/x265/files/test-ns.patch b/media-libs/x265/files/test-ns.patch
index 898751a7ae2d..86cadade6a09 100644
--- a/media-libs/x265/files/test-ns.patch
+++ b/media-libs/x265/files/test-ns.patch
@@ -1,7 +1,5 @@
Namespace functions for multi-bitdepth builds so that libraries are self-contained.
-Index: source/common/param.h
-===================================================================
--- source.orig/common/param.h
+++ source/common/param.h
@@ -53,6 +53,18 @@ int x265_param_default_preset(x265_param
@@ -23,8 +21,6 @@ Index: source/common/param.h
#define PARAM_NS X265_NS
#endif
}
-Index: source/encoder/api.cpp
-===================================================================
--- source.orig/encoder/api.cpp
+++ source/encoder/api.cpp
@@ -106,9 +106,9 @@ x265_encoder *x265_encoder_open(x265_par
@@ -58,15 +54,6 @@ Index: source/encoder/api.cpp
}
x265_copy_params(&save, encoder->m_latestParam);
int ret = encoder->reconfigureParam(encoder->m_latestParam, param_in);
-@@ -604,7 +604,7 @@ fail:
- *pi_nal = 0;
-
- if (numEncoded && encoder->m_param->csvLogLevel && encoder->m_outputCount >= encoder->m_latestParam->chunkStart)
-- x265_csvlog_frame(encoder->m_param, pic_out);
-+ PARAM_NS::x265_csvlog_frame(encoder->m_param, pic_out);
-
- if (numEncoded < 0)
- encoder->m_aborted = true;
@@ -637,7 +637,7 @@ void x265_vmaf_encoder_log(x265_encoder*
encoder->fetchStats(&stats, sizeof(stats));
int padx = encoder->m_sps.conformanceWindow.rightOffset;
@@ -76,15 +63,6 @@ Index: source/encoder/api.cpp
}
}
#endif
-@@ -651,7 +651,7 @@ void x265_encoder_log(x265_encoder* enc,
- encoder->fetchStats(&stats, sizeof(stats));
- int padx = encoder->m_sps.conformanceWindow.rightOffset;
- int pady = encoder->m_sps.conformanceWindow.bottomOffset;
-- x265_csvlog_encode(encoder->m_param, &stats, padx, pady, argc, argv);
-+ PARAM_NS::x265_csvlog_encode(encoder->m_param, &stats, padx, pady, argc, argv);
- }
- }
-
@@ -872,7 +872,7 @@ void x265_alloc_analysis_data(x265_param
return;
@@ -94,8 +72,6 @@ Index: source/encoder/api.cpp
}
void x265_free_analysis_data(x265_param *param, x265_analysis_data* analysis)
-Index: source/encoder/encoder.cpp
-===================================================================
--- source.orig/encoder/encoder.cpp
+++ source/encoder/encoder.cpp
@@ -186,8 +186,8 @@ void Encoder::create()
@@ -127,15 +103,6 @@ Index: source/encoder/encoder.cpp
X265_FREE(m_dupBuffer[i]);
}
-@@ -1592,7 +1592,7 @@ int Encoder::encode(const x265_picture*
- if (m_exportedPic)
- {
- if (!m_param->bUseAnalysisFile && m_param->analysisSave)
-- x265_free_analysis_data(m_param, &m_exportedPic->m_analysisData);
-+ PARAM_NS::x265_free_analysis_data(m_param, &m_exportedPic->m_analysisData);
- ATOMIC_DEC(&m_exportedPic->m_countRefEncoders);
- m_exportedPic = NULL;
- m_dpb->recycleUnreferenced();
@@ -1968,7 +1968,7 @@ int Encoder::encode(const x265_picture*
/* Free up inputPic->analysisData since it has already been used */
@@ -280,8 +247,6 @@ Index: source/encoder/encoder.cpp
m_aborted = true; \
return; \
}\
-Index: source/common/param.cpp
-===================================================================
--- source.orig/common/param.cpp
+++ source/common/param.cpp
@@ -102,7 +102,7 @@ x265_param *x265_param_alloc()
@@ -293,3 +258,23 @@ Index: source/common/param.cpp
#ifdef SVT_HEVC
x265_free(p->svtHevcParam);
#endif
+--- source.orig/encoder/api.cpp
++++ source/encoder/api.cpp
+@@ -604,7 +604,7 @@ fail:
+ *pi_nal = 0;
+
+ if (numEncoded && encoder->m_param->csvLogLevel && encoder->m_outputCount >= encoder->m_latestParam->chunkStart)
+- x265_csvlog_frame(encoder->m_param, pic_out);
++ PARAM_NS::x265_csvlog_frame(encoder->m_param, pic_out);
+
+ if (numEncoded < 0)
+ encoder->m_aborted = true;
+@@ -651,7 +651,7 @@ void x265_encoder_log(x265_encoder* enc,
+ encoder->fetchStats(&stats, sizeof(stats));
+ int padx = encoder->m_sps.conformanceWindow.rightOffset;
+ int pady = encoder->m_sps.conformanceWindow.bottomOffset;
+- x265_csvlog_encode(encoder->m_param, &stats, padx, pady, argc, argv);
++ PARAM_NS::x265_csvlog_encode(encoder->m_param, &stats, padx, pady, argc, argv);
+ }
+ }
+
diff --git a/media-libs/x265/files/x265-3.5-r5-cpp-std.patch b/media-libs/x265/files/x265-3.5-r5-cpp-std.patch
new file mode 100644
index 000000000000..99fbf9bd75de
--- /dev/null
+++ b/media-libs/x265/files/x265-3.5-r5-cpp-std.patch
@@ -0,0 +1,23 @@
+From: Paul Zander <negril.nx+gentoo@gmail.com>
+Date: Fri, 23 Aug 2024 14:31:40 +0200
+Subject: [PATCH] don't force old c++ standards
+
+Signed-off-by: Paul Zander <negril.nx+gentoo@gmail.com>
+
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -221,14 +221,6 @@ if(GCC)
+ if(NOT INTEL_CXX AND NOT CLANG AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 8.0)
+ add_definitions(-Wno-class-memaccess)
+ endif()
+- if(ENABLE_HDR10_PLUS)
+- if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.8")
+- message(FATAL_ERROR "gcc version above 4.8 required to support hdr10plus")
+- endif()
+- add_definitions(-std=gnu++11)
+- else()
+- add_definitions(-std=gnu++98)
+- endif()
+ if(ENABLE_PIC)
+ add_definitions(-fPIC)
+ endif(ENABLE_PIC)
diff --git a/media-libs/x265/files/x265-3.5-r5-gcc15.patch b/media-libs/x265/files/x265-3.5-r5-gcc15.patch
new file mode 100644
index 000000000000..6a474d3c192f
--- /dev/null
+++ b/media-libs/x265/files/x265-3.5-r5-gcc15.patch
@@ -0,0 +1,29 @@
+From: Ted Rodgers <ted.d.rodgers@gmail.com>
+Date: Fri, 23 Aug 2024 12:15:56 +0200
+Subject: [PATCH] Explicitly include <cstdint>
+
+GCC 15 will no longer include <cstdint> by default, resulting in build
+failures in projects that do not explicitly include it.
+
+Error:
+/var/tmp/portage/media-libs/x265-3.5-r4/work/x265_3.5/source/dynamicHDR10/json11/json11.cpp:101:32: error: ‘uint8_t’ does not name a type
+ 101 | } else if (static_cast<uint8_t>(ch) <= 0x1f) {
+ | ^~~~~~~
+/var/tmp/portage/media-libs/x265-3.5-r4/work/x265_3.5/source/dynamicHDR10/json11/json11.cpp:28:1: note: ‘uint8_t’ is defined in header ‘<cstdint>’; this is probably fixable by adding ‘#include <cstdint>’
+ 27 | #include <limits>
+ +++ |+#include <cstdint>
+ 28 |
+
+See-also: https://gcc.gnu.org/pipermail/gcc-cvs/2024-August/407124.html
+Signed-off-by: Paul Zander <negril.nx+gentoo@gmail.com>
+
+--- a/dynamicHDR10/json11/json11.cpp
++++ b/dynamicHDR10/json11/json11.cpp
+@@ -25,6 +25,7 @@
+ #include <cstdlib>
+ #include <cstdio>
+ #include <limits>
++#include <cstdint>
+
+ #if _MSC_VER
+ #pragma warning(disable: 4510) //const member cannot be default initialized
diff --git a/media-libs/x265/files/x265-3.5-r5-test-ns_2.patch b/media-libs/x265/files/x265-3.5-r5-test-ns_2.patch
new file mode 100644
index 000000000000..eec119f7f923
--- /dev/null
+++ b/media-libs/x265/files/x265-3.5-r5-test-ns_2.patch
@@ -0,0 +1,11 @@
+--- source.orig/encoder/encoder.cpp
++++ source/encoder/encoder.cpp
+@@ -1592,7 +1592,7 @@ int Encoder::encode(const x265_picture*
+ if (m_exportedPic)
+ {
+ if (!m_param->bUseAnalysisFile && m_param->analysisSave)
+- x265_free_analysis_data(m_param, &m_exportedPic->m_analysisData);
++ PARAM_NS::x265_free_analysis_data(m_param, &m_exportedPic->m_analysisData);
+ ATOMIC_DEC(&m_exportedPic->m_countRefEncoders);
+ m_exportedPic = NULL;
+ m_dpb->recycleUnreferenced();
diff --git a/media-libs/x265/files/x265-3.6-test-ns_2.patch b/media-libs/x265/files/x265-3.6-test-ns_2.patch
new file mode 100644
index 000000000000..63308e5bb48d
--- /dev/null
+++ b/media-libs/x265/files/x265-3.6-test-ns_2.patch
@@ -0,0 +1,30 @@
+--- source.orig/encoder/encoder.cpp
++++ source/encoder/encoder.cpp
+@@ -1478,7 +1478,7 @@ int Encoder::encode(const x265_picture* pic_in, x265_picture* pic_out)
+ if (m_exportedPic)
+ {
+ if (!m_param->bUseAnalysisFile && m_param->analysisSave)
+- x265_free_analysis_data(m_param, &m_exportedPic->m_analysisData);
++ PARAM_NS::x265_free_analysis_data(m_param, &m_exportedPic->m_analysisData);
+
+ ATOMIC_DEC(&m_exportedPic->m_countRefEncoders);
+
+--- a/common/threadpool.cpp
++++ b/common/threadpool.cpp
+@@ -25,6 +25,7 @@
+ #include "common.h"
+ #include "threadpool.h"
+ #include "threading.h"
++#include "param.h"
+
+ #include <new>
+
+@@ -314,7 +315,7 @@ ThreadPool* ThreadPool::allocThreadPools(x265_param* p, int& numPools, bool isTh
+ sprintf(nextCount, "%d", cpusPerNode[i]);
+ strcat(poolString, nextCount);
+ }
+- x265_param_parse(p, "pools", poolString);
++ PARAM_NS::x265_param_parse(p, "pools", poolString);
+ }
+ #endif
+ if (p->numaPools && *p->numaPools)
diff --git a/media-libs/x265/files/x265-9999-test-ns.patch b/media-libs/x265/files/x265-9999-test-ns.patch
index ed3de18ae83e..35859c54455e 100644
--- a/media-libs/x265/files/x265-9999-test-ns.patch
+++ b/media-libs/x265/files/x265-9999-test-ns.patch
@@ -31,6 +31,25 @@ Namespace functions for multi-bitdepth builds so that libraries are self-contain
#define PARAM_NS X265_NS
#endif
}
+--- a/common/threadpool.cpp
++++ b/common/threadpool.cpp
+@@ -25,6 +25,7 @@
+ #include "common.h"
+ #include "threadpool.h"
+ #include "threading.h"
++#include "param.h"
+
+ #include <new>
+
+@@ -314,7 +315,7 @@ ThreadPool* ThreadPool::allocThreadPools(x265_param* p, int& numPools, bool isTh
+ sprintf(nextCount, "%d", cpusPerNode[i]);
+ strcat(poolString, nextCount);
+ }
+- x265_param_parse(p, "pools", poolString);
++ PARAM_NS::x265_param_parse(p, "pools", poolString);
+ }
+ #endif
+ if (p->numaPools && *p->numaPools)
--- a/encoder/api.cpp
+++ b/encoder/api.cpp
@@ -106,9 +106,9 @@ x265_encoder *x265_encoder_open(x265_param *p)
@@ -64,16 +83,16 @@ Namespace functions for multi-bitdepth builds so that libraries are self-contain
}
x265_copy_params(&save, encoder->m_latestParam);
int ret = encoder->reconfigureParam(encoder->m_latestParam, param_in);
-@@ -602,7 +602,7 @@ fail:
- *pi_nal = 0;
-
+@@ -604,7 +604,7 @@ fail:
if (numEncoded && encoder->m_param->csvLogLevel && encoder->m_outputCount >= encoder->m_latestParam->chunkStart)
-- x265_csvlog_frame(encoder->m_param, pic_out);
-+ PARAM_NS::x265_csvlog_frame(encoder->m_param, pic_out);
+ {
+ for (int layer = 0; layer < encoder->m_param->numLayers; layer++)
+- x265_csvlog_frame(encoder->m_param, pic_out[layer]);
++ PARAM_NS::x265_csvlog_frame(encoder->m_param, pic_out[layer]);
+ }
if (numEncoded < 0)
- encoder->m_aborted = true;
-@@ -643,7 +643,7 @@ void x265_vmaf_encoder_log(x265_encoder* enc, int argc, char **argv, x265_param
+@@ -646,7 +646,7 @@ void x265_vmaf_encoder_log(x265_encoder* enc, int argc, char **argv, x265_param
encoder->fetchStats(&stats, sizeof(stats));
int padx = encoder->m_sps.conformanceWindow.rightOffset;
int pady = encoder->m_sps.conformanceWindow.bottomOffset;
@@ -82,16 +101,16 @@ Namespace functions for multi-bitdepth builds so that libraries are self-contain
}
}
#endif
-@@ -657,7 +657,7 @@ void x265_encoder_log(x265_encoder* enc, int argc, char **argv)
- encoder->fetchStats(&stats, sizeof(stats));
- int padx = encoder->m_sps.conformanceWindow.rightOffset;
- int pady = encoder->m_sps.conformanceWindow.bottomOffset;
-- x265_csvlog_encode(encoder->m_param, &stats, padx, pady, argc, argv);
-+ PARAM_NS::x265_csvlog_encode(encoder->m_param, &stats, padx, pady, argc, argv);
+@@ -662,7 +662,7 @@ void x265_encoder_log(x265_encoder* enc, int argc, char **argv)
+ for (int layer = 0; layer < encoder->m_param->numLayers; layer++)
+ {
+ encoder->fetchStats(stats, sizeof(stats[layer]), layer);
+- x265_csvlog_encode(encoder->m_param, &stats[0], padx, pady, argc, argv);
++ PARAM_NS::x265_csvlog_encode(encoder->m_param, &stats[0], padx, pady, argc, argv);
+ }
}
}
-
-@@ -878,7 +878,7 @@ void x265_alloc_analysis_data(x265_param *param, x265_analysis_data* analysis)
+@@ -884,7 +884,7 @@ void x265_alloc_analysis_data(x265_param *param, x265_analysis_data* analysis)
return;
fail:
@@ -102,7 +121,7 @@ Namespace functions for multi-bitdepth builds so that libraries are self-contain
void x265_free_analysis_data(x265_param *param, x265_analysis_data* analysis)
--- a/encoder/encoder.cpp
+++ b/encoder/encoder.cpp
-@@ -216,8 +216,8 @@ void Encoder::create()
+@@ -217,8 +217,8 @@ void Encoder::create()
{
m_dupBuffer[i] = (AdaptiveFrameDuplication*)x265_malloc(sizeof(AdaptiveFrameDuplication));
m_dupBuffer[i]->dupPic = NULL;
@@ -113,7 +132,7 @@ Namespace functions for multi-bitdepth builds so that libraries are self-contain
m_dupBuffer[i]->dupPlane = NULL;
m_dupBuffer[i]->dupPlane = X265_MALLOC(char, framesize);
m_dupBuffer[i]->dupPic->planes[0] = m_dupBuffer[i]->dupPlane;
-@@ -768,7 +768,7 @@ int Encoder::setAnalysisData(x265_analysis_data *analysis_data, int poc, uint32_
+@@ -774,7 +774,7 @@ int Encoder::setAnalysisData(x265_analysis_data *analysis_data, int poc, uint32_
curFrame->m_analysisData = (*analysis_data);
curFrame->m_analysisData.numCUsInFrame = widthInCU * heightInCU;
curFrame->m_analysisData.numPartitions = m_param->num4x4Partitions;
@@ -122,7 +141,7 @@ Namespace functions for multi-bitdepth builds so that libraries are self-contain
if (m_param->maxCUSize == 16)
{
if (analysis_data->sliceType == X265_TYPE_IDR || analysis_data->sliceType == X265_TYPE_I)
-@@ -872,7 +872,7 @@ void Encoder::destroy()
+@@ -881,7 +881,7 @@ void Encoder::destroy()
for (uint32_t i = 0; i < DUP_BUFFER; i++)
{
X265_FREE(m_dupBuffer[i]->dupPlane);
@@ -131,61 +150,61 @@ Namespace functions for multi-bitdepth builds so that libraries are self-contain
X265_FREE(m_dupBuffer[i]);
}
-@@ -1478,7 +1478,7 @@ int Encoder::encode(const x265_picture* pic_in, x265_picture* pic_out)
- if (m_exportedPic)
+@@ -1491,7 +1491,7 @@ int Encoder::encode(const x265_picture* pic_in, x265_picture** pic_out)
+ if (*m_exportedPic)
{
if (!m_param->bUseAnalysisFile && m_param->analysisSave)
-- x265_free_analysis_data(m_param, &m_exportedPic->m_analysisData);
-+ PARAM_NS::x265_free_analysis_data(m_param, &m_exportedPic->m_analysisData);
-
- ATOMIC_DEC(&m_exportedPic->m_countRefEncoders);
+- x265_free_analysis_data(m_param, &m_exportedPic[0]->m_analysisData);
++ PARAM_NS::x265_free_analysis_data(m_param, &m_exportedPic[0]->m_analysisData);
-@@ -1892,7 +1892,7 @@ int Encoder::encode(const x265_picture* pic_in, x265_picture* pic_out)
-
- /* Free up inputPic->analysisData since it has already been used */
- if ((m_param->analysisLoad && !m_param->analysisSave) || ((m_param->bAnalysisType == AVC_INFO) && slice->m_sliceType != I_SLICE))
-- x265_free_analysis_data(m_param, &outFrame->m_analysisData);
-+ PARAM_NS::x265_free_analysis_data(m_param, &outFrame->m_analysisData);
+ for (int i = 0; i < m_param->numLayers; i++)
+ {
+@@ -1973,7 +1973,7 @@ int Encoder::encode(const x265_picture* pic_in, x265_picture** pic_out)
- if (pic_out)
- {
-@@ -1971,7 +1971,7 @@ int Encoder::encode(const x265_picture* pic_in, x265_picture* pic_out)
- writeAnalysisFile(&pic_out->analysisData, *outFrame->m_encData);
- pic_out->analysisData.saveParam = pic_out->analysisData.saveParam;
- if (m_param->bUseAnalysisFile)
-- x265_free_analysis_data(m_param, &pic_out->analysisData);
-+ PARAM_NS::x265_free_analysis_data(m_param, &pic_out->analysisData);
+ /* Free up inputPic->analysisData since it has already been used */
+ if ((m_param->analysisLoad && !m_param->analysisSave) || ((m_param->bAnalysisType == AVC_INFO) && slice->m_sliceType != I_SLICE))
+- x265_free_analysis_data(m_param, &outFrame->m_analysisData);
++ PARAM_NS::x265_free_analysis_data(m_param, &outFrame->m_analysisData);
+ if (pic_out[sLayer])
+ {
+ PicYuv* recpic = outFrame->m_reconPic[0];
+@@ -2052,7 +2052,7 @@ int Encoder::encode(const x265_picture* pic_in, x265_picture** pic_out)
+ writeAnalysisFile(&pic_out[sLayer]->analysisData, *outFrame->m_encData);
+ pic_out[sLayer]->analysisData.saveParam = pic_out[sLayer]->analysisData.saveParam;
+ if (m_param->bUseAnalysisFile)
+- x265_free_analysis_data(m_param, &pic_out[sLayer]->analysisData);
++ PARAM_NS::x265_free_analysis_data(m_param, &pic_out[sLayer]->analysisData);
+ }
}
- }
- if (m_param->rc.bStatWrite && (m_param->analysisMultiPassRefine || m_param->analysisMultiPassDistortion))
-@@ -1986,7 +1986,7 @@ int Encoder::encode(const x265_picture* pic_in, x265_picture* pic_out)
- writeAnalysisFileRefine(&outFrame->m_analysisData, *outFrame->m_encData);
- }
- if (m_param->analysisMultiPassRefine || m_param->analysisMultiPassDistortion)
-- x265_free_analysis_data(m_param, &outFrame->m_analysisData);
-+ PARAM_NS::x265_free_analysis_data(m_param, &outFrame->m_analysisData);
- if (m_param->internalCsp == X265_CSP_I400)
- {
- if (slice->m_sliceType == P_SLICE)
-@@ -2153,7 +2153,7 @@ int Encoder::encode(const x265_picture* pic_in, x265_picture* pic_out)
+ if (m_param->rc.bStatWrite && (m_param->analysisMultiPassRefine || m_param->analysisMultiPassDistortion))
+@@ -2067,7 +2067,7 @@ int Encoder::encode(const x265_picture* pic_in, x265_picture** pic_out)
+ writeAnalysisFileRefine(&outFrame->m_analysisData, *outFrame->m_encData);
+ }
+ if (m_param->analysisMultiPassRefine || m_param->analysisMultiPassDistortion)
+- x265_free_analysis_data(m_param, &outFrame->m_analysisData);
++ PARAM_NS::x265_free_analysis_data(m_param, &outFrame->m_analysisData);
+ if (m_param->internalCsp == X265_CSP_I400)
+ {
+ if (slice->m_sliceType == P_SLICE)
+@@ -2250,7 +2250,7 @@ int Encoder::encode(const x265_picture* pic_in, x265_picture** pic_out)
uint32_t heightInCU = (m_param->sourceHeight + m_param->maxCUSize - 1) >> m_param->maxLog2CUSize;
- frameEnc->m_analysisData.numCUsInFrame = widthInCU * heightInCU;
- frameEnc->m_analysisData.numPartitions = m_param->num4x4Partitions;
-- x265_alloc_analysis_data(m_param, &frameEnc->m_analysisData);
-+ PARAM_NS::x265_alloc_analysis_data(m_param, &frameEnc->m_analysisData);
- frameEnc->m_analysisData.poc = frameEnc->m_poc;
+ frameEnc[0]->m_analysisData.numCUsInFrame = widthInCU * heightInCU;
+ frameEnc[0]->m_analysisData.numPartitions = m_param->num4x4Partitions;
+- x265_alloc_analysis_data(m_param, &frameEnc[0]->m_analysisData);
++ PARAM_NS::x265_alloc_analysis_data(m_param, &frameEnc[0]->m_analysisData);
+ frameEnc[0]->m_analysisData.poc = frameEnc[0]->m_poc;
if (m_param->rc.bStatRead)
- readAnalysisFile(&frameEnc->m_analysisData, frameEnc->m_poc, frameEnc->m_lowres.sliceType);
-@@ -2164,7 +2164,7 @@ int Encoder::encode(const x265_picture* pic_in, x265_picture* pic_out)
+ readAnalysisFile(&frameEnc[0]->m_analysisData, frameEnc[0]->m_poc, frameEnc[0]->m_lowres.sliceType);
+@@ -2261,7 +2261,7 @@ int Encoder::encode(const x265_picture* pic_in, x265_picture** pic_out)
for (int i = 0; i < m_param->rc.zonefileCount; i++)
{
- if (m_param->rc.zones[i].startFrame == frameEnc->m_poc)
+ if (m_param->rc.zones[i].startFrame == frameEnc[0]->m_poc)
- x265_encoder_reconfig(this, m_param->rc.zones[i].zoneParam);
+ PARAM_NS::x265_encoder_reconfig(this, m_param->rc.zones[i].zoneParam);
}
}
-@@ -2307,7 +2307,7 @@ int Encoder::encode(const x265_picture* pic_in, x265_picture* pic_out)
+@@ -2408,7 +2408,7 @@ int Encoder::encode(const x265_picture* pic_in, x265_picture** pic_out)
analysis->numCUsInFrame = numCUsInFrame;
analysis->numCuInHeight = heightInCU;
analysis->numPartitions = m_param->num4x4Partitions;
@@ -194,7 +213,7 @@ Namespace functions for multi-bitdepth builds so that libraries are self-contain
}
if (m_param->bEnableTemporalSubLayers > 2)
{
-@@ -4434,7 +4434,7 @@ void Encoder::readAnalysisFile(x265_analysis_data* analysis, int curPoc, const x
+@@ -4711,7 +4711,7 @@ void Encoder::readAnalysisFile(x265_analysis_data* analysis, int curPoc, const x
else if (fread(val, size, readSize, fileOffset) != readSize)\
{\
x265_log(NULL, X265_LOG_ERROR, "Error reading analysis data\n");\
@@ -203,7 +222,7 @@ Namespace functions for multi-bitdepth builds so that libraries are self-contain
m_aborted = true;\
return;\
}\
-@@ -4470,7 +4470,7 @@ void Encoder::readAnalysisFile(x265_analysis_data* analysis, int curPoc, const x
+@@ -4747,7 +4747,7 @@ void Encoder::readAnalysisFile(x265_analysis_data* analysis, int curPoc, const x
if (poc != curPoc || feof(m_analysisFileIn))
{
x265_log(NULL, X265_LOG_WARNING, "Error reading analysis data: Cannot find POC %d\n", curPoc);
@@ -212,7 +231,7 @@ Namespace functions for multi-bitdepth builds so that libraries are self-contain
return;
}
}
-@@ -4504,7 +4504,7 @@ void Encoder::readAnalysisFile(x265_analysis_data* analysis, int curPoc, const x
+@@ -4781,7 +4781,7 @@ void Encoder::readAnalysisFile(x265_analysis_data* analysis, int curPoc, const x
if (m_param->scaleFactor)
analysis->numPartitions *= factor;
/* Memory is allocated for inter and intra analysis data based on the slicetype */
@@ -221,7 +240,7 @@ Namespace functions for multi-bitdepth builds so that libraries are self-contain
if (m_param->ctuDistortionRefine == CTU_DISTORTION_INTERNAL)
{
-@@ -4757,7 +4757,7 @@ void Encoder::readAnalysisFile(x265_analysis_data* analysis, int curPoc, const x
+@@ -5034,7 +5034,7 @@ void Encoder::readAnalysisFile(x265_analysis_data* analysis, int curPoc, const x
else if (fread(val, size, readSize, fileOffset) != readSize)\
{\
x265_log(NULL, X265_LOG_ERROR, "Error reading analysis data\n");\
@@ -230,7 +249,7 @@ Namespace functions for multi-bitdepth builds so that libraries are self-contain
m_aborted = true;\
return;\
}\
-@@ -4794,7 +4794,7 @@ void Encoder::readAnalysisFile(x265_analysis_data* analysis, int curPoc, const x
+@@ -5071,7 +5071,7 @@ void Encoder::readAnalysisFile(x265_analysis_data* analysis, int curPoc, const x
if (poc != curPoc || feof(m_analysisFileIn))
{
x265_log(NULL, X265_LOG_WARNING, "Error reading analysis data: Cannot find POC %d\n", curPoc);
@@ -239,7 +258,7 @@ Namespace functions for multi-bitdepth builds so that libraries are self-contain
return;
}
}
-@@ -4825,7 +4825,7 @@ void Encoder::readAnalysisFile(x265_analysis_data* analysis, int curPoc, const x
+@@ -5102,7 +5102,7 @@ void Encoder::readAnalysisFile(x265_analysis_data* analysis, int curPoc, const x
analysis->numCuInHeight = cuLoc.heightInCU;
/* Memory is allocated for inter and intra analysis data based on the slicetype */
@@ -248,7 +267,7 @@ Namespace functions for multi-bitdepth builds so that libraries are self-contain
if (m_param->ctuDistortionRefine == CTU_DISTORTION_INTERNAL)
{
-@@ -5440,7 +5440,7 @@ void Encoder::readAnalysisFile(x265_analysis_data* analysis, int curPoc, int sli
+@@ -5717,7 +5717,7 @@ void Encoder::readAnalysisFile(x265_analysis_data* analysis, int curPoc, int sli
if (fread(val, size, readSize, fileOffset) != readSize)\
{\
x265_log(NULL, X265_LOG_ERROR, "Error reading analysis 2 pass data\n"); \
@@ -257,7 +276,7 @@ Namespace functions for multi-bitdepth builds so that libraries are self-contain
m_aborted = true; \
return; \
}\
-@@ -5454,7 +5454,7 @@ void Encoder::readAnalysisFile(x265_analysis_data* analysis, int curPoc, int sli
+@@ -5731,7 +5731,7 @@ void Encoder::readAnalysisFile(x265_analysis_data* analysis, int curPoc, int sli
if (poc != curPoc || feof(m_analysisFileIn))
{
x265_log(NULL, X265_LOG_WARNING, "Error reading analysis 2 pass data: Cannot find POC %d\n", curPoc);
@@ -266,7 +285,7 @@ Namespace functions for multi-bitdepth builds so that libraries are self-contain
return;
}
/* Now arrived at the right frame, read the record */
-@@ -5561,7 +5561,7 @@ void Encoder::writeAnalysisFile(x265_analysis_data* analysis, FrameData &curEncD
+@@ -5838,7 +5838,7 @@ void Encoder::writeAnalysisFile(x265_analysis_data* analysis, FrameData &curEncD
if (fwrite(val, size, writeSize, fileOffset) < writeSize)\
{\
x265_log(NULL, X265_LOG_ERROR, "Error writing analysis data\n");\
@@ -275,7 +294,7 @@ Namespace functions for multi-bitdepth builds so that libraries are self-contain
m_aborted = true;\
return;\
}\
-@@ -5783,7 +5783,7 @@ void Encoder::writeAnalysisFileRefine(x265_analysis_data* analysis, FrameData &c
+@@ -6060,7 +6060,7 @@ void Encoder::writeAnalysisFileRefine(x265_analysis_data* analysis, FrameData &c
if (fwrite(val, size, writeSize, fileOffset) < writeSize)\
{\
x265_log(NULL, X265_LOG_ERROR, "Error writing analysis 2 pass data\n"); \
diff --git a/media-libs/x265/metadata.xml b/media-libs/x265/metadata.xml
index af1229eaf0d8..91d4b52dc9b9 100644
--- a/media-libs/x265/metadata.xml
+++ b/media-libs/x265/metadata.xml
@@ -8,7 +8,6 @@
<flag name="10bit">Add support for producing 10bits HEVC.</flag>
<flag name="12bit">Add support for producing 12bits HEVC.</flag>
<flag name="numa">Build with support for NUMA nodes.</flag>
- <flag name="pic">Disable optimized assembly code that is not PIC friendly</flag>
</use>
<upstream>
<remote-id type="bitbucket">multicoreware/x265_git</remote-id>
diff --git a/media-libs/x265/x265-3.5-r2.ebuild b/media-libs/x265/x265-3.5-r2.ebuild
deleted file mode 100644
index 3fa4d5cb933f..000000000000
--- a/media-libs/x265/x265-3.5-r2.ebuild
+++ /dev/null
@@ -1,220 +0,0 @@
-# Copyright 1999-2023 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit cmake multilib-minimal multibuild
-
-if [[ ${PV} = 9999* ]]; then
- inherit git-r3
- EGIT_REPO_URI="https://bitbucket.org/multicoreware/x265_git/"
- S=${WORKDIR}/${P}/source
-else
- SRC_URI="https://bitbucket.org/multicoreware/x265_git/downloads/${PN}_${PV}.tar.gz"
- KEYWORDS="amd64 arm arm64 ~hppa ~ia64 ~loong ~mips ppc ppc64 ~riscv x86"
-fi
-
-DESCRIPTION="Library for encoding video streams into the H.265/HEVC format"
-HOMEPAGE="http://x265.org/ https://bitbucket.org/multicoreware/x265_git/"
-
-LICENSE="GPL-2"
-# subslot = libx265 soname
-SLOT="0/199"
-IUSE="+10bit +12bit cpu_flags_arm_neon cpu_flags_ppc_vsx2 numa pic test"
-RESTRICT="!test? ( test )"
-
-RDEPEND="numa? ( >=sys-process/numactl-2.0.10-r1[${MULTILIB_USEDEP}] )"
-DEPEND="${RDEPEND}"
-ASM_DEPEND=">=dev-lang/nasm-2.13"
-BDEPEND="
- abi_x86_32? ( ${ASM_DEPEND} )
- abi_x86_64? ( ${ASM_DEPEND} )"
-
-PATCHES=(
- "${FILESDIR}/arm-r1.patch"
- "${FILESDIR}/neon.patch"
- "${FILESDIR}/x265-3.3-ppc64.patch"
- "${FILESDIR}/tests.patch"
- "${FILESDIR}/test-ns.patch"
-)
-
-src_unpack() {
- if [[ ${PV} = 9999* ]]; then
- git-r3_src_unpack
- else
- unpack ${A}
- export S="$(echo "${WORKDIR}/${PN}_"*"/source")"
- fi
-}
-
-# 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.
-
-x265_get_variants() {
- local variants=""
- use 12bit && variants+="main12 "
- use 10bit && variants+="main10 "
- variants+="main"
- echo "${variants}"
-}
-
-x265_variant_src_configure() {
- mkdir -p "${BUILD_DIR}" || die
- pushd "${BUILD_DIR}" >/dev/null || die
-
- einfo "Configuring variant: ${MULTIBUILD_VARIANT} for ABI: ${ABI}"
-
- local mycmakeargs=( "${myabicmakeargs[@]}" )
- case "${MULTIBUILD_VARIANT}" in
- "main12")
- mycmakeargs+=(
- -DHIGH_BIT_DEPTH=ON
- -DEXPORT_C_API=OFF
- -DENABLE_SHARED=OFF
- -DENABLE_CLI=OFF
- -DMAIN12=ON
- )
- if [[ ${ABI} = x86 ]] ; then
- mycmakeargs+=( -DENABLE_ASSEMBLY=OFF )
- fi
- if [[ ${ABI} = arm* ]] ; then
- # 589674
- mycmakeargs+=( -DENABLE_ASSEMBLY=OFF )
- fi
- # disable altivec for 12bit build #607802#c5
- if [[ ${ABI} = ppc* ]] ; then
- mycmakeargs+=(
- -DENABLE_ALTIVEC=OFF
- -DCPU_POWER8=$(usex cpu_flags_ppc_vsx2 ON OFF)
- )
- fi
- ;;
- "main10")
- mycmakeargs+=(
- -DHIGH_BIT_DEPTH=ON
- -DEXPORT_C_API=OFF
- -DENABLE_SHARED=OFF
- -DENABLE_CLI=OFF
- -DENABLE_HDR10_PLUS=ON
- )
- if [[ ${ABI} = x86 ]] ; then
- mycmakeargs+=( -DENABLE_ASSEMBLY=OFF )
- fi
- if [[ ${ABI} = arm* ]] ; then
- # 589674
- mycmakeargs+=( -DENABLE_ASSEMBLY=OFF )
- fi
- # disable altivec for 10bit build #607802#c5
- if [[ ${ABI} = ppc* ]] ; then
- mycmakeargs+=(
- -DENABLE_ALTIVEC=OFF
- -DCPU_POWER8=$(usex cpu_flags_ppc_vsx2 ON OFF)
- )
- fi
- ;;
- "main")
- if (( "${#MULTIBUILD_VARIANTS[@]}" > 1 )) ; then
- local myvariants=( "${MULTIBUILD_VARIANTS[@]}" )
- unset myvariants[${#MULTIBUILD_VARIANTS[@]}-1]
- local liblist="" v=
- for v in "${myvariants[@]}" ; do
- ln -s "${BUILD_DIR%-*}-${v}/libx265.a" "libx265_${v}.a" || die
- liblist+="libx265_${v}.a;"
- done
- mycmakeargs+=(
- -DEXTRA_LIB="${liblist}"
- -DEXTRA_LINK_FLAGS=-L.
- -DLINKED_10BIT=$(usex 10bit)
- -DLINKED_12BIT=$(usex 12bit)
- )
- if [[ ${ABI} = ppc* ]] ; then
- # upstream uses mix of altivec + power8 vectors
- # it's impossible to enable altivec without CPU_POWER8
- # and it does not work on ppc32
- # so we toggle both variables together
- mycmakeargs+=(
- -DCPU_POWER8=$(usex cpu_flags_ppc_vsx2 ON OFF)
- -DENABLE_ALTIVEC=$(usex cpu_flags_ppc_vsx2 ON OFF)
- )
- fi
- fi
- ;;
- *)
- die "Unknown variant: ${MULTIBUILD_VARIANT}";;
- esac
- cmake_src_configure
- popd >/dev/null || die
-}
-
-multilib_src_configure() {
- local myabicmakeargs=(
- -DENABLE_TESTS=$(usex test ON OFF)
- $(multilib_is_native_abi || echo "-DENABLE_CLI=OFF")
- -DENABLE_PIC=ON
- -DENABLE_LIBNUMA=$(usex numa ON OFF)
- -DGIT_ARCHETYPE=1 #814116
- -DLIB_INSTALL_DIR="$(get_libdir)"
- )
-
- if [[ ${ABI} = x86 ]] ; then
- # Bug #528202
- if use pic ; then
- ewarn "PIC has been requested but x86 asm is not PIC-safe, disabling it."
- myabicmakeargs+=( -DENABLE_ASSEMBLY=OFF )
- fi
- elif [[ ${ABI} = x32 ]] ; then
- # bug #510890
- myabicmakeargs+=( -DENABLE_ASSEMBLY=OFF )
- elif [[ ${ABI} = arm ]] ; then
- myabicmakeargs+=( -DENABLE_ASSEMBLY=$(usex pic OFF $(usex cpu_flags_arm_neon ON OFF)) )
- use cpu_flags_arm_neon && use pic && ewarn "PIC has been requested but arm neon asm is not PIC-safe, disabling it."
- fi
-
- local MULTIBUILD_VARIANTS=( $(x265_get_variants) )
- multibuild_foreach_variant x265_variant_src_configure
-}
-
-multilib_src_compile() {
- local MULTIBUILD_VARIANTS=( $(x265_get_variants) )
- multibuild_foreach_variant cmake_src_compile
-}
-
-x265_variant_src_test() {
- if [ -x "${BUILD_DIR}/test/TestBench" ] ; then
- "${BUILD_DIR}/test/TestBench" || die
- else
- einfo "Unit tests check only assembly."
- einfo "You do not seem to have any for ABI=${ABI}, x265 variant=${MULTIBUILD_VARIANT}"
- einfo "Skipping tests."
- fi
-}
-
-multilib_src_test() {
- local MULTIBUILD_VARIANTS=( $(x265_get_variants) )
- multibuild_foreach_variant x265_variant_src_test
-}
-
-multilib_src_install() {
- # Install only "main" variant since the others are already linked into it.
- local MULTIBUILD_VARIANTS=( "main" )
- multibuild_foreach_variant cmake_src_install
-}
-
-multilib_src_install_all() {
- dodoc -r "${S}/../doc/"*
-
- # we don't install *.a files for all variants,
- # so just delete these files instead of pretending
- # real USE=static-libs support
- find "${ED}" -name "*.a" -delete || die
-}
diff --git a/media-libs/x265/x265-3.5-r3.ebuild b/media-libs/x265/x265-3.5-r3.ebuild
index f3d6c8cbd76a..7e950e3b98c8 100644
--- a/media-libs/x265/x265-3.5-r3.ebuild
+++ b/media-libs/x265/x265-3.5-r3.ebuild
@@ -36,6 +36,7 @@ PATCHES=(
"${FILESDIR}/x265-3.3-ppc64.patch"
"${FILESDIR}/tests.patch"
"${FILESDIR}/test-ns.patch"
+ "${FILESDIR}/${PN}-3.5-r5-test-ns_2.patch"
)
src_unpack() {
diff --git a/media-libs/x265/x265-3.5-r4.ebuild b/media-libs/x265/x265-3.5-r4.ebuild
index 11fbb36fc212..172970e12143 100644
--- a/media-libs/x265/x265-3.5-r4.ebuild
+++ b/media-libs/x265/x265-3.5-r4.ebuild
@@ -36,6 +36,7 @@ PATCHES=(
"${FILESDIR}/x265-3.3-ppc64.patch"
"${FILESDIR}/tests.patch"
"${FILESDIR}/test-ns.patch"
+ "${FILESDIR}/${PN}-3.5-r5-test-ns_2.patch"
)
src_unpack() {
diff --git a/media-libs/x265/x265-3.5-r5.ebuild b/media-libs/x265/x265-3.5-r5.ebuild
new file mode 100644
index 000000000000..ad78f487735a
--- /dev/null
+++ b/media-libs/x265/x265-3.5-r5.ebuild
@@ -0,0 +1,194 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake flag-o-matic multilib-minimal multibuild
+
+DESCRIPTION="Library for encoding video streams into the H.265/HEVC format"
+HOMEPAGE="http://x265.org/ https://bitbucket.org/multicoreware/x265_git/"
+
+if [[ ${PV} = 9999* ]]; then
+ inherit git-r3
+ EGIT_REPO_URI="https://bitbucket.org/multicoreware/x265_git/"
+ MY_P="${PN}-${PV}"
+else
+ SRC_URI="https://bitbucket.org/multicoreware/x265_git/downloads/${PN}_${PV}.tar.gz"
+ KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~loong ~mips ~ppc ~ppc64 ~riscv ~x86"
+ MY_P="${PN}_${PV}"
+fi
+
+S="${WORKDIR}/${MY_P}/source"
+unset MY_P
+
+LICENSE="GPL-2"
+# subslot = libx265 soname
+SLOT="0/199"
+IUSE="+10bit +12bit cpu_flags_ppc_vsx2 numa test"
+RESTRICT="!test? ( test )"
+
+RDEPEND="numa? ( >=sys-process/numactl-2.0.10-r1[${MULTILIB_USEDEP}] )"
+DEPEND="${RDEPEND}"
+ASM_DEPEND=">=dev-lang/nasm-2.13"
+BDEPEND="
+ abi_x86_32? ( ${ASM_DEPEND} )
+ abi_x86_64? ( ${ASM_DEPEND} )"
+
+PATCHES=(
+ "${FILESDIR}/arm-r1.patch"
+ "${FILESDIR}/neon.patch"
+ "${FILESDIR}/tests.patch"
+ "${FILESDIR}/test-ns.patch"
+ "${FILESDIR}/${PN}-3.5-r5-cpp-std.patch"
+ "${FILESDIR}/${PN}-3.5-r5-gcc15.patch"
+ "${FILESDIR}/${PN}-3.5-r5-test-ns_2.patch"
+)
+
+pkg_setup() {
+ variants=(
+ $(usev 12bit "main12")
+ $(usev 10bit "main10")
+ )
+}
+
+# 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
+
+x265_variant_src_configure() {
+ einfo "Configuring variant: ${MULTIBUILD_VARIANT} for ABI: ${ABI}"
+
+ local mycmakeargs=(
+ "${mycmakeargs[@]}"
+ -DHIGH_BIT_DEPTH=ON
+ -DEXPORT_C_API=OFF
+ -DENABLE_SHARED=OFF
+ -DENABLE_CLI=OFF
+ )
+
+ case "${MULTIBUILD_VARIANT}" in
+ "main12")
+ mycmakeargs+=(
+ -DMAIN12=ON
+ )
+ ;;
+ "main10")
+ mycmakeargs+=(
+ -DENABLE_HDR10_PLUS=ON
+ )
+ ;;
+ *)
+ die "Unknown variant: ${MULTIBUILD_VARIANT}";;
+ esac
+ cmake_src_configure
+}
+
+multilib_src_configure() {
+ # -Werror=odr
+ # https://bugs.gentoo.org/875854
+ # https://bitbucket.org/multicoreware/x265_git/issues/937/build-fails-with-lto
+ filter-lto
+
+ local mycmakeargs=(
+ $(multilib_is_native_abi || echo "-DENABLE_CLI=OFF")
+ -DENABLE_PIC=ON
+ -DENABLE_LIBNUMA="$(usex numa)"
+ -DENABLE_SVT_HEVC="no" # missing
+ -DENABLE_VTUNE="no" # missing
+ -DGIT_ARCHETYPE=1 #814116
+ -DLIB_INSTALL_DIR="$(get_libdir)"
+ )
+
+ # Unfortunately, the asm for x86/x32/arm isn't PIC-safe.
+ # x86 # Bug #528202, bug #913412
+ # x32 # bug #510890
+ if [[ ${ABI} = x86 ]] || [[ ${ABI} = x32 ]] || [[ ${ABI} = arm ]] ; then
+ mycmakeargs+=(
+ -DENABLE_ASSEMBLY=OFF
+ -DENABLE_TESTS="no" #728748
+ )
+ else
+ mycmakeargs+=(
+ -DENABLE_TESTS="$(usex test)"
+ )
+ fi
+
+ if [[ ${ABI} = ppc* ]] ; then
+ # upstream uses mix of altivec + power8 vectors
+ # it's impossible to enable altivec without CPU_POWER8
+ # and it does not work on ppc32
+ # so we toggle both variables together
+ mycmakeargs+=(
+ -DCPU_POWER8="$(usex cpu_flags_ppc_vsx2)"
+ -DENABLE_ALTIVEC="$(usex cpu_flags_ppc_vsx2)"
+ )
+ fi
+
+ local MULTIBUILD_VARIANTS=( "${variants[@]}" )
+ if [[ "${#MULTIBUILD_VARIANTS[@]}" -gt 1 ]] ; then
+ multibuild_foreach_variant x265_variant_src_configure
+
+ local liblist="" v=
+ for v in "${MULTIBUILD_VARIANTS[@]}" ; do
+ ln -s "${BUILD_DIR}-${v}/libx265.a" "${BUILD_DIR}/libx265_${v}.a" || die
+ liblist+="libx265_${v}.a;"
+ done
+
+ mycmakeargs+=(
+ -DEXTRA_LIB="${liblist}"
+ -DEXTRA_LINK_FLAGS="-L${BUILD_DIR}"
+ -DLINKED_10BIT"=$(usex 10bit)"
+ -DLINKED_12BIT="$(usex 12bit)"
+ )
+ fi
+
+ cmake_src_configure
+}
+
+multilib_src_compile() {
+ local MULTIBUILD_VARIANTS=( "${variants[@]}" )
+ if [[ "${#MULTIBUILD_VARIANTS[@]}" -gt 1 ]] ; then
+ multibuild_foreach_variant cmake_src_compile
+ fi
+ cmake_src_compile
+}
+
+x265_variant_src_test() {
+ if [[ -x "${BUILD_DIR}/test/TestBench" ]] ; then
+ "${BUILD_DIR}/test/TestBench" || die
+ else
+ einfo "Unit tests check only assembly."
+ einfo "You do not seem to have any for ABI=${ABI}, x265 variant=${MULTIBUILD_VARIANT}"
+ einfo "Skipping tests."
+ fi
+}
+
+multilib_src_test() {
+ local MULTIBUILD_VARIANTS=( "${variants[@]}" )
+ if [[ "${#MULTIBUILD_VARIANTS[@]}" -gt 1 ]] ; then
+ multibuild_foreach_variant x265_variant_src_test
+ fi
+ x265_variant_src_test
+}
+
+multilib_src_install() {
+ cmake_src_install
+}
+
+multilib_src_install_all() {
+ dodoc -r "${S}/../doc/"*
+
+ # we don't install *.a files for all variants,
+ # so just delete these files instead of pretending
+ # real USE=static-libs support
+ find "${ED}" -name "*.a" -delete || die
+}
diff --git a/media-libs/x265/x265-3.6.ebuild b/media-libs/x265/x265-3.6.ebuild
new file mode 100644
index 000000000000..064bd95be46a
--- /dev/null
+++ b/media-libs/x265/x265-3.6.ebuild
@@ -0,0 +1,194 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake flag-o-matic multilib-minimal multibuild
+
+DESCRIPTION="Library for encoding video streams into the H.265/HEVC format"
+HOMEPAGE="http://x265.org/ https://bitbucket.org/multicoreware/x265_git/"
+
+if [[ ${PV} = 9999* ]]; then
+ inherit git-r3
+ EGIT_REPO_URI="https://bitbucket.org/multicoreware/x265_git/"
+ MY_P="${PN}-${PV}"
+else
+ SRC_URI="https://bitbucket.org/multicoreware/x265_git/downloads/${PN}_${PV}.tar.gz -> ${PN}-${PV}.tar.gz"
+ KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~loong ~mips ~ppc ~ppc64 ~riscv ~x86"
+ MY_P="${PN}_${PV}"
+fi
+
+S="${WORKDIR}/${MY_P}/source"
+unset MY_P
+
+LICENSE="GPL-2"
+# subslot = libx265 soname
+SLOT="0/209"
+IUSE="+10bit +12bit cpu_flags_ppc_vsx2 numa test"
+RESTRICT="!test? ( test )"
+
+RDEPEND="numa? ( >=sys-process/numactl-2.0.10-r1[${MULTILIB_USEDEP}] )"
+DEPEND="${RDEPEND}"
+ASM_DEPEND=">=dev-lang/nasm-2.13"
+BDEPEND="
+ abi_x86_32? ( ${ASM_DEPEND} )
+ abi_x86_64? ( ${ASM_DEPEND} )"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-9999-arm.patch"
+ "${FILESDIR}/neon.patch"
+ "${FILESDIR}/tests.patch"
+ "${FILESDIR}/test-ns.patch"
+ "${FILESDIR}/${PN}-3.5-r5-cpp-std.patch"
+ "${FILESDIR}/${PN}-3.5-r5-gcc15.patch"
+ "${FILESDIR}/${PN}-3.6-test-ns_2.patch"
+)
+
+pkg_setup() {
+ variants=(
+ $(usev 12bit "main12")
+ $(usev 10bit "main10")
+ )
+}
+
+# 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
+
+x265_variant_src_configure() {
+ einfo "Configuring variant: ${MULTIBUILD_VARIANT} for ABI: ${ABI}"
+
+ local mycmakeargs=(
+ "${mycmakeargs[@]}"
+ -DHIGH_BIT_DEPTH=ON
+ -DEXPORT_C_API=OFF
+ -DENABLE_SHARED=OFF
+ -DENABLE_CLI=OFF
+ )
+
+ case "${MULTIBUILD_VARIANT}" in
+ "main12")
+ mycmakeargs+=(
+ -DMAIN12=ON
+ )
+ ;;
+ "main10")
+ mycmakeargs+=(
+ -DENABLE_HDR10_PLUS=ON
+ )
+ ;;
+ *)
+ die "Unknown variant: ${MULTIBUILD_VARIANT}";;
+ esac
+ cmake_src_configure
+}
+
+multilib_src_configure() {
+ # -Werror=odr
+ # https://bugs.gentoo.org/875854
+ # https://bitbucket.org/multicoreware/x265_git/issues/937/build-fails-with-lto
+ filter-lto
+
+ local mycmakeargs=(
+ $(multilib_is_native_abi || echo "-DENABLE_CLI=OFF")
+ -DENABLE_PIC=ON
+ -DENABLE_LIBNUMA="$(usex numa)"
+ -DENABLE_SVT_HEVC="no" # missing
+ -DENABLE_VTUNE="no" # missing
+ -DGIT_ARCHETYPE=1 #814116
+ -DLIB_INSTALL_DIR="$(get_libdir)"
+ )
+
+ # Unfortunately, the asm for x86/x32/arm isn't PIC-safe.
+ # x86 # Bug #528202, bug #913412
+ # x32 # bug #510890
+ if [[ ${ABI} = x86 ]] || [[ ${ABI} = x32 ]] || [[ ${ABI} = arm ]] ; then
+ mycmakeargs+=(
+ -DENABLE_ASSEMBLY=OFF
+ -DENABLE_TESTS="no" #728748
+ )
+ else
+ mycmakeargs+=(
+ -DENABLE_TESTS="$(usex test)"
+ )
+ fi
+
+ if [[ ${ABI} = ppc* ]] ; then
+ # upstream uses mix of altivec + power8 vectors
+ # it's impossible to enable altivec without CPU_POWER8
+ # and it does not work on ppc32
+ # so we toggle both variables together
+ mycmakeargs+=(
+ -DCPU_POWER8="$(usex cpu_flags_ppc_vsx2)"
+ -DENABLE_ALTIVEC="$(usex cpu_flags_ppc_vsx2)"
+ )
+ fi
+
+ local MULTIBUILD_VARIANTS=( "${variants[@]}" )
+ if [[ "${#MULTIBUILD_VARIANTS[@]}" -gt 1 ]] ; then
+ multibuild_foreach_variant x265_variant_src_configure
+
+ local liblist="" v=
+ for v in "${MULTIBUILD_VARIANTS[@]}" ; do
+ ln -s "${BUILD_DIR}-${v}/libx265.a" "${BUILD_DIR}/libx265_${v}.a" || die
+ liblist+="libx265_${v}.a;"
+ done
+
+ mycmakeargs+=(
+ -DEXTRA_LIB="${liblist}"
+ -DEXTRA_LINK_FLAGS="-L${BUILD_DIR}"
+ -DLINKED_10BIT"=$(usex 10bit)"
+ -DLINKED_12BIT="$(usex 12bit)"
+ )
+ fi
+
+ cmake_src_configure
+}
+
+multilib_src_compile() {
+ local MULTIBUILD_VARIANTS=( "${variants[@]}" )
+ if [[ "${#MULTIBUILD_VARIANTS[@]}" -gt 1 ]] ; then
+ multibuild_foreach_variant cmake_src_compile
+ fi
+ cmake_src_compile
+}
+
+x265_variant_src_test() {
+ if [[ -x "${BUILD_DIR}/test/TestBench" ]] ; then
+ "${BUILD_DIR}/test/TestBench" || die
+ else
+ einfo "Unit tests check only assembly."
+ einfo "You do not seem to have any for ABI=${ABI}, x265 variant=${MULTIBUILD_VARIANT}"
+ einfo "Skipping tests."
+ fi
+}
+
+multilib_src_test() {
+ local MULTIBUILD_VARIANTS=( "${variants[@]}" )
+ if [[ "${#MULTIBUILD_VARIANTS[@]}" -gt 1 ]] ; then
+ multibuild_foreach_variant x265_variant_src_test
+ fi
+ x265_variant_src_test
+}
+
+multilib_src_install() {
+ cmake_src_install
+}
+
+multilib_src_install_all() {
+ dodoc -r "${S}/../doc/"*
+
+ # we don't install *.a files for all variants,
+ # so just delete these files instead of pretending
+ # real USE=static-libs support
+ find "${ED}" -name "*.a" -delete || die
+}
diff --git a/media-libs/x265/x265-9999.ebuild b/media-libs/x265/x265-9999.ebuild
index 8be9f4a93e84..9e4c71595c06 100644
--- a/media-libs/x265/x265-9999.ebuild
+++ b/media-libs/x265/x265-9999.ebuild
@@ -5,21 +5,25 @@ EAPI=8
inherit cmake flag-o-matic multilib-minimal multibuild
+DESCRIPTION="Library for encoding video streams into the H.265/HEVC format"
+HOMEPAGE="http://x265.org/ https://bitbucket.org/multicoreware/x265_git/"
+
if [[ ${PV} = 9999* ]]; then
inherit git-r3
EGIT_REPO_URI="https://bitbucket.org/multicoreware/x265_git/"
- S=${WORKDIR}/${P}/source
+ MY_P="${PN}-${PV}"
else
- SRC_URI="https://bitbucket.org/multicoreware/x265_git/downloads/${PN}_${PV}.tar.gz"
- KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~x86"
+ SRC_URI="https://bitbucket.org/multicoreware/x265_git/downloads/${PN}_${PV}.tar.gz -> ${PN}-${PV}.tar.gz"
+ KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~loong ~mips ~ppc ~ppc64 ~riscv ~x86"
+ MY_P="${PN}_${PV}"
fi
-DESCRIPTION="Library for encoding video streams into the H.265/HEVC format"
-HOMEPAGE="http://x265.org/ https://bitbucket.org/multicoreware/x265_git/"
+S="${WORKDIR}/${MY_P}/source"
+unset MY_P
LICENSE="GPL-2"
# subslot = libx265 soname
-SLOT="0/208"
+SLOT="0/212"
IUSE="+10bit +12bit cpu_flags_ppc_vsx2 numa test"
RESTRICT="!test? ( test )"
@@ -34,16 +38,16 @@ PATCHES=(
"${FILESDIR}/${PN}-9999-arm.patch"
"${FILESDIR}/neon.patch"
"${FILESDIR}/tests.patch"
+ "${FILESDIR}/${PN}-3.5-r5-cpp-std.patch"
+ "${FILESDIR}/${PN}-3.5-r5-gcc15.patch"
"${FILESDIR}/${PN}-9999-test-ns.patch"
)
-src_unpack() {
- if [[ ${PV} = 9999* ]]; then
- git-r3_src_unpack
- else
- unpack ${A}
- export S="$(echo "${WORKDIR}/${PN}_"*"/source")"
- fi
+pkg_setup() {
+ variants=(
+ $(usev 12bit "main12")
+ $(usev 10bit "main10")
+ )
}
# By default, the library and the encoder is configured for only one output bit
@@ -57,102 +61,34 @@ src_unpack() {
# 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.
-
-x265_get_variants() {
- local variants=""
- use 12bit && variants+="main12 "
- use 10bit && variants+="main10 "
- variants+="main"
- echo "${variants}"
-}
+# allow disabling it
x265_variant_src_configure() {
- mkdir -p "${BUILD_DIR}" || die
- pushd "${BUILD_DIR}" >/dev/null || die
-
einfo "Configuring variant: ${MULTIBUILD_VARIANT} for ABI: ${ABI}"
- local mycmakeargs=( "${myabicmakeargs[@]}" )
+ local mycmakeargs=(
+ "${mycmakeargs[@]}"
+ -DHIGH_BIT_DEPTH=ON
+ -DEXPORT_C_API=OFF
+ -DENABLE_SHARED=OFF
+ -DENABLE_CLI=OFF
+ )
+
case "${MULTIBUILD_VARIANT}" in
"main12")
mycmakeargs+=(
- -DHIGH_BIT_DEPTH=ON
- -DEXPORT_C_API=OFF
- -DENABLE_SHARED=OFF
- -DENABLE_CLI=OFF
-DMAIN12=ON
)
- if [[ ${ABI} = x86 ]] ; then
- mycmakeargs+=( -DENABLE_ASSEMBLY=OFF )
- fi
- if [[ ${ABI} = arm* ]] ; then
- # 589674
- mycmakeargs+=( -DENABLE_ASSEMBLY=OFF )
- fi
- # disable altivec for 12bit build #607802#c5
- if [[ ${ABI} = ppc* ]] ; then
- mycmakeargs+=(
- -DENABLE_ALTIVEC=OFF
- -DCPU_POWER8=$(usex cpu_flags_ppc_vsx2 ON OFF)
- )
- fi
;;
"main10")
mycmakeargs+=(
- -DHIGH_BIT_DEPTH=ON
- -DEXPORT_C_API=OFF
- -DENABLE_SHARED=OFF
- -DENABLE_CLI=OFF
-DENABLE_HDR10_PLUS=ON
)
- if [[ ${ABI} = x86 ]] ; then
- mycmakeargs+=( -DENABLE_ASSEMBLY=OFF )
- fi
- if [[ ${ABI} = arm* ]] ; then
- # 589674
- mycmakeargs+=( -DENABLE_ASSEMBLY=OFF )
- fi
- # disable altivec for 10bit build #607802#c5
- if [[ ${ABI} = ppc* ]] ; then
- mycmakeargs+=(
- -DENABLE_ALTIVEC=OFF
- -DCPU_POWER8=$(usex cpu_flags_ppc_vsx2 ON OFF)
- )
- fi
- ;;
- "main")
- if (( "${#MULTIBUILD_VARIANTS[@]}" > 1 )) ; then
- local myvariants=( "${MULTIBUILD_VARIANTS[@]}" )
- unset myvariants[${#MULTIBUILD_VARIANTS[@]}-1]
- local liblist="" v=
- for v in "${myvariants[@]}" ; do
- ln -s "${BUILD_DIR%-*}-${v}/libx265.a" "libx265_${v}.a" || die
- liblist+="libx265_${v}.a;"
- done
- mycmakeargs+=(
- -DEXTRA_LIB="${liblist}"
- -DEXTRA_LINK_FLAGS=-L.
- -DLINKED_10BIT=$(usex 10bit)
- -DLINKED_12BIT=$(usex 12bit)
- )
- if [[ ${ABI} = ppc* ]] ; then
- # upstream uses mix of altivec + power8 vectors
- # it's impossible to enable altivec without CPU_POWER8
- # and it does not work on ppc32
- # so we toggle both variables together
- mycmakeargs+=(
- -DCPU_POWER8=$(usex cpu_flags_ppc_vsx2 ON OFF)
- -DENABLE_ALTIVEC=$(usex cpu_flags_ppc_vsx2 ON OFF)
- )
- fi
- fi
;;
*)
die "Unknown variant: ${MULTIBUILD_VARIANT}";;
esac
cmake_src_configure
- popd >/dev/null || die
}
multilib_src_configure() {
@@ -161,37 +97,73 @@ multilib_src_configure() {
# https://bitbucket.org/multicoreware/x265_git/issues/937/build-fails-with-lto
filter-lto
- local myabicmakeargs=(
- -DENABLE_TESTS=$(usex test ON OFF)
+ local mycmakeargs=(
$(multilib_is_native_abi || echo "-DENABLE_CLI=OFF")
-DENABLE_PIC=ON
- -DENABLE_LIBNUMA=$(usex numa ON OFF)
+ -DENABLE_LIBNUMA="$(usex numa)"
+ -DENABLE_MULTIVIEW="yes"
+ -DENABLE_SVT_HEVC="no" # missing
+ -DENABLE_VTUNE="no" # missing
-DGIT_ARCHETYPE=1 #814116
-DLIB_INSTALL_DIR="$(get_libdir)"
)
# Unfortunately, the asm for x86/x32/arm isn't PIC-safe.
- if [[ ${ABI} = x86 ]] ; then
- # Bug #528202, bug #913412
- myabicmakeargs+=( -DENABLE_ASSEMBLY=OFF )
- elif [[ ${ABI} = x32 ]] ; then
- # bug #510890
- myabicmakeargs+=( -DENABLE_ASSEMBLY=OFF )
- elif [[ ${ABI} = arm ]] ; then
- myabicmakeargs+=( -DENABLE_ASSEMBLY=OFF )
+ # x86 # Bug #528202, bug #913412
+ # x32 # bug #510890
+ if [[ ${ABI} = x86 ]] || [[ ${ABI} = x32 ]] || [[ ${ABI} = arm ]] ; then
+ mycmakeargs+=(
+ -DENABLE_ASSEMBLY=OFF
+ -DENABLE_TESTS="no" #728748
+ )
+ else
+ mycmakeargs+=(
+ -DENABLE_TESTS="$(usex test)"
+ )
+ fi
+
+ if [[ ${ABI} = ppc* ]] ; then
+ # upstream uses mix of altivec + power8 vectors
+ # it's impossible to enable altivec without CPU_POWER8
+ # and it does not work on ppc32
+ # so we toggle both variables together
+ mycmakeargs+=(
+ -DCPU_POWER8="$(usex cpu_flags_ppc_vsx2)"
+ -DENABLE_ALTIVEC="$(usex cpu_flags_ppc_vsx2)"
+ )
fi
- local MULTIBUILD_VARIANTS=( $(x265_get_variants) )
- multibuild_foreach_variant x265_variant_src_configure
+ local MULTIBUILD_VARIANTS=( "${variants[@]}" )
+ if [[ "${#MULTIBUILD_VARIANTS[@]}" -gt 1 ]] ; then
+ multibuild_foreach_variant x265_variant_src_configure
+
+ local liblist="" v=
+ for v in "${MULTIBUILD_VARIANTS[@]}" ; do
+ ln -s "${BUILD_DIR}-${v}/libx265.a" "${BUILD_DIR}/libx265_${v}.a" || die
+ liblist+="libx265_${v}.a;"
+ done
+
+ mycmakeargs+=(
+ -DEXTRA_LIB="${liblist}"
+ -DEXTRA_LINK_FLAGS="-L${BUILD_DIR}"
+ -DLINKED_10BIT"=$(usex 10bit)"
+ -DLINKED_12BIT="$(usex 12bit)"
+ )
+ fi
+
+ cmake_src_configure
}
multilib_src_compile() {
- local MULTIBUILD_VARIANTS=( $(x265_get_variants) )
- multibuild_foreach_variant cmake_src_compile
+ local MULTIBUILD_VARIANTS=( "${variants[@]}" )
+ if [[ "${#MULTIBUILD_VARIANTS[@]}" -gt 1 ]] ; then
+ multibuild_foreach_variant cmake_src_compile
+ fi
+ cmake_src_compile
}
x265_variant_src_test() {
- if [ -x "${BUILD_DIR}/test/TestBench" ] ; then
+ if [[ -x "${BUILD_DIR}/test/TestBench" ]] ; then
"${BUILD_DIR}/test/TestBench" || die
else
einfo "Unit tests check only assembly."
@@ -201,14 +173,15 @@ x265_variant_src_test() {
}
multilib_src_test() {
- local MULTIBUILD_VARIANTS=( $(x265_get_variants) )
- multibuild_foreach_variant x265_variant_src_test
+ local MULTIBUILD_VARIANTS=( "${variants[@]}" )
+ if [[ "${#MULTIBUILD_VARIANTS[@]}" -gt 1 ]] ; then
+ multibuild_foreach_variant x265_variant_src_test
+ fi
+ x265_variant_src_test
}
multilib_src_install() {
- # Install only "main" variant since the others are already linked into it.
- local MULTIBUILD_VARIANTS=( "main" )
- multibuild_foreach_variant cmake_src_install
+ cmake_src_install
}
multilib_src_install_all() {