SHARE
TWEET

Untitled

a guest Nov 9th, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. { stdenv, lib, fetchurl, libftdi1, libusb1, pkgconfig, hidapi, pkgs, autoreconfHook}:
  2.  
  3. stdenv.mkDerivation rec {
  4.   pname = "openocd";
  5.   version = "0.10.0-git";
  6.  
  7.   src = pkgs.fetchgit {
  8.     url = "https://git.code.sf.net/p/openocd/code";
  9.     rev = "9de7d9c81d91a5cfc16a1476d558d92b08d7e596";
  10.     sha256 = "1mlnpwr3bvzk3afjwgprhcbwchwdccb3vh288alai33c45dyirbn";
  11.     fetchSubmodules = true;
  12.   };
  13.  
  14.   nativeBuildInputs = [ pkgconfig autoreconfHook ];
  15.   buildInputs = [ libftdi1 libusb1 hidapi ];
  16.  
  17.   configureFlags = [
  18.     "--enable-jtag_vpi"
  19.     "--enable-usb_blaster_libftdi"
  20.     (lib.enableFeature (! stdenv.isDarwin) "amtjtagaccel")
  21.     (lib.enableFeature (! stdenv.isDarwin) "gw16012")
  22.     "--enable-presto_libftdi"
  23.     "--enable-openjtag_ftdi"
  24.     (lib.enableFeature (! stdenv.isDarwin) "oocd_trace")
  25.     "--enable-buspirate"
  26.     (lib.enableFeature stdenv.isLinux "sysfsgpio")
  27.     "--enable-remote-bitbang"
  28.   ];
  29.  
  30.   NIX_CFLAGS_COMPILE = lib.optionals stdenv.cc.isGNU [
  31.     "-Wno-implicit-fallthrough"
  32.     "-Wno-format-truncation"
  33.     "-Wno-format-overflow"
  34.     "-Wno-error=tautological-compare"
  35.   ];
  36.  
  37.   postInstall = lib.optionalString stdenv.isLinux ''
  38.     mkdir -p "$out/etc/udev/rules.d"
  39.     rules="$out/share/openocd/contrib/60-openocd.rules"
  40.     if [ ! -f "$rules" ]; then
  41.         echo "$rules is missing, must update the Nix file."
  42.         exit 1
  43.     fi
  44.     ln -s "$rules" "$out/etc/udev/rules.d/"
  45.   '';
  46.  
  47.   meta = with lib; {
  48.     description = "Free and Open On-Chip Debugging, In-System Programming and Boundary-Scan Testing";
  49.     longDescription = ''
  50.       OpenOCD provides on-chip programming and debugging support with a layered
  51.       architecture of JTAG interface and TAP support, debug target support
  52.       (e.g. ARM, MIPS), and flash chip drivers (e.g. CFI, NAND, etc.).  Several
  53.       network interfaces are available for interactiving with OpenOCD: HTTP,
  54.       telnet, TCL, and GDB.  The GDB server enables OpenOCD to function as a
  55.       "remote target" for source-level debugging of embedded systems using the
  56.       GNU GDB program.
  57.     '';
  58.     homepage = http://openocd.sourceforge.net/;
  59.     license = licenses.gpl2Plus;
  60.     maintainers = with maintainers; [ bjornfor ];
  61.     platforms = platforms.unix;
  62.   };
  63. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top