xlink: init at 0-unstable-2025-14-03

authored by Petr Hodina and committed by Masum Reza bf2701a5 d9a75b72

+108
+23
pkgs/by-name/xl/xlink/001-remove-hunter.patch
···
··· 1 + diff --git a/CMakeLists.txt b/CMakeLists.txt 2 + index b6be6e8..057a056 100644 3 + --- a/CMakeLists.txt 4 + +++ b/CMakeLists.txt 5 + @@ -4,12 +4,12 @@ 6 + 7 + cmake_minimum_required(VERSION 3.2) 8 + 9 + -include("cmake/HunterGate.cmake") 10 + -HunterGate( 11 + - URL "https://github.com/cpp-pm/hunter/archive/9d9242b60d5236269f894efd3ddd60a9ca83dd7f.tar.gz" 12 + - SHA1 "16cc954aa723bccd16ea45fc91a858d0c5246376" 13 + - LOCAL # Local config for dependencies 14 + -) 15 + +# include("cmake/HunterGate.cmake") 16 + +# HunterGate( 17 + +# URL "https://github.com/cpp-pm/hunter/archive/9d9242b60d5236269f894efd3ddd60a9ca83dd7f.tar.gz" 18 + +# SHA1 "16cc954aa723bccd16ea45fc91a858d0c5246376" 19 + +# LOCAL # Local config for dependencies 20 + +# ) 21 + 22 + ### Constants 23 + set(TARGET_NAME "XLink")
+85
pkgs/by-name/xl/xlink/package.nix
···
··· 1 + { 2 + lib, 3 + stdenv, 4 + fetchFromGitHub, 5 + cmake, 6 + pkg-config, 7 + libusb1, 8 + }: 9 + 10 + stdenv.mkDerivation (finalAttrs: { 11 + pname = "xlink"; 12 + version = "0-unstable-2025-14-03"; 13 + 14 + src = fetchFromGitHub { 15 + owner = "luxonis"; 16 + repo = "XLink"; 17 + rev = "fe8b5450f545a2ebf26dbc093e98c0265d7f4029"; 18 + hash = "sha256-OTqJfTDudiNrdsDBe1Pg0T1dJcfneGXO/+AIbXpVfxk="; 19 + }; 20 + 21 + outputs = [ 22 + "out" 23 + "share" 24 + ]; 25 + 26 + # Remove CMake Hunter package manager - needs network connection 27 + patches = [ 28 + ./001-remove-hunter.patch 29 + ]; 30 + 31 + nativeBuildInputs = [ 32 + cmake 33 + pkg-config 34 + ]; 35 + 36 + buildInputs = [ 37 + libusb1 38 + ]; 39 + 40 + cmakeFlags = [ 41 + (lib.cmakeBool "XLINK_ENABLE_LIBUSB" true) 42 + (lib.cmakeBool "XLINK_BUILD_EXAMPLES" true) 43 + (lib.cmakeBool "XLINK_BUILD_TESTS" true) 44 + (lib.cmakeBool "XLINK_LIBUSB_SYSTEM" true) 45 + (lib.cmakeFeature "CMAKE_BUILD_TYPE" "Release") 46 + ]; 47 + 48 + postInstall = '' 49 + mkdir -p $out/include 50 + mkdir -p $share/examples 51 + mkdir -p $share/tests 52 + 53 + cp -r $src/include/* $out/include/ 54 + 55 + examples=( 56 + "boot_firmware" 57 + "list_devices" 58 + "boot_bootloader" 59 + "search_devices" 60 + "Makefile" 61 + "device_connect_reset" 62 + ) 63 + 64 + tests=( 65 + "multiple_open_stream" 66 + "multithreading_search_test" 67 + ) 68 + 69 + find $buildDir 70 + for file in "''${examples[@]}"; do 71 + cp examples/$file $share/examples/$file 72 + done 73 + for file in "''${tests[@]}"; do 74 + cp tests/$file $share/tests/$file 75 + done 76 + ''; 77 + 78 + meta = { 79 + description = "XLink library for communication with Myriad VPUs"; 80 + homepage = "https://github.com/luxonis/XLink"; 81 + license = lib.licenses.asl20; 82 + platforms = lib.platforms.all; 83 + maintainers = with lib.maintainers; [ phodina ]; 84 + }; 85 + })