2022-03-30 09:31:56 +00:00
|
|
|
{ lib, stdenv, fetchzip, glib, zlib, libglvnd, python3, autoPatchelfHook }:
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2022-03-30 09:31:56 +00:00
|
|
|
version = "3.5";
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "sam-ba";
|
|
|
|
|
|
|
|
src = fetchzip {
|
2022-03-30 09:31:56 +00:00
|
|
|
url = "https://ww1.microchip.com/downloads/en/DeviceDoc/sam-ba_${version}-linux_x86_64.tar.gz";
|
|
|
|
sha256 = "1k0nbgyc98z94nphm2q7s82b274clfnayf4a2kv93l5594rzdbp1";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-03-30 09:31:56 +00:00
|
|
|
buildInputs = [
|
|
|
|
glib
|
|
|
|
libglvnd
|
|
|
|
zlib
|
|
|
|
|
|
|
|
(python3.withPackages (ps: [ps.pyserial]))
|
|
|
|
];
|
|
|
|
|
|
|
|
nativeBuildInputs = [ autoPatchelfHook ];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
installPhase = ''
|
2022-03-30 09:31:56 +00:00
|
|
|
runHook preInstall
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
mkdir -p "$out/bin/" \
|
|
|
|
"$out/opt/sam-ba/"
|
|
|
|
cp -a . "$out/opt/sam-ba/"
|
2022-03-30 09:31:56 +00:00
|
|
|
ln -sr "$out/opt/sam-ba/sam-ba" "$out/bin/"
|
|
|
|
ln -sr "$out/opt/sam-ba/multi_sam-ba.py" "$out/bin/"
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-03-30 09:31:56 +00:00
|
|
|
runHook postInstall
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Programming tools for Atmel SAM3/7/9 ARM-based microcontrollers";
|
|
|
|
longDescription = ''
|
|
|
|
Atmel SAM-BA software provides an open set of tools for programming the
|
|
|
|
Atmel SAM3, SAM7 and SAM9 ARM-based microcontrollers.
|
|
|
|
'';
|
2022-03-30 09:31:56 +00:00
|
|
|
# Alternatively: https://www.microchip.com/en-us/development-tool/SAM-BA-In-system-Programmer
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "http://www.at91.com/linux4sam/bin/view/Linux4SAM/SoftwareTools";
|
2022-06-26 10:26:21 +00:00
|
|
|
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
|
2022-03-30 09:31:56 +00:00
|
|
|
license = lib.licenses.gpl2Only;
|
|
|
|
platforms = [ "x86_64-linux" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = [ maintainers.bjornfor ];
|
|
|
|
};
|
|
|
|
}
|