mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 15:03:28 +00:00
photonvision: init at 2024.2.3
This commit is contained in:
parent
a89c3b15a6
commit
f8e85512ed
50
pkgs/by-name/ph/photonvision/package.nix
Normal file
50
pkgs/by-name/ph/photonvision/package.nix
Normal file
@ -0,0 +1,50 @@
|
||||
{ lib
|
||||
, stdenv
|
||||
, fetchurl
|
||||
, makeWrapper
|
||||
, temurin-jre-bin-11
|
||||
, bash
|
||||
, suitesparse
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "photonvision";
|
||||
version = "2024.2.3";
|
||||
|
||||
src = {
|
||||
"x86_64-linux" = fetchurl {
|
||||
url = "https://github.com/PhotonVision/photonvision/releases/download/v${version}/photonvision-v${version}-linuxx64.jar";
|
||||
hash = "sha256-45ae9sElAmN6++F9OGAvY/nUl/9UxvHtFxhetKVKfDc=";
|
||||
};
|
||||
"aarch64-linux" = fetchurl {
|
||||
url = "https://github.com/PhotonVision/photonvision/releases/download/v${version}/photonvision-v${version}-linuxarm64.jar";
|
||||
hash = "sha256-i/osKO+RAg2nFUPjBdkn3q0Id+uCSTiucfKFVVlEqgs=";
|
||||
};
|
||||
}.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
|
||||
|
||||
dontUnpack = true;
|
||||
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
install -D $src $out/lib/photonvision.jar
|
||||
|
||||
makeWrapper ${temurin-jre-bin-11}/bin/java $out/bin/photonvision \
|
||||
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ stdenv.cc.cc.lib suitesparse ]} \
|
||||
--prefix PATH : ${lib.makeBinPath [ temurin-jre-bin-11 bash.out ]} \
|
||||
--add-flags "-jar $out/lib/photonvision.jar"
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "The free, fast, and easy-to-use computer vision solution for the FIRST Robotics Competition";
|
||||
homepage = "https://photonvision.org/";
|
||||
license = licenses.gpl3;
|
||||
maintainers = with maintainers; [ max-niederman ];
|
||||
mainProgram = "photonvision";
|
||||
platforms = [ "x86_64-linux" "aarch64-linux" ];
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue
Block a user