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
71 lines
1.6 KiB
Nix
71 lines
1.6 KiB
Nix
{
|
|
stdenv,
|
|
lib,
|
|
fetchurl,
|
|
unzip,
|
|
boost,
|
|
pugixml,
|
|
hidapi,
|
|
libusb1 ? null,
|
|
}:
|
|
|
|
assert stdenv.hostPlatform.isLinux -> libusb1 != null;
|
|
|
|
let
|
|
hidapiDriver = lib.optionalString stdenv.hostPlatform.isLinux "-libusb";
|
|
|
|
in
|
|
stdenv.mkDerivation {
|
|
pname = "msp-debug-stack";
|
|
version = "3.15.1.1";
|
|
|
|
src = fetchurl {
|
|
url = "http://software-dl.ti.com/msp430/msp430_public_sw/mcu/msp430/MSPDS/3_15_1_001/export/MSPDebugStack_OS_Package_3_15_1_1.zip";
|
|
sha256 = "1j5sljqwc20zrb50mrji4mnmw5i680qc7n0lb0pakrrxqjc9m9g3";
|
|
};
|
|
sourceRoot = ".";
|
|
|
|
enableParallelBuilding = true;
|
|
libName = "libmsp430${stdenv.hostPlatform.extensions.sharedLibrary}";
|
|
makeFlags = [
|
|
"OUTPUT=$(libName)"
|
|
"HIDOBJ="
|
|
];
|
|
NIX_LDFLAGS = [
|
|
"-lpugixml"
|
|
"-lhidapi${hidapiDriver}"
|
|
];
|
|
env.NIX_CFLAGS_COMPILE = toString [ "-I${hidapi}/include/hidapi" ];
|
|
|
|
patches = [ ./bsl430.patch ];
|
|
|
|
preBuild = ''
|
|
rm ThirdParty/src/pugixml.cpp
|
|
rm ThirdParty/include/pugi{config,xml}.hpp
|
|
''
|
|
+ lib.optionalString stdenv.hostPlatform.isDarwin ''
|
|
makeFlagsArray+=(OUTNAME="-install_name ")
|
|
'';
|
|
|
|
installPhase = ''
|
|
install -Dm0755 -t $out/lib $libName
|
|
install -Dm0644 -t $out/include DLL430_v3/include/*.h
|
|
'';
|
|
|
|
nativeBuildInputs = [ unzip ];
|
|
buildInputs = [
|
|
boost
|
|
hidapi
|
|
pugixml
|
|
]
|
|
++ lib.optional stdenv.hostPlatform.isLinux libusb1;
|
|
|
|
meta = with lib; {
|
|
description = "TI MSP430 FET debug driver";
|
|
homepage = "https://www.ti.com/tool/MSPDS";
|
|
license = licenses.bsd3;
|
|
platforms = platforms.linux ++ platforms.darwin;
|
|
maintainers = with maintainers; [ aerialx ];
|
|
};
|
|
}
|