about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--pkgs/development/tools/misc/blackmagic/default.nix11
-rwxr-xr-xpkgs/development/tools/misc/blackmagic/helper.sh13
2 files changed, 18 insertions, 6 deletions
diff --git a/pkgs/development/tools/misc/blackmagic/default.nix b/pkgs/development/tools/misc/blackmagic/default.nix
index c5d85dd8d0ce..29aa99d3a15b 100644
--- a/pkgs/development/tools/misc/blackmagic/default.nix
+++ b/pkgs/development/tools/misc/blackmagic/default.nix
@@ -1,5 +1,5 @@
 { stdenv, lib, fetchFromGitHub
-, gcc-arm-embedded, libftdi1
+, gcc-arm-embedded, libftdi1, libusb, pkgconfig
 , python, pythonPackages
 }:
 
@@ -20,11 +20,12 @@ stdenv.mkDerivation rec {
   };
 
   nativeBuildInputs = [
-    gcc-arm-embedded
+    gcc-arm-embedded pkgconfig
   ];
 
   buildInputs = [
     libftdi1
+    libusb
     python
     pythonPackages.intelhex
   ];
@@ -60,7 +61,9 @@ stdenv.mkDerivation rec {
     '';
     homepage = https://github.com/blacksphere/blackmagic;
     license = licenses.gpl3Plus;
-    maintainers = with maintainers; [ pjones emily ];
-    platforms = platforms.unix;
+    maintainers = with maintainers; [ pjones emily sorki ];
+    # fails on darwin with
+    # arm-none-eabi-gcc: error: unrecognized command line option '-iframework'
+    platforms = platforms.linux;
   };
 }
diff --git a/pkgs/development/tools/misc/blackmagic/helper.sh b/pkgs/development/tools/misc/blackmagic/helper.sh
index 991d0249e169..278a758c186a 100755
--- a/pkgs/development/tools/misc/blackmagic/helper.sh
+++ b/pkgs/development/tools/misc/blackmagic/helper.sh
@@ -23,11 +23,18 @@ make_platform() {
   make clean
   make PROBE_HOST="$1"
 
-  if [ "$1" = libftdi ]; then
-    mkdir -p "$out/bin"
+  if [ "$1" = "libftdi" ]; then
     install -m 0555 blackmagic "$out/bin"
   fi
 
+  if [ "$1" = "pc-hosted" ]; then
+    install -m 0555 blackmagic_hosted "$out/bin"
+  fi
+
+  if [ "$1" = "pc-stlinkv2" ]; then
+    install -m 0555 blackmagic_stlinkv2 "$out/bin"
+  fi
+
   for f in $PRODUCTS; do
     if [ -r "$f" ]; then
       mkdir -p "$out/firmware/$1"
@@ -45,6 +52,8 @@ make -C libopencm3
 # And now all of the platforms:
 cd src
 
+mkdir -p "$out/bin"
+
 for platform in platforms/*/Makefile.inc; do
   probe=$(basename "$(dirname "$platform")")
   make_platform "$probe"