lol

libajantv2: 16.2-bugfix5 -> 17.1.0 (#367135)

authored by

Luke Granger-Brown and committed by
GitHub
c13f8abb 4e1d4f49

+180 -13
+13
pkgs/by-name/li/libajantv2/device-info-list.patch
··· 1 + diff --git a/ajantv2/src/ntv2devicescanner.cpp b/ajantv2/src/ntv2devicescanner.cpp 2 + index 448e48d372..6b46f9f69d 100644 3 + --- a/ajantv2/src/ntv2devicescanner.cpp 4 + +++ b/ajantv2/src/ntv2devicescanner.cpp 5 + @@ -137,7 +137,7 @@ 6 + } 7 + #endif // !defined(NTV2_DEPRECATE_16_3) 8 + 9 + -NTV2DeviceInfoList GetDeviceInfoList (void) 10 + +NTV2DeviceInfoList CNTV2DeviceScanner::GetDeviceInfoList (void) 11 + { 12 + AJAAutoLock tmpLock(&sDevInfoListLock); 13 + return sDevInfoList;
+27 -11
pkgs/by-name/li/libajantv2/package.nix
··· 5 5 cmake, 6 6 ninja, 7 7 pkg-config, 8 + mbedtls, 9 + udev, 10 + linuxPackages, 8 11 }: 9 12 10 - # Warning: We are aware that the upstream changed and there are new releases, 11 - # this got initally packaged for obs-studio which appears to fail to build even upstream with the new version. 12 - # https://github.com/NixOS/nixpkgs/pull/296191 / https://github.com/obsproject/obs-studio/pull/10037 13 13 stdenv.mkDerivation rec { 14 14 pname = "libajantv2"; 15 - version = "16.2-bugfix5"; 15 + version = "17.1.0"; 16 16 17 17 src = fetchFromGitHub { 18 18 owner = "aja-video"; 19 - repo = "ntv2"; 20 - rev = "v${version}"; 21 - sha256 = "sha256-h5PKWMwqTeI5/EaTWkjYojuvDU0FyMpzIjWB98UOJwc="; 19 + repo = "libajantv2"; 20 + rev = "ntv2_${builtins.replaceStrings [ "." ] [ "_" ] version}"; 21 + hash = "sha256-n9j98r1E9E0hv5gA8jCg/eQyqGuyU9JlZYm/zlcTQOo="; 22 22 }; 23 + patches = [ 24 + ./use-system-mbedtls.patch 25 + ./device-info-list.patch 26 + ]; 23 27 24 28 outputs = [ 25 29 "out" ··· 31 35 ninja 32 36 pkg-config 33 37 ]; 38 + buildInputs = [ 39 + mbedtls 40 + udev 41 + ]; 42 + 43 + cmakeFlags = [ 44 + (lib.cmakeBool "AJANTV2_BUILD_SHARED" true) 45 + ]; 34 46 35 47 postInstall = '' 36 48 mkdir -p "$out/lib/pkgconfig" 37 49 cat >"$out/lib/pkgconfig/libajantv2.pc" <<EOF 38 50 prefix=$out 39 51 libdir=\''${prefix}/lib 40 - includedir=\''${prefix}/include/ajalibraries 52 + includedir=\''${prefix}/include/libajantv2 41 53 42 54 Name: libajantv2 43 55 Description: Library for controlling AJA NTV2 video devices 44 56 Version: ${version} 45 57 Libs: -L\''${libdir} -lajantv2 46 - Cflags: -I\''${includedir} -I\''${includedir}/ajantv2/includes 58 + Cflags: -I\''${includedir} -I\''${includedir}/ajantv2/includes -I\''${includedir}/ajantv2/src/lin -DAJALinux -DAJA_LINUX -DAJA_USE_CPLUSPLUS11 -DNDEBUG -DNTV2_USE_CPLUSPLUS11 47 59 EOF 48 60 ''; 61 + 62 + passthru.tests = { 63 + inherit (linuxPackages) ajantv2; 64 + }; 49 65 50 66 meta = with lib; { 51 67 description = "AJA NTV2 Open Source Static Libs and Headers for building applications that only wish to statically link against"; 52 - homepage = "https://github.com/aja-video/ntv2"; 68 + homepage = "https://github.com/aja-video/libajantv2"; 53 69 license = with licenses; [ mit ]; 54 - maintainers = [ ]; 70 + maintainers = [ lib.maintainers.lukegb ]; 55 71 platforms = platforms.linux; 56 72 }; 57 73 }
+86
pkgs/by-name/li/libajantv2/use-system-mbedtls.patch
··· 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) 5 + 6 + Use system mbedtls, rather than downloading from a random Git branch... 7 + 8 + diff --git a/ajantv2/CMakeLists.txt b/ajantv2/CMakeLists.txt 9 + index ffa572e9c8..74c23e8e4e 100644 10 + --- a/ajantv2/CMakeLists.txt 11 + +++ b/ajantv2/CMakeLists.txt 12 + @@ -52,49 +52,13 @@ 13 + else() 14 + message(STATUS "NTV2 SDK will load signed 3rd-party plugins") 15 + 16 + - set(MBEDTLS_INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/mbedtls-install) 17 + - set(MBEDTLS_INCLUDE_DIR ${MBEDTLS_INSTALL_DIR}/include) 18 + - set(MBEDTLS_LIBRARY_DIR ${MBEDTLS_INSTALL_DIR}/${CMAKE_INSTALL_LIBDIR}) 19 + - 20 + - if(CMAKE_SYSTEM_NAME STREQUAL "Windows") 21 + - set(MBEDTLS_LIBRARY ${MBEDTLS_LIBRARY_DIR}/mbedtls.lib) 22 + - set(MBEDX509_LIBRARY ${MBEDTLS_LIBRARY_DIR}/mbedx509.lib) 23 + - set(MBEDCRYPTO_LIBRARY ${MBEDTLS_LIBRARY_DIR}/mbedcrypto.lib) 24 + - set(MBEDTLS_EXTRA_CONFIG_FLAGS 25 + - "-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON" 26 + - "-DMSVC_STATIC_RUNTIME=ON" 27 + - "-DCMAKE_MSVC_RUNTIME_LIBRARY=${CMAKE_MSVC_RUNTIME_LIBRARY}") 28 + - elseif (CMAKE_SYSTEM_NAME MATCHES "^(Linux|Darwin)$") 29 + - set(MBEDTLS_LIBRARY ${MBEDTLS_LIBRARY_DIR}/libmbedtls.a) 30 + - set(MBEDX509_LIBRARY ${MBEDTLS_LIBRARY_DIR}/libmbedx509.a) 31 + - set(MBEDCRYPTO_LIBRARY ${MBEDTLS_LIBRARY_DIR}/libmbedcrypto.a) 32 + - set(MBEDTLS_C_FLAGS -fPIC) 33 + - endif() 34 + - 35 + - # BUILD_BYPRODUCTS informing CMake where the .a files are located is required to make Ninja build work 36 + - ExternalProject_Add( 37 + - mbedtls 38 + - GIT_REPOSITORY https://github.com/aja-video/mbedtls.git 39 + - GIT_TAG fix-win-dll-cmake 40 + - CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${MBEDTLS_INSTALL_DIR} 41 + - -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} 42 + - -DENABLE_TESTING=OFF 43 + - -DENABLE_PROGRAMS=OFF 44 + - -DCMAKE_C_FLAGS=${MBEDTLS_C_FLAGS} 45 + - -DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET} 46 + - -DUSE_STATIC_MBEDTLS_LIBRARY=ON 47 + - -DUSE_SHARED_MBEDTLS_LIBRARY=OFF 48 + - ${MBEDTLS_EXTRA_CONFIG_FLAGS} 49 + - BUILD_ALWAYS TRUE 50 + - BUILD_BYPRODUCTS ${MBEDTLS_LIBRARY} ${MBEDX509_LIBRARY} ${MBEDCRYPTO_LIBRARY} 51 + - ) 52 + + find_package(PkgConfig REQUIRED) 53 + + pkg_check_modules(MBEDTLS REQUIRED mbedtls mbedcrypto mbedx509) 54 + 55 + list(APPEND TARGET_INCLUDE_DIRS 56 + ${MBEDTLS_INCLUDE_DIR}) 57 + list(APPEND MBEDTLS_LINK_LIBS 58 + - ${MBEDTLS_LIBRARY} 59 + - ${MBEDCRYPTO_LIBRARY} 60 + - ${MBEDX509_LIBRARY}) 61 + + ${MBEDTLS_LIBRARIES}) 62 + endif() 63 + 64 + 65 + @@ -668,10 +632,6 @@ 66 + aja_ntv2_log_build_info() 67 + 68 + add_library(${PROJECT_NAME} SHARED ${TARGET_SOURCES}) 69 + - 70 + - if (NOT AJANTV2_DISABLE_PLUGIN_LOAD) 71 + - add_dependencies(${PROJECT_NAME} mbedtls) 72 + - endif() 73 + 74 + target_compile_definitions(${PROJECT_NAME} PUBLIC 75 + ${TARGET_COMPILE_DEFS_DYNAMIC} 76 + @@ -687,10 +647,6 @@ 77 + 78 + add_library(${PROJECT_NAME} STATIC ${TARGET_SOURCES}) 79 + 80 + - if (NOT AJANTV2_DISABLE_PLUGIN_LOAD) 81 + - add_dependencies(${PROJECT_NAME} mbedtls) 82 + - endif() 83 + - 84 + target_compile_definitions(${PROJECT_NAME} PUBLIC 85 + ${TARGET_COMPILE_DEFS_STATIC} 86 + ${AJANTV2_TARGET_COMPILE_DEFS})
+11 -2
pkgs/development/libraries/gstreamer/bad/default.nix
··· 1 1 { lib 2 2 , stdenv 3 3 , fetchurl 4 + , fetchpatch 4 5 , substituteAll 5 6 , meson 6 7 , ninja ··· 46 47 , flite 47 48 , gsm 48 49 , json-glib 50 + , ajaSupport ? lib.meta.availableOn stdenv.hostPlatform libajantv2 49 51 , libajantv2 50 52 , libaom 51 53 , libdc1394 ··· 129 131 src = ./fix-paths.patch; 130 132 inherit (addDriverRunpath) driverLink; 131 133 }) 134 + # Add support for newer AJA SDK from next GStreamer release 135 + (fetchpatch { 136 + url = "https://github.com/GStreamer/gstreamer/commit/d68ac0db571f44cae42b57c876436b3b09df616b.patch"; 137 + hash = "sha256-ZXwlHzuPT8kUKt5+HkqFH5tzL9l5NusDXImabj4fBbI="; 138 + relative = "subprojects/${pname}"; 139 + }) 132 140 ]; 133 141 134 142 nativeBuildInputs = [ ··· 214 222 libmicrodns 215 223 ] ++ lib.optionals openh264Support [ 216 224 openh264 225 + ] ++ lib.optionals ajaSupport [ 226 + libajantv2 217 227 ] ++ lib.optionals (gst-plugins-base.waylandEnabled && stdenv.hostPlatform.isLinux) [ 218 228 libva # vaapi requires libva -> libdrm -> libpciaccess, which is Linux-only in nixpkgs 219 229 wayland ··· 224 234 225 235 chromaprint 226 236 flite 227 - libajantv2 228 237 libdrm 229 238 libgudev 230 239 sbc ··· 300 309 "-Donnx=disabled" # depends on `libonnxruntime` not packaged in nixpkgs as of writing 301 310 "-Dopenaptx=enabled" # since gstreamer-1.20.1 `libfreeaptx` is supported for circumventing the dubious license conflict with `libopenaptx` 302 311 "-Dopencv=${if opencvSupport then "enabled" else "disabled"}" # Reduces rebuild size when `config.cudaSupport = true` 303 - "-Daja=disabled" # should pass libajantv2 via aja-sdk-dir instead 312 + "-Daja=${if ajaSupport then "enabled" else "disabled"}" 304 313 "-Dmicrodns=${if microdnsSupport then "enabled" else "disabled"}" 305 314 "-Dbluez=${if bluezSupport then "enabled" else "disabled"}" 306 315 (lib.mesonEnable "openh264" openh264Support)
+41
pkgs/os-specific/linux/ajantv2/default.nix
··· 1 + { 2 + lib, 3 + stdenv, 4 + fetchFromGitHub, 5 + kernel, 6 + libajantv2, 7 + }: 8 + stdenv.mkDerivation { 9 + name = "ajantv2-module-${libajantv2.version}-${kernel.version}"; 10 + 11 + inherit (libajantv2) src; 12 + sourceRoot = "source/driver/linux"; 13 + 14 + hardeningDisable = [ "pic" ]; 15 + 16 + nativeBuildInputs = kernel.moduleBuildDependencies; 17 + 18 + preBuild = '' 19 + chmod -R +w ../../ 20 + ''; 21 + 22 + enableParallelBuilding = true; 23 + 24 + buildFlags = [ 25 + "KDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" 26 + ]; 27 + 28 + installPhase = '' 29 + install -D ajantv2.ko $out/lib/modules/${kernel.modDirVersion}/misc/ajantv2.ko 30 + install -D ajardma.ko $out/lib/modules/${kernel.modDirVersion}/misc/ajardma.ko 31 + ''; 32 + 33 + meta = { 34 + inherit (libajantv2.meta) license homepage maintainers; 35 + platforms = [ 36 + "x86_64-linux" 37 + "aarch64-linux" 38 + ]; 39 + description = "AJA video driver"; 40 + }; 41 + }
+2
pkgs/top-level/linux-kernels.nix
··· 322 322 323 323 acpi_call = callPackage ../os-specific/linux/acpi-call {}; 324 324 325 + ajantv2 = callPackage ../os-specific/linux/ajantv2 { }; 326 + 325 327 akvcam = callPackage ../os-specific/linux/akvcam { }; 326 328 327 329 amneziawg = callPackage ../os-specific/linux/amneziawg { };