nixpkgs/pkgs/by-name/sa/sam-ba/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

48 lines
1.4 KiB
Nix

{ lib, stdenv, fetchzip, glib, zlib, libglvnd, python3, autoPatchelfHook }:
stdenv.mkDerivation rec {
version = "3.5";
pname = "sam-ba";
src = fetchzip {
url = "https://ww1.microchip.com/downloads/en/DeviceDoc/sam-ba_${version}-linux_x86_64.tar.gz";
sha256 = "1k0nbgyc98z94nphm2q7s82b274clfnayf4a2kv93l5594rzdbp1";
};
buildInputs = [
glib
libglvnd
zlib
(python3.withPackages (ps: [ps.pyserial]))
];
nativeBuildInputs = [ autoPatchelfHook ];
installPhase = ''
runHook preInstall
mkdir -p "$out/bin/" \
"$out/opt/sam-ba/"
cp -a . "$out/opt/sam-ba/"
ln -sr "$out/opt/sam-ba/sam-ba" "$out/bin/"
ln -sr "$out/opt/sam-ba/multi_sam-ba.py" "$out/bin/"
runHook postInstall
'';
meta = with lib; {
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.
'';
# Alternatively: https://www.microchip.com/en-us/development-tool/SAM-BA-In-system-Programmer
homepage = "http://www.at91.com/linux4sam/bin/view/Linux4SAM/SoftwareTools";
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
license = lib.licenses.gpl2Only;
platforms = [ "x86_64-linux" ];
maintainers = [ maintainers.bjornfor ];
};
}