aboutsummaryrefslogtreecommitdiff
path: root/pkgs/development/tools/misc/openocd
diff options
context:
space:
mode:
authorAndrew Childs <lorne@cons.org.nz>2019-05-01 18:56:15 +0900
committerBjørn Forsman <bjorn.forsman@gmail.com>2019-05-01 15:52:13 +0200
commit8e2ab5d8dd745b17a4108ac26693ddd1d82e32dd (patch)
treefd22eb28846a7e0a3708497c042cb153dbb96c72 /pkgs/development/tools/misc/openocd
parent16e5ce4058185b860bf586a1283f44141443e46e (diff)
openocd: update libftdi dependency, fix Darwin build
Restrict Linux-only features to Linux and disable any feature that doesn't build on Darwin for any reason. Restrict GCC-specific cflags to GCC.
Diffstat (limited to 'pkgs/development/tools/misc/openocd')
-rw-r--r--pkgs/development/tools/misc/openocd/default.nix20
1 files changed, 10 insertions, 10 deletions
diff --git a/pkgs/development/tools/misc/openocd/default.nix b/pkgs/development/tools/misc/openocd/default.nix
index cea86f090d6..7141fdcee7e 100644
--- a/pkgs/development/tools/misc/openocd/default.nix
+++ b/pkgs/development/tools/misc/openocd/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, libftdi, libusb1, pkgconfig, hidapi }:
+{ stdenv, lib, fetchurl, libftdi1, libusb1, pkgconfig, hidapi }:
stdenv.mkDerivation rec {
name = "openocd-${version}";
@@ -10,28 +10,28 @@ stdenv.mkDerivation rec {
};
nativeBuildInputs = [ pkgconfig ];
- buildInputs = [ libftdi libusb1 hidapi ];
+ buildInputs = [ libftdi1 libusb1 hidapi ];
configureFlags = [
"--enable-jtag_vpi"
"--enable-usb_blaster_libftdi"
- "--enable-amtjtagaccel"
- "--enable-gw16012"
+ (lib.enableFeature (! stdenv.isDarwin) "amtjtagaccel")
+ (lib.enableFeature (! stdenv.isDarwin) "gw16012")
"--enable-presto_libftdi"
"--enable-openjtag_ftdi"
- "--enable-oocd_trace"
+ (lib.enableFeature (! stdenv.isDarwin) "oocd_trace")
"--enable-buspirate"
- "--enable-sysfsgpio"
+ (lib.enableFeature stdenv.isLinux "sysfsgpio")
"--enable-remote-bitbang"
];
- NIX_CFLAGS_COMPILE = [
+ NIX_CFLAGS_COMPILE = lib.optionals stdenv.cc.isGNU [
"-Wno-implicit-fallthrough"
"-Wno-format-truncation"
"-Wno-format-overflow"
];
- postInstall = ''
+ postInstall = lib.optionalString stdenv.isLinux ''
mkdir -p "$out/etc/udev/rules.d"
rules="$out/share/openocd/contrib/60-openocd.rules"
if [ ! -f "$rules" ]; then
@@ -41,7 +41,7 @@ stdenv.mkDerivation rec {
ln -s "$rules" "$out/etc/udev/rules.d/"
'';
- meta = with stdenv.lib; {
+ meta = with lib; {
description = "Free and Open On-Chip Debugging, In-System Programming and Boundary-Scan Testing";
longDescription = ''
OpenOCD provides on-chip programming and debugging support with a layered
@@ -55,6 +55,6 @@ stdenv.mkDerivation rec {
homepage = http://openocd.sourceforge.net/;
license = licenses.gpl2Plus;
maintainers = with maintainers; [ bjornfor ];
- platforms = platforms.linux;
+ platforms = platforms.unix;
};
}