2017-06-15 00:43:16 +01:00
|
|
|
{ stdenv, lib, fetchFromGitHub
|
2019-08-14 01:05:34 +01:00
|
|
|
, gcc-arm-embedded, libftdi1
|
2017-06-15 00:43:16 +01:00
|
|
|
, python, pythonPackages
|
|
|
|
}:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-14 01:05:34 +01:00
|
|
|
pname = "blackmagic";
|
2020-02-01 17:39:23 +00:00
|
|
|
version = "unstable-2020-02-20";
|
2019-08-14 01:05:34 +01:00
|
|
|
# `git describe --always`
|
2020-02-01 17:39:23 +00:00
|
|
|
firmwareVersion = "v1.6.1-409-g7a595ea";
|
2017-06-15 00:43:16 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "blacksphere";
|
|
|
|
repo = "blackmagic";
|
2020-02-01 17:39:23 +00:00
|
|
|
rev = "7a595ead255f2a052fe4561c24a0577112c9de84";
|
|
|
|
sha256 = "01kdm1rkj7ll0px882crf9w27d2ka8f3hcdmvhb9jwd60bf5dlap";
|
2017-06-15 00:43:16 +01:00
|
|
|
fetchSubmodules = true;
|
|
|
|
};
|
|
|
|
|
2018-10-12 21:21:26 +01:00
|
|
|
nativeBuildInputs = [
|
2019-08-14 01:05:34 +01:00
|
|
|
gcc-arm-embedded
|
2018-10-12 21:21:26 +01:00
|
|
|
];
|
|
|
|
|
2017-06-15 00:43:16 +01:00
|
|
|
buildInputs = [
|
2019-08-14 01:05:34 +01:00
|
|
|
libftdi1
|
2017-06-15 00:43:16 +01:00
|
|
|
python
|
|
|
|
pythonPackages.intelhex
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
# Prevent calling out to `git' to generate a version number:
|
|
|
|
substituteInPlace src/Makefile \
|
2019-08-14 01:05:34 +01:00
|
|
|
--replace '$(shell git describe --always --dirty)' '${firmwareVersion}'
|
2017-06-15 00:43:16 +01: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.
|
|
|
|
|
2019-08-14 01:05:34 +01:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2017-06-15 00:43:16 +01: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;
|
|
|
|
license = licenses.gpl3Plus;
|
2019-08-14 01:05:34 +01:00
|
|
|
maintainers = with maintainers; [ pjones emily ];
|
2017-06-15 00:43:16 +01:00
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|