x265: fix ARM cross compilation
This commit is contained in:
parent
926ad2fffc
commit
771eb24c21
|
@ -25,6 +25,8 @@
|
|||
let
|
||||
mkFlag = optSet: flag: if optSet then "-D${flag}=ON" else "-D${flag}=OFF";
|
||||
|
||||
isCross = stdenv.buildPlatform != stdenv.hostPlatform;
|
||||
|
||||
cmakeCommonFlags = [
|
||||
"-Wno-dev"
|
||||
(mkFlag custatsSupport "DETAILED_CU_STATS")
|
||||
|
@ -81,6 +83,8 @@ stdenv.mkDerivation rec {
|
|||
url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/media-libs/x265/files/test-ns.patch?id=1d1de341e1404a46b15ae3e84bc400d474cf1a2c";
|
||||
sha256 = "0zg3g53l07yh7ar5c241x50y5zp7g8nh8rh63ad4bdpchpc2f52d";
|
||||
})
|
||||
# Fix detection of NEON (and armv6 build) :
|
||||
./fix-neon-detection.patch
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
|
@ -107,7 +111,7 @@ stdenv.mkDerivation rec {
|
|||
"-DENABLE_SHARED=${if stdenv.hostPlatform.isStatic then "OFF" else "ON"}"
|
||||
"-DHIGH_BIT_DEPTH=OFF"
|
||||
"-DENABLE_HDR10_PLUS=ON"
|
||||
] ++ [
|
||||
(mkFlag (isCross && stdenv.hostPlatform.isAarch) "CROSS_COMPILE_ARM")
|
||||
(mkFlag cliSupport "ENABLE_CLI")
|
||||
(mkFlag unittestsSupport "ENABLE_TESTS")
|
||||
] ++ lib.optionals (multibitdepthSupport) [
|
||||
|
|
28
pkgs/development/libraries/x265/fix-neon-detection.patch
Normal file
28
pkgs/development/libraries/x265/fix-neon-detection.patch
Normal file
|
@ -0,0 +1,28 @@
|
|||
commit 72489cd0a1c229258abe4f20e4fdfd414dfa88da
|
||||
Author: rnhmjoj <rnhmjoj@inventati.org>
|
||||
Date: Sun Oct 2 00:15:24 2022 +0200
|
||||
|
||||
Fix NEON detection
|
||||
|
||||
diff --git a/cmake/FindNeon.cmake b/cmake/FindNeon.cmake
|
||||
index 0062449..9c436d9 100644
|
||||
--- a/cmake/FindNeon.cmake
|
||||
+++ b/cmake/FindNeon.cmake
|
||||
@@ -1,10 +1,11 @@
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
# Check the version of neon supported by the ARM CPU
|
||||
-execute_process(COMMAND cat /proc/cpuinfo | grep Features | grep neon
|
||||
- OUTPUT_VARIABLE neon_version
|
||||
- ERROR_QUIET
|
||||
- OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
-if(neon_version)
|
||||
- set(CPU_HAS_NEON 1)
|
||||
+message(STATUS "Detecting NEON support")
|
||||
+execute_process(COMMAND sed -n "/Features.* neon/q 1" /proc/cpuinfo
|
||||
+ RESULT_VARIABLE CPU_HAS_NEON)
|
||||
+if(CPU_HAS_NEON)
|
||||
+ message(STATUS "Detecting NEON support - supported")
|
||||
+else()
|
||||
+ message(STATUS "Detecting NEON support - not supported" )
|
||||
endif()
|
Loading…
Reference in a new issue