nixpkgs-suyu/pkgs/development/tools/misc/blackmagic/default.nix

70 lines
2 KiB
Nix
Raw Normal View History

2017-06-15 01:43:16 +02:00
{ stdenv, lib, fetchFromGitHub
2020-04-28 05:29:39 +02:00
, gcc-arm-embedded, libftdi1, libusb-compat-0_1, pkgconfig
2017-06-15 01:43:16 +02:00
, python, pythonPackages
}:
with lib;
stdenv.mkDerivation rec {
pname = "blackmagic";
version = "unstable-2020-02-20";
# `git describe --always`
firmwareVersion = "v1.6.1-409-g7a595ea";
2017-06-15 01:43:16 +02:00
src = fetchFromGitHub {
owner = "blacksphere";
repo = "blackmagic";
rev = "7a595ead255f2a052fe4561c24a0577112c9de84";
sha256 = "01kdm1rkj7ll0px882crf9w27d2ka8f3hcdmvhb9jwd60bf5dlap";
2017-06-15 01:43:16 +02:00
fetchSubmodules = true;
};
nativeBuildInputs = [
gcc-arm-embedded pkgconfig
];
2017-06-15 01:43:16 +02:00
buildInputs = [
libftdi1
2020-04-28 05:29:39 +02:00
libusb-compat-0_1
2017-06-15 01:43:16 +02:00
python
pythonPackages.intelhex
];
postPatch = ''
# Prevent calling out to `git' to generate a version number:
substituteInPlace src/Makefile \
--replace '$(shell git describe --always --dirty)' '${firmwareVersion}'
2017-06-15 01:43:16 +02:00
# Fix scripts that generate headers:
for f in $(find scripts libopencm3/scripts -type f); do
patchShebangs "$f"
done
'';
buildPhase = "${stdenv.shell} ${./helper.sh}";
installPhase = ":"; # buildPhase does this.
enableParallelBuilding = true;
2017-06-15 01:43:16 +02:00
meta = {
description = "In-application debugger for ARM Cortex microcontrollers";
longDescription = ''
The Black Magic Probe is a modern, in-application debugging tool
for embedded microprocessors. It allows you to see what is going
on "inside" an application running on an embedded microprocessor
while it executes.
This package builds the firmware for all supported platforms,
placing them in separate directories under the firmware
directory. It also places the FTDI version of the blackmagic
executable in the bin directory.
'';
homepage = "https://github.com/blacksphere/blackmagic";
2017-06-15 01:43:16 +02:00
license = licenses.gpl3Plus;
maintainers = with maintainers; [ pjones emily sorki ];
# fails on darwin with
# arm-none-eabi-gcc: error: unrecognized command line option '-iframework'
platforms = platforms.linux;
2017-06-15 01:43:16 +02:00
};
}