lol

oakctl: init at 0.2.12 (#403889)

authored by

Aleksana and committed by
GitHub
23866ef1 84a3c694

+80
+80
pkgs/by-name/oa/oakctl/package.nix
··· 1 + { 2 + lib, 3 + stdenv, 4 + fetchurl, 5 + libgcc, 6 + autoPatchelfHook, 7 + testers, 8 + oakctl, 9 + }: 10 + 11 + let 12 + version = "0.2.12"; 13 + 14 + # Note: Extracted from install script 15 + # https://oakctl-releases.luxonis.com/oakctl-installer.sh 16 + sources = { 17 + x86_64-linux = fetchurl { 18 + url = "https://oakctl-releases.luxonis.com/data/${version}/linux_x86_64/oakctl"; 19 + hash = "sha256-HCnFD0LD6sQp9k3SP2g4svjA5/kLvfrnN+IwiuMWGCY="; 20 + }; 21 + aarch64-linux = fetchurl { 22 + url = "https://oakctl-releases.luxonis.com/data/${version}/linux_aarch64/oakctl"; 23 + hash = "sha256-1oJQs57/tW3rsMM+LAuKiBUf1aKOKFoPQAMcVUfXqlE="; 24 + }; 25 + aarch64-darwin = fetchurl { 26 + url = "https://oakctl-releases.luxonis.com/data/${version}/darwin_arm64/oakctl"; 27 + hash = "sha256-arS2qfd/Z/ZCNWAKD9bc2PMwkhVtO5WViTibMST7zd8="; 28 + }; 29 + x86_64-darwin = fetchurl { 30 + url = "https://oakctl-releases.luxonis.com/data/${version}/darwin_x86_64/oakctl"; 31 + hash = "sha256-yyvDQbFEtlB8xmdbxquy22wAIUcCSVchP/AuSpi4TAU="; 32 + }; 33 + }; 34 + 35 + src = 36 + sources.${stdenv.hostPlatform.system} 37 + or (throw "Unsupported system: ${stdenv.hostPlatform.system}"); 38 + in 39 + stdenv.mkDerivation (finalAttrs: { 40 + pname = "oakctl"; 41 + inherit version src; 42 + 43 + dontUnpack = true; 44 + dontConfigure = true; 45 + dontBuild = true; 46 + 47 + passthru.tests.version = testers.testVersion { 48 + command = "HOME=$TMPDIR oakctl version"; 49 + package = oakctl; 50 + }; 51 + 52 + nativeBuildInputs = lib.optionals stdenv.hostPlatform.isLinux [ autoPatchelfHook ]; 53 + 54 + buildInputs = lib.optionals stdenv.hostPlatform.isLinux [ libgcc ]; 55 + 56 + installPhase = '' 57 + runHook preInstall 58 + 59 + mkdir -p $out/bin 60 + install -D -m 0755 $src $out/bin/${finalAttrs.pname} 61 + 62 + runHook postInstall 63 + ''; 64 + 65 + # Note: The command 'oakctl self-update' won't work as the binary is located in the nix/store 66 + meta = { 67 + description = "Tool to interact with Luxonis OAK4 cameras"; 68 + homepage = "https://rvc4.docs.luxonis.com/software/tools/oakctl"; 69 + license = lib.licenses.unfree; 70 + platforms = [ 71 + "x86_64-linux" 72 + "aarch64-linux" 73 + "x86_64-darwin" 74 + "aarch64-darwin" 75 + ]; 76 + mainProgram = "oakctl"; 77 + maintainers = with lib.maintainers; [ phodina ]; 78 + sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ]; 79 + }; 80 + })