Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
From 4ba35c72ff39fa1f379e7c69e8c4fd0662961df9 Mon Sep 17 00:00:00 2001
From: Andrew Childs <lorne@cons.org.nz>
Date: Sat, 17 Oct 2020 13:26:01 +0900
Subject: [PATCH] dynamicHDR10: update CMakeLists.txt for aarch64 support

Directly copied from the main CMakeLists.txt, which was updated in
ec7396adaa6afd2c8aab1918cfe4bb6e384740c3
---
source/dynamicHDR10/CMakeLists.txt | 20 +++++++++++++++-----
1 file changed, 15 insertions(+), 5 deletions(-)

diff --git a/source/dynamicHDR10/CMakeLists.txt b/source/dynamicHDR10/CMakeLists.txt
index 22fb79d44..853378d27 100644
--- a/source/dynamicHDR10/CMakeLists.txt
+++ b/source/dynamicHDR10/CMakeLists.txt
@@ -43,14 +43,24 @@ if(GCC)
endif()
endif()
if(ARM AND CROSS_COMPILE_ARM)
- set(ARM_ARGS -march=armv6 -mfloat-abi=soft -mfpu=vfp -marm -fPIC)
+ if(ARM64)
+ set(ARM_ARGS -fPIC)
+ else()
+ set(ARM_ARGS -march=armv6 -mfloat-abi=soft -mfpu=vfp -marm -fPIC)
+ endif()
+ message(STATUS "cross compile arm")
elseif(ARM)
- find_package(Neon)
- if(CPU_HAS_NEON)
- set(ARM_ARGS -mcpu=native -mfloat-abi=hard -mfpu=neon -marm -fPIC)
+ if(ARM64)
+ set(ARM_ARGS -fPIC)
add_definitions(-DHAVE_NEON)
else()
- set(ARM_ARGS -mcpu=native -mfloat-abi=hard -mfpu=vfp -marm)
+ find_package(Neon)
+ if(CPU_HAS_NEON)
+ set(ARM_ARGS -mcpu=native -mfloat-abi=hard -mfpu=neon -marm -fPIC)
+ add_definitions(-DHAVE_NEON)
+ else()
+ set(ARM_ARGS -mcpu=native -mfloat-abi=hard -mfpu=vfp -marm)
+ endif()
endif()
endif()
add_definitions(${ARM_ARGS})
--
2.28.0

12 changes: 8 additions & 4 deletions pkgs/development/libraries/x265/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
, custatsSupport ? false # Internal profiling of encoder work
, cliSupport ? true # Build standalone CLI application
, unittestsSupport ? false # Unit tests
, withHighBitDepth ? stdenv.hostPlatform.isx86_64 # requires explicit upstream support for platform
}:

let
mkFlag = optSet: flag: if optSet then "-D${flag}=ON" else "-D${flag}=OFF";
inherit (stdenv) is64bit;

cmakeFlagsAll = [
"-DSTATIC_LINK_CRT=OFF"
Expand All @@ -34,9 +34,13 @@ let
sha256 = "1jzgv2hxhcwmsdf6sbgyzm88a46dp09ll1fqj92g9vckvh9a7dsn";
};

patches = stdenv.lib.optionals stdenv.hostPlatform.isAarch64 [
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

patches shouldn't be conditional on a specific architecture - assuming the patch won't apply after a bump, this will lead to silent breakages.

If this patch doesn't break other arches, it should just be applied independent of architecture

./0001-dynamicHDR10-update-CMakeLists.txt-for-aarch64-suppo.patch
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't bundle patches in nixpkgs, if they can be sent upstream, and fetchpatched in here.

When doing so, please also add a comment pointing to the upstream PR.

];

buildLib = has12Bit: stdenv.mkDerivation rec {
name = "libx265-${if has12Bit then "12" else "10"}-${version}";
inherit src;
inherit src patches;
enableParallelBuilding = true;

postPatch = ''
Expand Down Expand Up @@ -66,7 +70,7 @@ in

stdenv.mkDerivation rec {
pname = "x265";
inherit version src;
inherit version src patches;

enableParallelBuilding = true;

Expand All @@ -79,7 +83,7 @@ stdenv.mkDerivation rec {
"-DENABLE_SHARED=ON"
"-DHIGH_BIT_DEPTH=OFF"
"-DENABLE_HDR10_PLUS=OFF"
] ++ stdenv.lib.optionals is64bit [
] ++ stdenv.lib.optionals withHighBitDepth [
"-DEXTRA_LIB=${libx265-10}/lib/libx265.a;${libx265-12}/lib/libx265.a"
"-DLINKED_10BIT=ON"
"-DLINKED_12BIT=ON"
Expand Down