Skip to content

Commit e124898

Browse files
authored
libajantv2: 17.1.3 -> 17.5.0 (NixOS#419060)
2 parents 367477b + 4fc2c00 commit e124898

File tree

7 files changed

+130
-19
lines changed

7 files changed

+130
-19
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
From f822ffa9f886b668fe0a6269f0ba8bf48043d190 Mon Sep 17 00:00:00 2001
2+
From: Luke Granger-Brown <git@lukegb.com>
3+
Date: Sun, 22 Jun 2025 14:12:08 +0100
4+
Subject: [PATCH 4/4] Don't attempt to install a non-existent Makefile
5+
6+
---
7+
demos/ntv2overlay/CMakeLists.txt | 3 ---
8+
1 file changed, 3 deletions(-)
9+
10+
diff --git a/demos/ntv2overlay/CMakeLists.txt b/demos/ntv2overlay/CMakeLists.txt
11+
index 4520e795..ae94906f 100644
12+
--- a/demos/ntv2overlay/CMakeLists.txt
13+
+++ b/demos/ntv2overlay/CMakeLists.txt
14+
@@ -48,6 +48,3 @@ endif()
15+
if (AJA_INSTALL_CMAKE)
16+
install(FILES CMakeLists.txt DESTINATION ${CMAKE_INSTALL_PREFIX}/libajantv2/demos/ntv2overlay)
17+
endif()
18+
-if (AJA_INSTALL_MISC)
19+
- install(FILES Makefile DESTINATION ${CMAKE_INSTALL_PREFIX}/libajantv2/demos/ntv2overlay)
20+
-endif()
21+
--
22+
2.49.0
23+
Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
1+
From 5d6984729190139ddcbefb825e4d59a8bdfc3551 Mon Sep 17 00:00:00 2001
2+
From: Luke Granger-Brown <git@lukegb.com>
3+
Date: Sun, 22 Jun 2025 14:05:49 +0100
4+
Subject: [PATCH 2/3] Properly mark CNTV2DeviceScanner::GetDeviceInfoList as a
5+
class member method
6+
7+
---
8+
ajantv2/src/ntv2devicescanner.cpp | 2 +-
9+
1 file changed, 1 insertion(+), 1 deletion(-)
10+
111
diff --git a/ajantv2/src/ntv2devicescanner.cpp b/ajantv2/src/ntv2devicescanner.cpp
2-
index 448e48d372..6b46f9f69d 100644
12+
index 11d145be..1fb0b433 100644
313
--- a/ajantv2/src/ntv2devicescanner.cpp
414
+++ b/ajantv2/src/ntv2devicescanner.cpp
5-
@@ -137,7 +137,7 @@
15+
@@ -117,7 +117,7 @@ CNTV2DeviceScanner::CNTV2DeviceScanner (const bool inScanNow)
616
}
717
#endif // !defined(NTV2_DEPRECATE_16_3)
818

@@ -11,3 +21,6 @@ index 448e48d372..6b46f9f69d 100644
1121
{
1222
AJAAutoLock tmpLock(&sDevInfoListLock);
1323
return sDevInfoList;
24+
--
25+
2.49.0
26+

pkgs/by-name/li/libajantv2/musl.patch

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
From 6b27c75125f2b2c66d5d6dd8d35569260ac72f17 Mon Sep 17 00:00:00 2001
1+
From 8312398dbc1f0a960c0e64c2faaa756277c0f67c Mon Sep 17 00:00:00 2001
22
From: Alyssa Ross <hi@alyssa.is>
33
Date: Fri, 3 Jan 2025 12:21:28 +0100
4-
Subject: [PATCH] Don't use non-standard ACCESSPERMS macro
4+
Subject: [PATCH 3/3] Don't use non-standard ACCESSPERMS macro
55

66
This macro is non-standard, and is not defined by e.g. musl libc.
77
It's just a define for 0777, so just use that instead.
@@ -28,5 +28,5 @@ index 78196446..e18b10a3 100644
2828
char* result = getcwd(cwdBuf, AJA_MAX_PATH);
2929
AJA_UNUSED(result);
3030
--
31-
2.47.0
31+
2.49.0
3232

pkgs/by-name/li/libajantv2/package.nix

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,19 @@
1212

1313
stdenv.mkDerivation rec {
1414
pname = "libajantv2";
15-
version = "17.1.3";
15+
version = "17.5.0";
1616

1717
src = fetchFromGitHub {
1818
owner = "aja-video";
1919
repo = "libajantv2";
2020
rev = "ntv2_${builtins.replaceStrings [ "." ] [ "_" ] version}";
21-
hash = "sha256-7APoPj2LnvdwfuVforoJz0YxKU1WmAgRqIfXao4IZmY=";
21+
hash = "sha256-/BfFbBScS75TpUZEeYzAHd1PtnZgnCNfGtjwYPJJjkg=";
2222
};
2323
patches = [
2424
./use-system-mbedtls.patch
2525
./device-info-list.patch
2626
./musl.patch
27+
./demos-ntv2overlay-no-makefile.patch
2728
];
2829

2930
outputs = [

pkgs/by-name/li/libajantv2/use-system-mbedtls.patch

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
1-
Commit ID: 1aeee534119a22e717ce3d0e9f62c8791cd825b9
2-
Change ID: pzyrusopmyvtvnwnruvrltqtpqtzxrpo
3-
Author: Luke Granger-Brown <git@lukegb.com> (2024-12-20 18:03:16)
4-
Committer: Luke Granger-Brown <git@lukegb.com> (2024-12-20 18:03:25)
1+
From 6c8dca24e48b0bbeb11e9611fe547246167030ab Mon Sep 17 00:00:00 2001
2+
From: Luke Granger-Brown <git@lukegb.com>
3+
Date: Fri, 20 Dec 2024 18:03:16 +0000
4+
Subject: [PATCH 1/3] Use system mbedtls, rather than downloading from a random
5+
Git branch...
56

6-
Use system mbedtls, rather than downloading from a random Git branch...
7+
---
8+
ajantv2/CMakeLists.txt | 50 +++---------------------------------------
9+
1 file changed, 3 insertions(+), 47 deletions(-)
710

811
diff --git a/ajantv2/CMakeLists.txt b/ajantv2/CMakeLists.txt
9-
index ffa572e9c8..74c23e8e4e 100644
12+
index 8037dd4b..aa6e6577 100644
1013
--- a/ajantv2/CMakeLists.txt
1114
+++ b/ajantv2/CMakeLists.txt
12-
@@ -52,49 +52,13 @@
13-
else()
15+
@@ -55,49 +55,13 @@ else()
16+
endif()
1417
message(STATUS "NTV2 SDK will load signed 3rd-party plugins")
1518

1619
- set(MBEDTLS_INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/mbedtls-install)
@@ -23,7 +26,6 @@ index ffa572e9c8..74c23e8e4e 100644
2326
- set(MBEDCRYPTO_LIBRARY ${MBEDTLS_LIBRARY_DIR}/mbedcrypto.lib)
2427
- set(MBEDTLS_EXTRA_CONFIG_FLAGS
2528
- "-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON"
26-
- "-DMSVC_STATIC_RUNTIME=ON"
2729
- "-DCMAKE_MSVC_RUNTIME_LIBRARY=${CMAKE_MSVC_RUNTIME_LIBRARY}")
2830
- elseif (CMAKE_SYSTEM_NAME MATCHES "^(Linux|Darwin)$")
2931
- set(MBEDTLS_LIBRARY ${MBEDTLS_LIBRARY_DIR}/libmbedtls.a)
@@ -35,7 +37,7 @@ index ffa572e9c8..74c23e8e4e 100644
3537
- # BUILD_BYPRODUCTS informing CMake where the .a files are located is required to make Ninja build work
3638
- ExternalProject_Add(
3739
- mbedtls
38-
- GIT_REPOSITORY https://github.com/aja-video/mbedtls.git
40+
- GIT_REPOSITORY ${AJANTV2_MBEDTLS_URL}
3941
- GIT_TAG fix-win-dll-cmake
4042
- CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${MBEDTLS_INSTALL_DIR}
4143
- -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
@@ -46,6 +48,7 @@ index ffa572e9c8..74c23e8e4e 100644
4648
- -DUSE_STATIC_MBEDTLS_LIBRARY=ON
4749
- -DUSE_SHARED_MBEDTLS_LIBRARY=OFF
4850
- ${MBEDTLS_EXTRA_CONFIG_FLAGS}
51+
- CMAKE_CACHE_ARGS "-DCMAKE_OSX_ARCHITECTURES:STRING=${CMAKE_OSX_ARCHITECTURES}"
4952
- BUILD_ALWAYS TRUE
5053
- BUILD_BYPRODUCTS ${MBEDTLS_LIBRARY} ${MBEDX509_LIBRARY} ${MBEDCRYPTO_LIBRARY}
5154
- )
@@ -62,7 +65,7 @@ index ffa572e9c8..74c23e8e4e 100644
6265
endif()
6366

6467

65-
@@ -668,10 +632,6 @@
68+
@@ -671,10 +635,6 @@ if (NOT TARGET ${PROJECT_NAME})
6669
aja_ntv2_log_build_info()
6770

6871
add_library(${PROJECT_NAME} SHARED ${TARGET_SOURCES})
@@ -73,7 +76,7 @@ index ffa572e9c8..74c23e8e4e 100644
7376

7477
target_compile_definitions(${PROJECT_NAME} PUBLIC
7578
${TARGET_COMPILE_DEFS_DYNAMIC}
76-
@@ -687,10 +647,6 @@
79+
@@ -690,10 +650,6 @@ if (NOT TARGET ${PROJECT_NAME})
7780

7881
add_library(${PROJECT_NAME} STATIC ${TARGET_SOURCES})
7982

@@ -84,3 +87,6 @@ index ffa572e9c8..74c23e8e4e 100644
8487
target_compile_definitions(${PROJECT_NAME} PUBLIC
8588
${TARGET_COMPILE_DEFS_STATIC}
8689
${AJANTV2_TARGET_COMPILE_DEFS})
90+
--
91+
2.49.0
92+

pkgs/os-specific/linux/ajantv2/default.nix

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ stdenv.mkDerivation {
99
inherit (libajantv2) src;
1010
sourceRoot = "${libajantv2.src.name}/driver/linux";
1111

12+
patches = [
13+
./fix-linux-6.15.patch
14+
];
15+
patchFlags = "-p3";
16+
1217
hardeningDisable = [ "pic" ];
1318

1419
nativeBuildInputs = kernel.moduleBuildDependencies;
@@ -35,5 +40,7 @@ stdenv.mkDerivation {
3540
"aarch64-linux"
3641
];
3742
description = "AJA video driver";
43+
# FTB for hardened 5.10/5.15 kernels
44+
broken = kernel.kernelOlder "6" && kernel.isHardened;
3845
};
3946
}
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
From 8eacfa908f7d9b366d68e0ea0516fdd867a1e492 Mon Sep 17 00:00:00 2001
2+
From: Luke Granger-Brown <git@lukegb.com>
3+
Date: Sun, 22 Jun 2025 19:38:10 +0100
4+
Subject: [PATCH 5/5] Use ccflags-y instead of EXTRA_CFLAGS, which stopped
5+
working in Linux 6.15
6+
7+
---
8+
driver/linux/Makefile | 14 +++++++-------
9+
1 file changed, 7 insertions(+), 7 deletions(-)
10+
11+
diff --git a/driver/linux/Makefile b/driver/linux/Makefile
12+
index f714ff9b..da4ee90b 100644
13+
--- a/driver/linux/Makefile
14+
+++ b/driver/linux/Makefile
15+
@@ -25,10 +25,10 @@ VERSIONING = -DSDKVER_MAJ=$(SDKVER_MAJ) -DSDKVER_MIN=$(SDKVER_MIN) -DSDKVER_PN
16+
DISTRO_INFO = -DDISTRO_TYPE=$(DISTRO_TYPE) -DDISTRO_IS_RHEL_LIKE=$(DISTRO_IS_RHEL_LIKE) \
17+
-DDISTRO_MAJ_VERSION=$(DISTRO_MAJ_VERSION) -DDISTRO_MIN_VERSION=$(DISTRO_MIN_VERSION) \
18+
-DDISTRO_KERNEL_PKG_MAJ=$(DISTRO_KERNEL_PKG_MAJ) -DDISTRO_KERNEL_PKG_MIN=$(DISTRO_KERNEL_PKG_MIN) -DDISTRO_KERNEL_PKG_PNT=$(DISTRO_KERNEL_PKG_PNT)
19+
-EXTRA_CFLAGS += -DAJALinux -DXENA2 $(DBG) -D$(NTV2TARGET) -D$(A_ARCH) $(EXTRA_DEPS) $(VERSIONING) $(DISTRO_INFO) $(INCLUDES) -Wall -Wno-implicit-fallthrough
20+
+ccflags-y += -DAJALinux -DXENA2 $(DBG) -D$(NTV2TARGET) -D$(A_ARCH) $(EXTRA_DEPS) $(VERSIONING) $(DISTRO_INFO) $(INCLUDES) -Wall -Wno-implicit-fallthrough
21+
22+
ifdef AJA_HEVC
23+
- EXTRA_CFLAGS += -DAJA_HEVC=$(AJA_HEVC)
24+
+ ccflags-y += -DAJA_HEVC=$(AJA_HEVC)
25+
endif
26+
27+
# if rdma is set
28+
@@ -73,7 +73,7 @@ ifeq ($(NVIDIA_KO),)
29+
endif
30+
31+
ifdef NVIDIA_IGPU
32+
- EXTRA_CFLAGS += -DAJA_IGPU=1
33+
+ ccflags-y += -DAJA_IGPU=1
34+
ifneq ($(NVIDIA_KO),)
35+
ifeq ($(NVIDIA_SYMVERS),)
36+
NVIDIA_GEN_SYMVERS := ./nvidia-ko-to-module-symvers $(NVIDIA_KO) $(A_LINUX_DRIVER_PATH)/nvidia.symvers
37+
@@ -91,17 +91,17 @@ endif
38+
39+
# determine if the ko is gpl - no ko is proprietary igpu
40+
ifeq ($(NVIDIA_KO),)
41+
- EXTRA_CFLAGS += -I$(NVIDIA_SRC_DIR) -DAJA_RDMA=1 -DNVIDIA_PROPRIETARY=1
42+
+ ccflags-y += -I$(NVIDIA_SRC_DIR) -DAJA_RDMA=1 -DNVIDIA_PROPRIETARY=1
43+
else
44+
ifeq ($(shell modinfo $(NVIDIA_KO) | grep license: | grep GPL),)
45+
- EXTRA_CFLAGS += -I$(NVIDIA_SRC_DIR) -DAJA_RDMA=1 -DNVIDIA_PROPRIETARY=1
46+
+ ccflags-y += -I$(NVIDIA_SRC_DIR) -DAJA_RDMA=1 -DNVIDIA_PROPRIETARY=1
47+
else
48+
- EXTRA_CFLAGS += -I$(NVIDIA_SRC_DIR) -DAJA_RDMA=1
49+
+ ccflags-y += -I$(NVIDIA_SRC_DIR) -DAJA_RDMA=1
50+
endif
51+
endif
52+
53+
ifdef AJA_CREATE_DEVICE_NODES
54+
- EXTRA_CFLAGS += -DAJA_CREATE_DEVICE_NODES=$(AJA_CREATE_DEVICE_NODES)
55+
+ ccflags-y += -DAJA_CREATE_DEVICE_NODES=$(AJA_CREATE_DEVICE_NODES)
56+
endif
57+
58+
AJANTV2INCS = $(A_LIB_NTV2_INC)/ajaexport.h \
59+
--
60+
2.49.0
61+

0 commit comments

Comments
 (0)