Files
nixpkgs/pkgs/by-name/oa/oakctl/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

84 lines
2.2 KiB
Nix

{
lib,
stdenv,
fetchurl,
libgcc,
autoPatchelfHook,
testers,
oakctl,
}:
let
version = "0.13.2";
# Note: Extracted from install script
# https://oakctl-releases.luxonis.com/oakctl-installer.sh
sources = {
x86_64-linux = fetchurl {
url = "https://oakctl-releases.luxonis.com/data/${version}/linux_x86_64/oakctl";
hash = "sha256-uS7CUnj9+/kBwGaaZA9P6R2//vhZ1cJW+lhkQePZ0is=";
};
aarch64-linux = fetchurl {
url = "https://oakctl-releases.luxonis.com/data/${version}/linux_aarch64/oakctl";
hash = "sha256-+WFSV3TALeJtdcxkcduaN8tWGLCrOxvs3UV6cOr1xAI=";
};
aarch64-darwin = fetchurl {
url = "https://oakctl-releases.luxonis.com/data/${version}/darwin_arm64/oakctl";
hash = "sha256-OgVmfYcRNVcLGjEbxdVUtsV45vICj+jKPQJ578aRwZs=";
};
x86_64-darwin = fetchurl {
url = "https://oakctl-releases.luxonis.com/data/${version}/darwin_x86_64/oakctl";
hash = "sha256-KjJxwMRLs0XqiOTHjke+dSVKBftwBDYppjrqsbf0Qe8=";
};
};
src =
sources.${stdenv.hostPlatform.system}
or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
in
stdenv.mkDerivation (finalAttrs: {
pname = "oakctl";
inherit version src;
dontUnpack = true;
dontConfigure = true;
dontBuild = true;
passthru.tests.version = testers.testVersion {
command = "HOME=$TMPDIR oakctl version";
package = oakctl;
};
nativeBuildInputs = lib.optionals stdenv.hostPlatform.isLinux [ autoPatchelfHook ];
buildInputs = lib.optionals stdenv.hostPlatform.isLinux [
libgcc
stdenv.cc.cc.lib
];
installPhase = ''
runHook preInstall
mkdir -p $out/bin
install -D -m 0755 $src $out/bin/oakctl
runHook postInstall
'';
# Note: The command 'oakctl self-update' won't work as the binary is located in the nix/store
meta = {
description = "Tool to interact with Luxonis OAK4 cameras";
homepage = "https://docs.luxonis.com/software-v3/oak-apps/oakctl/";
license = lib.licenses.unfree;
platforms = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
mainProgram = "oakctl";
maintainers = with lib.maintainers; [ phodina ];
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
};
})