1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-20 21:17:46 +00:00
nixpkgs/pkgs/development/tools/misc/blackmagic/default.nix
Jonathan Ringer 9bb3fccb5b treewide: pkgs.pkgconfig -> pkgs.pkg-config, move pkgconfig to alias.nix
continuation of #109595

pkgconfig was aliased in 2018, however, it remained in
all-packages.nix due to its wide usage. This cleans
up the remaining references to pkgs.pkgsconfig and
moves the entry to aliases.nix.

python3Packages.pkgconfig remained unchanged because
it's the canonical name of the upstream package
on pypi.
2021-01-19 01:16:25 -08:00

70 lines
2 KiB
Nix

{ stdenv, lib, fetchFromGitHub
, gcc-arm-embedded, libftdi1, libusb-compat-0_1, pkg-config
, python, pythonPackages
}:
with lib;
stdenv.mkDerivation rec {
pname = "blackmagic";
version = "unstable-2020-08-05";
# `git describe --always`
firmwareVersion = "v1.6.1-539-gdd74ec8";
src = fetchFromGitHub {
owner = "blacksphere";
repo = "blackmagic";
rev = "dd74ec8e6f734302daa1ee361af88dfb5043f166";
sha256 = "18w8y64fs7wfdypa4vm3migk5w095z8nbd8qp795f322mf2bz281";
fetchSubmodules = true;
};
nativeBuildInputs = [
gcc-arm-embedded pkg-config
];
buildInputs = [
libftdi1
libusb-compat-0_1
python
pythonPackages.intelhex
];
postPatch = ''
# Prevent calling out to `git' to generate a version number:
substituteInPlace src/Makefile \
--replace '$(shell git describe --always --dirty)' '${firmwareVersion}'
# 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;
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;
maintainers = with maintainers; [ pjones emily sorki ];
# fails on darwin with
# arm-none-eabi-gcc: error: unrecognized command line option '-iframework'
platforms = platforms.linux;
};
}