about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/tools/misc
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/tools/misc')
-rw-r--r--nixpkgs/pkgs/development/tools/misc/abi-compliance-checker/default.nix26
-rw-r--r--nixpkgs/pkgs/development/tools/misc/abi-dumper/default.nix33
-rw-r--r--nixpkgs/pkgs/development/tools/misc/arcanist/default.nix58
-rw-r--r--nixpkgs/pkgs/development/tools/misc/astyle/default.nix26
-rw-r--r--nixpkgs/pkgs/development/tools/misc/autobuild/default.nix34
-rw-r--r--nixpkgs/pkgs/development/tools/misc/autoconf-archive/default.nix20
-rw-r--r--nixpkgs/pkgs/development/tools/misc/autoconf/2.13.nix40
-rw-r--r--nixpkgs/pkgs/development/tools/misc/autoconf/2.64.nix51
-rw-r--r--nixpkgs/pkgs/development/tools/misc/autoconf/default.nix52
-rw-r--r--nixpkgs/pkgs/development/tools/misc/autogen/default.nix58
-rw-r--r--nixpkgs/pkgs/development/tools/misc/automake/automake-1.11.x.nix49
-rw-r--r--nixpkgs/pkgs/development/tools/misc/automake/automake-1.15.x.nix43
-rw-r--r--nixpkgs/pkgs/development/tools/misc/automake/automake-1.16.x.nix43
-rw-r--r--nixpkgs/pkgs/development/tools/misc/automake/builder.sh47
-rw-r--r--nixpkgs/pkgs/development/tools/misc/automake/fix-perl-5.26.patch10
-rw-r--r--nixpkgs/pkgs/development/tools/misc/automake/fix-test-autoconf-2.69.patch13
-rw-r--r--nixpkgs/pkgs/development/tools/misc/automake/setup-hook.sh5
-rw-r--r--nixpkgs/pkgs/development/tools/misc/automoc4/default.nix20
-rw-r--r--nixpkgs/pkgs/development/tools/misc/avarice/default.nix24
-rw-r--r--nixpkgs/pkgs/development/tools/misc/avrdude/default.nix33
-rw-r--r--nixpkgs/pkgs/development/tools/misc/awf/default.nix37
-rw-r--r--nixpkgs/pkgs/development/tools/misc/babeltrace/default.nix22
-rw-r--r--nixpkgs/pkgs/development/tools/misc/bashdb/default.nix26
-rw-r--r--nixpkgs/pkgs/development/tools/misc/bin_replace_string/default.nix31
-rw-r--r--nixpkgs/pkgs/development/tools/misc/binutils/0001-x86-Add-a-GNU_PROPERTY_X86_ISA_1_USED-note-if-needed.patch517
-rw-r--r--nixpkgs/pkgs/development/tools/misc/binutils/0001-x86-Properly-add-X86_ISA_1_NEEDED-property.patch137
-rw-r--r--nixpkgs/pkgs/development/tools/misc/binutils/0001-x86-Properly-merge-GNU_PROPERTY_X86_ISA_1_USED.patch583
-rw-r--r--nixpkgs/pkgs/development/tools/misc/binutils/always-search-rpath.patch14
-rw-r--r--nixpkgs/pkgs/development/tools/misc/binutils/build-components-separately.patch178
-rw-r--r--nixpkgs/pkgs/development/tools/misc/binutils/default.nix155
-rw-r--r--nixpkgs/pkgs/development/tools/misc/binutils/deterministic.patch12
-rw-r--r--nixpkgs/pkgs/development/tools/misc/binutils/disambiguate-arm-targets.patch23
-rw-r--r--nixpkgs/pkgs/development/tools/misc/binutils/gold-symbol-visibility.patch79
-rw-r--r--nixpkgs/pkgs/development/tools/misc/binutils/no-plugins.patch19
-rw-r--r--nixpkgs/pkgs/development/tools/misc/binutils/support-ios.patch168
-rw-r--r--nixpkgs/pkgs/development/tools/misc/blackmagic/default.nix66
-rwxr-xr-xnixpkgs/pkgs/development/tools/misc/blackmagic/helper.sh51
-rw-r--r--nixpkgs/pkgs/development/tools/misc/bossa/bin2c.c122
-rw-r--r--nixpkgs/pkgs/development/tools/misc/bossa/bossa-no-applet-build.patch16
-rw-r--r--nixpkgs/pkgs/development/tools/misc/bossa/default.nix52
-rw-r--r--nixpkgs/pkgs/development/tools/misc/bsdbuild/default.nix68
-rw-r--r--nixpkgs/pkgs/development/tools/misc/cbrowser/backslashes-quotes.diff49
-rw-r--r--nixpkgs/pkgs/development/tools/misc/cbrowser/default.nix34
-rw-r--r--nixpkgs/pkgs/development/tools/misc/ccache/default.nix80
-rw-r--r--nixpkgs/pkgs/development/tools/misc/ccache/fix-debug-prefix-map-suite.patch42
-rw-r--r--nixpkgs/pkgs/development/tools/misc/ccache/skip-fs-dependent-test.patch26
-rw-r--r--nixpkgs/pkgs/development/tools/misc/ccls/default.nix50
-rw-r--r--nixpkgs/pkgs/development/tools/misc/ccls/wrapper12
-rw-r--r--nixpkgs/pkgs/development/tools/misc/cflow/default.nix57
-rw-r--r--nixpkgs/pkgs/development/tools/misc/cgdb/default.nix26
-rw-r--r--nixpkgs/pkgs/development/tools/misc/checkbashisms/default.nix26
-rw-r--r--nixpkgs/pkgs/development/tools/misc/chrpath/default.nix23
-rw-r--r--nixpkgs/pkgs/development/tools/misc/chruby/default.nix45
-rw-r--r--nixpkgs/pkgs/development/tools/misc/chruby/env.patch12
-rw-r--r--nixpkgs/pkgs/development/tools/misc/circleci-cli/default.nix35
-rw-r--r--nixpkgs/pkgs/development/tools/misc/cl-launch/default.nix38
-rw-r--r--nixpkgs/pkgs/development/tools/misc/cl-launch/default.upstream2
-rw-r--r--nixpkgs/pkgs/development/tools/misc/cli11/default.nix35
-rw-r--r--nixpkgs/pkgs/development/tools/misc/coccinelle/default.nix57
-rw-r--r--nixpkgs/pkgs/development/tools/misc/complexity/default.nix32
-rw-r--r--nixpkgs/pkgs/development/tools/misc/cppi/default.nix31
-rw-r--r--nixpkgs/pkgs/development/tools/misc/cproto/cproto_patch11
-rw-r--r--nixpkgs/pkgs/development/tools/misc/cproto/default.nix34
-rw-r--r--nixpkgs/pkgs/development/tools/misc/cquery/default.nix65
-rw-r--r--nixpkgs/pkgs/development/tools/misc/cquery/wrapper12
-rw-r--r--nixpkgs/pkgs/development/tools/misc/creduce/default.nix57
-rw-r--r--nixpkgs/pkgs/development/tools/misc/cscope/default.nix53
-rw-r--r--nixpkgs/pkgs/development/tools/misc/csmith/default.nix49
-rw-r--r--nixpkgs/pkgs/development/tools/misc/ctags/default.nix36
-rw-r--r--nixpkgs/pkgs/development/tools/misc/ctags/wrapped.nix78
-rw-r--r--nixpkgs/pkgs/development/tools/misc/cwebbin/default.nix51
-rw-r--r--nixpkgs/pkgs/development/tools/misc/d-feet/default.nix82
-rw-r--r--nixpkgs/pkgs/development/tools/misc/dbench/default.nix42
-rw-r--r--nixpkgs/pkgs/development/tools/misc/dbench/fix-missing-stdint.patch10
-rw-r--r--nixpkgs/pkgs/development/tools/misc/ddd/default.nix20
-rw-r--r--nixpkgs/pkgs/development/tools/misc/ddd/gcc44.patch11
-rw-r--r--nixpkgs/pkgs/development/tools/misc/dejagnu/default.nix53
-rw-r--r--nixpkgs/pkgs/development/tools/misc/dfu-programmer/default.nix25
-rw-r--r--nixpkgs/pkgs/development/tools/misc/dfu-util/default.nix31
-rw-r--r--nixpkgs/pkgs/development/tools/misc/dialog/default.nix40
-rw-r--r--nixpkgs/pkgs/development/tools/misc/distcc/default.nix84
-rw-r--r--nixpkgs/pkgs/development/tools/misc/distcc/masq.nix44
-rw-r--r--nixpkgs/pkgs/development/tools/misc/doclifter/default.nix26
-rw-r--r--nixpkgs/pkgs/development/tools/misc/drush/default.nix38
-rw-r--r--nixpkgs/pkgs/development/tools/misc/editorconfig-core-c/default.nix38
-rw-r--r--nixpkgs/pkgs/development/tools/misc/eggdbus/default.nix20
-rw-r--r--nixpkgs/pkgs/development/tools/misc/elfinfo/default.nix23
-rw-r--r--nixpkgs/pkgs/development/tools/misc/elfkickers/default.nix23
-rw-r--r--nixpkgs/pkgs/development/tools/misc/elfutils/debug-info-from-env.patch27
-rw-r--r--nixpkgs/pkgs/development/tools/misc/elfutils/default.nix76
-rw-r--r--nixpkgs/pkgs/development/tools/misc/epm/default.nix27
-rw-r--r--nixpkgs/pkgs/development/tools/misc/findnewest/default.nix22
-rw-r--r--nixpkgs/pkgs/development/tools/misc/fsatrace/default.nix31
-rw-r--r--nixpkgs/pkgs/development/tools/misc/fswatch/default.nix33
-rw-r--r--nixpkgs/pkgs/development/tools/misc/gdb/darwin-target-match.patch11
-rw-r--r--nixpkgs/pkgs/development/tools/misc/gdb/debug-info-from-env.patch13
-rw-r--r--nixpkgs/pkgs/development/tools/misc/gdb/default.nix99
-rw-r--r--nixpkgs/pkgs/development/tools/misc/gdbgui/default.nix52
-rw-r--r--nixpkgs/pkgs/development/tools/misc/gede/default.nix33
-rw-r--r--nixpkgs/pkgs/development/tools/misc/gengetopt/default.nix41
-rw-r--r--nixpkgs/pkgs/development/tools/misc/global/default.nix59
-rw-r--r--nixpkgs/pkgs/development/tools/misc/gnum4/darwin-secure-format.patch15
-rw-r--r--nixpkgs/pkgs/development/tools/misc/gnum4/default.nix44
-rw-r--r--nixpkgs/pkgs/development/tools/misc/gnum4/s_isdir.patch14
-rw-r--r--nixpkgs/pkgs/development/tools/misc/gob2/default.nix29
-rw-r--r--nixpkgs/pkgs/development/tools/misc/gperf/3.0.x.nix35
-rw-r--r--nixpkgs/pkgs/development/tools/misc/gperf/default.nix33
-rw-r--r--nixpkgs/pkgs/development/tools/misc/gperf/gperf-ar-fix.patch46
-rw-r--r--nixpkgs/pkgs/development/tools/misc/gpshell/default.nix27
-rw-r--r--nixpkgs/pkgs/development/tools/misc/gputils/default.nix18
-rw-r--r--nixpkgs/pkgs/development/tools/misc/gtkdialog/default.nix21
-rw-r--r--nixpkgs/pkgs/development/tools/misc/gtkperf/bench.patch60
-rw-r--r--nixpkgs/pkgs/development/tools/misc/gtkperf/default.nix24
-rw-r--r--nixpkgs/pkgs/development/tools/misc/help2man/1.40.4-cygwin-nls.patch165
-rw-r--r--nixpkgs/pkgs/development/tools/misc/help2man/default.nix46
-rw-r--r--nixpkgs/pkgs/development/tools/misc/hound/default.nix41
-rw-r--r--nixpkgs/pkgs/development/tools/misc/hound/deps.nix1
-rw-r--r--nixpkgs/pkgs/development/tools/misc/hydra/default.nix140
-rw-r--r--nixpkgs/pkgs/development/tools/misc/icon-naming-utils/default.nix25
-rw-r--r--nixpkgs/pkgs/development/tools/misc/igprof/default.nix43
-rw-r--r--nixpkgs/pkgs/development/tools/misc/indent/darwin.patch15
-rw-r--r--nixpkgs/pkgs/development/tools/misc/indent/default.nix27
-rw-r--r--nixpkgs/pkgs/development/tools/misc/inotify-tools/default.nix22
-rw-r--r--nixpkgs/pkgs/development/tools/misc/intel-gpu-tools/default.nix40
-rw-r--r--nixpkgs/pkgs/development/tools/misc/intltool/default.nix29
-rw-r--r--nixpkgs/pkgs/development/tools/misc/iozone/default.nix61
-rw-r--r--nixpkgs/pkgs/development/tools/misc/itstool/default.nix30
-rw-r--r--nixpkgs/pkgs/development/tools/misc/jscoverage/default.nix52
-rw-r--r--nixpkgs/pkgs/development/tools/misc/jscoverage/jsfalse_to_null.patch26
-rw-r--r--nixpkgs/pkgs/development/tools/misc/kconfig-frontends/default.nix39
-rw-r--r--nixpkgs/pkgs/development/tools/misc/kdbg/default.nix28
-rw-r--r--nixpkgs/pkgs/development/tools/misc/kibana/6.x.nix63
-rw-r--r--nixpkgs/pkgs/development/tools/misc/kibana/7.x.nix63
-rw-r--r--nixpkgs/pkgs/development/tools/misc/kibana/disable-nodejs-version-check-7.patch19
-rw-r--r--nixpkgs/pkgs/development/tools/misc/kibana/disable-nodejs-version-check.patch19
-rw-r--r--nixpkgs/pkgs/development/tools/misc/libtool/default.nix36
-rw-r--r--nixpkgs/pkgs/development/tools/misc/libtool/libtool2.nix49
-rw-r--r--nixpkgs/pkgs/development/tools/misc/libwhich/default.nix24
-rw-r--r--nixpkgs/pkgs/development/tools/misc/linuxkit/default.nix29
-rw-r--r--nixpkgs/pkgs/development/tools/misc/lit/default.nix21
-rw-r--r--nixpkgs/pkgs/development/tools/misc/loccount/default.nix35
-rw-r--r--nixpkgs/pkgs/development/tools/misc/lsof/default.nix54
-rw-r--r--nixpkgs/pkgs/development/tools/misc/lsof/no-build-info.patch43
-rw-r--r--nixpkgs/pkgs/development/tools/misc/ltrace/default.nix29
-rw-r--r--nixpkgs/pkgs/development/tools/misc/lttng-tools/default.nix23
-rw-r--r--nixpkgs/pkgs/development/tools/misc/lttng-ust/default.nix39
-rw-r--r--nixpkgs/pkgs/development/tools/misc/lttv/default.nix24
-rw-r--r--nixpkgs/pkgs/development/tools/misc/luarocks/darwin-3.1.3.patch24
-rw-r--r--nixpkgs/pkgs/development/tools/misc/luarocks/default.nix74
-rw-r--r--nixpkgs/pkgs/development/tools/misc/luarocks/default.upstream1
-rw-r--r--nixpkgs/pkgs/development/tools/misc/luarocks/luarocks-nix.nix14
-rw-r--r--nixpkgs/pkgs/development/tools/misc/luarocks/setup-hook.sh16
-rw-r--r--nixpkgs/pkgs/development/tools/misc/macdylibbundler/default.nix32
-rw-r--r--nixpkgs/pkgs/development/tools/misc/md2man/default.nix25
-rw-r--r--nixpkgs/pkgs/development/tools/misc/mdl/Gemfile3
-rw-r--r--nixpkgs/pkgs/development/tools/misc/mdl/Gemfile.lock21
-rw-r--r--nixpkgs/pkgs/development/tools/misc/mdl/default.nix17
-rw-r--r--nixpkgs/pkgs/development/tools/misc/mdl/gemset.nix54
-rw-r--r--nixpkgs/pkgs/development/tools/misc/mkcert/default.nix22
-rw-r--r--nixpkgs/pkgs/development/tools/misc/moby/default.nix27
-rw-r--r--nixpkgs/pkgs/development/tools/misc/msitools/default.nix27
-rw-r--r--nixpkgs/pkgs/development/tools/misc/ninka/default.nix36
-rw-r--r--nixpkgs/pkgs/development/tools/misc/nixbang/default.nix22
-rw-r--r--nixpkgs/pkgs/development/tools/misc/nrfutil/default.nix33
-rw-r--r--nixpkgs/pkgs/development/tools/misc/objconv/default.nix39
-rw-r--r--nixpkgs/pkgs/development/tools/misc/one_gadget/Gemfile2
-rw-r--r--nixpkgs/pkgs/development/tools/misc/one_gadget/Gemfile.lock17
-rw-r--r--nixpkgs/pkgs/development/tools/misc/one_gadget/default.nix17
-rw-r--r--nixpkgs/pkgs/development/tools/misc/one_gadget/gemset.nix34
-rw-r--r--nixpkgs/pkgs/development/tools/misc/opengrok/default.nix32
-rw-r--r--nixpkgs/pkgs/development/tools/misc/openocd/default.nix61
-rw-r--r--nixpkgs/pkgs/development/tools/misc/pahole/default.nix26
-rw-r--r--nixpkgs/pkgs/development/tools/misc/patchelf/default.nix22
-rw-r--r--nixpkgs/pkgs/development/tools/misc/patchelf/setup-hook.sh22
-rw-r--r--nixpkgs/pkgs/development/tools/misc/patchelf/unstable.nix38
-rw-r--r--nixpkgs/pkgs/development/tools/misc/pkg-config/2.36.3-not-win32.patch324
-rw-r--r--nixpkgs/pkgs/development/tools/misc/pkg-config/default.nix49
-rw-r--r--nixpkgs/pkgs/development/tools/misc/pkg-config/requires-private.patch17
-rw-r--r--nixpkgs/pkgs/development/tools/misc/pkg-config/setup-hook.sh6
-rw-r--r--nixpkgs/pkgs/development/tools/misc/pkgconf/default.nix19
-rw-r--r--nixpkgs/pkgs/development/tools/misc/pmccabe/default.nix48
-rw-r--r--nixpkgs/pkgs/development/tools/misc/pmccabe/getopt_on_darwin.patch15
-rw-r--r--nixpkgs/pkgs/development/tools/misc/prelink/default.nix25
-rw-r--r--nixpkgs/pkgs/development/tools/misc/premake/3.nix30
-rw-r--r--nixpkgs/pkgs/development/tools/misc/premake/5.nix43
-rw-r--r--nixpkgs/pkgs/development/tools/misc/premake/default.nix35
-rw-r--r--nixpkgs/pkgs/development/tools/misc/premake/setup-hook.sh19
-rw-r--r--nixpkgs/pkgs/development/tools/misc/pwndbg/default.nix62
-rw-r--r--nixpkgs/pkgs/development/tools/misc/reviewdog/default.nix26
-rw-r--r--nixpkgs/pkgs/development/tools/misc/rman/default.nix32
-rw-r--r--nixpkgs/pkgs/development/tools/misc/rolespec/default.nix49
-rw-r--r--nixpkgs/pkgs/development/tools/misc/saleae-logic/default.nix97
-rw-r--r--nixpkgs/pkgs/development/tools/misc/saleae-logic/preload.c341
-rw-r--r--nixpkgs/pkgs/development/tools/misc/sccache/default.nix33
-rw-r--r--nixpkgs/pkgs/development/tools/misc/semver-tool/default.nix32
-rw-r--r--nixpkgs/pkgs/development/tools/misc/sipp/default.nix41
-rw-r--r--nixpkgs/pkgs/development/tools/misc/sloccount/default.nix72
-rw-r--r--nixpkgs/pkgs/development/tools/misc/sqitch/default.nix28
-rw-r--r--nixpkgs/pkgs/development/tools/misc/srecord/default.nix24
-rw-r--r--nixpkgs/pkgs/development/tools/misc/stlink/default.nix36
-rw-r--r--nixpkgs/pkgs/development/tools/misc/stm32flash/default.nix26
-rw-r--r--nixpkgs/pkgs/development/tools/misc/strace/default.nix30
-rw-r--r--nixpkgs/pkgs/development/tools/misc/swig/2.x.nix35
-rw-r--r--nixpkgs/pkgs/development/tools/misc/swig/3.x.nix36
-rw-r--r--nixpkgs/pkgs/development/tools/misc/swig/4.nix37
-rw-r--r--nixpkgs/pkgs/development/tools/misc/swig/default.nix26
-rw-r--r--nixpkgs/pkgs/development/tools/misc/sysbench/default.nix22
-rw-r--r--nixpkgs/pkgs/development/tools/misc/tcptrack/default.nix25
-rw-r--r--nixpkgs/pkgs/development/tools/misc/teensy-loader-cli/default.nix27
-rw-r--r--nixpkgs/pkgs/development/tools/misc/terracognita/default.nix22
-rw-r--r--nixpkgs/pkgs/development/tools/misc/terraform-lsp/default.nix22
-rw-r--r--nixpkgs/pkgs/development/tools/misc/tet/default.nix29
-rw-r--r--nixpkgs/pkgs/development/tools/misc/texi2html/default.nix27
-rw-r--r--nixpkgs/pkgs/development/tools/misc/texinfo/4.13a.nix19
-rw-r--r--nixpkgs/pkgs/development/tools/misc/texinfo/5.2.nix4
-rw-r--r--nixpkgs/pkgs/development/tools/misc/texinfo/6.5.nix4
-rw-r--r--nixpkgs/pkgs/development/tools/misc/texinfo/common.nix68
-rw-r--r--nixpkgs/pkgs/development/tools/misc/texinfo/perl.patch43
-rw-r--r--nixpkgs/pkgs/development/tools/misc/tie/default.nix28
-rw-r--r--nixpkgs/pkgs/development/tools/misc/tinyprog/default.nix42
-rw-r--r--nixpkgs/pkgs/development/tools/misc/tokei/Cargo.lock.patch13
-rw-r--r--nixpkgs/pkgs/development/tools/misc/tokei/default.nix36
-rw-r--r--nixpkgs/pkgs/development/tools/misc/travis/Gemfile3
-rw-r--r--nixpkgs/pkgs/development/tools/misc/travis/Gemfile.lock51
-rw-r--r--nixpkgs/pkgs/development/tools/misc/travis/default.nix16
-rw-r--r--nixpkgs/pkgs/development/tools/misc/travis/gemset.nix154
-rw-r--r--nixpkgs/pkgs/development/tools/misc/travis/shell.nix11
-rw-r--r--nixpkgs/pkgs/development/tools/misc/trv/default.nix37
-rw-r--r--nixpkgs/pkgs/development/tools/misc/uisp/default.nix19
-rw-r--r--nixpkgs/pkgs/development/tools/misc/uncrustify/default.nix26
-rw-r--r--nixpkgs/pkgs/development/tools/misc/unifdef/default.nix31
-rw-r--r--nixpkgs/pkgs/development/tools/misc/universal-ctags/default.nix47
-rw-r--r--nixpkgs/pkgs/development/tools/misc/universal-ctags/sed-test.patch12
-rw-r--r--nixpkgs/pkgs/development/tools/misc/usb-modeswitch/data.nix26
-rw-r--r--nixpkgs/pkgs/development/tools/misc/usb-modeswitch/default.nix32
-rw-r--r--nixpkgs/pkgs/development/tools/misc/vtable-dumper/default.nix24
-rw-r--r--nixpkgs/pkgs/development/tools/misc/watson-ruby/Gemfile2
-rw-r--r--nixpkgs/pkgs/development/tools/misc/watson-ruby/Gemfile.lock15
-rw-r--r--nixpkgs/pkgs/development/tools/misc/watson-ruby/default.nix31
-rw-r--r--nixpkgs/pkgs/development/tools/misc/watson-ruby/gemset.nix18
-rw-r--r--nixpkgs/pkgs/development/tools/misc/whatstyle/default.nix30
-rw-r--r--nixpkgs/pkgs/development/tools/misc/wishbone-tool/default.nix25
-rw-r--r--nixpkgs/pkgs/development/tools/misc/xc3sprog/default.nix25
-rw-r--r--nixpkgs/pkgs/development/tools/misc/xxdiff/default.nix51
-rw-r--r--nixpkgs/pkgs/development/tools/misc/ycmd/default.nix83
-rw-r--r--nixpkgs/pkgs/development/tools/misc/yodl/default.nix52
246 files changed, 10822 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/tools/misc/abi-compliance-checker/default.nix b/nixpkgs/pkgs/development/tools/misc/abi-compliance-checker/default.nix
new file mode 100644
index 000000000000..37d49b1f35bf
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/abi-compliance-checker/default.nix
@@ -0,0 +1,26 @@
+{ stdenv, fetchFromGitHub, ctags, perl, binutils, abi-dumper }:
+
+stdenv.mkDerivation rec {
+  pname = "abi-compliance-checker";
+  version = "2.3";
+
+  src = fetchFromGitHub {
+    owner = "lvc";
+    repo = "abi-compliance-checker";
+    rev = version;
+    sha256 = "1f1f9j2nf9j83sfl2ljadch99v6ha8rq8xm7ax5akc05hjpyckij";
+  };
+
+  buildInputs = [ binutils ctags perl ];
+  propagatedBuildInputs = [ abi-dumper ];
+
+  makeFlags = [ "prefix=$(out)" ];
+
+  meta = with stdenv.lib; {
+    homepage = https://lvc.github.io/abi-compliance-checker;
+    description = "A tool for checking backward API/ABI compatibility of a C/C++ library";
+    license = licenses.lgpl21;
+    maintainers = [ maintainers.bhipple ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/abi-dumper/default.nix b/nixpkgs/pkgs/development/tools/misc/abi-dumper/default.nix
new file mode 100644
index 000000000000..ca59bf28b1ec
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/abi-dumper/default.nix
@@ -0,0 +1,33 @@
+{ stdenv, fetchFromGitHub, ctags, perl, elfutils, vtable-dumper }:
+
+stdenv.mkDerivation rec {
+  pname = "abi-dumper";
+  version = "1.1";
+
+  src = fetchFromGitHub {
+    owner = "lvc";
+    repo = "abi-dumper";
+    rev = version;
+    sha256 = "1byhw132aj7a5a5zh5s3pnjlrhdk4cz6xd5irp1y08jl980qba5j";
+  };
+
+  patchPhase = ''
+    substituteInPlace abi-dumper.pl \
+      --replace eu-readelf ${elfutils}/bin/eu-readelf \
+      --replace vtable-dumper ${vtable-dumper}/bin/vtable-dumper \
+      --replace '"ctags"' '"${ctags}/bin/ctags"'
+  '';
+
+  buildInputs = [ elfutils ctags perl vtable-dumper ];
+
+  preBuild = "mkdir -p $out";
+  makeFlags = [ "prefix=$(out)" ];
+
+  meta = with stdenv.lib; {
+    homepage = https://github.com/lvc/abi-dumper;
+    description = "Dump ABI of an ELF object containing DWARF debug info";
+    license = licenses.lgpl21;
+    maintainers = [ maintainers.bhipple ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/arcanist/default.nix b/nixpkgs/pkgs/development/tools/misc/arcanist/default.nix
new file mode 100644
index 000000000000..b3d380b0a0ad
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/arcanist/default.nix
@@ -0,0 +1,58 @@
+{ stdenv, fetchFromGitHub, php, flex, makeWrapper }:
+
+let
+  libphutil = fetchFromGitHub {
+    owner = "phacility";
+    repo = "libphutil";
+    rev = "3215e4e291ed4468faeed4542d47a571b5bc559a";
+    sha256 = "0bbinaxny0j4iniz2grf0s9cysbl3x24yc32f3jra9mwsgh2v2zj";
+  };
+  arcanist = fetchFromGitHub {
+    owner = "phacility";
+    repo = "arcanist";
+    rev = "2650e8627a20e1bfe334a4a2b787f44ef5d6ebc5";
+    sha256 = "0x0xxiar202ypbgxh19swzjil546bbp8li4k5yrpvab55y8ymkd4";
+  };
+in
+stdenv.mkDerivation {
+  pname = "arcanist";
+  version = "20180916";
+
+  src = [ arcanist libphutil ];
+  buildInputs = [ php makeWrapper flex ];
+
+  unpackPhase = ''
+    cp -aR ${libphutil} libphutil
+    cp -aR ${arcanist} arcanist
+    chmod +w -R libphutil arcanist
+  '';
+
+  postPatch = stdenv.lib.optionalString stdenv.isAarch64 ''
+    substituteInPlace libphutil/support/xhpast/Makefile \
+      --replace "-minline-all-stringops" ""
+  '';
+
+  buildPhase = ''
+    (
+      cd libphutil/support/xhpast
+      make clean all install
+    )
+  '';
+  installPhase = ''
+    mkdir -p $out/bin $out/libexec
+    cp -R libphutil $out/libexec/libphutil
+    cp -R arcanist  $out/libexec/arcanist
+
+    ln -s $out/libexec/arcanist/bin/arc $out/bin
+    wrapProgram $out/bin/arc \
+      --prefix PATH : "${php}/bin"
+  '';
+
+  meta = {
+    description = "Command line interface to Phabricator";
+    homepage    = "http://phabricator.org";
+    license     = stdenv.lib.licenses.asl20;
+    platforms   = stdenv.lib.platforms.unix;
+    maintainers = [ stdenv.lib.maintainers.thoughtpolice ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/astyle/default.nix b/nixpkgs/pkgs/development/tools/misc/astyle/default.nix
new file mode 100644
index 000000000000..66e972826cb9
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/astyle/default.nix
@@ -0,0 +1,26 @@
+{ stdenv, lib, fetchurl, cmake }:
+
+stdenv.mkDerivation rec {
+  pname = "astyle";
+  version = "3.1";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/${pname}/${pname}_${version}_linux.tar.gz";
+    sha256 = "1ms54wcs7hg1bsywqwf2lhdfizgbk7qxc9ghasxk8i99jvwlrk6b";
+  };
+
+  # lots of hardcoded references to /usr
+  postPatch = ''
+    substituteInPlace CMakeLists.txt \
+      --replace ' /usr/' " $out/"
+  '';
+
+  nativeBuildInputs = [ cmake ];
+
+  meta = with lib; {
+    description = "Source code indenter, formatter, and beautifier for C, C++, C# and Java";
+    homepage = "https://astyle.sourceforge.net/";
+    license = licenses.lgpl3;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/autobuild/default.nix b/nixpkgs/pkgs/development/tools/misc/autobuild/default.nix
new file mode 100644
index 000000000000..8f425a929590
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/autobuild/default.nix
@@ -0,0 +1,34 @@
+{ fetchurl, stdenv, makeWrapper, perl, openssh, rsync }:
+
+stdenv.mkDerivation rec {
+  name = "autobuild-5.3";
+
+  src = fetchurl {
+    url = "http://savannah.spinellicreations.com/autobuild/${name}.tar.gz";
+    sha256 = "0gv7g61ja9q9zg1m30k4snqwwy1kq7b4df6sb7d2qra7kbdq8af1";
+  };
+
+  buildInputs = [ makeWrapper perl openssh rsync ];
+
+  doCheck = true;
+
+  meta = {
+    description = "Continuous integration tool";
+
+    longDescription = ''
+      Autobuild is a package that process output from building
+      software, primarily focused on packages using Autoconf and
+      Automake, and then generate a HTML summary file, containing
+      links to each build log.
+
+      Autobuild can also help you automate building your project on
+      many systems concurrently.  Users with accounts on the
+      SourceForge compile farms will be able to invoke a parallel
+      build of their Autoconf/Automake based software, and produce a
+      summary of the build status, after reading the manual.
+    '';
+
+    homepage = https://josefsson.org/autobuild/;
+    license = stdenv.lib.licenses.gpl2Plus;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/autoconf-archive/default.nix b/nixpkgs/pkgs/development/tools/misc/autoconf-archive/default.nix
new file mode 100644
index 000000000000..9901e46d5787
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/autoconf-archive/default.nix
@@ -0,0 +1,20 @@
+{ stdenv, fetchurl, xz }:
+
+stdenv.mkDerivation rec {
+  pname = "autoconf-archive";
+  version = "2019.01.06";
+
+  src = fetchurl {
+    url = "mirror://gnu/autoconf-archive/autoconf-archive-${version}.tar.xz";
+    sha256 = "0gqya7nf4j5k98dkky0c3bnr0paciya91vkqazg7knlq621mq68p";
+  };
+
+  buildInputs = [ xz ];
+
+  meta = with stdenv.lib; {
+    description = "Archive of autoconf m4 macros";
+    homepage = https://www.gnu.org/software/autoconf-archive/;
+    license = licenses.gpl3;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/autoconf/2.13.nix b/nixpkgs/pkgs/development/tools/misc/autoconf/2.13.nix
new file mode 100644
index 000000000000..9e777e53cf62
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/autoconf/2.13.nix
@@ -0,0 +1,40 @@
+{stdenv, fetchurl, m4, perl, lzma}:
+
+stdenv.mkDerivation rec {
+  name = "autoconf-2.13";
+
+  src = fetchurl {
+    url = "mirror://gnu/autoconf/${name}.tar.gz";
+    sha256 = "07krzl4czczdsgzrrw9fiqx35xcf32naf751khg821g5pqv12qgh";
+  };
+
+  nativebuildInputs = [ lzma ];
+  buildInputs = [ m4 perl ];
+
+  doCheck = true;
+
+  # Don't fixup "#! /bin/sh" in Autoconf, otherwise it will use the
+  # "fixed" path in generated files!
+  dontPatchShebangs = true;
+
+  postInstall = ''ln -s autoconf "$out"/bin/autoconf-2.13'';
+
+  meta = {
+    homepage = https://www.gnu.org/software/autoconf/;
+    description = "Part of the GNU Build System";
+    branch = "2.13";
+
+    longDescription = ''
+      GNU Autoconf is an extensible package of M4 macros that produce
+      shell scripts to automatically configure software source code
+      packages.  These scripts can adapt the packages to many kinds of
+      UNIX-like systems without manual user intervention.  Autoconf
+      creates a configuration script for a package from a template
+      file that lists the operating system features that the package
+      can use, in the form of M4 macro calls.
+    '';
+
+    license = stdenv.lib.licenses.gpl2Plus;
+    platforms = stdenv.lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/autoconf/2.64.nix b/nixpkgs/pkgs/development/tools/misc/autoconf/2.64.nix
new file mode 100644
index 000000000000..98b55e31f60b
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/autoconf/2.64.nix
@@ -0,0 +1,51 @@
+{ stdenv, fetchurl, m4, perl }:
+
+stdenv.mkDerivation rec {
+  name = "autoconf-2.64";
+
+  src = fetchurl {
+    url = "mirror://gnu/autoconf/${name}.tar.xz";
+    sha256 = "0j3jdjpf5ly39dlp0bg70h72nzqr059k0x8iqxvaxf106chpgn9j";
+  };
+
+  buildInputs = [ m4 perl ];
+
+  # Work around a known issue in Cygwin.  See
+  # http://thread.gmane.org/gmane.comp.sysutils.autoconf.bugs/6822 for
+  # details.
+  # There are many test failures on `i386-pc-solaris2.11'.
+  #doCheck = ((!stdenv.isCygwin) && (!stdenv.isSunOS));
+  doCheck = false;
+
+  # Don't fixup "#! /bin/sh" in Autoconf, otherwise it will use the
+  # "fixed" path in generated files!
+  dontPatchShebangs = true;
+
+  enableParallelBuilding = true;
+
+  # Make the Autotest test suite run in parallel.
+  preCheck =''
+    export TESTSUITEFLAGS="-j$NIX_BUILD_CORES"
+  '';
+
+  doInstallCheck = false; # fails
+
+  meta = {
+    homepage = https://www.gnu.org/software/autoconf/;
+    description = "Part of the GNU Build System";
+
+    longDescription = ''
+      GNU Autoconf is an extensible package of M4 macros that produce
+      shell scripts to automatically configure software source code
+      packages.  These scripts can adapt the packages to many kinds of
+      UNIX-like systems without manual user intervention.  Autoconf
+      creates a configuration script for a package from a template
+      file that lists the operating system features that the package
+      can use, in the form of M4 macro calls.
+    '';
+
+    license = stdenv.lib.licenses.gpl2Plus;
+
+    platforms = stdenv.lib.platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/autoconf/default.nix b/nixpkgs/pkgs/development/tools/misc/autoconf/default.nix
new file mode 100644
index 000000000000..304b4fddf0d5
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/autoconf/default.nix
@@ -0,0 +1,52 @@
+{ stdenv, fetchurl, m4, perl }:
+
+stdenv.mkDerivation rec {
+  name = "autoconf-2.69";
+
+  src = fetchurl {
+    url = "mirror://gnu/autoconf/${name}.tar.xz";
+    sha256 = "113nlmidxy9kjr45kg9x3ngar4951mvag1js2a3j8nxcz34wxsv4";
+  };
+
+  nativeBuildInputs = [ m4 perl ];
+  buildInputs = [ m4 ];
+
+  # Work around a known issue in Cygwin.  See
+  # http://thread.gmane.org/gmane.comp.sysutils.autoconf.bugs/6822 for
+  # details.
+  # There are many test failures on `i386-pc-solaris2.11'.
+  #doCheck = ((!stdenv.isCygwin) && (!stdenv.isSunOS));
+  doCheck = false;
+
+  # Don't fixup "#! /bin/sh" in Autoconf, otherwise it will use the
+  # "fixed" path in generated files!
+  dontPatchShebangs = true;
+
+  enableParallelBuilding = true;
+
+  # Make the Autotest test suite run in parallel.
+  preCheck =''
+    export TESTSUITEFLAGS="-j$NIX_BUILD_CORES"
+  '';
+
+  doInstallCheck = false; # fails
+
+  meta = {
+    homepage = https://www.gnu.org/software/autoconf/;
+    description = "Part of the GNU Build System";
+
+    longDescription = ''
+      GNU Autoconf is an extensible package of M4 macros that produce
+      shell scripts to automatically configure software source code
+      packages.  These scripts can adapt the packages to many kinds of
+      UNIX-like systems without manual user intervention.  Autoconf
+      creates a configuration script for a package from a template
+      file that lists the operating system features that the package
+      can use, in the form of M4 macro calls.
+    '';
+
+    license = stdenv.lib.licenses.gpl2Plus;
+
+    platforms = stdenv.lib.platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/autogen/default.nix b/nixpkgs/pkgs/development/tools/misc/autogen/default.nix
new file mode 100644
index 000000000000..dc7197897192
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/autogen/default.nix
@@ -0,0 +1,58 @@
+{ stdenv, buildPackages, fetchurl, which, pkgconfig, perl, guile, libxml2 }:
+
+stdenv.mkDerivation rec {
+  pname = "autogen";
+  version = "5.18.12";
+
+  src = fetchurl {
+    url = "mirror://gnu/autogen/rel${version}/autogen-${version}.tar.xz";
+    sha256 = "1n5zq4872sakvz9c7ncsdcfp0z8rsybsxvbmhkpbd19ii0pacfxy";
+  };
+
+  outputs = [ "bin" "dev" "lib" "out" "man" "info" ];
+
+  nativeBuildInputs = [ which pkgconfig perl ]
+    # autogen needs a build autogen when cross-compiling
+    ++ stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
+      buildPackages.buildPackages.autogen buildPackages.texinfo ];
+  buildInputs = [
+    guile libxml2
+  ];
+
+  configureFlags = stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
+    "--with-libxml2=${libxml2.dev}"
+    "--with-libxml2-cflags=-I${libxml2.dev}/include/libxml2"
+    # the configure check for regcomp wants to run a host program
+    "libopts_cv_with_libregex=yes"
+    #"MAKEINFO=${buildPackages.texinfo}/bin/makeinfo"
+  ];
+
+  postPatch = ''
+    # Fix a broken sed expression used for detecting the minor
+    # version of guile we are using
+    sed -i "s,sed '.*-I.*',sed 's/\\\(^\\\| \\\)-I/\\\1/g',g" configure
+
+    substituteInPlace pkg/libopts/mklibsrc.sh --replace /tmp $TMPDIR
+  '';
+
+  postInstall = ''
+    mkdir -p $dev/bin
+    mv $bin/bin/autoopts-config $dev/bin
+
+    for f in $lib/lib/autogen/tpl-config.tlib $out/share/autogen/tpl-config.tlib; do
+      sed -e "s|$dev/include|/no-such-autogen-include-path|" -i $f
+      sed -e "s|$bin/bin|/no-such-autogen-bin-path|" -i $f
+      sed -e "s|$lib/lib|/no-such-autogen-lib-path|" -i $f
+    done
+  '';
+
+  #doCheck = true; # 2 tests fail because of missing /dev/tty
+
+  meta = with stdenv.lib; {
+    description = "Automated text and program generation tool";
+    license = with licenses; [ gpl3Plus lgpl3Plus ];
+    homepage = https://www.gnu.org/software/autogen/;
+    platforms = platforms.all;
+    maintainers = [ ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/automake/automake-1.11.x.nix b/nixpkgs/pkgs/development/tools/misc/automake/automake-1.11.x.nix
new file mode 100644
index 000000000000..a5aa44abcdef
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/automake/automake-1.11.x.nix
@@ -0,0 +1,49 @@
+{ stdenv, fetchurl, perl, autoconf }:
+
+stdenv.mkDerivation rec {
+  name = "automake-1.11.6";
+
+  # TODO: Remove the `aclocal' wrapper when $ACLOCAL_PATH support is
+  # available upstream; see
+  # <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=9026>.
+  builder = ./builder.sh;
+
+  setupHook = ./setup-hook.sh;
+
+  src = fetchurl {
+    url = "mirror://gnu/automake/${name}.tar.xz";
+    sha256 = "1ffbc6cc41f0ea6c864fbe9485b981679dc5e350f6c4bc6c3512f5a4226936b5";
+  };
+
+  patches = [ ./fix-test-autoconf-2.69.patch ./fix-perl-5.26.patch ];
+
+  buildInputs = [ perl autoconf ];
+
+  # Disable indented log output from Make, otherwise "make.test" will
+  # fail.
+  preCheck = "unset NIX_INDENT_MAKE";
+  doCheck = false; # takes _a lot_ of time, fails 11 of 782 tests
+
+  # Don't fixup "#! /bin/sh" in Libtool, otherwise it will use the
+  # "fixed" path in generated files!
+  dontPatchShebangs = true;
+
+  # Run the test suite in parallel.
+  enableParallelBuilding = true;
+
+  meta = {
+    branch = "1.11";
+    homepage = https://www.gnu.org/software/automake/;
+    description = "GNU standard-compliant makefile generator";
+
+    longDescription = ''
+      GNU Automake is a tool for automatically generating
+      `Makefile.in' files compliant with the GNU Coding
+      Standards.  Automake requires the use of Autoconf.
+    '';
+
+    license = stdenv.lib.licenses.gpl2Plus;
+
+    platforms = stdenv.lib.platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/automake/automake-1.15.x.nix b/nixpkgs/pkgs/development/tools/misc/automake/automake-1.15.x.nix
new file mode 100644
index 000000000000..e1aeb025c30f
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/automake/automake-1.15.x.nix
@@ -0,0 +1,43 @@
+{ stdenv, fetchurl, perl, autoconf }:
+
+stdenv.mkDerivation rec {
+  name = "automake-1.15";
+
+  src = fetchurl {
+    url = "mirror://gnu/automake/${name}.tar.xz";
+    sha256 = "0dl6vfi2lzz8alnklwxzfz624b95hb1ipjvd3mk177flmddcf24r";
+  };
+
+  nativeBuildInputs = [ autoconf perl ];
+  buildInputs = [ autoconf ];
+
+  setupHook = ./setup-hook.sh;
+
+  # Disable indented log output from Make, otherwise "make.test" will
+  # fail.
+  preCheck = "unset NIX_INDENT_MAKE";
+  doCheck = false; # takes _a lot_ of time, fails 3 out of 2698 tests, all seem to be related to paths
+  doInstallCheck = false; # runs the same thing, fails the same tests
+
+  # The test suite can run in parallel.
+  enableParallelBuilding = true;
+
+  # Don't fixup "#! /bin/sh" in Libtool, otherwise it will use the
+  # "fixed" path in generated files!
+  dontPatchShebangs = true;
+
+  meta = {
+    branch = "1.15";
+    homepage = https://www.gnu.org/software/automake/;
+    description = "GNU standard-compliant makefile generator";
+    license = stdenv.lib.licenses.gpl2Plus;
+
+    longDescription = ''
+      GNU Automake is a tool for automatically generating
+      `Makefile.in' files compliant with the GNU Coding
+      Standards.  Automake requires the use of Autoconf.
+    '';
+
+    platforms = stdenv.lib.platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/automake/automake-1.16.x.nix b/nixpkgs/pkgs/development/tools/misc/automake/automake-1.16.x.nix
new file mode 100644
index 000000000000..1e432a6e149b
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/automake/automake-1.16.x.nix
@@ -0,0 +1,43 @@
+{ stdenv, fetchurl, perl, autoconf }:
+
+stdenv.mkDerivation rec {
+  name = "automake-1.16.1";
+
+  src = fetchurl {
+    url = "mirror://gnu/automake/${name}.tar.xz";
+    sha256 = "08g979ficj18i1w6w5219bgmns7czr03iadf20mk3lrzl8wbn1ax";
+  };
+
+  nativeBuildInputs = [ autoconf perl ];
+  buildInputs = [ autoconf ];
+
+  setupHook = ./setup-hook.sh;
+
+  # Disable indented log output from Make, otherwise "make.test" will
+  # fail.
+  preCheck = "unset NIX_INDENT_MAKE";
+  doCheck = false; # takes _a lot_ of time, fails 3 out of 2698 tests, all seem to be related to paths
+  doInstallCheck = false; # runs the same thing, fails the same tests
+
+  # The test suite can run in parallel.
+  enableParallelBuilding = true;
+
+  # Don't fixup "#! /bin/sh" in Libtool, otherwise it will use the
+  # "fixed" path in generated files!
+  dontPatchShebangs = true;
+
+  meta = {
+    branch = "1.15";
+    homepage = https://www.gnu.org/software/automake/;
+    description = "GNU standard-compliant makefile generator";
+    license = stdenv.lib.licenses.gpl2Plus;
+
+    longDescription = ''
+      GNU Automake is a tool for automatically generating
+      `Makefile.in' files compliant with the GNU Coding
+      Standards.  Automake requires the use of Autoconf.
+    '';
+
+    platforms = stdenv.lib.platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/automake/builder.sh b/nixpkgs/pkgs/development/tools/misc/automake/builder.sh
new file mode 100644
index 000000000000..e54a2acca67e
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/automake/builder.sh
@@ -0,0 +1,47 @@
+source $stdenv/setup
+
+# Wrap the given `aclocal' program, appending extra `-I' flags
+# corresponding to the directories listed in $ACLOCAL_PATH.  (Note
+# that `wrapProgram' can't be used for that purpose since it can only
+# prepend flags, not append them.)
+wrapAclocal() {
+    local program="$1"
+    local wrapped="$(dirname $program)/.$(basename $program)-wrapped"
+
+    mv "$program" "$wrapped"
+    cat > "$program"<<EOF
+#! $SHELL -e
+
+unset extraFlagsArray
+declare -a extraFlagsArray
+
+oldIFS=\$IFS
+IFS=:
+for dir in \$ACLOCAL_PATH; do
+    if test -n "\$dir" -a -d "\$dir"; then
+        extraFlagsArray=("\${extraFlagsArray[@]}" "-I" "\$dir")
+    fi
+done
+IFS=\$oldIFS
+
+exec "$wrapped" "\$@" "\${extraFlagsArray[@]}"
+EOF
+    chmod +x "$program"
+}
+
+postInstall() {
+    # Create a wrapper around `aclocal' that converts every element in
+    # `ACLOCAL_PATH' into a `-I dir' option.  This way `aclocal'
+    # becomes modular; M4 macros do not need to be stored in a single
+    # global directory, while callers of `aclocal' do not need to pass
+    # `-I' options explicitly.
+
+    for prog in $out/bin/aclocal*; do
+        wrapAclocal "$prog"
+    done
+
+    ln -s aclocal-1.11 $out/share/aclocal
+    ln -s automake-1.11 $out/share/automake
+}
+
+genericBuild
diff --git a/nixpkgs/pkgs/development/tools/misc/automake/fix-perl-5.26.patch b/nixpkgs/pkgs/development/tools/misc/automake/fix-perl-5.26.patch
new file mode 100644
index 000000000000..fb2d08de6d81
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/automake/fix-perl-5.26.patch
@@ -0,0 +1,10 @@
+--- automake-1.11.2/automake.in
++++ automake-1.11.2/automake.in
+@@ -4156,7 +4156,7 @@ sub substitute_ac_subst_variables_worker($)
+ sub substitute_ac_subst_variables ($)
+ {
+   my ($text) = @_;
+-  $text =~ s/\${([^ \t=:+{}]+)}/&substitute_ac_subst_variables_worker ($1)/ge;
++  $text =~ s/\$\{([^ \t=:+{}]+)}/&substitute_ac_subst_variables_worker ($1)/ge;
+   return $text;
+ }
diff --git a/nixpkgs/pkgs/development/tools/misc/automake/fix-test-autoconf-2.69.patch b/nixpkgs/pkgs/development/tools/misc/automake/fix-test-autoconf-2.69.patch
new file mode 100644
index 000000000000..2ffa91f24eda
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/automake/fix-test-autoconf-2.69.patch
@@ -0,0 +1,13 @@
+With Autoconf 2.69 (instead of 2.68), config.{guess,sub} are needed.
+
+--- automake-1.11.2/tests/compile_f90_c_cxx.test	2011-12-20 21:56:29.000000000 +0100
++++ automake-1.11.2/tests/compile_f90_c_cxx.test	2012-07-07 13:35:58.000000000 +0200
+@@ -41,7 +41,7 @@ END
+ : > baz.cc
+ 
+ $ACLOCAL
+-$AUTOMAKE
++$AUTOMAKE --add-missing
+ 
+ # Look for the macros at the beginning of rules.  Be careful, as there
+ # are literal tabs at the beginning of the search strings.
diff --git a/nixpkgs/pkgs/development/tools/misc/automake/setup-hook.sh b/nixpkgs/pkgs/development/tools/misc/automake/setup-hook.sh
new file mode 100644
index 000000000000..292632b7cbce
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/automake/setup-hook.sh
@@ -0,0 +1,5 @@
+addAclocals () {
+    addToSearchPathWithCustomDelimiter : ACLOCAL_PATH $1/share/aclocal
+}
+
+addEnvHooks "$hostOffset" addAclocals
diff --git a/nixpkgs/pkgs/development/tools/misc/automoc4/default.nix b/nixpkgs/pkgs/development/tools/misc/automoc4/default.nix
new file mode 100644
index 000000000000..c2bf7e0a831c
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/automoc4/default.nix
@@ -0,0 +1,20 @@
+{ stdenv, fetchurl, cmake, qt4 }:
+
+stdenv.mkDerivation rec {
+  name = "automoc4-0.9.88";
+  
+  src = fetchurl {
+    url = "mirror://kde/stable/automoc4/0.9.88/${name}.tar.bz2";
+    sha256 = "0jackvg0bdjg797qlbbyf9syylm0qjs55mllhn11vqjsq3s1ch93";
+  };
+  
+  buildInputs = [ cmake qt4 ];
+  
+  meta = with stdenv.lib; {
+    homepage = https://techbase.kde.org/Development/Tools/Automoc4;
+    description = "KDE Meta Object Compiler";
+    license = licenses.bsd2;
+    maintainers = [ maintainers.sander ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/avarice/default.nix b/nixpkgs/pkgs/development/tools/misc/avarice/default.nix
new file mode 100644
index 000000000000..a8f6426a3b7b
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/avarice/default.nix
@@ -0,0 +1,24 @@
+{ stdenv, fetchurl, pkgconfig, gcc, perl, libusb }:
+
+stdenv.mkDerivation rec {
+
+  name="avarice-2.13";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/avarice/${name}.tar.bz2";
+    sha256 = "0jhh1h1k5b41v2ycq8kn43nkrkh0b9l7xjmw38rak871g3z3hix1";
+  };
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ gcc perl libusb ];
+
+  meta = {
+    license = stdenv.lib.licenses.gpl2;
+    description = "Translator between GDB's remote debug protocol and the AVR JTAG ICE protocol";
+    homepage = https://sourceforge.net/projects/avarice/files/avarice/;
+    maintainers = [ stdenv.lib.maintainers.smironov ];
+    platforms = stdenv.lib.platforms.linux;
+    broken = true; # 2018-04-10
+  };
+}
+
diff --git a/nixpkgs/pkgs/development/tools/misc/avrdude/default.nix b/nixpkgs/pkgs/development/tools/misc/avrdude/default.nix
new file mode 100644
index 000000000000..39f98ae00284
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/avrdude/default.nix
@@ -0,0 +1,33 @@
+{ stdenv, fetchurl, yacc, flex, libusb, libelf, libftdi1, readline
+# docSupport is a big dependency, disabled by default
+, docSupport ? false, texLive ? null, texinfo ? null, texi2html ? null
+}:
+
+assert docSupport -> texLive != null && texinfo != null && texi2html != null;
+
+stdenv.mkDerivation rec {
+  name = "avrdude-6.3";
+
+  src = fetchurl {
+    url = "mirror://savannah/avrdude/${name}.tar.gz";
+    sha256 = "15m1w1qad3dj7r8n5ng1qqcaiyx1gyd6hnc3p2apgjllccdp77qg";
+  };
+
+  configureFlags = stdenv.lib.optionals docSupport "--enable-doc";
+
+  buildInputs = [ yacc flex libusb libelf libftdi1 readline ]
+    ++ stdenv.lib.optionals docSupport [ texLive texinfo texi2html ];
+
+  meta = with stdenv.lib; {
+    description = "Command-line tool for programming Atmel AVR microcontrollers";
+    longDescription = ''
+      AVRDUDE (AVR Downloader/UploaDEr) is an utility to
+      download/upload/manipulate the ROM and EEPROM contents of AVR
+      microcontrollers using the in-system programming technique (ISP).
+    '';
+    homepage = https://www.nongnu.org/avrdude/;
+    license = licenses.gpl2Plus;
+    platforms = with platforms; linux ++ darwin;
+    maintainers = [ maintainers.bjornfor ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/awf/default.nix b/nixpkgs/pkgs/development/tools/misc/awf/default.nix
new file mode 100644
index 000000000000..8892142ad779
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/awf/default.nix
@@ -0,0 +1,37 @@
+{ stdenv, fetchFromGitHub, autoreconfHook, gtk2, gtk3, pkgconfig
+, wrapGAppsHook }:
+
+stdenv.mkDerivation rec {
+  pname = "awf";
+  version = "1.4.0";
+
+  src = fetchFromGitHub {
+    owner = "valr";
+    repo = "awf";
+    rev = "v${version}";
+    sha256 = "0jl2kxwpvf2n8974zzyp69mqhsbjnjcqm39y0jvijvjb1iy8iman";
+  };
+
+  nativeBuildInputs = [ autoreconfHook pkgconfig wrapGAppsHook ];
+
+  buildInputs = [ gtk2 gtk3 ];
+
+  autoreconfPhase = ''
+    patchShebangs ./autogen.sh
+    ./autogen.sh
+  '';
+
+  meta = with stdenv.lib; {
+    description = "A Widget Factory";
+    longDescription = ''
+      A widget factory is a theme preview application for gtk2 and
+      gtk3. It displays the various widget types provided by gtk2/gtk3
+      in a single window allowing to see the visual effect of the
+      applied theme.
+    '';
+    homepage = https://github.com/valr/awf;
+    license = licenses.gpl3;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ michalrus ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/babeltrace/default.nix b/nixpkgs/pkgs/development/tools/misc/babeltrace/default.nix
new file mode 100644
index 000000000000..19ed711f1f4c
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/babeltrace/default.nix
@@ -0,0 +1,22 @@
+{ stdenv, fetchurl, pkgconfig, glib, libuuid, popt, elfutils }:
+
+stdenv.mkDerivation rec {
+  name = "babeltrace-1.5.7";
+
+  src = fetchurl {
+    url = "https://www.efficios.com/files/babeltrace/${name}.tar.bz2";
+    sha256 = "0yw05cnk5w8b5nbznycglyn4h3hq56a1n8rlb9k9rlzz4ph32lr1";
+  };
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ glib libuuid popt elfutils ];
+
+  meta = with stdenv.lib; {
+    description = "Command-line tool and library to read and convert LTTng tracefiles";
+    homepage = https://www.efficios.com/babeltrace;
+    license = licenses.mit;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.bjornfor ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/bashdb/default.nix b/nixpkgs/pkgs/development/tools/misc/bashdb/default.nix
new file mode 100644
index 000000000000..72848d049303
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/bashdb/default.nix
@@ -0,0 +1,26 @@
+{ stdenv, fetchurl, makeWrapper, python3Packages }:
+
+stdenv.mkDerivation rec {
+  pname = "bashdb";
+  version = "4.4-1.0.0";
+
+  src = fetchurl {
+    url =  "mirror://sourceforge/bashdb/${pname}-${version}.tar.bz2";
+    sha256 = "0p7i7bpzs6q1i7swnkr89kxqgzr146xw8d2acmqwqbslzm9dqlml";
+  };
+
+  nativeBuildInputs = [
+    makeWrapper
+  ];
+
+  postInstall = ''
+    wrapProgram $out/bin/bashdb --prefix PYTHONPATH ":" "$(toPythonPath ${python3Packages.pygments})"
+  '';
+
+  meta = {
+    description = "Bash script debugger";
+    homepage = http://bashdb.sourceforge.net/;
+    license = stdenv.lib.licenses.gpl2;
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/bin_replace_string/default.nix b/nixpkgs/pkgs/development/tools/misc/bin_replace_string/default.nix
new file mode 100644
index 000000000000..c246ddb9d905
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/bin_replace_string/default.nix
@@ -0,0 +1,31 @@
+{ stdenv, fetchurl, libelf, txt2man }:
+
+stdenv.mkDerivation {
+  pname = "bin_replace_string";
+  version = "0.2";
+
+  src = fetchurl {
+    sha256 = "1gnpddxwpsfrg4l76x5yplsvbcdbviybciqpn22yq3g3qgnr5c2a";
+    url = "ftp://ohnopub.net/mirror/bin_replace_string-0.2.tar.bz2";
+  };
+
+  buildInputs = [ libelf ];
+  nativeBuildInputs = [ txt2man ];
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    description = "Edit precompiled binaries";
+    longDescription = ''
+      bin_replace_string edits C-style strings in precompiled binaries. This is
+      intended to be useful to replace arbitrary strings in binaries whose
+      source code is not available. However, because of the nature of compiled
+      binaries, bin_replace_string may only replace a given C-string with a
+      shorter C-string.
+    '';
+    homepage = http://ohnopub.net/~ohnobinki/bin_replace_string/;
+    downloadPage = ftp://ohnopub.net/mirror/;
+    license = licenses.gpl3Plus;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/binutils/0001-x86-Add-a-GNU_PROPERTY_X86_ISA_1_USED-note-if-needed.patch b/nixpkgs/pkgs/development/tools/misc/binutils/0001-x86-Add-a-GNU_PROPERTY_X86_ISA_1_USED-note-if-needed.patch
new file mode 100644
index 000000000000..5a047b0f0703
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/binutils/0001-x86-Add-a-GNU_PROPERTY_X86_ISA_1_USED-note-if-needed.patch
@@ -0,0 +1,517 @@
+From 6737a6b34f4823deb7142f27b4074831a37ac1e1 Mon Sep 17 00:00:00 2001
+From: "H.J. Lu" <hjl.tools@gmail.com>
+Date: Fri, 20 Jul 2018 09:18:47 -0700
+Subject: [PATCH] x86: Add a GNU_PROPERTY_X86_ISA_1_USED note if needed
+
+When -z separate-code, which is enabled by default for Linux/x86, is
+used to create executable, ld won't place any data in the code-only
+PT_LOAD segment.  If there are no data sections placed before the
+code-only PT_LOAD segment, the program headers won't be mapped into
+any PT_LOAD segment.  When the executable tries to access it (based
+on the program header address passed in AT_PHDR), it will lead to
+segfault.  This patch inserts a GNU_PROPERTY_X86_ISA_1_USED note if
+there may be no data sections before the text section so that the
+first PT_LOAD segment won't be code-only and will contain the program
+header.
+
+Testcases are adjusted to either pass "-z noseparate-code" to ld or
+discard the .note.gnu.property section.  A Linux/x86 run-time test is
+added.
+
+bfd/
+
+	PR ld/23428
+	* elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): If the
+	separate code program header is needed, make sure that the first
+	read-only PT_LOAD segment has no code by adding a
+	GNU_PROPERTY_X86_ISA_1_USED note.
+
+ld/
+
+	PR ld/23428
+	* testsuite/ld-elf/linux-x86.S: New file.
+	* testsuite/ld-elf/linux-x86.exp: Likewise.
+	* testsuite/ld-elf/pr23428.c: Likewise.
+	* testsuite/ld-elf/sec64k.exp: Pass "-z noseparate-code" to ld
+	for Linux/x86 targets.
+	* testsuite/ld-i386/abs-iamcu.d: Likewise.
+	* testsuite/ld-i386/abs.d: Likewise.
+	* testsuite/ld-i386/pr12718.d: Likewise.
+	* testsuite/ld-i386/pr12921.d: Likewise.
+	* testsuite/ld-x86-64/abs-k1om.d: Likewise.
+	* testsuite/ld-x86-64/abs-l1om.d: Likewise.
+	* testsuite/ld-x86-64/abs.d: Likewise.
+	* testsuite/ld-x86-64/pr12718.d: Likewise.
+	* testsuite/ld-x86-64/pr12921.d: Likewise.
+	* testsuite/ld-linkonce/zeroeh.ld: Discard .note.gnu.property
+	section.
+	* testsuite/ld-scripts/print-memory-usage.t: Likewise.
+	* testsuite/ld-scripts/size-2.t: Likewise.
+	* testsuite/lib/ld-lib.exp (run_ld_link_exec_tests): Use ld
+	to create executable if language is "asm".
+
+(cherry picked from commit 241e64e3b42cd9eba514b8e0ad2ef39a337f10a5)
+---
+ bfd/elfxx-x86.c                              | 60 ++++++++++++++-----
+ ld/testsuite/ld-elf/linux-x86.S              | 63 ++++++++++++++++++++
+ ld/testsuite/ld-elf/linux-x86.exp            | 46 ++++++++++++++
+ ld/testsuite/ld-elf/pr23428.c                | 43 +++++++++++++
+ ld/testsuite/ld-elf/sec64k.exp               |  2 +
+ ld/testsuite/ld-i386/abs-iamcu.d             |  2 +-
+ ld/testsuite/ld-i386/abs.d                   |  2 +-
+ ld/testsuite/ld-i386/pr12718.d               |  2 +-
+ ld/testsuite/ld-i386/pr12921.d               |  2 +-
+ ld/testsuite/ld-linkonce/zeroeh.ld           |  1 +
+ ld/testsuite/ld-scripts/print-memory-usage.t |  2 +
+ ld/testsuite/ld-scripts/size-2.t             |  1 +
+ ld/testsuite/ld-x86-64/abs-k1om.d            |  2 +-
+ ld/testsuite/ld-x86-64/abs-l1om.d            |  2 +-
+ ld/testsuite/ld-x86-64/abs.d                 |  2 +-
+ ld/testsuite/ld-x86-64/pr12718.d             |  2 +-
+ ld/testsuite/ld-x86-64/pr12921.d             |  2 +-
+ ld/testsuite/lib/ld-lib.exp                  |  5 +-
+ 20 files changed, 248 insertions(+), 25 deletions(-)
+ create mode 100644 ld/testsuite/ld-elf/linux-x86.S
+ create mode 100644 ld/testsuite/ld-elf/linux-x86.exp
+ create mode 100644 ld/testsuite/ld-elf/pr23428.c
+
+diff --git a/bfd/elfxx-x86.c b/bfd/elfxx-x86.c
+index a2497aab86..2e4ff88f1f 100644
+--- a/bfd/elfxx-x86.c
++++ b/bfd/elfxx-x86.c
+@@ -2524,6 +2524,7 @@ _bfd_x86_elf_link_setup_gnu_properties
+   const struct elf_backend_data *bed;
+   unsigned int class_align = ABI_64_P (info->output_bfd) ? 3 : 2;
+   unsigned int got_align;
++  bfd_boolean has_text = FALSE;
+ 
+   features = 0;
+   if (info->ibt)
+@@ -2538,24 +2539,59 @@ _bfd_x86_elf_link_setup_gnu_properties
+     if (bfd_get_flavour (pbfd) == bfd_target_elf_flavour
+ 	&& bfd_count_sections (pbfd) != 0)
+       {
++	if (!has_text)
++	  {
++	    /* Check if there is no non-empty text section.  */
++	    sec = bfd_get_section_by_name (pbfd, ".text");
++	    if (sec != NULL && sec->size != 0)
++	      has_text = TRUE;
++	  }
++
+ 	ebfd = pbfd;
+ 
+ 	if (elf_properties (pbfd) != NULL)
+ 	  break;
+       }
+ 
+-  if (ebfd != NULL && features)
++  bed = get_elf_backend_data (info->output_bfd);
++
++  htab = elf_x86_hash_table (info, bed->target_id);
++  if (htab == NULL)
++    return pbfd;
++
++  if (ebfd != NULL)
+     {
+-      /* If features is set, add GNU_PROPERTY_X86_FEATURE_1_IBT and
+-	 GNU_PROPERTY_X86_FEATURE_1_SHSTK.  */
+-      prop = _bfd_elf_get_property (ebfd,
+-				    GNU_PROPERTY_X86_FEATURE_1_AND,
+-				    4);
+-      prop->u.number |= features;
+-      prop->pr_kind = property_number;
++      prop = NULL;
++      if (features)
++	{
++	  /* If features is set, add GNU_PROPERTY_X86_FEATURE_1_IBT and
++	     GNU_PROPERTY_X86_FEATURE_1_SHSTK.  */
++	  prop = _bfd_elf_get_property (ebfd,
++					GNU_PROPERTY_X86_FEATURE_1_AND,
++					4);
++	  prop->u.number |= features;
++	  prop->pr_kind = property_number;
++	}
++      else if (has_text
++	       && elf_properties (ebfd) == NULL
++	       && elf_tdata (info->output_bfd)->o->build_id.sec == NULL
++	       && !htab->elf.dynamic_sections_created
++	       && !info->traditional_format
++	       && (info->output_bfd->flags & D_PAGED) != 0
++	       && info->separate_code)
++	{
++	  /* If the separate code program header is needed, make sure
++	     that the first read-only PT_LOAD segment has no code by
++	     adding a GNU_PROPERTY_X86_ISA_1_USED note.  */
++	  prop = _bfd_elf_get_property (ebfd,
++					GNU_PROPERTY_X86_ISA_1_USED,
++					4);
++	  prop->u.number = GNU_PROPERTY_X86_ISA_1_486;
++	  prop->pr_kind = property_number;
++	}
+ 
+       /* Create the GNU property note section if needed.  */
+-      if (pbfd == NULL)
++      if (prop != NULL && pbfd == NULL)
+ 	{
+ 	  sec = bfd_make_section_with_flags (ebfd,
+ 					     NOTE_GNU_PROPERTY_SECTION_NAME,
+@@ -2581,12 +2617,6 @@ error_alignment:
+ 
+   pbfd = _bfd_elf_link_setup_gnu_properties (info);
+ 
+-  bed = get_elf_backend_data (info->output_bfd);
+-
+-  htab = elf_x86_hash_table (info, bed->target_id);
+-  if (htab == NULL)
+-    return pbfd;
+-
+   htab->r_info = init_table->r_info;
+   htab->r_sym = init_table->r_sym;
+ 
+diff --git a/ld/testsuite/ld-elf/linux-x86.S b/ld/testsuite/ld-elf/linux-x86.S
+new file mode 100644
+index 0000000000..bdf40c6e01
+--- /dev/null
++++ b/ld/testsuite/ld-elf/linux-x86.S
+@@ -0,0 +1,63 @@
++	.text
++	.globl _start
++	.type _start,@function
++	.p2align 4
++_start:
++	xorl %ebp, %ebp
++#ifdef __LP64__
++	popq %rdi
++	movq %rsp, %rsi
++	andq  $~15, %rsp
++#elif defined __x86_64__
++	mov (%rsp),%edi
++	addl $4,%esp
++	movl %esp, %esi
++	andl  $~15, %esp
++#else
++	popl %esi
++	movl %esp, %ecx
++	andl  $~15, %esp
++
++	subl $8,%esp
++	pushl %ecx
++	pushl %esi
++#endif
++
++	call main
++
++	hlt
++
++	.type syscall,  @function
++	.globl syscall
++	.p2align 4
++syscall:
++#ifdef __x86_64__
++	movq %rdi, %rax		/* Syscall number -> rax.  */
++	movq %rsi, %rdi		/* shift arg1 - arg5.  */
++	movq %rdx, %rsi
++	movq %rcx, %rdx
++	movq %r8, %r10
++	movq %r9, %r8
++	movq 8(%rsp),%r9	/* arg6 is on the stack.  */
++	syscall			/* Do the system call.  */
++#else
++	push %ebp
++	push %edi
++	push %esi
++	push %ebx
++	mov 0x2c(%esp),%ebp
++	mov 0x28(%esp),%edi
++	mov 0x24(%esp),%esi
++	mov 0x20(%esp),%edx
++	mov 0x1c(%esp),%ecx
++	mov 0x18(%esp),%ebx
++	mov 0x14(%esp),%eax
++	int $0x80
++	pop %ebx
++	pop %esi
++	pop %edi
++	pop %ebp
++#endif
++	ret			/* Return to caller.  */
++	.size syscall, .-syscall
++	.section .note.GNU-stack,"",@progbits
+diff --git a/ld/testsuite/ld-elf/linux-x86.exp b/ld/testsuite/ld-elf/linux-x86.exp
+new file mode 100644
+index 0000000000..36217c6fb4
+--- /dev/null
++++ b/ld/testsuite/ld-elf/linux-x86.exp
+@@ -0,0 +1,46 @@
++# Expect script for simple native Linux/x86 tests.
++#   Copyright (C) 2018 Free Software Foundation, Inc.
++#
++# This file is part of the GNU Binutils.
++#
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
++# MA 02110-1301, USA.
++#
++
++# Test very simple native Linux/x86 programs with linux-x86.S.
++if { ![isnative] || [which $CC] == 0 \
++     || (![istarget "i?86-*-linux*"] \
++         && ![istarget "x86_64-*-linux*"] \
++         && ![istarget "amd64-*-linux*"]) } {
++    return
++}
++
++# Add $PLT_CFLAGS if PLT is expected.
++global PLT_CFLAGS
++# Add $NOPIE_CFLAGS and $NOPIE_LDFLAGS if non-PIE is required.
++global NOPIE_CFLAGS NOPIE_LDFLAGS
++
++run_ld_link_exec_tests [list \
++    [list \
++	"Run PR ld/23428 test" \
++	"--no-dynamic-linker -z separate-code" \
++	"" \
++	{ linux-x86.S pr23428.c } \
++	"pr23428" \
++	"pass.out" \
++	"$NOPIE_CFLAGS -fno-asynchronous-unwind-tables" \
++	"asm" \
++    ] \
++]
+diff --git a/ld/testsuite/ld-elf/pr23428.c b/ld/testsuite/ld-elf/pr23428.c
+new file mode 100644
+index 0000000000..3631ed7926
+--- /dev/null
++++ b/ld/testsuite/ld-elf/pr23428.c
+@@ -0,0 +1,43 @@
++#include <unistd.h>
++#include <link.h>
++#include <syscall.h>
++
++#define STRING_COMMA_LEN(STR) (STR), (sizeof (STR) - 1)
++
++int
++main (int argc, char **argv)
++{
++  char **ev = &argv[argc + 1];
++  char **evp = ev;
++  ElfW(auxv_t) *av;
++  const ElfW(Phdr) *phdr = NULL;
++  size_t phnum = 0;
++  size_t loadnum = 0;
++  int fd = STDOUT_FILENO;
++  size_t i;
++
++  while (*evp++ != NULL)
++    ;
++
++  av = (ElfW(auxv_t) *) evp;
++
++  for (; av->a_type != AT_NULL; ++av)
++    switch (av->a_type)
++      {
++      case AT_PHDR:
++	phdr = (const void *) av->a_un.a_val;
++	break;
++      case AT_PHNUM:
++	phnum = av->a_un.a_val;
++	break;
++      }
++
++  for (i = 0; i < phnum; i++, phdr++)
++    if (phdr->p_type == PT_LOAD)
++      loadnum++;
++
++  syscall (SYS_write, fd, STRING_COMMA_LEN ("PASS\n"));
++
++  syscall (SYS_exit, !loadnum);
++  return 0;
++}
+diff --git a/ld/testsuite/ld-elf/sec64k.exp b/ld/testsuite/ld-elf/sec64k.exp
+index b58139e9dd..3909c0eaa1 100644
+--- a/ld/testsuite/ld-elf/sec64k.exp
++++ b/ld/testsuite/ld-elf/sec64k.exp
+@@ -177,6 +177,8 @@ if { ![istarget "d10v-*-*"]
+     foreach sfile $sfiles { puts $ofd "#source: $sfile" }
+     if { [istarget spu*-*-*] } {
+ 	puts $ofd "#ld: --local-store 0:0"
++    } elseif { [istarget "i?86-*-linux*"] || [istarget "x86_64-*-linux*"] } {
++	puts $ofd "#ld: -z noseparate-code"
+     } else {
+ 	puts $ofd "#ld:"
+     }
+diff --git a/ld/testsuite/ld-i386/abs-iamcu.d b/ld/testsuite/ld-i386/abs-iamcu.d
+index ac9beff2e5..aba7d6b03f 100644
+--- a/ld/testsuite/ld-i386/abs-iamcu.d
++++ b/ld/testsuite/ld-i386/abs-iamcu.d
+@@ -2,7 +2,7 @@
+ #source: abs.s
+ #source: zero.s
+ #as: --32 -march=iamcu
+-#ld: -m elf_iamcu
++#ld: -m elf_iamcu -z noseparate-code
+ #objdump: -rs -j .text
+ 
+ .*:     file format .*
+diff --git a/ld/testsuite/ld-i386/abs.d b/ld/testsuite/ld-i386/abs.d
+index e660aca524..191ee4456a 100644
+--- a/ld/testsuite/ld-i386/abs.d
++++ b/ld/testsuite/ld-i386/abs.d
+@@ -2,7 +2,7 @@
+ #as: --32
+ #source: abs.s
+ #source: zero.s
+-#ld: -melf_i386
++#ld: -melf_i386 -z noseparate-code
+ #objdump: -rs
+ 
+ .*:     file format .*
+diff --git a/ld/testsuite/ld-i386/pr12718.d b/ld/testsuite/ld-i386/pr12718.d
+index ec51540a42..7eba52d95e 100644
+--- a/ld/testsuite/ld-i386/pr12718.d
++++ b/ld/testsuite/ld-i386/pr12718.d
+@@ -1,6 +1,6 @@
+ #name: PR ld/12718
+ #as: --32
+-#ld: -melf_i386
++#ld: -melf_i386 -z noseparate-code
+ #readelf: -S
+ 
+ There are 5 section headers, starting at offset 0x[0-9a-f]+:
+diff --git a/ld/testsuite/ld-i386/pr12921.d b/ld/testsuite/ld-i386/pr12921.d
+index e49079b3c8..ea2da3eb51 100644
+--- a/ld/testsuite/ld-i386/pr12921.d
++++ b/ld/testsuite/ld-i386/pr12921.d
+@@ -1,6 +1,6 @@
+ #name: PR ld/12921
+ #as: --32
+-#ld: -melf_i386
++#ld: -melf_i386 -z noseparate-code
+ #readelf: -S --wide
+ 
+ There are 7 section headers, starting at offset 0x[0-9a-f]+:
+diff --git a/ld/testsuite/ld-linkonce/zeroeh.ld b/ld/testsuite/ld-linkonce/zeroeh.ld
+index b22eaa12c9..f89855a08f 100644
+--- a/ld/testsuite/ld-linkonce/zeroeh.ld
++++ b/ld/testsuite/ld-linkonce/zeroeh.ld
+@@ -2,4 +2,5 @@ SECTIONS {
+  .text 0xa00 : { *(.text); *(.gnu.linkonce.t.*) }
+  .gcc_except_table 0x2000 : { *(.gcc_except_table) }
+  .eh_frame 0x4000 : { *(.eh_frame) }
++  /DISCARD/ : { *(.note.gnu.property) }
+ }
+diff --git a/ld/testsuite/ld-scripts/print-memory-usage.t b/ld/testsuite/ld-scripts/print-memory-usage.t
+index 5ff057a5e3..6eda1d2dc4 100644
+--- a/ld/testsuite/ld-scripts/print-memory-usage.t
++++ b/ld/testsuite/ld-scripts/print-memory-usage.t
+@@ -11,4 +11,6 @@ SECTIONS
+     *(.data)
+     *(.rw)
+   }
++
++  /DISCARD/ : { *(.note.gnu.property) }
+ }
+diff --git a/ld/testsuite/ld-scripts/size-2.t b/ld/testsuite/ld-scripts/size-2.t
+index 723863995e..c3c4eddab4 100644
+--- a/ld/testsuite/ld-scripts/size-2.t
++++ b/ld/testsuite/ld-scripts/size-2.t
+@@ -18,4 +18,5 @@ SECTIONS
+     LONG (SIZEOF (.tdata))
+     LONG (SIZEOF (.tbss))
+   } :image
++  /DISCARD/ : { *(.note.gnu.property) }
+ }
+diff --git a/ld/testsuite/ld-x86-64/abs-k1om.d b/ld/testsuite/ld-x86-64/abs-k1om.d
+index 2c26639fc0..6b0fde0eed 100644
+--- a/ld/testsuite/ld-x86-64/abs-k1om.d
++++ b/ld/testsuite/ld-x86-64/abs-k1om.d
+@@ -2,7 +2,7 @@
+ #source: ../ld-i386/abs.s
+ #source: ../ld-i386/zero.s
+ #as: --64 -march=k1om
+-#ld: -m elf_k1om
++#ld: -m elf_k1om -z noseparate-code
+ #objdump: -rs -j .text
+ 
+ .*:     file format .*
+diff --git a/ld/testsuite/ld-x86-64/abs-l1om.d b/ld/testsuite/ld-x86-64/abs-l1om.d
+index 1fb96d44b7..f87869f9d0 100644
+--- a/ld/testsuite/ld-x86-64/abs-l1om.d
++++ b/ld/testsuite/ld-x86-64/abs-l1om.d
+@@ -2,7 +2,7 @@
+ #source: ../ld-i386/abs.s
+ #source: ../ld-i386/zero.s
+ #as: --64 -march=l1om
+-#ld: -m elf_l1om
++#ld: -m elf_l1om -z noseparate-code
+ #objdump: -rs -j .text
+ #target: x86_64-*-linux*
+ 
+diff --git a/ld/testsuite/ld-x86-64/abs.d b/ld/testsuite/ld-x86-64/abs.d
+index b24b018639..d99ab4685d 100644
+--- a/ld/testsuite/ld-x86-64/abs.d
++++ b/ld/testsuite/ld-x86-64/abs.d
+@@ -1,7 +1,7 @@
+ #name: Absolute non-overflowing relocs
+ #source: ../ld-i386/abs.s
+ #source: ../ld-i386/zero.s
+-#ld:
++#ld: -z noseparate-code
+ #objdump: -rs
+ 
+ .*:     file format .*
+diff --git a/ld/testsuite/ld-x86-64/pr12718.d b/ld/testsuite/ld-x86-64/pr12718.d
+index 07d17325d0..2c503ffbaa 100644
+--- a/ld/testsuite/ld-x86-64/pr12718.d
++++ b/ld/testsuite/ld-x86-64/pr12718.d
+@@ -1,6 +1,6 @@
+ #name: PR ld/12718
+ #as: --64
+-#ld: -melf_x86_64
++#ld: -melf_x86_64 -z noseparate-code
+ #readelf: -S --wide
+ 
+ There are 5 section headers, starting at offset 0x[0-9a-f]+:
+diff --git a/ld/testsuite/ld-x86-64/pr12921.d b/ld/testsuite/ld-x86-64/pr12921.d
+index 6fe6abee09..1162d55818 100644
+--- a/ld/testsuite/ld-x86-64/pr12921.d
++++ b/ld/testsuite/ld-x86-64/pr12921.d
+@@ -1,6 +1,6 @@
+ #name: PR ld/12921
+ #as: --64
+-#ld: -melf_x86_64
++#ld: -melf_x86_64 -z noseparate-code
+ #readelf: -S --wide
+ 
+ There are 7 section headers, starting at offset 0x[0-9a-f]+:
+diff --git a/ld/testsuite/lib/ld-lib.exp b/ld/testsuite/lib/ld-lib.exp
+index cfbefe9028..1095091882 100644
+--- a/ld/testsuite/lib/ld-lib.exp
++++ b/ld/testsuite/lib/ld-lib.exp
+@@ -1482,7 +1482,10 @@ proc run_ld_link_exec_tests { ldtests args } {
+ 	    continue
+ 	}
+ 
+-	if { [ string match "c++" $lang ] } {
++	if { [ string match "asm" $lang ] } {
++	    set link_proc ld_link
++	    set link_cmd $ld
++	} elseif { [ string match "c++" $lang ] } {
+ 	    set link_proc ld_link
+ 	    set link_cmd $CXX
+ 	} else {
+-- 
+2.20.1
+
diff --git a/nixpkgs/pkgs/development/tools/misc/binutils/0001-x86-Properly-add-X86_ISA_1_NEEDED-property.patch b/nixpkgs/pkgs/development/tools/misc/binutils/0001-x86-Properly-add-X86_ISA_1_NEEDED-property.patch
new file mode 100644
index 000000000000..ca50d9a57cd1
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/binutils/0001-x86-Properly-add-X86_ISA_1_NEEDED-property.patch
@@ -0,0 +1,137 @@
+From 28a27bdbb9500797e6767f80c8128b09112aeed5 Mon Sep 17 00:00:00 2001
+From: "H.J. Lu" <hjl.tools@gmail.com>
+Date: Sat, 11 Aug 2018 06:41:33 -0700
+Subject: [PATCH] x86: Properly add X86_ISA_1_NEEDED property
+
+Existing properties may be removed during property merging.  We avoid
+adding X86_ISA_1_NEEDED property only if existing properties won't be
+removed.
+
+bfd/
+
+	PR ld/23428
+	* elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Don't
+	add X86_ISA_1_NEEDED property only if existing properties won't
+	be removed.
+
+ld/
+
+	PR ld/23428
+	* testsuite/ld-elf/dummy.s: New file.
+	* testsuite/ld-elf/linux-x86.S: Add X86_FEATURE_1_AND property.
+	* testsuite/ld-elf/linux-x86.exp: Add dummy.s to pr23428.
+
+(cherry picked from commit ab9e342807d132182892de1be1a92d6e91a5c1da)
+---
+ bfd/elfxx-x86.c                   | 28 ++++++++++++++++++++++------
+ ld/testsuite/ld-elf/dummy.s       |  1 +
+ ld/testsuite/ld-elf/linux-x86.S   | 28 ++++++++++++++++++++++++++++
+ ld/testsuite/ld-elf/linux-x86.exp |  2 +-
+ 6 files changed, 66 insertions(+), 7 deletions(-)
+ create mode 100644 ld/testsuite/ld-elf/dummy.s
+
+diff --git a/bfd/elfxx-x86.c b/bfd/elfxx-x86.c
+index 7ccfd25815..2d8f7b640b 100644
+--- a/bfd/elfxx-x86.c
++++ b/bfd/elfxx-x86.c
+@@ -2588,7 +2588,6 @@ _bfd_x86_elf_link_setup_gnu_properties
+ 	  prop->pr_kind = property_number;
+ 	}
+       else if (has_text
+-	       && elf_properties (ebfd) == NULL
+ 	       && elf_tdata (info->output_bfd)->o->build_id.sec == NULL
+ 	       && !htab->elf.dynamic_sections_created
+ 	       && !info->traditional_format
+@@ -2598,11 +2597,28 @@ _bfd_x86_elf_link_setup_gnu_properties
+ 	  /* If the separate code program header is needed, make sure
+ 	     that the first read-only PT_LOAD segment has no code by
+ 	     adding a GNU_PROPERTY_X86_ISA_1_NEEDED note.  */
+-	  prop = _bfd_elf_get_property (ebfd,
+-					GNU_PROPERTY_X86_ISA_1_NEEDED,
+-					4);
+-	  prop->u.number = GNU_PROPERTY_X86_ISA_1_486;
+-	  prop->pr_kind = property_number;
++	  elf_property_list *list;
++	  bfd_boolean need_property = TRUE;
++
++	  for (list = elf_properties (ebfd); list; list = list->next)
++	    switch (list->property.pr_type)
++	      {
++	      case GNU_PROPERTY_STACK_SIZE:
++	      case GNU_PROPERTY_NO_COPY_ON_PROTECTED:
++	      case GNU_PROPERTY_X86_ISA_1_NEEDED:
++		/* These properties won't be removed during merging.  */
++		need_property = FALSE;
++		break;
++	      }
++
++	  if (need_property)
++	    {
++	      prop = _bfd_elf_get_property (ebfd,
++					    GNU_PROPERTY_X86_ISA_1_NEEDED,
++					    4);
++	      prop->u.number = GNU_PROPERTY_X86_ISA_1_486;
++	      prop->pr_kind = property_number;
++	    }
+ 	}
+ 
+       /* Create the GNU property note section if needed.  */
+diff --git a/ld/testsuite/ld-elf/dummy.s b/ld/testsuite/ld-elf/dummy.s
+new file mode 100644
+index 0000000000..403f98000d
+--- /dev/null
++++ b/ld/testsuite/ld-elf/dummy.s
+@@ -0,0 +1 @@
++# Dummy
+diff --git a/ld/testsuite/ld-elf/linux-x86.S b/ld/testsuite/ld-elf/linux-x86.S
+index bdf40c6e01..d94abc1106 100644
+--- a/ld/testsuite/ld-elf/linux-x86.S
++++ b/ld/testsuite/ld-elf/linux-x86.S
+@@ -61,3 +61,31 @@ syscall:
+ 	ret			/* Return to caller.  */
+ 	.size syscall, .-syscall
+ 	.section .note.GNU-stack,"",@progbits
++
++	.section ".note.gnu.property", "a"
++#ifdef __LP64__
++	.p2align 3
++#else
++	.p2align 2
++#endif
++	.long 1f - 0f		/* name length */
++	.long 5f - 2f		/* data length */
++	.long 5			/* note type */
++0:	.asciz "GNU"		/* vendor name */
++1:
++#ifdef __LP64__
++	.p2align 3
++#else
++	.p2align 2
++#endif
++2:	.long 0xc0000002	/* pr_type.  */
++	.long 4f - 3f		/* pr_datasz.  */
++3:
++	.long 0x2
++4:
++#ifdef __LP64__
++	.p2align 3
++#else
++	.p2align 2
++#endif
++5:
+diff --git a/ld/testsuite/ld-elf/linux-x86.exp b/ld/testsuite/ld-elf/linux-x86.exp
+index 36217c6fb4..f6f5a80853 100644
+--- a/ld/testsuite/ld-elf/linux-x86.exp
++++ b/ld/testsuite/ld-elf/linux-x86.exp
+@@ -37,7 +37,7 @@ run_ld_link_exec_tests [list \
+ 	"Run PR ld/23428 test" \
+ 	"--no-dynamic-linker -z separate-code" \
+ 	"" \
+-	{ linux-x86.S pr23428.c } \
++	{ linux-x86.S pr23428.c dummy.s } \
+ 	"pr23428" \
+ 	"pass.out" \
+ 	"$NOPIE_CFLAGS -fno-asynchronous-unwind-tables" \
+-- 
+2.20.1
+
diff --git a/nixpkgs/pkgs/development/tools/misc/binutils/0001-x86-Properly-merge-GNU_PROPERTY_X86_ISA_1_USED.patch b/nixpkgs/pkgs/development/tools/misc/binutils/0001-x86-Properly-merge-GNU_PROPERTY_X86_ISA_1_USED.patch
new file mode 100644
index 000000000000..866d6db8ce24
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/binutils/0001-x86-Properly-merge-GNU_PROPERTY_X86_ISA_1_USED.patch
@@ -0,0 +1,583 @@
+From d55c3e36094f06bb1fb02f5eac19fdccf1d91f7e Mon Sep 17 00:00:00 2001
+From: "H.J. Lu" <hjl.tools@gmail.com>
+Date: Wed, 8 Aug 2018 06:09:15 -0700
+Subject: [PATCH] x86: Properly merge GNU_PROPERTY_X86_ISA_1_USED
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Without the GNU_PROPERTY_X86_ISA_1_USED property, all ISAs may be used.
+If a bit in the GNU_PROPERTY_X86_ISA_1_USED property is unset, the
+corresponding x86 instruction set isn’t used.  When merging properties
+from 2 input files and one input file doesn't have the
+GNU_PROPERTY_X86_ISA_1_USED property, the output file shouldn't have
+it neither.  This patch removes the GNU_PROPERTY_X86_ISA_1_USED
+property if an input file doesn't have it.
+
+This patch replaces the GNU_PROPERTY_X86_ISA_1_USED property with the
+GNU_PROPERTY_X86_ISA_1_NEEDED property which is the minimum ISA
+requirement.
+
+bfd/
+
+	PR ld/23486
+	* elfxx-x86.c (_bfd_x86_elf_merge_gnu_properties): Remove
+	GNU_PROPERTY_X86_ISA_1_USED if an input file doesn't have it.
+	(_bfd_x86_elf_link_setup_gnu_properties): Adding the
+	GNU_PROPERTY_X86_ISA_1_NEEDED, instead of
+	GNU_PROPERTY_X86_ISA_1_USED, property.
+
+ld/
+
+	PR ld/23486
+	* testsuite/ld-i386/i386.exp: Run PR ld/23486 tests.
+	* testsuite/ld-x86-64/x86-64.exp: Likewise.
+	* testsuite/ld-i386/pr23486a.d: New file.
+	* testsuite/ld-i386/pr23486b.d: Likewise.
+	* testsuite/ld-x86-64/pr23486a-x32.d: Likewise.
+	* testsuite/ld-x86-64/pr23486a.d: Likewise.
+	* testsuite/ld-x86-64/pr23486a.s: Likewise.
+	* testsuite/ld-x86-64/pr23486b-x32.d: Likewise.
+	* testsuite/ld-x86-64/pr23486b.d: Likewise.
+	* testsuite/ld-x86-64/pr23486b.s: Likewise.
+	* testsuite/ld-i386/property-3.r: Remove "x86 ISA used".
+	* testsuite/ld-i386/property-4.r: Likewise.
+	* testsuite/ld-i386/property-5.r: Likewise.
+	* testsuite/ld-i386/property-x86-ibt3a.d: Likewise.
+	* testsuite/ld-i386/property-x86-ibt3b.d: Likewise.
+	* testsuite/ld-i386/property-x86-shstk3a.d: Likewise.
+	* testsuite/ld-i386/property-x86-shstk3b.d: Likewise.
+	* testsuite/ld-x86-64/property-3.r: Likewise.
+	* testsuite/ld-x86-64/property-4.r: Likewise.
+	* testsuite/ld-x86-64/property-5.r: Likewise.
+	* testsuite/ld-x86-64/property-x86-ibt3a-x32.d: Likewise.
+	* testsuite/ld-x86-64/property-x86-ibt3a.d: Likewise.
+	* testsuite/ld-x86-64/property-x86-ibt3b-x32.d: Likewise.
+	* testsuite/ld-x86-64/property-x86-ibt3b.d: Likewise.
+	* testsuite/ld-x86-64/property-x86-shstk3a-x32.d: Likewise.
+	* testsuite/ld-x86-64/property-x86-shstk3a.d: Likewise.
+	* testsuite/ld-x86-64/property-x86-shstk3b-x32.d: Likewise.
+	* testsuite/ld-x86-64/property-x86-shstk3b.d: Likewise.
+
+(cherry picked from commit f7309df20c4e787041cedc4a6aced89c15259e54)
+---
+ bfd/elfxx-x86.c                               | 25 ++++++++++++---
+ ld/testsuite/ld-i386/i386.exp                 |  2 ++
+ ld/testsuite/ld-i386/pr23486a.d               | 10 ++++++
+ ld/testsuite/ld-i386/pr23486b.d               | 10 ++++++
+ ld/testsuite/ld-i386/property-3.r             |  1 -
+ ld/testsuite/ld-i386/property-4.r             |  1 -
+ ld/testsuite/ld-i386/property-5.r             |  1 -
+ ld/testsuite/ld-i386/property-x86-ibt3a.d     |  5 ++-
+ ld/testsuite/ld-i386/property-x86-ibt3b.d     |  5 ++-
+ ld/testsuite/ld-i386/property-x86-shstk3a.d   |  5 ++-
+ ld/testsuite/ld-i386/property-x86-shstk3b.d   |  5 ++-
+ ld/testsuite/ld-x86-64/pr23486a-x32.d         | 10 ++++++
+ ld/testsuite/ld-x86-64/pr23486a.d             | 10 ++++++
+ ld/testsuite/ld-x86-64/pr23486a.s             | 30 +++++++++++++++++
+ ld/testsuite/ld-x86-64/pr23486b-x32.d         | 10 ++++++
+ ld/testsuite/ld-x86-64/pr23486b.d             | 10 ++++++
+ ld/testsuite/ld-x86-64/pr23486b.s             | 30 +++++++++++++++++
+ ld/testsuite/ld-x86-64/property-3.r           |  1 -
+ ld/testsuite/ld-x86-64/property-4.r           |  1 -
+ ld/testsuite/ld-x86-64/property-5.r           |  1 -
+ .../ld-x86-64/property-x86-ibt3a-x32.d        |  5 ++-
+ ld/testsuite/ld-x86-64/property-x86-ibt3a.d   |  5 ++-
+ .../ld-x86-64/property-x86-ibt3b-x32.d        |  5 ++-
+ ld/testsuite/ld-x86-64/property-x86-ibt3b.d   |  5 ++-
+ .../ld-x86-64/property-x86-shstk3a-x32.d      |  5 ++-
+ ld/testsuite/ld-x86-64/property-x86-shstk3a.d |  5 ++-
+ .../ld-x86-64/property-x86-shstk3b-x32.d      |  5 ++-
+ ld/testsuite/ld-x86-64/property-x86-shstk3b.d |  5 ++-
+ ld/testsuite/ld-x86-64/x86-64.exp             |  4 +++
+ 31 files changed, 211 insertions(+), 47 deletions(-)
+ create mode 100644 ld/testsuite/ld-i386/pr23486a.d
+ create mode 100644 ld/testsuite/ld-i386/pr23486b.d
+ create mode 100644 ld/testsuite/ld-x86-64/pr23486a-x32.d
+ create mode 100644 ld/testsuite/ld-x86-64/pr23486a.d
+ create mode 100644 ld/testsuite/ld-x86-64/pr23486a.s
+ create mode 100644 ld/testsuite/ld-x86-64/pr23486b-x32.d
+ create mode 100644 ld/testsuite/ld-x86-64/pr23486b.d
+ create mode 100644 ld/testsuite/ld-x86-64/pr23486b.s
+
+--- a/bfd/elfxx-x86.c
++++ b/bfd/elfxx-x86.c
+@@ -2407,12 +2407,27 @@ _bfd_x86_elf_merge_gnu_properties (struct bfd_link_info *info,
+   switch (pr_type)
+     {
+     case GNU_PROPERTY_X86_ISA_1_USED:
++      if (aprop == NULL || bprop == NULL)
++	{
++	  /* Only one of APROP and BPROP can be NULL.  */
++	  if (aprop != NULL)
++	    {
++	      /* Remove this property since the other input file doesn't
++		 have it.  */
++	      aprop->pr_kind = property_remove;
++	      updated = TRUE;
++	    }
++	  break;
++	}
++      goto or_property;
++
+     case GNU_PROPERTY_X86_ISA_1_NEEDED:
+       if (aprop != NULL && bprop != NULL)
+ 	{
++or_property:
+ 	  number = aprop->u.number;
+ 	  aprop->u.number = number | bprop->u.number;
+-	  /* Remove the property if ISA bits are empty.  */
++	  /* Remove the property if all bits are empty.  */
+ 	  if (aprop->u.number == 0)
+ 	    {
+ 	      aprop->pr_kind = property_remove;
+@@ -2428,14 +2443,14 @@ _bfd_x86_elf_merge_gnu_properties (struct bfd_link_info *info,
+ 	    {
+ 	      if (aprop->u.number == 0)
+ 		{
+-		  /* Remove APROP if ISA bits are empty.  */
++		  /* Remove APROP if all bits are empty.  */
+ 		  aprop->pr_kind = property_remove;
+ 		  updated = TRUE;
+ 		}
+ 	    }
+ 	  else
+ 	    {
+-	      /* Return TRUE if APROP is NULL and ISA bits of BPROP
++	      /* Return TRUE if APROP is NULL and all bits of BPROP
+ 		 aren't empty to indicate that BPROP should be added
+ 		 to ABFD.  */
+ 	      updated = bprop->u.number != 0;
+@@ -2582,9 +2597,9 @@ _bfd_x86_elf_link_setup_gnu_properties
+ 	{
+ 	  /* If the separate code program header is needed, make sure
+ 	     that the first read-only PT_LOAD segment has no code by
+-	     adding a GNU_PROPERTY_X86_ISA_1_USED note.  */
++	     adding a GNU_PROPERTY_X86_ISA_1_NEEDED note.  */
+ 	  prop = _bfd_elf_get_property (ebfd,
+-					GNU_PROPERTY_X86_ISA_1_USED,
++					GNU_PROPERTY_X86_ISA_1_NEEDED,
+ 					4);
+ 	  prop->u.number = GNU_PROPERTY_X86_ISA_1_486;
+ 	  prop->pr_kind = property_number;
+diff --git a/ld/testsuite/ld-i386/i386.exp b/ld/testsuite/ld-i386/i386.exp
+index 6d794fe653..78dad02579 100644
+--- a/ld/testsuite/ld-i386/i386.exp
++++ b/ld/testsuite/ld-i386/i386.exp
+@@ -462,6 +462,8 @@ run_dump_test "pr23189"
+ run_dump_test "pr23194"
+ run_dump_test "pr23372a"
+ run_dump_test "pr23372b"
++run_dump_test "pr23486a"
++run_dump_test "pr23486b"
+ 
+ if { !([istarget "i?86-*-linux*"]
+        || [istarget "i?86-*-gnu*"]
+diff --git a/ld/testsuite/ld-i386/pr23486a.d b/ld/testsuite/ld-i386/pr23486a.d
+new file mode 100644
+index 0000000000..41a6dcf7d5
+--- /dev/null
++++ b/ld/testsuite/ld-i386/pr23486a.d
+@@ -0,0 +1,10 @@
++#source: ../ld-x86-64/pr23486a.s
++#source: ../ld-x86-64/pr23486b.s
++#as: --32
++#ld: -r -m elf_i386
++#readelf: -n
++
++Displaying notes found in: .note.gnu.property
++  Owner                 Data size	Description
++  GNU                  0x0000000c	NT_GNU_PROPERTY_TYPE_0
++      Properties: x86 ISA needed: i486, 586
+diff --git a/ld/testsuite/ld-i386/pr23486b.d b/ld/testsuite/ld-i386/pr23486b.d
+new file mode 100644
+index 0000000000..08019b7274
+--- /dev/null
++++ b/ld/testsuite/ld-i386/pr23486b.d
+@@ -0,0 +1,10 @@
++#source: ../ld-x86-64/pr23486b.s
++#source: ../ld-x86-64/pr23486a.s
++#as: --32
++#ld: -r -m elf_i386
++#readelf: -n
++
++Displaying notes found in: .note.gnu.property
++  Owner                 Data size	Description
++  GNU                  0x0000000c	NT_GNU_PROPERTY_TYPE_0
++      Properties: x86 ISA needed: i486, 586
+diff --git a/ld/testsuite/ld-i386/property-3.r b/ld/testsuite/ld-i386/property-3.r
+index 0ed91f5922..d03203c1e5 100644
+--- a/ld/testsuite/ld-i386/property-3.r
++++ b/ld/testsuite/ld-i386/property-3.r
+@@ -3,6 +3,5 @@ Displaying notes found in: .note.gnu.property
+   Owner                 Data size	Description
+   GNU                  0x[0-9a-f]+	NT_GNU_PROPERTY_TYPE_0
+       Properties: stack size: 0x800000
+-	x86 ISA used: 586, SSE
+ 	x86 ISA needed: i486, 586
+ #pass
+diff --git a/ld/testsuite/ld-i386/property-4.r b/ld/testsuite/ld-i386/property-4.r
+index cb2bc15d9a..da295eb6c7 100644
+--- a/ld/testsuite/ld-i386/property-4.r
++++ b/ld/testsuite/ld-i386/property-4.r
+@@ -3,6 +3,5 @@ Displaying notes found in: .note.gnu.property
+   Owner                 Data size	Description
+   GNU                  0x[0-9a-f]+	NT_GNU_PROPERTY_TYPE_0
+       Properties: stack size: 0x800000
+-	x86 ISA used: i486, 586, SSE
+ 	x86 ISA needed: i486, 586, SSE
+ #pass
+diff --git a/ld/testsuite/ld-i386/property-5.r b/ld/testsuite/ld-i386/property-5.r
+index 552965058c..e4141594b3 100644
+--- a/ld/testsuite/ld-i386/property-5.r
++++ b/ld/testsuite/ld-i386/property-5.r
+@@ -3,6 +3,5 @@ Displaying notes found in: .note.gnu.property
+   Owner                 Data size	Description
+   GNU                  0x[0-9a-f]+	NT_GNU_PROPERTY_TYPE_0
+       Properties: stack size: 0x900000
+-	x86 ISA used: i486, 586, SSE
+ 	x86 ISA needed: i486, 586, SSE
+ #pass
+diff --git a/ld/testsuite/ld-i386/property-x86-ibt3a.d b/ld/testsuite/ld-i386/property-x86-ibt3a.d
+index 4bb35b00fb..0aedea1614 100644
+--- a/ld/testsuite/ld-i386/property-x86-ibt3a.d
++++ b/ld/testsuite/ld-i386/property-x86-ibt3a.d
+@@ -6,6 +6,5 @@
+ 
+ Displaying notes found in: .note.gnu.property
+   Owner                 Data size	Description
+-  GNU                  0x00000018	NT_GNU_PROPERTY_TYPE_0
+-      Properties: x86 ISA used: i486, 586, SSE2, SSE3
+-	x86 ISA needed: 586, SSE, SSE3, SSE4_1
++  GNU                  0x0000000c	NT_GNU_PROPERTY_TYPE_0
++      Properties: x86 ISA needed: 586, SSE, SSE3, SSE4_1
+diff --git a/ld/testsuite/ld-i386/property-x86-ibt3b.d b/ld/testsuite/ld-i386/property-x86-ibt3b.d
+index 418d58a8f7..bd69ac6478 100644
+--- a/ld/testsuite/ld-i386/property-x86-ibt3b.d
++++ b/ld/testsuite/ld-i386/property-x86-ibt3b.d
+@@ -6,6 +6,5 @@
+ 
+ Displaying notes found in: .note.gnu.property
+   Owner                 Data size	Description
+-  GNU                  0x00000018	NT_GNU_PROPERTY_TYPE_0
+-      Properties: x86 ISA used: i486, 586, SSE2, SSE3
+-	x86 ISA needed: 586, SSE, SSE3, SSE4_1
++  GNU                  0x0000000c	NT_GNU_PROPERTY_TYPE_0
++      Properties: x86 ISA needed: 586, SSE, SSE3, SSE4_1
+diff --git a/ld/testsuite/ld-i386/property-x86-shstk3a.d b/ld/testsuite/ld-i386/property-x86-shstk3a.d
+index e261038f60..76d2a39f2c 100644
+--- a/ld/testsuite/ld-i386/property-x86-shstk3a.d
++++ b/ld/testsuite/ld-i386/property-x86-shstk3a.d
+@@ -6,6 +6,5 @@
+ 
+ Displaying notes found in: .note.gnu.property
+   Owner                 Data size	Description
+-  GNU                  0x00000018	NT_GNU_PROPERTY_TYPE_0
+-      Properties: x86 ISA used: i486, 586, SSE2, SSE3
+-	x86 ISA needed: 586, SSE, SSE3, SSE4_1
++  GNU                  0x0000000c	NT_GNU_PROPERTY_TYPE_0
++      Properties: x86 ISA needed: 586, SSE, SSE3, SSE4_1
+diff --git a/ld/testsuite/ld-i386/property-x86-shstk3b.d b/ld/testsuite/ld-i386/property-x86-shstk3b.d
+index 25f3d2361e..e770ecffa5 100644
+--- a/ld/testsuite/ld-i386/property-x86-shstk3b.d
++++ b/ld/testsuite/ld-i386/property-x86-shstk3b.d
+@@ -6,6 +6,5 @@
+ 
+ Displaying notes found in: .note.gnu.property
+   Owner                 Data size	Description
+-  GNU                  0x00000018	NT_GNU_PROPERTY_TYPE_0
+-      Properties: x86 ISA used: i486, 586, SSE2, SSE3
+-	x86 ISA needed: 586, SSE, SSE3, SSE4_1
++  GNU                  0x0000000c	NT_GNU_PROPERTY_TYPE_0
++      Properties: x86 ISA needed: 586, SSE, SSE3, SSE4_1
+diff --git a/ld/testsuite/ld-x86-64/pr23486a-x32.d b/ld/testsuite/ld-x86-64/pr23486a-x32.d
+new file mode 100644
+index 0000000000..6d9fa68cdb
+--- /dev/null
++++ b/ld/testsuite/ld-x86-64/pr23486a-x32.d
+@@ -0,0 +1,10 @@
++#source: pr23486a.s
++#source: pr23486b.s
++#as: --x32
++#ld: -r -m elf32_x86_64
++#readelf: -n
++
++Displaying notes found in: .note.gnu.property
++  Owner                 Data size	Description
++  GNU                  0x0000000c	NT_GNU_PROPERTY_TYPE_0
++      Properties: x86 ISA needed: i486, 586
+diff --git a/ld/testsuite/ld-x86-64/pr23486a.d b/ld/testsuite/ld-x86-64/pr23486a.d
+new file mode 100644
+index 0000000000..dc2b7bf760
+--- /dev/null
++++ b/ld/testsuite/ld-x86-64/pr23486a.d
+@@ -0,0 +1,10 @@
++#source: pr23486a.s
++#source: pr23486b.s
++#as: --64 -defsym __64_bit__=1
++#ld: -r -m elf_x86_64
++#readelf: -n
++
++Displaying notes found in: .note.gnu.property
++  Owner                 Data size	Description
++  GNU                  0x00000010	NT_GNU_PROPERTY_TYPE_0
++      Properties: x86 ISA needed: i486, 586
+diff --git a/ld/testsuite/ld-x86-64/pr23486a.s b/ld/testsuite/ld-x86-64/pr23486a.s
+new file mode 100644
+index 0000000000..a07d0c7ced
+--- /dev/null
++++ b/ld/testsuite/ld-x86-64/pr23486a.s
+@@ -0,0 +1,30 @@
++	.section ".note.gnu.property", "a"
++.ifdef __64_bit__
++	.p2align 3
++.else
++	.p2align 2
++.endif
++	.long 1f - 0f		/* name length.  */
++	.long 4f - 1f		/* data length.  */
++	/* NT_GNU_PROPERTY_TYPE_0 */
++	.long 5			/* note type.  */
++0:
++	.asciz "GNU"		/* vendor name.  */
++1:
++.ifdef __64_bit__
++	.p2align 3
++.else
++	.p2align 2
++.endif
++	/* GNU_PROPERTY_X86_ISA_1_USED */
++	.long 0xc0000000	/* pr_type.  */
++	.long 3f - 2f		/* pr_datasz.  */
++2:
++	.long 0xa
++3:
++.ifdef __64_bit__
++	.p2align 3
++.else
++	.p2align 2
++.endif
++4:
+diff --git a/ld/testsuite/ld-x86-64/pr23486b-x32.d b/ld/testsuite/ld-x86-64/pr23486b-x32.d
+new file mode 100644
+index 0000000000..0445e69d82
+--- /dev/null
++++ b/ld/testsuite/ld-x86-64/pr23486b-x32.d
+@@ -0,0 +1,10 @@
++#source: pr23486b.s
++#source: pr23486a.s
++#as: --x32
++#ld: -r -m elf32_x86_64
++#readelf: -n
++
++Displaying notes found in: .note.gnu.property
++  Owner                 Data size	Description
++  GNU                  0x0000000c	NT_GNU_PROPERTY_TYPE_0
++      Properties: x86 ISA needed: i486, 586
+diff --git a/ld/testsuite/ld-x86-64/pr23486b.d b/ld/testsuite/ld-x86-64/pr23486b.d
+new file mode 100644
+index 0000000000..dc2b7bf760
+--- /dev/null
++++ b/ld/testsuite/ld-x86-64/pr23486b.d
+@@ -0,0 +1,10 @@
++#source: pr23486a.s
++#source: pr23486b.s
++#as: --64 -defsym __64_bit__=1
++#ld: -r -m elf_x86_64
++#readelf: -n
++
++Displaying notes found in: .note.gnu.property
++  Owner                 Data size	Description
++  GNU                  0x00000010	NT_GNU_PROPERTY_TYPE_0
++      Properties: x86 ISA needed: i486, 586
+diff --git a/ld/testsuite/ld-x86-64/pr23486b.s b/ld/testsuite/ld-x86-64/pr23486b.s
+new file mode 100644
+index 0000000000..c5167eeb65
+--- /dev/null
++++ b/ld/testsuite/ld-x86-64/pr23486b.s
+@@ -0,0 +1,30 @@
++	.section ".note.gnu.property", "a"
++.ifdef __64_bit__
++	.p2align 3
++.else
++	.p2align 2
++.endif
++	.long 1f - 0f		/* name length.  */
++	.long 4f - 1f		/* data length.  */
++	/* NT_GNU_PROPERTY_TYPE_0 */
++	.long 5			/* note type.  */
++0:
++	.asciz "GNU"		/* vendor name.  */
++1:
++.ifdef __64_bit__
++	.p2align 3
++.else
++	.p2align 2
++.endif
++	/* GNU_PROPERTY_X86_ISA_1_NEEDED */
++	.long 0xc0000001	/* pr_type.  */
++	.long 3f - 2f		/* pr_datasz.  */
++2:
++	.long 0x3
++3:
++.ifdef __64_bit__
++	.p2align 3
++.else
++	.p2align 2
++.endif
++4:
+diff --git a/ld/testsuite/ld-x86-64/property-3.r b/ld/testsuite/ld-x86-64/property-3.r
+index 0ed91f5922..d03203c1e5 100644
+--- a/ld/testsuite/ld-x86-64/property-3.r
++++ b/ld/testsuite/ld-x86-64/property-3.r
+@@ -3,6 +3,5 @@ Displaying notes found in: .note.gnu.property
+   Owner                 Data size	Description
+   GNU                  0x[0-9a-f]+	NT_GNU_PROPERTY_TYPE_0
+       Properties: stack size: 0x800000
+-	x86 ISA used: 586, SSE
+ 	x86 ISA needed: i486, 586
+ #pass
+diff --git a/ld/testsuite/ld-x86-64/property-4.r b/ld/testsuite/ld-x86-64/property-4.r
+index cb2bc15d9a..da295eb6c7 100644
+--- a/ld/testsuite/ld-x86-64/property-4.r
++++ b/ld/testsuite/ld-x86-64/property-4.r
+@@ -3,6 +3,5 @@ Displaying notes found in: .note.gnu.property
+   Owner                 Data size	Description
+   GNU                  0x[0-9a-f]+	NT_GNU_PROPERTY_TYPE_0
+       Properties: stack size: 0x800000
+-	x86 ISA used: i486, 586, SSE
+ 	x86 ISA needed: i486, 586, SSE
+ #pass
+diff --git a/ld/testsuite/ld-x86-64/property-5.r b/ld/testsuite/ld-x86-64/property-5.r
+index 552965058c..e4141594b3 100644
+--- a/ld/testsuite/ld-x86-64/property-5.r
++++ b/ld/testsuite/ld-x86-64/property-5.r
+@@ -3,6 +3,5 @@ Displaying notes found in: .note.gnu.property
+   Owner                 Data size	Description
+   GNU                  0x[0-9a-f]+	NT_GNU_PROPERTY_TYPE_0
+       Properties: stack size: 0x900000
+-	x86 ISA used: i486, 586, SSE
+ 	x86 ISA needed: i486, 586, SSE
+ #pass
+diff --git a/ld/testsuite/ld-x86-64/property-x86-ibt3a-x32.d b/ld/testsuite/ld-x86-64/property-x86-ibt3a-x32.d
+index 011426f5a4..4cec728dc7 100644
+--- a/ld/testsuite/ld-x86-64/property-x86-ibt3a-x32.d
++++ b/ld/testsuite/ld-x86-64/property-x86-ibt3a-x32.d
+@@ -6,6 +6,5 @@
+ 
+ Displaying notes found in: .note.gnu.property
+   Owner                 Data size	Description
+-  GNU                  0x00000018	NT_GNU_PROPERTY_TYPE_0
+-      Properties: x86 ISA used: 586, SSE, SSE3, SSE4_1
+-	x86 ISA needed: i486, 586, SSE2, SSE3
++  GNU                  0x0000000c	NT_GNU_PROPERTY_TYPE_0
++      Properties: x86 ISA needed: i486, 586, SSE2, SSE3
+diff --git a/ld/testsuite/ld-x86-64/property-x86-ibt3a.d b/ld/testsuite/ld-x86-64/property-x86-ibt3a.d
+index 1b4229a037..a8df49a351 100644
+--- a/ld/testsuite/ld-x86-64/property-x86-ibt3a.d
++++ b/ld/testsuite/ld-x86-64/property-x86-ibt3a.d
+@@ -6,6 +6,5 @@
+ 
+ Displaying notes found in: .note.gnu.property
+   Owner                 Data size	Description
+-  GNU                  0x00000020	NT_GNU_PROPERTY_TYPE_0
+-      Properties: x86 ISA used: 586, SSE, SSE3, SSE4_1
+-	x86 ISA needed: i486, 586, SSE2, SSE3
++  GNU                  0x00000010	NT_GNU_PROPERTY_TYPE_0
++      Properties: x86 ISA needed: i486, 586, SSE2, SSE3
+diff --git a/ld/testsuite/ld-x86-64/property-x86-ibt3b-x32.d b/ld/testsuite/ld-x86-64/property-x86-ibt3b-x32.d
+index 290ed6abf1..c112626711 100644
+--- a/ld/testsuite/ld-x86-64/property-x86-ibt3b-x32.d
++++ b/ld/testsuite/ld-x86-64/property-x86-ibt3b-x32.d
+@@ -6,6 +6,5 @@
+ 
+ Displaying notes found in: .note.gnu.property
+   Owner                 Data size	Description
+-  GNU                  0x00000018	NT_GNU_PROPERTY_TYPE_0
+-      Properties: x86 ISA used: 586, SSE, SSE3, SSE4_1
+-	x86 ISA needed: i486, 586, SSE2, SSE3
++  GNU                  0x0000000c	NT_GNU_PROPERTY_TYPE_0
++      Properties: x86 ISA needed: i486, 586, SSE2, SSE3
+diff --git a/ld/testsuite/ld-x86-64/property-x86-ibt3b.d b/ld/testsuite/ld-x86-64/property-x86-ibt3b.d
+index 1142e03272..f10dffdc2c 100644
+--- a/ld/testsuite/ld-x86-64/property-x86-ibt3b.d
++++ b/ld/testsuite/ld-x86-64/property-x86-ibt3b.d
+@@ -6,6 +6,5 @@
+ 
+ Displaying notes found in: .note.gnu.property
+   Owner                 Data size	Description
+-  GNU                  0x00000020	NT_GNU_PROPERTY_TYPE_0
+-      Properties: x86 ISA used: 586, SSE, SSE3, SSE4_1
+-	x86 ISA needed: i486, 586, SSE2, SSE3
++  GNU                  0x00000010	NT_GNU_PROPERTY_TYPE_0
++      Properties: x86 ISA needed: i486, 586, SSE2, SSE3
+diff --git a/ld/testsuite/ld-x86-64/property-x86-shstk3a-x32.d b/ld/testsuite/ld-x86-64/property-x86-shstk3a-x32.d
+index 819542d181..0147a3c7b6 100644
+--- a/ld/testsuite/ld-x86-64/property-x86-shstk3a-x32.d
++++ b/ld/testsuite/ld-x86-64/property-x86-shstk3a-x32.d
+@@ -6,6 +6,5 @@
+ 
+ Displaying notes found in: .note.gnu.property
+   Owner                 Data size	Description
+-  GNU                  0x00000018	NT_GNU_PROPERTY_TYPE_0
+-      Properties: x86 ISA used: 586, SSE, SSE3, SSE4_1
+-	x86 ISA needed: i486, 586, SSE2, SSE3
++  GNU                  0x0000000c	NT_GNU_PROPERTY_TYPE_0
++      Properties: x86 ISA needed: i486, 586, SSE2, SSE3
+diff --git a/ld/testsuite/ld-x86-64/property-x86-shstk3a.d b/ld/testsuite/ld-x86-64/property-x86-shstk3a.d
+index 4c5d0e0a18..1f8c2dc929 100644
+--- a/ld/testsuite/ld-x86-64/property-x86-shstk3a.d
++++ b/ld/testsuite/ld-x86-64/property-x86-shstk3a.d
+@@ -6,6 +6,5 @@
+ 
+ Displaying notes found in: .note.gnu.property
+   Owner                 Data size	Description
+-  GNU                  0x00000020	NT_GNU_PROPERTY_TYPE_0
+-      Properties: x86 ISA used: 586, SSE, SSE3, SSE4_1
+-	x86 ISA needed: i486, 586, SSE2, SSE3
++  GNU                  0x00000010	NT_GNU_PROPERTY_TYPE_0
++      Properties: x86 ISA needed: i486, 586, SSE2, SSE3
+diff --git a/ld/testsuite/ld-x86-64/property-x86-shstk3b-x32.d b/ld/testsuite/ld-x86-64/property-x86-shstk3b-x32.d
+index ba181e0bc5..7ca2539ca5 100644
+--- a/ld/testsuite/ld-x86-64/property-x86-shstk3b-x32.d
++++ b/ld/testsuite/ld-x86-64/property-x86-shstk3b-x32.d
+@@ -6,6 +6,5 @@
+ 
+ Displaying notes found in: .note.gnu.property
+   Owner                 Data size	Description
+-  GNU                  0x00000018	NT_GNU_PROPERTY_TYPE_0
+-      Properties: x86 ISA used: 586, SSE, SSE3, SSE4_1
+-	x86 ISA needed: i486, 586, SSE2, SSE3
++  GNU                  0x0000000c	NT_GNU_PROPERTY_TYPE_0
++      Properties: x86 ISA needed: i486, 586, SSE2, SSE3
+diff --git a/ld/testsuite/ld-x86-64/property-x86-shstk3b.d b/ld/testsuite/ld-x86-64/property-x86-shstk3b.d
+index 5216f385dd..f66a40e449 100644
+--- a/ld/testsuite/ld-x86-64/property-x86-shstk3b.d
++++ b/ld/testsuite/ld-x86-64/property-x86-shstk3b.d
+@@ -6,6 +6,5 @@
+ 
+ Displaying notes found in: .note.gnu.property
+   Owner                 Data size	Description
+-  GNU                  0x00000020	NT_GNU_PROPERTY_TYPE_0
+-      Properties: x86 ISA used: 586, SSE, SSE3, SSE4_1
+-	x86 ISA needed: i486, 586, SSE2, SSE3
++  GNU                  0x00000010	NT_GNU_PROPERTY_TYPE_0
++      Properties: x86 ISA needed: i486, 586, SSE2, SSE3
+diff --git a/ld/testsuite/ld-x86-64/x86-64.exp b/ld/testsuite/ld-x86-64/x86-64.exp
+index 6edb9e86f4..ae21e554ad 100644
+--- a/ld/testsuite/ld-x86-64/x86-64.exp
++++ b/ld/testsuite/ld-x86-64/x86-64.exp
+@@ -403,6 +403,10 @@ run_dump_test "pr23372a"
+ run_dump_test "pr23372a-x32"
+ run_dump_test "pr23372b"
+ run_dump_test "pr23372b-x32"
++run_dump_test "pr23486a"
++run_dump_test "pr23486a-x32"
++run_dump_test "pr23486b"
++run_dump_test "pr23486b-x32"
+ 
+ if { ![istarget "x86_64-*-linux*"] && ![istarget "x86_64-*-nacl*"]} {
+     return
+-- 
+2.20.1
+
diff --git a/nixpkgs/pkgs/development/tools/misc/binutils/always-search-rpath.patch b/nixpkgs/pkgs/development/tools/misc/binutils/always-search-rpath.patch
new file mode 100644
index 000000000000..2e9956e6b6e4
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/binutils/always-search-rpath.patch
@@ -0,0 +1,14 @@
+diff --git a/ld/genscripts.sh b/ld/genscripts.sh
+index b6940d376d..0feb1adfd0 100755
+--- a/ld/genscripts.sh
++++ b/ld/genscripts.sh
+@@ -125,6 +125,9 @@ if test "x$NATIVE" = "xyes" ; then
+   USE_LIBPATH=yes
+ fi
+ 
++# TODO: why is this needed?
++USE_LIBPATH=yes
++
+ # Set the library search path, for libraries named by -lfoo.
+ # If LIB_PATH is defined (e.g., by Makefile) and non-empty, it is used.
+ # Otherwise, the default is set here.
diff --git a/nixpkgs/pkgs/development/tools/misc/binutils/build-components-separately.patch b/nixpkgs/pkgs/development/tools/misc/binutils/build-components-separately.patch
new file mode 100644
index 000000000000..d3cd0d2131cc
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/binutils/build-components-separately.patch
@@ -0,0 +1,178 @@
+From bc09a9236f67e710d545ac11bcdac7b55dbcc1a0 Mon Sep 17 00:00:00 2001
+From: John Ericson <John.Ericson@Obsidian.Systems>
+Date: Thu, 12 Oct 2017 11:16:57 -0400
+Subject: [PATCH] Build components separately
+
+---
+ bfd/configure.ac     | 18 +++---------------
+ opcodes/Makefile.am  | 17 +++++++++++++----
+ opcodes/configure.ac | 45 ++++++---------------------------------------
+ 3 files changed, 22 insertions(+), 58 deletions(-)
+
+diff --git a/bfd/configure.ac b/bfd/configure.ac
+index 9a183c1628..8728837384 100644
+--- a/bfd/configure.ac
++++ b/bfd/configure.ac
+@@ -241,31 +241,19 @@ AC_CACHE_CHECK(linker --as-needed support, bfd_cv_ld_as_needed,
+ 
+ LT_LIB_M
+ 
+-# When building a shared libbfd, link against the pic version of libiberty
+-# so that apps that use libbfd won't need libiberty just to satisfy any
+-# libbfd references.
+-# We can't do that if a pic libiberty is unavailable since including non-pic
+-# code would insert text relocations into libbfd.
+ SHARED_LIBADD=
+-SHARED_LDFLAGS=
++SHARED_LDFLAGS=-liberty
+ if test "$enable_shared" = "yes"; then
+-changequote(,)dnl
+-  x=`sed -n -e 's/^[ 	]*PICFLAG[ 	]*=[ 	]*//p' < ../libiberty/Makefile | sed -n '$p'`
+-changequote([,])dnl
+-  if test -n "$x"; then
+-    SHARED_LIBADD="-L`pwd`/../libiberty/pic -liberty"
+-  fi
+-
+ # More hacks to build DLLs on Windows.
+   case "${host}" in
+   *-*-cygwin*)
+     SHARED_LDFLAGS="-no-undefined"
+-    SHARED_LIBADD="-L`pwd`/../libiberty -liberty -L`pwd`/../intl -lintl -lcygwin -lkernel32"
++    SHARED_LIBADD="-liberty -lintl -lcygwin -lkernel32"
+   ;;
+ 
+   # Hack to build or1k-src on OSX
+   or1k*-*-darwin*)
+-    SHARED_LIBADD="-L`pwd`/../libiberty/pic -L`pwd`/../intl -liberty -lintl"
++    SHARED_LIBADD="-liberty -lintl"
+   ;;
+   esac
+ 
+diff --git a/opcodes/Makefile.am b/opcodes/Makefile.am
+index 925e7ff651..47b395c195 100644
+--- a/opcodes/Makefile.am
++++ b/opcodes/Makefile.am
+@@ -52,7 +52,7 @@ libopcodes_la_LDFLAGS += -rpath $(rpath_bfdlibdir)
+ endif
+ 
+ # This is where bfd.h lives.
+-BFD_H = ../bfd/bfd.h
++BFD_H = $(BFDDIR)/bfd.h
+ 
+ BUILD_LIBS = @BUILD_LIBS@
+ BUILD_LIB_DEPS = @BUILD_LIB_DEPS@
+@@ -303,7 +303,7 @@ OFILES = @BFD_MACHINES@
+ # development.sh is used to determine -Werror default.
+ CONFIG_STATUS_DEPENDENCIES = $(BFDDIR)/development.sh
+ 
+-AM_CPPFLAGS = -I. -I$(srcdir) -I../bfd -I$(INCDIR) -I$(BFDDIR) @HDEFINES@ @INCINTL@
++AM_CPPFLAGS = -I. -I$(srcdir) -I$(INCDIR) -I$(BFDDIR) @HDEFINES@ @INCINTL@
+ 
+ disassemble.lo: disassemble.c
+ if am__fastdepCC
+@@ -324,12 +324,21 @@ libopcodes_la_SOURCES =  dis-buf.c disassemble.c dis-init.c
+ # old version of libbfd, or to pick up libbfd for the wrong architecture
+ # if host != build. So for building with shared libraries we use a
+ # hardcoded path to libbfd.so instead of relying on the entries in libbfd.la.
+-libopcodes_la_DEPENDENCIES = $(OFILES) @SHARED_DEPENDENCIES@
++libopcodes_la_DEPENDENCIES = $(OFILES) @SHARED_DEPENDENCIES@ libtool-soversion
+ libopcodes_la_LIBADD = $(OFILES) @SHARED_LIBADD@
+-libopcodes_la_LDFLAGS += -release `cat ../bfd/libtool-soversion` @SHARED_LDFLAGS@
++libopcodes_la_LDFLAGS += -release `cat libtool-soversion` @SHARED_LDFLAGS@
+ # Allow dependency tracking to work on all the source files.
+ EXTRA_libopcodes_la_SOURCES = $(LIBOPCODES_CFILES)
+ 
++libtool-soversion:
++	@echo "creating $@"
++	bfd_soversion="$(VERSION)" ;\
++	. $(BFDDIR)/development.sh ;\
++	if test "$$development" = true ; then \
++	  bfd_soversion="$(VERSION).$${bfd_version_date}" ;\
++	fi ;\
++	echo "$${bfd_soversion}" > $@
++
+ # libtool will build .libs/libopcodes.a.  We create libopcodes.a in
+ # the build directory so that we don't have to convert all the
+ # programs that use libopcodes.a simultaneously.  This is a hack which
+diff --git a/opcodes/configure.ac b/opcodes/configure.ac
+index b9f5eb8a4f..ef2c2152b7 100644
+--- a/opcodes/configure.ac
++++ b/opcodes/configure.ac
+@@ -89,6 +89,7 @@ AC_PROG_INSTALL
+ 
+ AC_CHECK_HEADERS(string.h strings.h stdlib.h limits.h)
+ ACX_HEADER_STRING
++GCC_HEADER_STDINT(bfd_stdint.h)
+ 
+ AC_CHECK_DECLS([basename, stpcpy])
+ 
+@@ -134,61 +135,27 @@ AC_CACHE_CHECK(linker --as-needed support, bfd_cv_ld_as_needed,
+ 
+ LT_LIB_M
+ 
+-#Libs for generator progs
+-if test "x$cross_compiling" = "xno"; then
+-  BUILD_LIBS=../libiberty/libiberty.a
+-  BUILD_LIB_DEPS=$BUILD_LIBS
+-else
+-  # if cross-compiling, assume that the system provides -liberty
+-  # and that the version is compatible with new headers.
+-  BUILD_LIBS=-liberty
+-  BUILD_LIB_DEPS=
+-fi
+-BUILD_LIBS="$BUILD_LIBS $LIBINTL"
+-BUILD_LIB_DEPS="$BUILD_LIB_DEPS $LIBINTL_DEP"
++BUILD_LIBS="-liberty $LIBINTL"
++BUILD_LIB_DEPS="$LIBINTL_DEP"
+ 
+ AC_SUBST(BUILD_LIBS)
+ AC_SUBST(BUILD_LIB_DEPS)
+ 
+ # Horrible hacks to build DLLs on Windows and a shared library elsewhere.
+ SHARED_LDFLAGS=
+-SHARED_LIBADD=
++SHARED_LIBADD=-liberty
+ SHARED_DEPENDENCIES=
+ if test "$enable_shared" = "yes"; then
+-# When building a shared libopcodes, link against the pic version of libiberty
+-# so that apps that use libopcodes won't need libiberty just to satisfy any
+-# libopcodes references.
+-# We can't do that if a pic libiberty is unavailable since including non-pic
+-# code would insert text relocations into libopcodes.
+ # Note that linking against libbfd as we do here, which is itself linked
+ # against libiberty, may not satisfy all the libopcodes libiberty references
+ # since libbfd may not pull in the entirety of libiberty.
+-changequote(,)dnl
+-  x=`sed -n -e 's/^[ 	]*PICFLAG[ 	]*=[ 	]*//p' < ../libiberty/Makefile | sed -n '$p'`
+-changequote([,])dnl
+-  if test -n "$x"; then
+-    SHARED_LIBADD="-L`pwd`/../libiberty/pic -liberty"
+-  fi
+-
+   case "${host}" in
+     *-*-cygwin*)
+       SHARED_LDFLAGS="-no-undefined"
+-      SHARED_LIBADD="-L`pwd`/../bfd -lbfd -L`pwd`/../libiberty -liberty -L`pwd`/../intl -lintl -lcygwin"
++      SHARED_LIBADD="-lbfd -liberty -lintl -lcygwin"
+       ;;
+-   *-*-darwin*)
+-     SHARED_LIBADD="-Wl,`pwd`/../bfd/.libs/libbfd.dylib ${SHARED_LIBADD}"
+-     SHARED_DEPENDENCIES="../bfd/libbfd.la"
+-     ;;
+     *)
+-      case "$host_vendor" in
+-        hp)
+-          SHARED_LIBADD="-Wl,`pwd`/../bfd/.libs/libbfd.sl ${SHARED_LIBADD}"
+-	  ;;
+-	*)
+-          SHARED_LIBADD="-Wl,`pwd`/../bfd/.libs/libbfd.so ${SHARED_LIBADD}"
+-	  ;;
+-      esac
+-      SHARED_DEPENDENCIES="../bfd/libbfd.la"
++      SHARED_LIBADD="-lbfd ${SHARED_LIBADD}"
+       ;;
+   esac
+ 
+-- 
+2.14.2
+
diff --git a/nixpkgs/pkgs/development/tools/misc/binutils/default.nix b/nixpkgs/pkgs/development/tools/misc/binutils/default.nix
new file mode 100644
index 000000000000..210659289d1e
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/binutils/default.nix
@@ -0,0 +1,155 @@
+{ stdenv, lib, buildPackages
+, fetchurl, zlib, autoreconfHook, gettext
+# Enabling all targets increases output size to a multiple.
+, withAllTargets ? false, libbfd, libopcodes
+, enableShared ? true
+, noSysDirs
+, gold ? !stdenv.buildPlatform.isDarwin || stdenv.hostPlatform == stdenv.targetPlatform
+, bison ? null
+}:
+
+let
+  reuseLibs = enableShared && withAllTargets;
+
+  # Remove gold-symbol-visibility patch when updating, the proper fix
+  # is now upstream.
+  # https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commitdiff;h=330b90b5ffbbc20c5de6ae6c7f60c40fab2e7a4f;hp=99181ccac0fc7d82e7dabb05dc7466e91f1645d3
+  version = "2.31.1";
+  basename = "binutils-${version}";
+  # The targetPrefix prepended to binary names to allow multiple binuntils on the
+  # PATH to both be usable.
+  targetPrefix = lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform)
+                  "${stdenv.targetPlatform.config}-";
+in
+
+stdenv.mkDerivation {
+  name = targetPrefix + basename;
+
+  # HACK to ensure that we preserve source from bootstrap binutils to not rebuild LLVM
+  src = stdenv.__bootPackages.binutils-unwrapped.src or (fetchurl {
+    url = "mirror://gnu/binutils/${basename}.tar.bz2";
+    sha256 = "1l34hn1zkmhr1wcrgf0d4z7r3najxnw3cx2y2fk7v55zjlk3ik7z";
+  });
+
+  patches = [
+    # Make binutils output deterministic by default.
+    ./deterministic.patch
+
+    # Bfd looks in BINDIR/../lib for some plugins that don't
+    # exist. This is pointless (since users can't install plugins
+    # there) and causes a cycle between the lib and bin outputs, so
+    # get rid of it.
+    ./no-plugins.patch
+
+    # Help bfd choose between elf32-littlearm, elf32-littlearm-symbian, and
+    # elf32-littlearm-vxworks in favor of the first.
+    # https://github.com/NixOS/nixpkgs/pull/30484#issuecomment-345472766
+    ./disambiguate-arm-targets.patch
+
+    # For some reason bfd ld doesn't search DT_RPATH when cross-compiling. It's
+    # not clear why this behavior was decided upon but it has the unfortunate
+    # consequence that the linker will fail to find transitive dependencies of
+    # shared objects when cross-compiling. Consequently, we are forced to
+    # override this behavior, forcing ld to search DT_RPATH even when
+    # cross-compiling.
+    ./always-search-rpath.patch
+
+    # https://sourceware.org/bugzilla/show_bug.cgi?id=22868
+    ./gold-symbol-visibility.patch
+
+    # https://sourceware.org/bugzilla/show_bug.cgi?id=23428
+    # un-break features so linking against musl doesn't produce crash-only binaries
+    ./0001-x86-Add-a-GNU_PROPERTY_X86_ISA_1_USED-note-if-needed.patch
+    ./0001-x86-Properly-merge-GNU_PROPERTY_X86_ISA_1_USED.patch
+    ./0001-x86-Properly-add-X86_ISA_1_NEEDED-property.patch
+  ] ++ lib.optional stdenv.targetPlatform.isiOS ./support-ios.patch;
+
+  outputs = [ "out" "info" "man" ];
+
+  depsBuildBuild = [ buildPackages.stdenv.cc ];
+  nativeBuildInputs = [
+    bison
+  ] ++ lib.optionals stdenv.targetPlatform.isiOS [
+    autoreconfHook
+  ];
+  buildInputs = [ zlib gettext ];
+
+  inherit noSysDirs;
+
+  preConfigure = ''
+    # Clear the default library search path.
+    if test "$noSysDirs" = "1"; then
+        echo 'NATIVE_LIB_DIRS=' >> ld/configure.tgt
+    fi
+
+    # Use symlinks instead of hard links to save space ("strip" in the
+    # fixup phase strips each hard link separately).
+    for i in binutils/Makefile.in gas/Makefile.in ld/Makefile.in gold/Makefile.in; do
+        sed -i "$i" -e 's|ln |ln -s |'
+    done
+  '';
+
+  # As binutils takes part in the stdenv building, we don't want references
+  # to the bootstrap-tools libgcc (as uses to happen on arm/mips)
+  NIX_CFLAGS_COMPILE = if stdenv.hostPlatform.isDarwin
+    then "-Wno-string-plus-int -Wno-deprecated-declarations"
+    else "-static-libgcc";
+
+  hardeningDisable = [ "format" "pie" ];
+
+  # TODO(@Ericson2314): Always pass "--target" and always targetPrefix.
+  configurePlatforms = [ "build" "host" ] ++ lib.optional (stdenv.targetPlatform != stdenv.hostPlatform) "target";
+
+  configureFlags =
+    (if enableShared then [ "--enable-shared" "--disable-static" ]
+                     else [ "--disable-shared" "--enable-static" ])
+  ++ lib.optional withAllTargets "--enable-targets=all"
+  ++ [
+    "--enable-64-bit-bfd"
+    "--with-system-zlib"
+
+    "--enable-deterministic-archives"
+    "--disable-werror"
+    "--enable-fix-loongson2f-nop"
+
+    # Turn on --enable-new-dtags by default to make the linker set
+    # RUNPATH instead of RPATH on binaries.  This is important because
+    # RUNPATH can be overriden using LD_LIBRARY_PATH at runtime.
+    "--enable-new-dtags"
+  ] ++ lib.optionals gold [ "--enable-gold" "--enable-plugins" ];
+
+  doCheck = false; # fails
+
+  postFixup = lib.optionalString reuseLibs ''
+    rm "$out"/lib/lib{bfd,opcodes}-${version}.so
+    ln -s '${lib.getLib libbfd}/lib/libbfd-${version}.so' "$out/lib/"
+    ln -s '${lib.getLib libopcodes}/lib/libopcodes-${version}.so' "$out/lib/"
+  '';
+
+  # else fails with "./sanity.sh: line 36: $out/bin/size: not found"
+  doInstallCheck = stdenv.buildPlatform == stdenv.hostPlatform && stdenv.hostPlatform == stdenv.targetPlatform;
+
+  enableParallelBuilding = true;
+
+  passthru = {
+    inherit targetPrefix version;
+  };
+
+  meta = with lib; {
+    description = "Tools for manipulating binaries (linker, assembler, etc.)";
+    longDescription = ''
+      The GNU Binutils are a collection of binary tools.  The main
+      ones are `ld' (the GNU linker) and `as' (the GNU assembler).
+      They also include the BFD (Binary File Descriptor) library,
+      `gprof', `nm', `strip', etc.
+    '';
+    homepage = https://www.gnu.org/software/binutils/;
+    license = licenses.gpl3Plus;
+    maintainers = with maintainers; [ ericson2314 ];
+    platforms = platforms.unix;
+
+    /* Give binutils a lower priority than gcc-wrapper to prevent a
+       collision due to the ld/as wrappers/symlinks in the latter. */
+    priority = 10;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/binutils/deterministic.patch b/nixpkgs/pkgs/development/tools/misc/binutils/deterministic.patch
new file mode 100644
index 000000000000..736e0aca6ce1
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/binutils/deterministic.patch
@@ -0,0 +1,12 @@
+diff -ur orig/binutils-2.23.1/ld/ldlang.c binutils-2.23.1/ld/ldlang.c
+--- orig/ld/ldlang.c
++++ new/ld/ldlang.c
+@@ -3095,6 +3095,8 @@
+                           ldfile_output_machine))
+     einfo (_("%P%F:%s: can not set architecture: %E\n"), name);
+ 
++  link_info.output_bfd->flags |= BFD_DETERMINISTIC_OUTPUT;
++
+   link_info.hash = bfd_link_hash_table_create (link_info.output_bfd);
+   if (link_info.hash == NULL)
+     einfo (_("%P%F: can not create hash table: %E\n"));
diff --git a/nixpkgs/pkgs/development/tools/misc/binutils/disambiguate-arm-targets.patch b/nixpkgs/pkgs/development/tools/misc/binutils/disambiguate-arm-targets.patch
new file mode 100644
index 000000000000..abbfa73da05d
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/binutils/disambiguate-arm-targets.patch
@@ -0,0 +1,23 @@
+diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c
+index 9f956d3..f5b61f1 100644
+--- a/bfd/elf32-arm.c
++++ b/bfd/elf32-arm.c
+@@ -19585,7 +19585,10 @@ elf32_arm_vxworks_final_write_processing (bfd *abfd, bfd_boolean linker)
+ #undef  ELF_MAXPAGESIZE
+ #define ELF_MAXPAGESIZE			0x1000
+ 
++/* Prioritize elf32-*arm (priority 1) over elf32-*arm-vxworks (priority 2) */
++#define elf_match_priority 2
+ #include "elf32-target.h"
++#undef  elf_match_priority
+ 
+ 
+ /* Merge backend specific data from an object file to the output
+@@ -19974,4 +19977,7 @@ elf32_arm_symbian_plt_sym_val (bfd_vma i, const asection *plt,
+ #undef  ELF_MAXPAGESIZE
+ #define ELF_MAXPAGESIZE			0x8000
+ 
++/* Prioritize elf32-*arm (priority 1) over elf32-*arm-symbian (priority 2) */
++#define elf_match_priority 2
+ #include "elf32-target.h"
++#undef  elf_match_priority
diff --git a/nixpkgs/pkgs/development/tools/misc/binutils/gold-symbol-visibility.patch b/nixpkgs/pkgs/development/tools/misc/binutils/gold-symbol-visibility.patch
new file mode 100644
index 000000000000..0fb05a482d1c
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/binutils/gold-symbol-visibility.patch
@@ -0,0 +1,79 @@
+commit 8564af037f5c4c6d2744a89497691359205b2bbc
+Author: Shea Levy <shea@shealevy.com>
+Date:   Mon Mar 19 10:52:40 2018 -0400
+
+    Revert "Allow multiply-defined absolute symbols when they have the same value."
+    
+    This reverts commit 5dc824ed42cd173c1525f5abc76f4091f11a4dbc.
+
+diff --git a/gold/ChangeLog-2017 b/gold/ChangeLog-2017
+index b2a47710b5..d7ca1b48c0 100644
+--- a/gold/ChangeLog-2017
++++ b/gold/ChangeLog-2017
+@@ -114,11 +114,6 @@
+ 	(localedir): Define as @localedir@.
+ 	(gnulocaledir, gettextsrcdir): Use @datarootdir@.
+ 
+-2017-11-28  Cary Coutant  <ccoutant@gmail.com>
+-
+-	* resolve.cc (Symbol_table::resolve): Allow multiply-defined absolute
+-	symbols when they have the same value.
+-
+ 2017-11-28  Cary Coutant  <ccoutant@gmail.com>
+ 
+ 	* object.h (class Sized_relobj_file): Remove discarded_eh_frame_shndx_.
+diff --git a/gold/resolve.cc b/gold/resolve.cc
+index 4a5784cf8b..803576bfed 100644
+--- a/gold/resolve.cc
++++ b/gold/resolve.cc
+@@ -247,28 +247,18 @@ Symbol_table::resolve(Sized_symbol<size>* to,
+ 		      Object* object, const char* version,
+ 		      bool is_default_version)
+ {
+-  bool to_is_ordinary;
+-  const unsigned int to_shndx = to->shndx(&to_is_ordinary);
+-
+   // It's possible for a symbol to be defined in an object file
+   // using .symver to give it a version, and for there to also be
+   // a linker script giving that symbol the same version.  We
+   // don't want to give a multiple-definition error for this
+   // harmless redefinition.
++  bool to_is_ordinary;
+   if (to->source() == Symbol::FROM_OBJECT
+       && to->object() == object
+-      && to->is_defined()
+       && is_ordinary
++      && to->is_defined()
++      && to->shndx(&to_is_ordinary) == st_shndx
+       && to_is_ordinary
+-      && to_shndx == st_shndx
+-      && to->value() == sym.get_st_value())
+-    return;
+-
+-  // Likewise for an absolute symbol defined twice with the same value.
+-  if (!is_ordinary
+-      && st_shndx == elfcpp::SHN_ABS
+-      && !to_is_ordinary
+-      && to_shndx == elfcpp::SHN_ABS
+       && to->value() == sym.get_st_value())
+     return;
+ 
+@@ -360,8 +350,8 @@ Symbol_table::resolve(Sized_symbol<size>* to,
+       && (sym.get_st_bind() == elfcpp::STB_WEAK
+ 	  || to->binding() == elfcpp::STB_WEAK)
+       && orig_st_shndx != elfcpp::SHN_UNDEF
++      && to->shndx(&to_is_ordinary) != elfcpp::SHN_UNDEF
+       && to_is_ordinary
+-      && to_shndx != elfcpp::SHN_UNDEF
+       && sym.get_st_size() != 0    // Ignore weird 0-sized symbols.
+       && to->symsize() != 0
+       && (sym.get_st_type() != to->type()
+@@ -372,7 +362,7 @@ Symbol_table::resolve(Sized_symbol<size>* to,
+     {
+       Symbol_location fromloc
+           = { object, orig_st_shndx, static_cast<off_t>(sym.get_st_value()) };
+-      Symbol_location toloc = { to->object(), to_shndx,
++      Symbol_location toloc = { to->object(), to->shndx(&to_is_ordinary),
+ 				static_cast<off_t>(to->value()) };
+       this->candidate_odr_violations_[to->name()].insert(fromloc);
+       this->candidate_odr_violations_[to->name()].insert(toloc);
diff --git a/nixpkgs/pkgs/development/tools/misc/binutils/no-plugins.patch b/nixpkgs/pkgs/development/tools/misc/binutils/no-plugins.patch
new file mode 100644
index 000000000000..9624b7976b70
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/binutils/no-plugins.patch
@@ -0,0 +1,19 @@
+diff -ru binutils-2.27-orig/bfd/plugin.c binutils-2.27/bfd/plugin.c
+--- binutils-2.27-orig/bfd/plugin.c	2016-10-14 17:46:30.791315555 +0200
++++ binutils-2.27/bfd/plugin.c	2016-10-14 17:46:38.583298765 +0200
+@@ -333,6 +333,7 @@
+   if (plugin_program_name == NULL)
+     return found;
+ 
++#if 0
+   plugin_dir = concat (BINDIR, "/../lib/bfd-plugins", NULL);
+   p = make_relative_prefix (plugin_program_name,
+ 			    BINDIR,
+@@ -364,6 +365,7 @@
+   free (p);
+   if (d)
+     closedir (d);
++#endif
+ 
+   return found;
+ }
diff --git a/nixpkgs/pkgs/development/tools/misc/binutils/support-ios.patch b/nixpkgs/pkgs/development/tools/misc/binutils/support-ios.patch
new file mode 100644
index 000000000000..74e56d130ed5
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/binutils/support-ios.patch
@@ -0,0 +1,168 @@
+diff --git a/bfd/config.bfd b/bfd/config.bfd
+index f04a993f06..1e24a9d030 100644
+--- a/bfd/config.bfd
++++ b/bfd/config.bfd
+@@ -238,7 +238,7 @@ case "${targ}" in
+ 
+ # START OF targmatch.h
+ #ifdef BFD64
+-  aarch64-*-darwin*)
++  aarch64-*-darwin* | aarch64-*-ios*)
+     targ_defvec=aarch64_mach_o_vec
+     targ_selvecs="arm_mach_o_vec mach_o_le_vec mach_o_be_vec mach_o_fat_vec"
+     targ_archs="$targ_archs bfd_i386_arch bfd_powerpc_arch bfd_rs6000_arch"
+@@ -358,7 +358,7 @@ case "${targ}" in
+     targ_selvecs=arc_elf32_be_vec
+     ;;
+ 
+-  arm-*-darwin*)
++  arm-*-darwin* | arm-*-ios*)
+     targ_defvec=arm_mach_o_vec
+     targ_selvecs="mach_o_le_vec mach_o_be_vec mach_o_fat_vec"
+     targ_archs="$targ_archs bfd_i386_arch bfd_powerpc_arch bfd_rs6000_arch"
+@@ -678,7 +678,7 @@ case "${targ}" in
+   i[3-7]86-*-aix*)
+     targ_defvec=i386_coff_vec
+     ;;
+-  i[3-7]86-*-darwin* | i[3-7]86-*-macos10* | i[3-7]86-*-rhapsody*)
++  i[3-7]86-*-darwin* | i[3-7]86-*-ios* | i[3-7]86-*-macos10* | i[3-7]86-*-rhapsody*)
+     targ_defvec=i386_mach_o_vec
+     targ_selvecs="mach_o_le_vec mach_o_be_vec mach_o_fat_vec pef_vec pef_xlib_vec sym_vec"
+     targ64_selvecs=x86_64_mach_o_vec
+@@ -762,7 +762,7 @@ case "${targ}" in
+     targ_defvec=x86_64_elf64_cloudabi_vec
+     want64=true
+     ;;
+-  x86_64-*-darwin*)
++  x86_64-*-darwin* | x86_64-*-ios*)
+     targ_defvec=x86_64_mach_o_vec
+     targ_selvecs="i386_mach_o_vec mach_o_le_vec mach_o_be_vec mach_o_fat_vec pef_vec pef_xlib_vec sym_vec"
+     targ_archs="$targ_archs bfd_powerpc_arch bfd_rs6000_arch"
+@@ -1402,7 +1402,7 @@ case "${targ}" in
+     targ_selvecs="powerpc_elf32_le_vec powerpc_boot_vec"
+     targ64_selvecs="powerpc_elf64_vec powerpc_elf64_le_vec"
+     ;;
+-  powerpc-*-darwin* | powerpc-*-macos10* | powerpc-*-rhapsody*)
++  powerpc-*-darwin* | powerpc-*-ios* | powerpc-*-macos10* | powerpc-*-rhapsody*)
+     targ_defvec=mach_o_be_vec
+     targ_selvecs="mach_o_be_vec mach_o_le_vec mach_o_fat_vec pef_vec pef_xlib_vec sym_vec"
+     targ_archs="$targ_archs bfd_i386_arch"
+diff --git a/configure.ac b/configure.ac
+index aae94501e4..2cceb4dad4 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -510,7 +510,7 @@ if test x$enable_libgomp = x ; then
+ 	;;
+     *-*-solaris2* | *-*-hpux11*)
+ 	;;
+-    *-*-darwin* | *-*-aix*)
++    *-*-darwin* | *-*-ios* | *-*-aix*)
+ 	;;
+     nvptx*-*-*)
+ 	;;
+@@ -700,13 +700,13 @@ esac
+ 
+ # Disable libffi for some systems.
+ case "${target}" in
+-  powerpc-*-darwin*)
++  powerpc-*-darwin* | powerpc-*-ios*)
+     ;;
+-  i[[3456789]]86-*-darwin*)
++  i[[3456789]]86-*-darwin* | i[[3456789]]86-*-ios*)
+     ;;
+-  x86_64-*-darwin[[912]]*)
++  x86_64-*-darwin[[912]]* | x86_64-*-ios[[912]]*)
+     ;;
+-  *-*-darwin*)
++  *-*-darwin* | *-*-ios*)
+     noconfigdirs="$noconfigdirs target-libffi"
+     ;;
+   *-*-netware*)
+@@ -788,7 +788,7 @@ esac
+ # Disable the go frontend on systems where it is known to not work. Please keep
+ # this in sync with contrib/config-list.mk.
+ case "${target}" in
+-*-*-darwin* | *-*-cygwin* | *-*-mingw*)
++*-*-darwin* | *-*-ios* | *-*-cygwin* | *-*-mingw*)
+     unsupported_languages="$unsupported_languages go"
+     ;;
+ esac
+@@ -797,7 +797,7 @@ esac
+ # For testing, you can easily override this with --enable-libgo.
+ if test x$enable_libgo = x; then
+     case "${target}" in
+-    *-*-darwin*)
++    *-*-darwin* | *-*-ios*)
+ 	# PR 46986
+ 	noconfigdirs="$noconfigdirs target-libgo"
+ 	;;
+@@ -916,27 +916,27 @@ esac
+ case "${target}" in
+   *-*-chorusos)
+     ;;
+-  aarch64-*-darwin*)
++  aarch64-*-darwin* | aarch64-*-ios*)
+     noconfigdirs="$noconfigdirs ld gas gdb gprof"
+     noconfigdirs="$noconfigdirs sim target-rda"
+     ;;
+-  arm-*-darwin*)
++  arm-*-darwin* | arm-*-ios*)
+     noconfigdirs="$noconfigdirs ld gas gdb gprof"
+     noconfigdirs="$noconfigdirs sim target-rda"
+     ;;
+-  powerpc-*-darwin*)
++  powerpc-*-darwin* | powerpc-*-ios*)
+     noconfigdirs="$noconfigdirs ld gas gdb gprof"
+     noconfigdirs="$noconfigdirs sim target-rda"
+     ;;
+-  i[[3456789]]86-*-darwin*)
++  i[[3456789]]86-*-darwin* | i[[3456789]]86-*-ios*)
+     noconfigdirs="$noconfigdirs ld gprof"
+     noconfigdirs="$noconfigdirs sim target-rda"
+     ;;
+-  x86_64-*-darwin[[912]]*)
++  x86_64-*-darwin[[912]]* | x86_64-*-ios[[912]]*)
+     noconfigdirs="$noconfigdirs ld gas gprof"
+     noconfigdirs="$noconfigdirs sim target-rda"
+     ;;
+-  *-*-darwin*)
++  *-*-darwin* | *-*-ios*)
+     noconfigdirs="$noconfigdirs ld gas gdb gprof"
+     noconfigdirs="$noconfigdirs sim target-rda"
+     ;;
+@@ -1226,7 +1226,7 @@ case "${host}" in
+   hppa*-*)	
+     host_makefile_frag="config/mh-pa"
+     ;;
+-  *-*-darwin*)
++  *-*-darwin* | *-*-ios*)
+     host_makefile_frag="config/mh-darwin"
+     ;;
+   powerpc-*-aix*)
+@@ -1697,7 +1697,7 @@ ACX_ELF_TARGET_IFELSE([# ELF platforms build the lto-plugin always.
+   build_lto_plugin=yes
+ ],[if test x"$default_enable_lto" = x"yes" ; then
+     case $target in
+-      *-apple-darwin[[912]]* | *-cygwin* | *-mingw* | *djgpp*) ;;
++      *-apple-darwin[[912]]* | *-apple-ios[[912]]* | *-cygwin* | *-mingw* | *djgpp*) ;;
+       # On other non-ELF platforms, LTO has yet to be validated.
+       *) enable_lto=no ;;
+     esac
+@@ -1708,7 +1708,7 @@ ACX_ELF_TARGET_IFELSE([# ELF platforms build the lto-plugin always.
+   # warn during gcc/ subconfigure; unless you're bootstrapping with
+   # -flto it won't be needed until after installation anyway.
+     case $target in
+-      *-cygwin* | *-mingw* | *-apple-darwin* | *djgpp*) ;;
++      *-cygwin* | *-mingw* | *-apple-darwin* | *-apple-ios* | *djgpp*) ;;
+       *) if test x"$enable_lto" = x"yes"; then
+ 	AC_MSG_ERROR([LTO support is not enabled for this target.])
+         fi
+@@ -2590,7 +2590,7 @@ rm -f conftest*
+ # Decide which environment variable is used to find dynamic libraries.
+ case "${host}" in
+   *-*-hpux*) RPATH_ENVVAR=SHLIB_PATH ;;
+-  *-*-darwin*) RPATH_ENVVAR=DYLD_LIBRARY_PATH ;;
++  *-*-darwin* | *-*-ios* ) RPATH_ENVVAR=DYLD_LIBRARY_PATH ;;
+   *-*-mingw* | *-*-cygwin ) RPATH_ENVVAR=PATH ;;
+   *) RPATH_ENVVAR=LD_LIBRARY_PATH ;;
+ esac
diff --git a/nixpkgs/pkgs/development/tools/misc/blackmagic/default.nix b/nixpkgs/pkgs/development/tools/misc/blackmagic/default.nix
new file mode 100644
index 000000000000..ddc15f856b53
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/blackmagic/default.nix
@@ -0,0 +1,66 @@
+{ stdenv, lib, fetchFromGitHub
+, gcc-arm-embedded, libftdi1
+, python, pythonPackages
+}:
+
+with lib;
+
+stdenv.mkDerivation rec {
+  pname = "blackmagic";
+  version = "unstable-2019-08-13";
+  # `git describe --always`
+  firmwareVersion = "v1.6.1-317-gc9c8b08";
+
+  src = fetchFromGitHub {
+    owner = "blacksphere";
+    repo = "blackmagic";
+    rev = "c9c8b089f716c31433432f5ee54c5c206e4945cf";
+    sha256 = "0175plba7h3r1p584ygkjlvg2clvxa2m0xfdcb2v8jza2vzc8ywd";
+    fetchSubmodules = true;
+  };
+
+  nativeBuildInputs = [
+    gcc-arm-embedded
+  ];
+
+  buildInputs = [
+    libftdi1
+    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 ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/blackmagic/helper.sh b/nixpkgs/pkgs/development/tools/misc/blackmagic/helper.sh
new file mode 100755
index 000000000000..991d0249e169
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/blackmagic/helper.sh
@@ -0,0 +1,51 @@
+################################################################################
+# Build all of the platforms manually since the `all_platforms' target
+# doesn't preserve all of the build outputs and overrides CFLAGS.
+set -e
+set -u
+
+################################################################################
+# Prevent a warning from shellcheck:
+out=${out:-/tmp}
+
+################################################################################
+export CFLAGS=$NIX_CFLAGS_COMPILE
+export MAKEFLAGS="\
+  ${enableParallelBuilding:+-j${NIX_BUILD_CORES} -l${NIX_BUILD_CORES}}"
+
+################################################################################
+PRODUCTS="blackmagic.bin blackmagic.hex blackmagic_dfu.bin blackmagic_dfu.hex"
+
+################################################################################
+make_platform() {
+  echo "Building for hardware platform $1"
+
+  make clean
+  make PROBE_HOST="$1"
+
+  if [ "$1" = libftdi ]; then
+    mkdir -p "$out/bin"
+    install -m 0555 blackmagic "$out/bin"
+  fi
+
+  for f in $PRODUCTS; do
+    if [ -r "$f" ]; then
+      mkdir -p "$out/firmware/$1"
+      install -m 0444 "$f" "$out/firmware/$1"
+    fi
+  done
+
+}
+
+################################################################################
+# Start by building libopencm3:
+make -C libopencm3
+
+################################################################################
+# And now all of the platforms:
+cd src
+
+for platform in platforms/*/Makefile.inc; do
+  probe=$(basename "$(dirname "$platform")")
+  make_platform "$probe"
+done
diff --git a/nixpkgs/pkgs/development/tools/misc/bossa/bin2c.c b/nixpkgs/pkgs/development/tools/misc/bossa/bin2c.c
new file mode 100644
index 000000000000..f0b915de540a
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/bossa/bin2c.c
@@ -0,0 +1,122 @@
+// bin2c.c
+//
+// convert a binary file into a C source vector
+//
+// THE "BEER-WARE LICENSE" (Revision 3.1415):
+// sandro AT sigala DOT it wrote this file. As long as you retain this notice you can do
+// whatever you want with this stuff.  If we meet some day, and you think this stuff is
+// worth it, you can buy me a beer in return.  Sandro Sigala
+//
+// syntax:  bin2c [-c] [-z] <input_file> <output_file>
+//
+//          -c    add the "const" keyword to definition
+//          -z    terminate the array with a zero (useful for embedded C strings)
+//
+// examples:
+//     bin2c -c myimage.png myimage_png.cpp
+//     bin2c -z sometext.txt sometext_txt.cpp
+ 
+#include <ctype.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+ 
+#ifndef PATH_MAX
+#define PATH_MAX 1024
+#endif
+ 
+int useconst = 0;
+int zeroterminated = 0;
+ 
+int myfgetc(FILE *f)
+{
+	int c = fgetc(f);
+	if (c == EOF && zeroterminated)
+	{
+		zeroterminated = 0;
+		return 0;
+	}
+	return c;
+}
+ 
+void process(const char *ifname, const char *ofname)
+{
+	FILE *ifile, *ofile;
+	ifile = fopen(ifname, "rb");
+	if (ifile == NULL)
+	{
+		fprintf(stderr, "cannot open %s for reading\n", ifname);
+		exit(1);
+	}
+	ofile = fopen(ofname, "wb");
+	if (ofile == NULL)
+	{
+		fprintf(stderr, "cannot open %s for writing\n", ofname);
+		exit(1);
+	}
+	char buf[PATH_MAX], *p;
+	const char *cp;
+	if ((cp = strrchr(ifname, '/')) != NULL)
+	{
+		++cp;
+	} else {
+		if ((cp = strrchr(ifname, '\\')) != NULL)
+			++cp;
+		else
+			cp = ifname;
+	}
+	strcpy(buf, cp);
+	for (p = buf; *p != '\0'; ++p)
+	{
+		if (!isalnum(*p))
+			*p = '_';
+	}
+	fprintf(ofile, "static %sunsigned char %s[] = {\n", useconst ? "const " : "", buf);
+	int c, col = 1;
+	while ((c = myfgetc(ifile)) != EOF)
+	{
+		if (col >= 78 - 6)
+		{
+			fputc('\n', ofile);
+			col = 1;
+		}
+		fprintf(ofile, "0x%.2x, ", c);
+		col += 6;
+	}
+	fprintf(ofile, "\n};\n");
+ 
+	fclose(ifile);
+	fclose(ofile);
+}
+ 
+void usage(void)
+{
+	fprintf(stderr, "usage: bin2c [-cz] <input_file> <output_file>\n");
+	exit(1);
+}
+ 
+int main(int argc, char **argv)
+{
+	while (argc > 3)
+	{
+		if (!strcmp(argv[1], "-c"))
+		{
+			useconst = 1;
+			--argc;
+			++argv;
+		} else if (!strcmp(argv[1], "-z"))
+		{
+			zeroterminated = 1;
+			--argc;
+			++argv;
+		} else {
+			usage();
+		}
+	}
+	if (argc != 3)
+	{
+		usage();
+	}
+	process(argv[1], argv[2]);
+	return 0;
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/bossa/bossa-no-applet-build.patch b/nixpkgs/pkgs/development/tools/misc/bossa/bossa-no-applet-build.patch
new file mode 100644
index 000000000000..4284245f485d
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/bossa/bossa-no-applet-build.patch
@@ -0,0 +1,16 @@
+diff --git a/Makefile b/Makefile
+index cc8882e..97b11ee 100644
+--- a/Makefile
++++ b/Makefile
+@@ -184,11 +184,6 @@ $(foreach src,$(COMMON_SRCS),$(eval $(call common_obj,$(src))))
+ # Applet rules
+ #
+ define applet_obj
+-$(SRCDIR)/$(1:%.asm=%.cpp): $(SRCDIR)/$(1)
+-	@echo APPLET $(1:%.asm=%)
+-	$$(Q)$$(ARMAS) -o $$(@:%.o=%.obj) $$<
+-	$$(Q)$$(ARMOBJCOPY) -O binary $$(@:%.o=%.obj) $$(@:%.o=%.bin)
+-	$$(Q)appletgen $(1:%.asm=%) $(SRCDIR) $(OBJDIR)
+ $(OBJDIR)/$(1:%.asm=%.o): $(SRCDIR)/$(1:%.asm=%.cpp)
+ 	@echo CPP APPLET $$<
+ 	$$(Q)$$(CXX) $$(COMMON_CXXFLAGS) -c -o $$(@) $$(<:%.asm=%.cpp)
diff --git a/nixpkgs/pkgs/development/tools/misc/bossa/default.nix b/nixpkgs/pkgs/development/tools/misc/bossa/default.nix
new file mode 100644
index 000000000000..6548e9643971
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/bossa/default.nix
@@ -0,0 +1,52 @@
+{ stdenv, fetchgit, wxGTK, libX11, readline }:
+
+let
+  # BOSSA needs a "bin2c" program to embed images.
+  # Source taken from:
+  # http://wiki.wxwidgets.org/Embedding_PNG_Images-Bin2c_In_C
+  bin2c = stdenv.mkDerivation {
+    name = "bossa-bin2c";
+    src = ./bin2c.c;
+    dontUnpack = true;
+    buildPhase = ''cc $src -o bin2c'';
+    installPhase = ''mkdir -p $out/bin; cp bin2c $out/bin/'';
+  };
+
+in
+stdenv.mkDerivation {
+  name = "bossa-1.8";
+
+  src = fetchgit {
+    url = https://github.com/shumatech/BOSSA;
+    rev = "3be622ca0aa6214a2fc51c1ec682c4a58a423d62";
+    sha256 = "19ik86qbffcb04cgmi4mnascbkck4ynfj87ha65qdk6fmp5q35vm";
+  };
+
+  patches = [ ./bossa-no-applet-build.patch ];
+
+  nativeBuildInputs = [ bin2c ];
+  buildInputs = [ wxGTK libX11 readline ];
+
+  # Explicitly specify targets so they don't get stripped.
+  makeFlags = [ "bin/bossac" "bin/bossash" "bin/bossa" ];
+  NIX_CFLAGS_COMPILE = "-Wno-error=deprecated-declarations";
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp bin/bossa{c,sh,} $out/bin/
+  '';
+
+  meta = with stdenv.lib; {
+    description = "A flash programming utility for Atmel's SAM family of flash-based ARM microcontrollers";
+    longDescription = ''
+      BOSSA is a flash programming utility for Atmel's SAM family of
+      flash-based ARM microcontrollers. The motivation behind BOSSA is
+      to create a simple, easy-to-use, open source utility to replace
+      Atmel's SAM-BA software. BOSSA is an acronym for Basic Open
+      Source SAM-BA Application to reflect that goal.
+    '';
+    homepage = http://www.shumatech.com/web/products/bossa;
+    license = licenses.bsd3;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/bsdbuild/default.nix b/nixpkgs/pkgs/development/tools/misc/bsdbuild/default.nix
new file mode 100644
index 000000000000..dd84e3830c41
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/bsdbuild/default.nix
@@ -0,0 +1,68 @@
+{ stdenv, fetchurl, perl, libtool, pkgconfig, gettext, mandoc, ed }:
+
+stdenv.mkDerivation rec {
+  pname = "bsdbuild";
+  version = "3.1";
+
+  src = fetchurl {
+    url = "http://stable.hypertriton.com/bsdbuild/${pname}-${version}.tar.gz";
+    sha256 = "1zrdjh7a6z4khhfw9zrp490afq306cpl5v8wqz2z55ys7k1n5ifl";
+  };
+
+  buildInputs = [ perl mandoc ed ];
+  nativeBuildInputs = [ pkgconfig libtool gettext ];
+
+  prePatch = ''
+    #ignore unfamiliar flags
+    substituteInPlace configure \
+      --replace '--sbindir=*' '--sbindir=* | --includedir=* | --oldincludedir=*'
+    #same for packages using bsdbuild
+    substituteInPlace mkconfigure.pl \
+      --replace '--sbindir=*' '--sbindir=* | --includedir=* | --oldincludedir=*'
+    #insert header for missing NULL macro
+    for f in db4.pm sdl_ttf.pm mysql.pm uim.pm strlcpy.pm getpwuid.pm \
+      getaddrinfo.pm strtoll.pm free_null.pm getpwnam_r.pm \
+      gettimeofday.pm gethostbyname.pm xinerama.pm strsep.pm \
+      fontconfig.pm gettext.pm pthreads.pm strlcat.pm kqueue.pm wgl.pm \
+      alsa.pm crypt.pm cracklib.pm freesg-rg.pm edacious.pm mmap.pm \
+      agar.pm x11.pm x11.pm execvp.pm agar-core.pm dyld.pm getopt.pm \
+      strtold.pm sdl_image.pm shl_load.pm glx.pm percgi.pm timerfd.pm \
+      glob.pm dlopen.pm freesg.pm csidl.pm perl.pm select.pm \
+      portaudio.pm etubestore.pm;
+    do
+ed -s -v BSDBuild/$f << EOF
+/#include
+i
+#include <stddef.h>
+.
+w
+EOF
+    done
+  '';
+
+  configureFlags = [
+    "--with-libtool=${libtool}/bin/libtool"
+    "--enable-nls=yes"
+    "--with-gettext=${gettext}"
+    "--with-manpages=yes"
+  ];
+
+  meta = {
+    homepage = http://bsdbuild.hypertriton.com;
+    description = "A cross-platform build system.";
+
+    longDescription = ''
+      BSDBuild is a cross-platform build system. Derived from the
+      traditional 4.4BSD make libraries, BSDBuild allows BSD-style
+      Makefiles (without BSD make extensions), and works natively
+      under most operating systems and make flavors. Since BSDBuild
+      is implemented as a library (as opposed to a macro package),
+      Makefiles are edited directly, as opposed to being compiled
+      (however, if the build directory is separate from the source
+      directory, BSDBuild will produce the required Makefiles in place).
+    '';
+
+    license = stdenv.lib.licenses.bsd3;
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/cbrowser/backslashes-quotes.diff b/nixpkgs/pkgs/development/tools/misc/cbrowser/backslashes-quotes.diff
new file mode 100644
index 000000000000..cc42f0745da5
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/cbrowser/backslashes-quotes.diff
@@ -0,0 +1,49 @@
+Based on this:
+http://sourceforge.net/tracker/?func=detail&aid=1493886&group_id=5152&atid=305152
+fix the infinite loops in quote highlight - ID: 1493886
+
+--- cbrowser-0.8-2/ftcllib.tcl	2000-07-04 01:17:43.000000000 +0200
++++ cbrowser-0.8/ftcllib.tcl	2006-05-24 00:39:18.833762522 +0200
+@@ -1290,13 +1290,39 @@
+   foreach {start end} [concat 1.0 [$widget tag ranges comment] end] {
+ 
+     while {[set temp [$widget search -regexp -- $pattern $start $end]] != ""} {
++      set startquote [$widget index "$temp + 1chars"]
+ 
+-      set endquote [$widget search -regexp -- {[^\\]\"} "$temp + 1chars" $end]
++      set temp [$widget index "$startquote + 1chars"]
++      while {1==1} {
++        set endquote [$widget search -regexp -- {\"} $temp $end]
++
++	# The program will not break if a /*C comment*/ is between C quotes.
++	if { $endquote == "" } {
++	  set endquote $startquote
++	  break
++	}
++
++        # look for double backslashes
++	if {[set temp2 [$widget search -regexp -- {\\\\} $temp $endquote]] != ""} {
++	  set temp "$temp2 + 2chars"
++	  continue
++	}
++        
++        # look for \"
++	if {[set temp2 [$widget search -regexp -- {\\\"} $temp $endquote]] != ""} {
++	  set temp "$temp2 + 2chars"
++	  continue
++	}
++
++	break
++      }
+ 
+       if {[strlen $endquote] > 0} {
+-        set start [$widget index "$endquote + 2chars"]
++        set start [$widget index "$endquote + 1chars"]
+ 
+-        $widget tag add quote "$temp + 1chars" $start
++        $widget tag add quote $startquote $start
++      } else {
++        set start [$widget index "$start + 1chars"]
+       }
+     }
+   }
diff --git a/nixpkgs/pkgs/development/tools/misc/cbrowser/default.nix b/nixpkgs/pkgs/development/tools/misc/cbrowser/default.nix
new file mode 100644
index 000000000000..6519f349bfc8
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/cbrowser/default.nix
@@ -0,0 +1,34 @@
+{ fetchurl, stdenv, tk, makeWrapper }:
+
+stdenv.mkDerivation rec {
+  name = "cbrowser-0.8";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/cbrowser/cbrowser-0.8.tar.gz";
+    sha256 = "1050mirjab23qsnq3lp3a9vwcbavmh9kznzjm7dr5vkx8b7ffcji";
+  };
+
+  patches = [ ./backslashes-quotes.diff ];
+
+  buildInputs = [ tk makeWrapper ];
+
+  installPhase = ''
+    mkdir -p $out/bin $out/share/${name}
+    cp -R * $out/share/${name}/
+
+    makeWrapper $out/share/${name}/cbrowser $out/bin/cbrowser \
+      --prefix PATH : ${tk}/bin
+  '';
+
+  meta = {
+    description = "Tcl/Tk GUI front-end to cscope";
+
+    license = stdenv.lib.licenses.gpl2Plus;
+
+    homepage = https://sourceforge.net/projects/cbrowser/;
+
+    maintainers = with stdenv.lib.maintainers; [viric];
+
+    platforms = with stdenv.lib.platforms; linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/ccache/default.nix b/nixpkgs/pkgs/development/tools/misc/ccache/default.nix
new file mode 100644
index 000000000000..4eeb61a7edd9
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/ccache/default.nix
@@ -0,0 +1,80 @@
+{ stdenv, fetchurl, perl, zlib, makeWrapper }:
+
+let ccache = stdenv.mkDerivation rec {
+  pname = "ccache";
+  version = "3.4.1";
+
+  src = fetchurl {
+    sha256 = "1pppi4jbkkj641cdynmc35jaj40jjicw7gj75ran5qs5886jcblc";
+    url = "mirror://samba/ccache/${pname}-${version}.tar.xz";
+  };
+
+  nativeBuildInputs = [ perl ];
+
+  buildInputs = [ zlib ];
+
+  outputs = [ "out" "man" ];
+
+  # non to be fail on filesystems with unconventional blocksizes (zfs on Hydra?)
+  patches = [
+    ./fix-debug-prefix-map-suite.patch
+    ./skip-fs-dependent-test.patch
+  ];
+
+  postPatch = ''
+    substituteInPlace Makefile.in --replace 'objs) $(extra_libs)' 'objs)'
+  '';
+
+  doCheck = !stdenv.isDarwin;
+
+  passthru = {
+    # A derivation that provides gcc and g++ commands, but that
+    # will end up calling ccache for the given cacheDir
+    links = {unwrappedCC, extraConfig}: stdenv.mkDerivation {
+      name = "ccache-links";
+      passthru = {
+        isClang = unwrappedCC.isClang or false;
+        isGNU = unwrappedCC.isGNU or false;
+      };
+      inherit (unwrappedCC) lib;
+      nativeBuildInputs = [ makeWrapper ];
+      buildCommand = ''
+        mkdir -p $out/bin
+
+        wrap() {
+          local cname="$1"
+          if [ -x "${unwrappedCC}/bin/$cname" ]; then
+            makeWrapper ${ccache}/bin/ccache $out/bin/$cname \
+              --run ${stdenv.lib.escapeShellArg extraConfig} \
+              --add-flags ${unwrappedCC}/bin/$cname
+          fi
+        }
+
+        wrap cc
+        wrap c++
+        wrap gcc
+        wrap g++
+        wrap clang
+        wrap clang++
+
+        for executable in $(ls ${unwrappedCC}/bin); do
+          if [ ! -x "$out/bin/$executable" ]; then
+            ln -s ${unwrappedCC}/bin/$executable $out/bin/$executable
+          fi
+        done
+        for file in $(ls ${unwrappedCC} | grep -vw bin); do
+          ln -s ${unwrappedCC}/$file $out/$file
+        done
+      '';
+    };
+  };
+
+  meta = with stdenv.lib; {
+    description = "Compiler cache for fast recompilation of C/C++ code";
+    homepage = http://ccache.samba.org/;
+    downloadPage = https://ccache.samba.org/download.html;
+    license = licenses.gpl3Plus;
+    platforms = platforms.unix;
+  };
+};
+in ccache
diff --git a/nixpkgs/pkgs/development/tools/misc/ccache/fix-debug-prefix-map-suite.patch b/nixpkgs/pkgs/development/tools/misc/ccache/fix-debug-prefix-map-suite.patch
new file mode 100644
index 000000000000..98a6fbf10bf1
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/ccache/fix-debug-prefix-map-suite.patch
@@ -0,0 +1,42 @@
+--- a/test/suites/debug_prefix_map.bash
++++ b/test/suites/debug_prefix_map.bash
+@@ -29,7 +29,7 @@
+     expect_stat 'cache hit (preprocessed)' 0
+     expect_stat 'cache miss' 1
+     expect_stat 'files in cache' 2
+-    if grep -E "[^=]`pwd`[^=]" test.o >/dev/null 2>&1; then
++    if objdump -g test.o | grep ": `pwd`$" >/dev/null 2>&1; then
+         test_failed "Source dir (`pwd`) found in test.o"
+     fi
+
+@@ -39,7 +39,7 @@
+     expect_stat 'cache hit (preprocessed)' 0
+     expect_stat 'cache miss' 1
+     expect_stat 'files in cache' 2
+-    if grep -E "[^=]`pwd`[^=]" test.o >/dev/null 2>&1; then
++    if objdump -g test.o | grep ": `pwd`$" >/dev/null 2>&1; then
+         test_failed "Source dir (`pwd`) found in test.o"
+     fi
+
+@@ -52,10 +52,10 @@
+     expect_stat 'cache hit (preprocessed)' 0
+     expect_stat 'cache miss' 1
+     expect_stat 'files in cache' 2
+-    if grep -E "[^=]`pwd`[^=]" test.o >/dev/null 2>&1; then
++    if objdump -g test.o | grep ": `pwd`$" >/dev/null 2>&1; then
+         test_failed "Source dir (`pwd`) found in test.o"
+     fi
+-    if ! grep "name" test.o >/dev/null 2>&1; then
++    if ! objdump -g test.o | grep ": name$" >/dev/null 2>&1; then
+         test_failed "Relocation (name) not found in test.o"
+     fi
+
+@@ -65,7 +65,7 @@
+     expect_stat 'cache hit (preprocessed)' 0
+     expect_stat 'cache miss' 1
+     expect_stat 'files in cache' 2
+-    if grep -E "[^=]`pwd`[^=]" test.o >/dev/null 2>&1; then
++    if objdump -g test.o | grep ": `pwd`$" >/dev/null 2>&1; then
+         test_failed "Source dir (`pwd`) found in test.o"
+     fi
+ }
diff --git a/nixpkgs/pkgs/development/tools/misc/ccache/skip-fs-dependent-test.patch b/nixpkgs/pkgs/development/tools/misc/ccache/skip-fs-dependent-test.patch
new file mode 100644
index 000000000000..7b233df6531b
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/ccache/skip-fs-dependent-test.patch
@@ -0,0 +1,26 @@
+--- a/test/suites/cleanup.bash
++++ b/test/suites/cleanup.bash
+@@ -94,23 +94,6 @@
+
+     $CCACHE -F 0 -M 256K >/dev/null
+     CCACHE_LOGFILE=/tmp/foo $CCACHE -c >/dev/null
+-    expect_file_count 3 '*.o' $CCACHE_DIR
+-    expect_file_count 3 '*.d' $CCACHE_DIR
+-    expect_file_count 3 '*.stderr' $CCACHE_DIR
+-    expect_stat 'files in cache' 9
+-    expect_stat 'cleanups performed' 1
+-    for i in 3 4 5; do
+-        file=$CCACHE_DIR/a/result$i-4017.o
+-        if [ ! -f $file ]; then
+-            test_failed "File $file removed when it shouldn't"
+-        fi
+-    done
+-    for i in 0 1 2 6 7 8 9; do
+-        file=$CCACHE_DIR/a/result$i-4017.o
+-        if [ -f $file ]; then
+-            test_failed "File $file not removed when it should"
+-        fi
+-    done
+
+     # -------------------------------------------------------------------------
+     TEST "Automatic cache cleanup, limit_multiple 0.9"
diff --git a/nixpkgs/pkgs/development/tools/misc/ccls/default.nix b/nixpkgs/pkgs/development/tools/misc/ccls/default.nix
new file mode 100644
index 000000000000..e42c3e58db8e
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/ccls/default.nix
@@ -0,0 +1,50 @@
+{ stdenv, fetchFromGitHub
+, cmake, llvmPackages, rapidjson, runtimeShell }:
+
+stdenv.mkDerivation rec {
+  pname = "ccls";
+  version = "0.20190823";
+
+  src = fetchFromGitHub {
+    owner = "MaskRay";
+    repo = "ccls";
+    rev = version;
+    sha256 = "1qy1kf83mrvbhwl8m0h7ralwd3sid8y8fpk7pmy81y1nq8f1cf6f";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = with llvmPackages; [ clang-unwrapped llvm rapidjson ];
+
+  cmakeFlags = [
+    "-DCCLS_VERSION=${version}"
+    "-DCMAKE_OSX_DEPLOYMENT_TARGET=10.12"
+  ];
+
+  preConfigure = ''
+    cmakeFlagsArray+=(-DCMAKE_CXX_FLAGS="-fvisibility=hidden -fno-rtti")
+  '';
+
+  shell = runtimeShell;
+  postFixup = ''
+    # We need to tell ccls where to find the standard library headers.
+
+    standard_library_includes="\\\"-isystem\\\", \\\"${stdenv.lib.getDev stdenv.cc.libc}/include\\\""
+    standard_library_includes+=", \\\"-isystem\\\", \\\"${llvmPackages.libcxx}/include/c++/v1\\\""
+    export standard_library_includes
+
+    wrapped=".ccls-wrapped"
+    export wrapped
+
+    mv $out/bin/ccls $out/bin/$wrapped
+    substituteAll ${./wrapper} $out/bin/ccls
+    chmod --reference=$out/bin/$wrapped $out/bin/ccls
+  '';
+
+  meta = with stdenv.lib; {
+    description = "A c/c++ language server powered by clang";
+    homepage    = https://github.com/MaskRay/ccls;
+    license     = licenses.asl20;
+    platforms   = platforms.linux ++ platforms.darwin;
+    maintainers = [ maintainers.mic92 ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/ccls/wrapper b/nixpkgs/pkgs/development/tools/misc/ccls/wrapper
new file mode 100644
index 000000000000..f8d7b9eb3fea
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/ccls/wrapper
@@ -0,0 +1,12 @@
+#! @shell@ -e
+
+initString="--init={\"clang\":{\"extraArgs\": [@standard_library_includes@"
+
+if [ "${NIX_CFLAGS_COMPILE}" != "" ]; then
+  read -a cflags_array <<< ${NIX_CFLAGS_COMPILE}
+  initString+=$(printf ', \"%s\"' "${cflags_array[@]}")
+fi
+
+initString+="]}}"
+
+exec -a "$0" "@out@/bin/@wrapped@" "${initString}" "${extraFlagsArray[@]}" "$@"
diff --git a/nixpkgs/pkgs/development/tools/misc/cflow/default.nix b/nixpkgs/pkgs/development/tools/misc/cflow/default.nix
new file mode 100644
index 000000000000..ed4886305e3c
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/cflow/default.nix
@@ -0,0 +1,57 @@
+{ stdenv, fetchurl, gettext, emacs }:
+
+stdenv.mkDerivation rec {
+  name = "cflow-1.6";
+
+  src = fetchurl {
+    url = "mirror://gnu/cflow/${name}.tar.bz2";
+    sha256 = "1mzd3yf0dfv8h2av5vsxxlhpk21nw064h91b2kgfrdz92r0pnj1l";
+  };
+
+  patchPhase = ''
+    substituteInPlace "src/cflow.h"					\
+      --replace "/usr/bin/cpp"						\
+                "$(cat ${stdenv.cc}/nix-support/orig-cc)/bin/cpp"
+  '';
+
+  buildInputs = [ gettext ] ++
+    # We don't have Emacs/GTK/etc. on {Dar,Cyg}win.
+    stdenv.lib.optional
+      (! (stdenv.lib.lists.any (x: stdenv.hostPlatform.system == x)
+              [ "i686-cygwin" ]))
+      emacs;
+
+  doCheck = true;
+
+  meta = with stdenv.lib; {
+    description = "Tool to analyze the control flow of C programs";
+
+    longDescription = ''
+      GNU cflow analyzes a collection of C source files and prints a
+      graph, charting control flow within the program.
+
+      GNU cflow is able to produce both direct and inverted flowgraphs
+      for C sources.  Optionally a cross-reference listing can be
+      generated.  Two output formats are implemented: POSIX and GNU
+      (extended).
+
+      The package also provides Emacs major mode for examining the
+      produced flowcharts in Emacs.
+    '';
+
+    license = licenses.gpl3Plus;
+
+    homepage = https://www.gnu.org/software/cflow/;
+
+    maintainers = [ maintainers.vrthra ];
+
+    /* On Darwin, build fails with:
+
+       Undefined symbols:
+         "_argp_program_version", referenced from:
+             _argp_program_version$non_lazy_ptr in libcflow.a(argp-parse.o)
+       ld: symbol(s) not found
+     */
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/cgdb/default.nix b/nixpkgs/pkgs/development/tools/misc/cgdb/default.nix
new file mode 100644
index 000000000000..f823519fb34a
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/cgdb/default.nix
@@ -0,0 +1,26 @@
+{ stdenv, fetchurl, ncurses, readline, flex, texinfo }:
+
+stdenv.mkDerivation rec {
+  pname = "cgdb";
+  version = "0.7.1";
+
+  src = fetchurl {
+    url = "https://cgdb.me/files/${pname}-${version}.tar.gz";
+    sha256 = "1671gpz5gx5j0zga8xy2x7h33vqh3nij93lbb6dbb366ivjknwmv";
+  };
+
+  buildInputs = [ ncurses readline flex texinfo ];
+
+  meta = with stdenv.lib; {
+    description = "A curses interface to gdb";
+
+    homepage = https://cgdb.github.io/;
+
+    repositories.git = git://github.com/cgdb/cgdb.git;
+
+    license = licenses.gpl2Plus;
+
+    platforms = with platforms; linux ++ cygwin;
+    maintainers = with maintainers; [ vrthra ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/checkbashisms/default.nix b/nixpkgs/pkgs/development/tools/misc/checkbashisms/default.nix
new file mode 100644
index 000000000000..887a0f16ec1a
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/checkbashisms/default.nix
@@ -0,0 +1,26 @@
+{ stdenv, fetchurl, perl }:
+stdenv.mkDerivation rec {
+  version = "2.0.0.2";
+  pname = "checkbashisms";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/project/checkbaskisms/${version}/checkbashisms";
+    sha256 = "1vm0yykkg58ja9ianfpm3mgrpah109gj33b41kl0jmmm11zip9jd";
+  };
+
+  buildInputs = [ perl ];
+
+  # The link returns directly the script. No need for unpacking
+  dontUnpack = true;
+
+  installPhase = ''
+    install -D -m755 $src $out/bin/checkbashisms
+  '';
+
+  meta = {
+    homepage = https://sourceforge.net/projects/checkbaskisms/;
+    description = "Check shell scripts for non-portable syntax";
+    license = stdenv.lib.licenses.gpl2;
+    platforms = stdenv.lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/chrpath/default.nix b/nixpkgs/pkgs/development/tools/misc/chrpath/default.nix
new file mode 100644
index 000000000000..956a8df69cea
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/chrpath/default.nix
@@ -0,0 +1,23 @@
+{ stdenv, fetchurl }:
+
+stdenv.mkDerivation {
+  name = "chrpath-0.16";
+
+  src = fetchurl {
+    url = "https://alioth.debian.org/frs/download.php/file/3979/chrpath-0.16.tar.gz";
+    sha256 = "0yvfq891mcdkf8g18gjjkn2m5rvs8z4z4cl1vwdhx6f2p9a4q3dv";
+  };
+
+  meta = with stdenv.lib; {
+    description = "Command line tool to adjust the RPATH or RUNPATH of ELF binaries";
+    longDescription = ''
+      chrpath changes, lists or removes the rpath or runpath setting in a
+      binary. The rpath, or runpath if it is present, is where the runtime
+      linker should look for the libraries needed for a program.
+    '';
+    homepage = https://alioth.debian.org/projects/chrpath/;
+    license = licenses.gpl2;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.bjornfor ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/chruby/default.nix b/nixpkgs/pkgs/development/tools/misc/chruby/default.nix
new file mode 100644
index 000000000000..1aac0bd651c7
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/chruby/default.nix
@@ -0,0 +1,45 @@
+{ stdenv, lib, fetchFromGitHub, runCommand, rubies ? null }:
+
+let
+  rubiesEnv = runCommand "chruby-env" { preferLocalBuild = true; } ''
+    mkdir $out
+    ${lib.concatStrings
+        (lib.mapAttrsToList (name: path: "ln -s ${path} $out/${name}\n") rubies)}
+  '';
+
+in stdenv.mkDerivation rec {
+  pname = "chruby";
+
+  version = "0.3.9";
+
+  src = fetchFromGitHub {
+    owner = "postmodern";
+    repo = "chruby";
+    rev = "v${version}";
+    sha256 = "1894g6fymr8kra9vwhbmnrcr58l022mcd7g9ans4zd3izla2j3gx";
+  };
+
+  phases = [ "unpackPhase" "patchPhase" "installPhase" "fixupPhase" ];
+
+  patches = lib.optionalString (rubies != null) [
+    ./env.patch
+  ];
+
+  postPatch = lib.optionalString (rubies != null) ''
+    substituteInPlace share/chruby/chruby.sh --replace "@rubiesEnv@" ${rubiesEnv}
+  '';
+
+  installPhase = ''
+    mkdir $out
+    cp -r bin $out
+    cp -r share $out
+  '';
+
+  meta = with lib; {
+    description = "Changes the current Ruby";
+    homepage = https://github.com/postmodern/chruby;
+    license = licenses.mit;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ cstrahan ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/chruby/env.patch b/nixpkgs/pkgs/development/tools/misc/chruby/env.patch
new file mode 100644
index 000000000000..6a4ef8b73497
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/chruby/env.patch
@@ -0,0 +1,12 @@
+diff --git a/share/chruby/chruby.sh b/share/chruby/chruby.sh
+--- a/share/chruby/chruby.sh
++++ b/share/chruby/chruby.sh
+@@ -1,7 +1,7 @@
+ CHRUBY_VERSION="0.3.8"
+ RUBIES=()
+ 
+-for dir in "$PREFIX/opt/rubies" "$HOME/.rubies"; do
++for dir in @rubiesEnv@; do
+ 	[[ -d "$dir" && -n "$(ls -A "$dir")" ]] && RUBIES+=("$dir"/*)
+ done
+ unset dir
diff --git a/nixpkgs/pkgs/development/tools/misc/circleci-cli/default.nix b/nixpkgs/pkgs/development/tools/misc/circleci-cli/default.nix
new file mode 100644
index 000000000000..a590d4a61067
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/circleci-cli/default.nix
@@ -0,0 +1,35 @@
+{ stdenv, fetchFromGitHub, buildGoModule }:
+
+buildGoModule rec {
+  pname = "circleci-cli";
+  version = "0.1.5879";
+
+  src = fetchFromGitHub {
+    owner = "CircleCI-Public";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "1471g56apaw0c5dpa0jrr7hvzh3kbwfr3yr0m4mz2dlf27d481ac";
+  };
+
+  modSha256 = "0cvmcsl00jfikpkw3f7k5zw65156z5g5l2b6s5803a2i9d613268";
+
+  preBuild = ''
+    substituteInPlace data/data.go \
+      --replace 'packr.New("circleci-cli-box", "../_data")' 'packr.New("circleci-cli-box", "${placeholder "out"}/share/circleci-cli")'
+  '';
+
+  postInstall = ''
+    install -Dm644 -t $out/share/circleci-cli _data/data.yml
+  '';
+
+  meta = with stdenv.lib; {
+    # Box blurb edited from the AUR package circleci-cli
+    description = ''
+      Command to enable you to reproduce the CircleCI environment locally and
+      run jobs as if they were running on the hosted CirleCI application.
+    '';
+    maintainers = with maintainers; [ synthetica ];
+    license = licenses.mit;
+    homepage = https://circleci.com/;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/cl-launch/default.nix b/nixpkgs/pkgs/development/tools/misc/cl-launch/default.nix
new file mode 100644
index 000000000000..c245a32a06d9
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/cl-launch/default.nix
@@ -0,0 +1,38 @@
+{stdenv, fetchurl}:
+let
+  s = # Generated upstream information
+  rec {
+    baseName="cl-launch";
+    version="4.1.4.1";
+    name="${baseName}-${version}";
+    hash="09450yknzb0m3375lg4k8gdypmk3xwl8m1krv1kvhylmrm3995mz";
+    url="http://common-lisp.net/project/xcvb/cl-launch/cl-launch-4.1.4.1.tar.gz";
+    sha256="09450yknzb0m3375lg4k8gdypmk3xwl8m1krv1kvhylmrm3995mz";
+  };
+  buildInputs = [
+  ];
+in
+stdenv.mkDerivation {
+  inherit (s) name version;
+  inherit buildInputs;
+  src = fetchurl {
+    inherit (s) url sha256;
+  };
+
+  preConfigure = ''
+    export makeFlags="$makeFlags PREFIX='$out'"
+    mkdir -p "$out/bin"
+  '';
+
+  preBuild = ''
+    sed -e 's/\t\t@/\t\t/g' -i Makefile
+  '';
+
+  meta = {
+    inherit (s) version;
+    description = ''Common Lisp launcher script'';
+    license = stdenv.lib.licenses.llgpl21 ;
+    maintainers = [stdenv.lib.maintainers.raskin];
+    platforms = stdenv.lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/cl-launch/default.upstream b/nixpkgs/pkgs/development/tools/misc/cl-launch/default.upstream
new file mode 100644
index 000000000000..ff7ee9446d28
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/cl-launch/default.upstream
@@ -0,0 +1,2 @@
+url http://common-lisp.net/project/xcvb/cl-launch/
+version_link '.-[0-9].*[0-9][.]tar[.][a-z0-9]*$'
diff --git a/nixpkgs/pkgs/development/tools/misc/cli11/default.nix b/nixpkgs/pkgs/development/tools/misc/cli11/default.nix
new file mode 100644
index 000000000000..a3579b734084
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/cli11/default.nix
@@ -0,0 +1,35 @@
+{ stdenv, fetchFromGitHub, cmake, gtest, python, boost }:
+
+stdenv.mkDerivation rec {
+  pname = "cli11";
+  version = "1.8.0";
+
+  src = fetchFromGitHub {
+    owner = "CLIUtils";
+    repo = "CLI11";
+    rev = "v${version}";
+    sha256 = "0i1x4ax5hal7jdsxw40ljwfv68h0ac85iyi35i8p52p9s5qsc71q";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  checkInputs = [ boost python ];
+
+  doCheck = true;
+
+  preConfigure = ''
+    rm -rfv extern/googletest
+    ln -sfv ${gtest.src} extern/googletest
+  '';
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    description = "CLI11 is a command line parser for C++11";
+    homepage = https://github.com/CLIUtils/CLI11;
+    platforms = [ "x86_64-linux" ];
+    maintainers = with maintainers; [ nand0p ];
+    license = licenses.unfreeRedistributable;
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/coccinelle/default.nix b/nixpkgs/pkgs/development/tools/misc/coccinelle/default.nix
new file mode 100644
index 000000000000..861a6eff1640
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/coccinelle/default.nix
@@ -0,0 +1,57 @@
+{ fetchurl, stdenv, python, ncurses, ocamlPackages, pkgconfig }:
+
+stdenv.mkDerivation rec {
+  pname = "coccinelle";
+  version = "1.0.6";
+
+  src = fetchurl {
+    url = "http://coccinelle.lip6.fr/distrib/${pname}-${version}.tgz";
+    sha256 = "02g9hmwkvfl838zz690yra5jzrqjg6y6ffxkrfcsx790bhkfsll4";
+  };
+
+  buildInputs = with ocamlPackages; [
+    ocaml findlib menhir
+    ocaml_pcre pycaml
+    python ncurses pkgconfig
+  ];
+
+  doCheck = !stdenv.isDarwin;
+
+  # The build system builds two versions of spgen:
+  # 'spgen' with ocamlc -custom (bytecode specially linked)
+  # and 'spgen.opt' using ocamlopt.
+  # I'm not sure of the intentions here, but the way
+  # the 'spgen' binary is produced results in an
+  # invalid/incorrect interpreter path (/lib/ld-linux*).
+  # We could patch it, but without knowing why it's
+  # finding the wrong path it seems safer to use
+  # the .opt version that is built correctly.
+  # All that said, our fix here is simple: remove 'spgen'.
+  # The bin/spgen entrypoint is really a bash script
+  # and will use spgen.opt if 'spgen' doesn't exist.
+  postInstall = ''
+    rm $out/lib/coccinelle/spgen/spgen
+  '';
+
+  meta = {
+    description = "Program to apply semantic patches to C code";
+    longDescription = ''
+      Coccinelle is a program matching and transformation engine which
+      provides the language SmPL (Semantic Patch Language) for
+      specifying desired matches and transformations in C code.
+      Coccinelle was initially targeted towards performing collateral
+      evolutions in Linux.  Such evolutions comprise the changes that
+      are needed in client code in response to evolutions in library
+      APIs, and may include modifications such as renaming a function,
+      adding a function argument whose value is somehow
+      context-dependent, and reorganizing a data structure.  Beyond
+      collateral evolutions, Coccinelle is successfully used (by us
+      and others) for finding and fixing bugs in systems code.
+    '';
+
+    homepage = http://coccinelle.lip6.fr/;
+    license = stdenv.lib.licenses.gpl2;
+    platforms = stdenv.lib.platforms.unix;
+    maintainers = [ stdenv.lib.maintainers.thoughtpolice ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/complexity/default.nix b/nixpkgs/pkgs/development/tools/misc/complexity/default.nix
new file mode 100644
index 000000000000..a2a39b810553
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/complexity/default.nix
@@ -0,0 +1,32 @@
+{ fetchurl, stdenv, autogen }:
+
+stdenv.mkDerivation rec {
+  pname = "complexity";
+  version = "1.10";
+
+  src = fetchurl {
+    url = "mirror://gnu/complexity/${pname}-${version}.tar.gz";
+    sha256 = "1vfns9xm7w0wrz12a3w15slrqnrfh6qxk15nv7qkj3irll3ff522";
+  };
+
+  buildInputs = [ autogen ];
+
+  doCheck = true;
+
+  meta = {
+    description = "C code complexity measurement tool";
+
+    longDescription =
+      '' GNU Complexity is a tool designed for analyzing the complexity of C
+         program functions.  It is very similar to the McCabe scoring, but
+         addresses several issues not considered in that scoring scheme.
+      '';
+
+    license = stdenv.lib.licenses.gpl3Plus;
+
+    homepage = https://www.gnu.org/software/complexity/;
+
+    platforms = stdenv.lib.platforms.gnu ++ stdenv.lib.platforms.linux;
+    maintainers = [ ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/cppi/default.nix b/nixpkgs/pkgs/development/tools/misc/cppi/default.nix
new file mode 100644
index 000000000000..e4d123dece1d
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/cppi/default.nix
@@ -0,0 +1,31 @@
+{ fetchurl, stdenv }:
+
+stdenv.mkDerivation rec {
+  name = "cppi-1.18";
+
+  src = fetchurl {
+    url = "mirror://gnu/cppi/${name}.tar.xz";
+    sha256 = "1jk42cjaggk71rimjnx3qpmb6hivps0917vl3z7wbxk3i2whb98j";
+  };
+
+  doCheck = true;
+
+  meta = {
+    homepage = https://savannah.gnu.org/projects/cppi/;
+
+    description = "A C preprocessor directive indenter";
+
+    longDescription =
+      '' GNU cppi indents C preprocessor directives to reflect their nesting
+         and ensure that there is exactly one space character between each #if,
+         #elif, #define directive and the following token.  The number of
+         spaces between the `#' and the following directive must correspond
+         to the level of nesting of that directive.
+      '';
+
+    license = stdenv.lib.licenses.gpl3Plus;
+
+    maintainers = [ ];
+    platforms = stdenv.lib.platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/cproto/cproto_patch b/nixpkgs/pkgs/development/tools/misc/cproto/cproto_patch
new file mode 100644
index 000000000000..3743fef977b0
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/cproto/cproto_patch
@@ -0,0 +1,11 @@
+diff -Naur cproto-4.6-old/cproto.h cproto-4.6/cproto.h
+--- cproto-4.6-old/cproto.h	1998-01-18 19:49:16.000000000 -0500
++++ cproto-4.6/cproto.h	2004-03-14 00:02:32.148070032 -0500
+@@ -117,6 +117,7 @@
+     Declarator *declarator;
+     DeclaratorList decl_list;
+ } YYSTYPE;
++#define YYSTYPE_IS_DECLARED 1
+ 
+ /* Prototype styles */
+ #if OPT_LINTLIBRARY
diff --git a/nixpkgs/pkgs/development/tools/misc/cproto/default.nix b/nixpkgs/pkgs/development/tools/misc/cproto/default.nix
new file mode 100644
index 000000000000..973caee64e85
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/cproto/default.nix
@@ -0,0 +1,34 @@
+{ stdenv, fetchurl, flex, bison }:
+
+stdenv.mkDerivation rec {
+  pname = "cproto";
+  version = "4.7o";
+
+  src = fetchurl {
+    urls = [
+      "mirror://debian/pool/main/c/cproto/cproto_${version}.orig.tar.gz"
+      # No version listings and apparently no versioned tarball over http(s).
+      "ftp://ftp.invisible-island.net/cproto/cproto-${version}.tgz"
+    ];
+    sha256 = "0kxlrhhgm84v2q6n3wp7bb77g7wjxkb7azdvb6a70naf0rr0nsy7";
+  };
+
+  # patch made by Joe Khoobyar copied from gentoo bugs
+  patches = ./cproto_patch;
+
+  nativeBuildInputs = [ flex bison ];
+
+  doCheck = true;
+
+  doInstallCheck = true;
+  installCheckPhase = ''
+    [ "$("$out/bin/cproto" -V 2>&1)" = '${version}' ]
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Tool to generate C function prototypes from C source code";
+    homepage = https://invisible-island.net/cproto/;
+    license = licenses.publicDomain;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/cquery/default.nix b/nixpkgs/pkgs/development/tools/misc/cquery/default.nix
new file mode 100644
index 000000000000..c43509a4f43b
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/cquery/default.nix
@@ -0,0 +1,65 @@
+{ fetchFromGitHub, makeWrapper
+, cmake, llvmPackages, ncurses
+, runtimeShell }:
+
+let
+  src = fetchFromGitHub {
+    owner = "cquery-project";
+    repo = "cquery";
+    rev = "a95a6503d68a85baa25465ce147b7fc20f4a552e";
+    sha256 = "0rxbdln7dqkdw4q8rhclssgwypq16g9flkwmaabsr8knckbszxrx";
+    fetchSubmodules = true;
+  };
+
+  stdenv = llvmPackages.stdenv;
+
+in
+stdenv.mkDerivation {
+  pname = "cquery";
+  version = "2018-10-14";
+
+  inherit src;
+
+  nativeBuildInputs = [ cmake makeWrapper ];
+  buildInputs = with llvmPackages; [ clang clang-unwrapped llvm ncurses ];
+
+  cmakeFlags = [
+    "-DSYSTEM_CLANG=ON"
+    "-DCLANG_CXX=ON"
+    "-DCMAKE_OSX_DEPLOYMENT_TARGET=10.12"
+  ];
+
+  shell = runtimeShell;
+  postFixup = ''
+    # We need to tell cquery where to find the standard library headers.
+
+    standard_library_includes="\\\"-isystem\\\", \\\"${stdenv.lib.getDev stdenv.cc.libc}/include\\\""
+    standard_library_includes+=", \\\"-isystem\\\", \\\"${llvmPackages.libcxx}/include/c++/v1\\\""
+    export standard_library_includes
+
+    wrapped=".cquery-wrapped"
+    export wrapped
+
+    mv $out/bin/cquery $out/bin/$wrapped
+    substituteAll ${./wrapper} $out/bin/cquery
+    chmod --reference=$out/bin/$wrapped $out/bin/cquery
+  '';
+
+  doInstallCheck = true;
+  installCheckPhase = ''
+    pushd ${src}
+    $out/bin/cquery --ci --test-unit
+
+    # The integration tests have to be disabled because cquery ignores `--init`
+    # if they are invoked, which means it won't find the system includes.
+    #$out/bin/cquery --ci --test-index
+  '';
+
+  meta = with stdenv.lib; {
+    description = "A c/c++ language server powered by libclang";
+    homepage    = https://github.com/cquery-project/cquery;
+    license     = licenses.mit;
+    platforms   = platforms.linux ++ platforms.darwin;
+    maintainers = [ maintainers.tobim ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/cquery/wrapper b/nixpkgs/pkgs/development/tools/misc/cquery/wrapper
new file mode 100644
index 000000000000..534f900f94af
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/cquery/wrapper
@@ -0,0 +1,12 @@
+#! @shell@ -e
+
+initString="--init={\"cacheDirectory\": \"/tmp/cquery\", \"extraClangArguments\": [@standard_library_includes@"
+
+if [ "${NIX_CFLAGS_COMPILE}" != "" ]; then
+  read -a cflags_array <<< ${NIX_CFLAGS_COMPILE}
+  initString+=$(printf ', \"%s\"' "${cflags_array[@]}")
+fi
+
+initString+="]}"
+
+exec -a "$0" "@out@/bin/@wrapped@" "${initString}" "${extraFlagsArray[@]}" "$@"
diff --git a/nixpkgs/pkgs/development/tools/misc/creduce/default.nix b/nixpkgs/pkgs/development/tools/misc/creduce/default.nix
new file mode 100644
index 000000000000..1aa17bac750c
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/creduce/default.nix
@@ -0,0 +1,57 @@
+{ stdenv, fetchurl, cmake, makeWrapper
+, llvm, clang-unwrapped
+, flex
+, zlib
+, perlPackages
+, utillinux
+}:
+
+stdenv.mkDerivation rec {
+  pname = "creduce";
+  version = "2.9.0";
+
+  src = fetchurl {
+    url = "https://embed.cs.utah.edu/${pname}/${pname}-${version}.tar.gz";
+    sha256 = "1b833z0g1hich68kzbkpfc26xb8w2phfl5savy8c6ir9ihwy1a8w";
+  };
+
+  nativeBuildInputs = [ cmake makeWrapper ];
+  buildInputs = [
+    # Ensure stdenv's CC is on PATH before clang-unwrapped
+    stdenv.cc
+    # Actual deps:
+    llvm clang-unwrapped
+    flex zlib
+  ] ++ (with perlPackages; [ perl ExporterLite FileWhich GetoptTabular RegexpCommon TermReadKey ]);
+
+  # On Linux, c-reduce's preferred way to reason about
+  # the cpu architecture/topology is to use 'lscpu',
+  # so let's make sure it knows where to find it:
+  postPatch = stdenv.lib.optionalString stdenv.isLinux ''
+    substituteInPlace creduce/creduce_utils.pm --replace \
+      lscpu ${utillinux}/bin/lscpu
+  '';
+
+
+  enableParallelBuilding = true;
+
+  postInstall = ''
+    wrapProgram $out/bin/creduce --prefix PERL5LIB : "$PERL5LIB"
+  '';
+
+  meta = with stdenv.lib; {
+    description = "A C program reducer";
+    homepage = https://embed.cs.utah.edu/creduce;
+    # Officially, the license is: https://github.com/csmith-project/creduce/blob/master/COPYING
+    license = licenses.ncsa;
+    longDescription = ''
+      C-Reduce is a tool that takes a large C or C++ program that has a
+      property of interest (such as triggering a compiler bug) and
+      automatically produces a much smaller C/C++ program that has the same
+      property.  It is intended for use by people who discover and report
+      bugs in compilers and other tools that process C/C++ code.
+    '';
+    maintainers = [ maintainers.dtzWill ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/cscope/default.nix b/nixpkgs/pkgs/development/tools/misc/cscope/default.nix
new file mode 100644
index 000000000000..67cd321cfd53
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/cscope/default.nix
@@ -0,0 +1,53 @@
+{ fetchurl, stdenv, ncurses
+, emacsSupport ? true, emacs
+}:
+
+stdenv.mkDerivation rec {
+  name = "cscope-15.9";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/cscope/${name}.tar.gz";
+    sha256 = "0ngiv4aj3rr35k3q3wjx0y19gh7i1ydqa0cqip6sjwd8fph5ll65";
+  };
+
+  configureFlags = [ "--with-ncurses=${ncurses.dev}" ];
+
+  buildInputs = [ ncurses ];
+  nativeBuildInputs = stdenv.lib.optional emacsSupport emacs;
+
+  postInstall = stdenv.lib.optionalString emacsSupport ''
+    cd "contrib/xcscope"
+
+    sed -i "cscope-indexer" \
+        -"es|^PATH=.*$|PATH=\"$out/bin:\$PATH\"|g"
+    sed -i "xcscope.el" \
+        -"es|\"cscope-indexer\"|\"$out/libexec/cscope/cscope-indexer\"|g";
+
+    mkdir -p "$out/libexec/cscope"
+    cp "cscope-indexer" "$out/libexec/cscope"
+
+    mkdir -p "$out/share/emacs/site-lisp"
+    emacs --batch --eval '(byte-compile-file "xcscope.el")'
+    cp xcscope.el{,c} "$out/share/emacs/site-lisp"
+  '';
+
+  meta = {
+    description = "A developer's tool for browsing source code";
+
+    longDescription = ''
+      Cscope is a developer's tool for browsing source code.  It has
+      an impeccable Unix pedigree, having been originally developed at
+      Bell Labs back in the days of the PDP-11.  Cscope was part of
+      the official AT&T Unix distribution for many years, and has been
+      used to manage projects involving 20 million lines of code!
+    '';
+
+    license = "BSD-style";
+
+    homepage = http://cscope.sourceforge.net/;
+
+    maintainers = with stdenv.lib.maintainers; [viric];
+
+    platforms = stdenv.lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/csmith/default.nix b/nixpkgs/pkgs/development/tools/misc/csmith/default.nix
new file mode 100644
index 000000000000..34cbadb38afb
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/csmith/default.nix
@@ -0,0 +1,49 @@
+{ stdenv, fetchurl, m4, makeWrapper, libbsd, perlPackages }:
+
+stdenv.mkDerivation rec {
+  pname = "csmith";
+  version = "2.3.0";
+
+  src = fetchurl {
+    url = "https://embed.cs.utah.edu/csmith/${pname}-${version}.tar.gz";
+    sha256 = "1mb5zgixsyf86slggs756k8a5ddmj980md3ic9sa1y75xl5cqizj";
+  };
+
+  nativeBuildInputs = [ m4 makeWrapper ];
+  buildInputs = [ libbsd ] ++ (with perlPackages; [ perl SysCPU ]);
+
+  postInstall = ''
+    substituteInPlace $out/bin/compiler_test.pl \
+      --replace '$CSMITH_HOME/runtime' $out/include/${pname}-${version} \
+      --replace ' ''${CSMITH_HOME}/runtime' " $out/include/${pname}-${version}" \
+      --replace '$CSMITH_HOME/src/csmith' $out/bin/csmith
+
+    substituteInPlace $out/bin/launchn.pl \
+      --replace '../compiler_test.pl' $out/bin/compiler_test.pl \
+      --replace '../$CONFIG_FILE' '$CONFIG_FILE'
+
+    wrapProgram $out/bin/launchn.pl \
+      --prefix PERL5LIB : "$PERL5LIB"
+
+    mkdir -p $out/share/csmith
+    mv $out/bin/compiler_test.in $out/share/csmith/
+  '';
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    description = "A random generator of C programs";
+    homepage = https://embed.cs.utah.edu/csmith;
+    # Officially, the license is this: https://github.com/csmith-project/csmith/blob/master/COPYING
+    license = licenses.bsd2;
+    longDescription = ''
+      Csmith is a tool that can generate random C programs that statically and
+      dynamically conform to the C99 standard. It is useful for stress-testing
+      compilers, static analyzers, and other tools that process C code.
+      Csmith has found bugs in every tool that it has tested, and has been used
+      to find and report more than 400 previously unknown compiler bugs.
+    '';
+    maintainers = [ maintainers.dtzWill ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/ctags/default.nix b/nixpkgs/pkgs/development/tools/misc/ctags/default.nix
new file mode 100644
index 000000000000..86136084d840
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/ctags/default.nix
@@ -0,0 +1,36 @@
+{ stdenv, fetchsvn, autoreconfHook }:
+
+stdenv.mkDerivation rec {
+  name = "ctags-${revision}";
+  revision = "816";
+
+  src = fetchsvn {
+    url = https://svn.code.sf.net/p/ctags/code/trunk;
+    rev = revision;
+    sha256 = "0jmbkrmscbl64j71qffcc39x005jrmphx8kirs1g2ws44wil39hf";
+  };
+
+  nativeBuildInputs = [ autoreconfHook ];
+
+  # don't use $T(E)MP which is set to the build directory
+  configureFlags= [ "--enable-tmpdir=/tmp" ];
+
+  meta = with stdenv.lib; {
+    description = "A tool for fast source code browsing (exuberant ctags)";
+    longDescription = ''
+      Ctags generates an index (or tag) file of language objects found
+      in source files that allows these items to be quickly and easily
+      located by a text editor or other utility.  A tag signifies a
+      language object for which an index entry is available (or,
+      alternatively, the index entry created for that object).  Many
+      programming languages are supported.
+    '';
+    homepage = http://ctags.sourceforge.net/;
+    license = licenses.gpl2Plus;
+    platforms = platforms.unix;
+
+    # So that Exuberant ctags is preferred over emacs's ctags
+    priority = 1;
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/ctags/wrapped.nix b/nixpkgs/pkgs/development/tools/misc/ctags/wrapped.nix
new file mode 100644
index 000000000000..869e7a61121d
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/ctags/wrapped.nix
@@ -0,0 +1,78 @@
+{ pkgs, ctags }:
+
+with pkgs.stdenv.lib;
+
+# define some ctags wrappers adding support for some not that common languages
+# customization:
+# a) add stuff here
+# b) override asLang, phpLang, ... using packageOverrides
+# c) use ctagsWrapped.override {args = [ your liste ];}
+
+# install using -iA ctagsWrapped.ctagsWrapped
+
+{
+
+  # the derivation. use language extensions specified by args
+  ctagsWrapped = makeOverridable ( {args, name} :  pkgs.writeScriptBin name ''
+  #!${pkgs.runtimeShell}
+  exec ${pkgs.ctags}/bin/ctags ${concatStringsSep " " (map escapeShellArg args)} "$@"
+  '') {
+    args = let x = pkgs.ctagsWrapped; in concatLists [
+      x.defaultArgs x.phpLang x.jsLang x.nixLang x.asLang x.rubyLang
+    ];
+    name = "${ctags.name}-wrapped";
+  };
+
+  ### language arguments
+
+  # don't scan version control directories
+  defaultArgs = [
+    "--exclude=\.svn"
+    "--exclude=\.hg"
+    "--exclude=\.git"
+    "--exclude=\_darcs"
+    "--sort=yes"
+  ];
+
+  # actionscript
+  asLang = [
+    "--langdef=ActionScript"
+    "--langmap=ActionScript:.as"
+    "--regex-ActionScript=/function[ \\t]+([A-Za-z0-9_]+)[ \\t]*\\(/\1/f,function,functions/"
+    "--regex-ActionScript=/function[ \\t]+(set|get)[ \\t]+([A-Za-z0-9_]+)[ \\t]*\\(/\2/p,property,properties/"
+    "--regex-ActionScript=/interface[ \\t]+[a-z0-9_.]*([A-Z][A-Za-z0-9_]+)/\\1/i,interface,interfaces/"
+    "--regex-ActionScript=/package[ \\t]+([^ \\t]*)/\\1/p/"
+    "--regex-ActionScript=/class[ \\t]+[a-z0-9_.]*([A-Z][A-Za-z0-9_]+)/\\1/c,class,classes/"
+  ];
+
+  # PHP
+  phpLang = [
+    "--langmap=PHP:.php"
+    "--regex-PHP=/abstract class ([^ ]*)/\\1/c/"
+    "--regex-PHP=/interface ([^ ]*)/\\1/i/"
+    "--regex-PHP=/function[ \\t]+([^ (]*)/\\1/f/"
+  ];
+
+  # Javascript: also find unnamed functions and funtions beeing passed within a dict.
+  # the dict properties is used to implement duck typing in frameworks
+  # var foo = function () { ... }
+  # {
+  # a : function () {}
+  # only recognize names up 100 characters. Else you'll be in trouble scanning compressed .js files.
+  jsLang = [
+    "--regex-JavaScript=/([^ \\t]{1,100})[ \\t]*:[ \\t]*function[ \\t]*\\(/\\1/f/"
+  ];
+
+  # find foo in "foo =", don't think we can do a lot better
+  nixLang = [
+    "--langdef=NIX"
+    "--langmap=NIX:.nix"
+    "--regex-NIX=/\([^ \\t*]*\)[ \\t]*=/\\1/f/"
+  ];
+
+  rubyLang = [
+    "--langmap=RUBY:.rb"
+    "--regex-RUBY=/class ([^ ]*)/\\1/c/"
+    "--regex-RUBY=/^[ ]*module[ ]*([^ ]*)/\\1/m/"
+  ];
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/cwebbin/default.nix b/nixpkgs/pkgs/development/tools/misc/cwebbin/default.nix
new file mode 100644
index 000000000000..3a54a17a93af
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/cwebbin/default.nix
@@ -0,0 +1,51 @@
+{ stdenv, fetchFromGitHub, fetchurl, tie }:
+
+stdenv.mkDerivation rec {
+  pname = "cwebbin";
+  version = "22p";
+
+  src = fetchFromGitHub {
+    owner = "ascherer";
+    repo = "cwebbin";
+    rev = "2016-05-20-22p";
+    sha256 = "0zf93016hm9i74i2v384rwzcw16y3hg5vc2mibzkx1rzvqa50yfr";
+  };
+
+  cweb = fetchurl {
+    url = https://www.ctan.org/tex-archive/web/c_cpp/cweb/cweb-3.64ah.tgz;
+    sha256 = "1hdzxfzaibnjxjzgp6d2zay8nsarnfy9hfq55hz1bxzzl23n35aj";
+  };
+
+  buildInputs = [ tie ];
+
+  makeFlags = [
+    "MACROSDIR=$(out)/share/texmf/tex/generic/cweb"
+    "CWEBINPUTS=$(out)/lib/cweb"
+    "DESTDIR=$(out)/bin/"
+    "MANDIR=$(out)/share/man/man1"
+    "EMACSDIR=$(out)/share/emacs/site-lisp"
+    "CP=cp"
+    "RM=rm"
+    "PDFTEX=echo"
+    "CC=c++"
+  ];
+
+  buildPhase = ''
+    zcat ${cweb} | tar -xvpf -
+    make -f Makefile.unix boot $makeFlags
+    make -f Makefile.unix cautiously $makeFlags
+  '';
+
+  installPhase = ''
+    mkdir -p $out/share/man/man1 $out/share/texmf/tex/generic $out/share/emacs $out/lib
+    make -f Makefile.unix install $makeFlags
+  '';
+
+  meta = with stdenv.lib; {
+    inherit (src.meta) homepage;
+    description = "Literate Programming in C/C++";
+    platforms = with platforms; unix;
+    maintainers = with maintainers; [ vrthra ];
+    license = licenses.abstyles;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/d-feet/default.nix b/nixpkgs/pkgs/development/tools/misc/d-feet/default.nix
new file mode 100644
index 000000000000..cc256bc23bdf
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/d-feet/default.nix
@@ -0,0 +1,82 @@
+{ stdenv
+, pkgconfig
+, fetchurl
+, meson
+, ninja
+, glib
+, gtk3
+, python3
+, wrapGAppsHook
+, gnome3
+, libwnck3
+, gobject-introspection
+, gettext
+, itstool
+}:
+
+python3.pkgs.buildPythonApplication rec {
+  pname = "d-feet";
+  version = "0.3.15";
+
+  format = "other";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/d-feet/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "1cgxgpj546jgpyns6z9nkm5k48lid8s36mvzj8ydkjqws2d19zqz";
+  };
+
+  nativeBuildInputs = [
+    gettext
+    gobject-introspection
+    itstool
+    meson
+    ninja
+    pkgconfig
+    python3
+    wrapGAppsHook
+  ];
+
+  buildInputs = [
+    glib
+    gnome3.adwaita-icon-theme
+    gtk3
+    libwnck3
+  ];
+
+  propagatedBuildInputs = with python3.pkgs; [
+    pygobject3
+  ];
+
+  mesonFlags = [
+    "-Dtests=false" # needs dbus
+  ];
+
+  # Temporary fix
+  # See https://github.com/NixOS/nixpkgs/issues/56943
+  strictDeps = false;
+
+  postPatch = ''
+    chmod +x meson_post_install.py
+    patchShebangs meson_post_install.py
+  '';
+
+  passthru = {
+    updateScript = gnome3.updateScript {
+      packageName = pname;
+      attrPath = "dfeet";
+      versionPolicy = "none";
+    };
+  };
+
+  meta = with stdenv.lib; {
+    description = "D-Feet is an easy to use D-Bus debugger";
+    longDescription = ''
+      D-Feet can be used to inspect D-Bus interfaces of running programs
+      and invoke methods on those interfaces.
+    '';
+    homepage = https://wiki.gnome.org/Apps/DFeet;
+    platforms = platforms.linux;
+    license = licenses.gpl2;
+    maintainers = with maintainers; [ ktosiek ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/dbench/default.nix b/nixpkgs/pkgs/development/tools/misc/dbench/default.nix
new file mode 100644
index 000000000000..5bccea9ced88
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/dbench/default.nix
@@ -0,0 +1,42 @@
+{ stdenv, fetchgit, autoconf, popt, zlib }:
+
+stdenv.mkDerivation {
+  name = "dbench-2013-01-01";
+
+  src = fetchgit {
+    url = git://git.samba.org/sahlberg/dbench.git;
+    rev = "65b19870ed8d25bff14cafa1c30beb33f1fb6597";
+    sha256 = "16lcbwmmx8z5i73k3dnf54yffrpx7ql3y9k3cpkss9dcyxb1p83i";
+  };
+
+  buildInputs = [ autoconf popt zlib ];
+
+  patches = [
+    # patch has been also sent upstream and might be included in future versions
+    ./fix-missing-stdint.patch
+  ];
+
+  preConfigure = ''
+    ./autogen.sh
+    configureFlagsArray+=("--datadir=$out/share/dbench")
+  '';
+
+  postInstall = ''
+    cp -R loadfiles/* $out/share/dbench/doc/dbench/loadfiles
+
+    # dbench looks here for the file
+    ln -s doc/dbench/loadfiles/client.txt $out/share/dbench/client.txt
+
+    # backwards compatible to older nixpkgs packaging introduced by
+    # 3f27be8e5d5861cd4b9487d6c5212d88bf24316d
+    ln -s dbench/doc/dbench/loadfiles $out/share/loadfiles
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Filesystem benchmark tool based on load patterns";
+    homepage = https://dbench.samba.org/;
+    license = licenses.gpl3;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.bjornfor ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/dbench/fix-missing-stdint.patch b/nixpkgs/pkgs/development/tools/misc/dbench/fix-missing-stdint.patch
new file mode 100644
index 000000000000..96cb28e9e55a
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/dbench/fix-missing-stdint.patch
@@ -0,0 +1,10 @@
+--- dbench-65b1987.org/libnfs.c	2017-11-08 12:25:39.652147989 +0000
++++ dbench-65b1987/libnfs.c	2017-11-08 12:26:20.269897054 +0000
+@@ -23,6 +23,7 @@
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <fcntl.h>
++#include <stdint.h>
+ 
+ #define discard_const(ptr) ((void *)((intptr_t)(ptr)))
+ 
diff --git a/nixpkgs/pkgs/development/tools/misc/ddd/default.nix b/nixpkgs/pkgs/development/tools/misc/ddd/default.nix
new file mode 100644
index 000000000000..c51a5f504741
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/ddd/default.nix
@@ -0,0 +1,20 @@
+{stdenv, fetchurl, motif, ncurses, libX11, libXt}:
+
+stdenv.mkDerivation rec {
+  name = "ddd-3.3.12";
+  src = fetchurl {
+    url = "mirror://gnu/ddd/${name}.tar.gz";
+    sha256 = "0p5nx387857w3v2jbgvps2p6mlm0chajcdw5sfrddcglsxkwvmis";
+  };
+  buildInputs = [motif ncurses libX11 libXt];
+  configureFlags = [ "--with-x" ];
+
+  patches = [ ./gcc44.patch ];
+
+  meta = {
+    homepage = https://www.gnu.org/software/ddd;
+    description = "Graphical front-end for command-line debuggers";
+    license = stdenv.lib.licenses.gpl2;
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/ddd/gcc44.patch b/nixpkgs/pkgs/development/tools/misc/ddd/gcc44.patch
new file mode 100644
index 000000000000..c4e4004b12e0
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/ddd/gcc44.patch
@@ -0,0 +1,11 @@
+http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=504868
+--- a/ddd/strclass.C~ 2008-11-07 17:57:13.000000000 +0000
++++ b/ddd/strclass.C  2008-11-07 17:57:27.000000000 +0000
+@@ -39,6 +39,7 @@
+ #include <ctype.h>
+ #include <limits.h>
+ #include <new>
++#include <cstdio>
+ #include <stdlib.h>
+ 
+ void string::error(const char* msg) const
diff --git a/nixpkgs/pkgs/development/tools/misc/dejagnu/default.nix b/nixpkgs/pkgs/development/tools/misc/dejagnu/default.nix
new file mode 100644
index 000000000000..693c791875be
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/dejagnu/default.nix
@@ -0,0 +1,53 @@
+{ fetchurl, stdenv, expect, makeWrapper }:
+
+stdenv.mkDerivation rec {
+  name = "dejagnu-1.6.2";
+
+  src = fetchurl {
+    url = "mirror://gnu/dejagnu/${name}.tar.gz";
+    sha256 = "0qfj2wd4qk1yn9yzam6g8nmyxfazcc0knjyyibycb2ainkhp21hd";
+  };
+
+  buildInputs = [ expect makeWrapper ];
+
+  doCheck = true;
+
+  # Note: The test-suite *requires* /dev/pts among the `build-chroot-dirs' of
+  # the build daemon when building in a chroot.  See
+  # <https://www.mail-archive.com/nix-dev@cs.uu.nl/msg01056.html> for
+  # details.
+
+  # The test-suite needs to have a non-empty stdin:
+  #   https://lists.gnu.org/archive/html/bug-dejagnu/2003-06/msg00002.html
+  checkPhase = ''
+    # Provide `runtest' with a log name, otherwise it tries to run
+    # `whoami', which fails when in a chroot.
+    LOGNAME="nix-build-daemon" make check < /dev/zero
+  '';
+
+  postInstall = ''
+    wrapProgram "$out/bin/runtest" \
+      --prefix PATH ":" "${expect}/bin"
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Framework for testing other programs";
+
+    longDescription = ''
+      DejaGnu is a framework for testing other programs.  Its purpose
+      is to provide a single front end for all tests.  Think of it as a
+      custom library of Tcl procedures crafted to support writing a
+      test harness.  A test harness is the testing infrastructure that
+      is created to support a specific program or tool.  Each program
+      can have multiple testsuites, all supported by a single test
+      harness.  DejaGnu is written in Expect, which in turn uses Tcl --
+      Tool command language.
+    '';
+
+    homepage = https://www.gnu.org/software/dejagnu/;
+    license = licenses.gpl2Plus;
+
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ vrthra ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/dfu-programmer/default.nix b/nixpkgs/pkgs/development/tools/misc/dfu-programmer/default.nix
new file mode 100644
index 000000000000..1dd53f62cec6
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/dfu-programmer/default.nix
@@ -0,0 +1,25 @@
+{ stdenv, fetchurl, libusb }:
+let
+  version = "0.7.2";
+in
+stdenv.mkDerivation rec {
+  pname = "dfu-programmer";
+  inherit version;
+
+  buildInputs = [ libusb ];
+
+  src = fetchurl {
+    url = "mirror://sourceforge/dfu-programmer/${pname}-${version}.tar.gz";
+    sha256 = "15gr99y1z9vbvhrkd25zqhnzhg6zjmaam3vfjzf2mazd39mx7d0x";
+  };
+
+  configureFlags = [ "--disable-libusb_1_0" ];
+
+  meta = with stdenv.lib; {
+    license = licenses.gpl2;
+    description = "A Device Firmware Update based USB programmer for Atmel chips with a USB bootloader";
+    homepage = http://dfu-programmer.sourceforge.net/;
+    maintainers = [ maintainers.the-kenny ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/dfu-util/default.nix b/nixpkgs/pkgs/development/tools/misc/dfu-util/default.nix
new file mode 100644
index 000000000000..bf1effbe71a2
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/dfu-util/default.nix
@@ -0,0 +1,31 @@
+{ stdenv, fetchurl, pkgconfig, libusb1 }:
+
+stdenv.mkDerivation rec {
+  pname = "dfu-util";
+  version = "0.9";
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ libusb1 ];
+
+  src = fetchurl {
+    url = "http://dfu-util.sourceforge.net/releases/${pname}-${version}.tar.gz";
+    sha256 = "0czq73m92ngf30asdzrfkzraag95hlrr74imbanqq25kdim8qhin";
+  };
+
+  meta = with stdenv.lib; {
+    description = "Device firmware update (DFU) USB programmer";
+    longDescription = ''
+      dfu-util is a program that implements the host (PC) side of the USB
+      DFU 1.0 and 1.1 (Universal Serial Bus Device Firmware Upgrade) protocol.
+
+      DFU is intended to download and upload firmware to devices connected over
+      USB. It ranges from small devices like micro-controller boards up to mobile
+      phones. With dfu-util you are able to download firmware to your device or
+      upload firmware from it.
+    '';
+    homepage = http://dfu-util.sourceforge.net;
+    license = licenses.gpl2Plus;
+    platforms = platforms.unix;
+    maintainers = [ maintainers.fpletz ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/dialog/default.nix b/nixpkgs/pkgs/development/tools/misc/dialog/default.nix
new file mode 100644
index 000000000000..378cc4683b41
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/dialog/default.nix
@@ -0,0 +1,40 @@
+{ stdenv, fetchurl, ncurses
+, withLibrary ? false, libtool
+, unicodeSupport ? true
+, enableShared ? !stdenv.isDarwin
+}:
+
+assert withLibrary -> libtool != null;
+assert unicodeSupport -> ncurses.unicode && ncurses != null;
+
+stdenv.mkDerivation rec {
+  pname = "dialog";
+  version = "1.3-20190211";
+
+  src = fetchurl {
+    urls = [
+      "ftp://ftp.invisible-island.net/dialog/${pname}-${version}.tgz"
+      "https://invisible-mirror.net/archives/dialog/${pname}-${version}.tgz"
+    ];
+    sha256 = "1lx0bvradzx1zl7znlrsnyljcs596r7wamkhyq37ikbxsy4y5h29";
+  };
+
+  buildInputs = [ ncurses ];
+
+  configureFlags = [
+    "--disable-rpath-hacks"
+    (stdenv.lib.withFeature withLibrary "libtool")
+    "--with-ncurses${stdenv.lib.optionalString unicodeSupport "w"}"
+    "--with-libtool-opts=${stdenv.lib.optionalString enableShared "-shared"}"
+  ];
+
+  installTargets = "install${stdenv.lib.optionalString withLibrary "-full"}";
+
+  meta = {
+    homepage = https://invisible-island.net/dialog/dialog.html;
+    description = "Display dialog boxes from shell";
+    license = stdenv.lib.licenses.lgpl21Plus;
+    maintainers = [ stdenv.lib.maintainers.spacefrogg ];
+    platforms = stdenv.lib.platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/distcc/default.nix b/nixpkgs/pkgs/development/tools/misc/distcc/default.nix
new file mode 100644
index 000000000000..9891726c6633
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/distcc/default.nix
@@ -0,0 +1,84 @@
+{ stdenv, fetchFromGitHub, popt, avahi, pkgconfig, python, gtk2, runCommand
+, gcc, autoconf, automake, which, procps, libiberty_static
+, runtimeShell
+, sysconfDir ? ""   # set this parameter to override the default value $out/etc
+, static ? false
+}:
+
+let
+  name    = "distcc";
+  version = "2016-02-24";
+  distcc = stdenv.mkDerivation {
+    name = "${name}-${version}";
+    src = fetchFromGitHub {
+      owner = "distcc";
+      repo = "distcc";
+      rev = "b2fa4e21b4029e13e2c33f7b03ca43346f2cecb8";
+      sha256 = "1vj31wcdas8wy52hy6749mlrca9v6ynycdiigx5ay8pnya9z73c6";
+    };
+
+  nativeBuildInputs = [ pkgconfig ];
+    buildInputs = [popt avahi pkgconfig python gtk2 autoconf automake which procps libiberty_static];
+    preConfigure =
+    ''
+      export CPATH=$(ls -d ${gcc.cc}/lib/gcc/*/${gcc.cc.version}/plugin/include)
+
+      configureFlagsArray=( CFLAGS="-O2 -fno-strict-aliasing"
+                            CXXFLAGS="-O2 -fno-strict-aliasing"
+          --mandir=$out/share/man
+                            ${if sysconfDir == "" then "" else "--sysconfdir=${sysconfDir}"}
+                            ${if static then "LDFLAGS=-static" else ""}
+                            --with${if static == true || popt == null then "" else "out"}-included-popt
+                            --with${if avahi != null then "" else "out"}-avahi
+                            --with${if gtk2 != null then "" else "out"}-gtk
+                            --without-gnome
+                            --enable-rfc2553
+                            --disable-Werror   # a must on gcc 4.6
+                           )
+      installFlags="sysconfdir=$out/etc";
+
+      ./autogen.sh
+    '';
+
+    # The test suite fails because it uses hard-coded paths, i.e. /usr/bin/gcc.
+    doCheck = false;
+
+    passthru = {
+      # A derivation that provides gcc and g++ commands, but that
+      # will end up calling distcc for the given cacheDir
+      #
+      # extraConfig is meant to be sh lines exporting environment
+      # variables like DISTCC_HOSTS, DISTCC_DIR, ...
+      links = extraConfig: (runCommand "distcc-links" { passthru.gcc = gcc.cc; }
+        ''
+          mkdir -p $out/bin
+          if [ -x "${gcc.cc}/bin/gcc" ]; then
+            cat > $out/bin/gcc << EOF
+            #!${runtimeShell}
+            ${extraConfig}
+            exec ${distcc}/bin/distcc gcc "\$@"
+          EOF
+            chmod +x $out/bin/gcc
+          fi
+          if [ -x "${gcc.cc}/bin/g++" ]; then
+            cat > $out/bin/g++ << EOF
+            #!${runtimeShell}
+            ${extraConfig}
+            exec ${distcc}/bin/distcc g++ "\$@"
+          EOF
+            chmod +x $out/bin/g++
+          fi
+        '');
+    };
+
+    meta = {
+      description = "A fast, free distributed C/C++ compiler";
+      homepage = http://distcc.org;
+      license = "GPL";
+
+      platforms = stdenv.lib.platforms.linux;
+      maintainers = with stdenv.lib.maintainers; [ anderspapitto ];
+    };
+  };
+in
+  distcc
diff --git a/nixpkgs/pkgs/development/tools/misc/distcc/masq.nix b/nixpkgs/pkgs/development/tools/misc/distcc/masq.nix
new file mode 100644
index 000000000000..f3bccde81606
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/distcc/masq.nix
@@ -0,0 +1,44 @@
+{ stdenv, gccRaw, binutils }:
+
+stdenv.mkDerivation {
+  name = "distcc-masq-${gccRaw.name}";
+
+  phases = [ "installPhase" ];
+  installPhase = ''
+    mkdir -p $out/bin
+
+    bin=${gccRaw}/bin
+
+    shopt -s nullglob
+    if [ -f $bin/gcc ]; then
+      ln -s $bin/gcc $out/bin
+    else
+      for a in $bin/*-gcc; do
+        ln -s $bin/*-gcc $out/bin/gcc
+        ln -s $bin/*-gcc $out/bin/cc
+      done
+    fi
+
+    if [ -f $bin/g++ ]; then
+      ln -s $bin/g++ $out/bin
+    else
+      for a in $bin/*-g++; do
+        ln -sf $bin/*-g++ $out/bin/g++
+        ln -sf $bin/*-g++ $out/bin/c++
+      done
+    fi
+
+    bbin=${binutils}/bin
+    if [ -f $bbin/as ]; then
+      ln -s $bbin/as $out/bin
+    else
+      for a in $bbin/*-as; do
+        ln -sf $bbin/*-as $out/bin/as
+      done
+    fi
+  '';
+
+  meta = {
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/doclifter/default.nix b/nixpkgs/pkgs/development/tools/misc/doclifter/default.nix
new file mode 100644
index 000000000000..9975f0f5465c
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/doclifter/default.nix
@@ -0,0 +1,26 @@
+{stdenv, fetchurl, python}:
+
+stdenv.mkDerivation {
+  name = "doclifter-2.19";
+  src = fetchurl {
+    url = http://www.catb.org/~esr/doclifter/doclifter-2.19.tar.gz;
+    sha256 = "1as6z7mdjrrkw2kism41q5ybvyzvwcmj9qzla2fz98v9f4jbj2s2";
+  };
+  buildInputs = [ python ];
+  
+  makeFlags = "PREFIX=$(out)";
+  
+  preInstall = ''
+    mkdir -p $out/bin
+    mkdir -p $out/share/man/man1
+    cp manlifter $out/bin
+    cp manlifter.1 $out/share/man/man1
+  '';
+  
+  meta = {
+    description = "Lift documents in nroff markups to XML-DocBook";
+    homepage = http://www.catb.org/esr/doclifter;
+    license = "BSD";
+    platforms = stdenv.lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/drush/default.nix b/nixpkgs/pkgs/development/tools/misc/drush/default.nix
new file mode 100644
index 000000000000..f9a640d47038
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/drush/default.nix
@@ -0,0 +1,38 @@
+{ stdenv, fetchurl, php, which, makeWrapper, bash, coreutils, ncurses }:
+
+stdenv.mkDerivation rec {
+  name = "drush-6.1.0";
+
+  meta = with stdenv.lib; {
+    description = "Command-line shell and Unix scripting interface for Drupal";
+    homepage    = https://github.com/drush-ops/drush;
+    license     = licenses.gpl2;
+    maintainers = with maintainers; [ lovek323 ];
+    platforms   = platforms.all;
+  };
+
+  src = fetchurl {
+    url    = https://github.com/drush-ops/drush/archive/6.1.0.tar.gz;
+    sha256 = "1jgnc4jjyapyn04iczvcz92ic0vq8d1w8xi55ismqyy5cxhqj6bp";
+  };
+
+  consoleTable = fetchurl {
+    url    = http://download.pear.php.net/package/Console_Table-1.1.3.tgz;
+    sha256 = "07gbjd7m1fj5dmavr0z20vkqwx1cz2522sj9022p257jifj1yl76";
+  };
+
+  buildInputs = [ php which makeWrapper ];
+
+  installPhase = ''
+    # install libraries
+    cd lib
+    tar -xf ${consoleTable}
+    cd ..
+
+    mkdir -p "$out"
+    cp -r . "$out/src"
+    mkdir "$out/bin"
+    wrapProgram "$out/src/drush" --prefix PATH : "${stdenv.lib.makeBinPath [ which php bash coreutils ncurses ]}"
+    ln -s "$out/src/drush" "$out/bin/drush"
+  '';
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/editorconfig-core-c/default.nix b/nixpkgs/pkgs/development/tools/misc/editorconfig-core-c/default.nix
new file mode 100644
index 000000000000..2eda1f044ce8
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/editorconfig-core-c/default.nix
@@ -0,0 +1,38 @@
+{ stdenv, fetchgit, cmake, pcre, doxygen }:
+
+stdenv.mkDerivation rec {
+  name = "editorconfig-core-c-${meta.version}";
+
+  src = fetchgit {
+    url = "https://github.com/editorconfig/editorconfig-core-c.git";
+    rev = "v${meta.version}";
+    sha256 = "0awpb63ci85kal3pnlj2b54bay8igj1rbc13d8gqkvidlb51nnx4";
+    fetchSubmodules = true;
+    inherit name;
+  };
+
+  buildInputs = [ pcre ];
+  nativeBuildInputs = [ cmake doxygen ];
+
+  # Multiple doxygen can not generate man pages in the same base directory in
+  # parallel: https://bugzilla.gnome.org/show_bug.cgi?id=791153
+  enableParallelBuilding = false;
+
+  meta = with stdenv.lib; {
+    homepage = https://editorconfig.org/;
+    description = "EditorConfig core library written in C";
+    longDescription = ''
+      EditorConfig makes it easy to maintain the correct coding style when
+      switching between different text editors and between different
+      projects. The EditorConfig project maintains a file format and plugins
+      for various text editors which allow this file format to be read and used
+      by those editors. For information on the file format and supported text
+      editors, see the EditorConfig website.
+    '';
+    downloadPage = https://github.com/editorconfig/editorconfig-core-c;
+    license = with licenses; [ bsd2 bsd3 ];
+    version = "0.12.1";
+    maintainers = with maintainers; [ dochang ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/eggdbus/default.nix b/nixpkgs/pkgs/development/tools/misc/eggdbus/default.nix
new file mode 100644
index 000000000000..7c7e53404343
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/eggdbus/default.nix
@@ -0,0 +1,20 @@
+{ stdenv, fetchurl, pkgconfig, glib, dbus, dbus-glib }:
+
+stdenv.mkDerivation rec {
+  name = "eggdbus-0.6";
+
+  src = fetchurl {
+    url = "https://hal.freedesktop.org/releases/${name}.tar.gz";
+    sha256 = "118hj63ac65zlg71kydv4607qcg1qpdlql4kvhnwnnhar421jnq4";
+  };
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ glib dbus dbus-glib ];
+
+  meta = with stdenv.lib; {
+    homepage = https://hal.freedesktop.org/releases/;
+    description = "D-Bus bindings for GObject";
+    platforms = platforms.linux;
+    license = licenses.lgpl2;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/elfinfo/default.nix b/nixpkgs/pkgs/development/tools/misc/elfinfo/default.nix
new file mode 100644
index 000000000000..cb127906c0bf
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/elfinfo/default.nix
@@ -0,0 +1,23 @@
+{ stdenv, buildGoModule, fetchFromGitHub }:
+
+buildGoModule rec {
+  pname = "elfinfo";
+  version = "0.7.6";
+
+  goPackagePath = "github.com/xyproto/elfinfo";
+  src = fetchFromGitHub {
+    rev = version;
+    owner = "xyproto";
+    repo = "elfinfo";
+    sha256 = "0f6ik4d157assxdfslnyc91mg70kfh396rapikfv473znx2v2pg9";
+  };
+
+  modSha256 = "1xr0pylaqcb4f4g862120cgqdxp0bpwsk77zd6g7kk91lqdcvsdf";
+
+  meta = with stdenv.lib; {
+    description = "Small utility for showing information about ELF files";
+    homepage = https://elfinfo.roboticoverlords.org/;
+    license = licenses.mit;
+    maintainers = with maintainers; [ dtzWill ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/elfkickers/default.nix b/nixpkgs/pkgs/development/tools/misc/elfkickers/default.nix
new file mode 100644
index 000000000000..c7eaafd9c7a8
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/elfkickers/default.nix
@@ -0,0 +1,23 @@
+{ stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "elfkickers";
+  version = "3.1";
+
+  src = fetchurl {
+    url = "http://www.muppetlabs.com/~breadbox/pub/software/ELFkickers-${version}.tar.gz";
+    sha256 = "0n0sypjrdm3ramv0sby4sdh3i3j9d0ihadr951wa08ypdnq3yrkd";
+  };
+
+  makeFlags = [ "CC=cc prefix=$(out)" ];
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    homepage = http://www.muppetlabs.com/~breadbox/software/elfkickers.html;
+    description = "A collection of programs that access and manipulate ELF files";
+    platforms = platforms.linux;
+    license = licenses.gpl2;
+    maintainers = [ maintainers.dtzWill ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/elfutils/debug-info-from-env.patch b/nixpkgs/pkgs/development/tools/misc/elfutils/debug-info-from-env.patch
new file mode 100644
index 000000000000..409f1311c315
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/elfutils/debug-info-from-env.patch
@@ -0,0 +1,27 @@
+Look up .build-id files relative to the directories in the
+colon-separated environment variable NIX_DEBUG_INFO_DIRS, unless
+overriden by --debuginfo-path.
+
+diff -ru elfutils-0.169-orig/libdwfl/argp-std.c elfutils-0.169/libdwfl/argp-std.c
+--- elfutils-0.169-orig/libdwfl/argp-std.c	2017-05-02 23:05:52.000000000 +0200
++++ elfutils-0.169/libdwfl/argp-std.c	2017-07-28 16:08:06.739558106 +0200
+@@ -376,5 +376,7 @@
+ const struct argp *
+ dwfl_standard_argp (void)
+ {
++  debuginfo_path = getenv("NIX_DEBUG_INFO_DIRS");
++
+   return &libdwfl_argp;
+ }
+diff -ru elfutils-0.169-orig/src/stack.c elfutils-0.169/src/stack.c
+--- elfutils-0.169-orig/src/stack.c	2017-02-24 11:55:28.000000000 +0100
++++ elfutils-0.169/src/stack.c	2017-07-28 15:50:06.743196696 +0200
+@@ -631,6 +631,8 @@
+   /* Set locale.  */
+   (void) setlocale (LC_ALL, "");
+ 
++  debuginfo_path = getenv("NIX_DEBUG_INFO_DIRS");
++
+   const struct argp_option options[] =
+     {
+       { NULL, 0, NULL, 0, N_("Input selection options:"), 0 },
diff --git a/nixpkgs/pkgs/development/tools/misc/elfutils/default.nix b/nixpkgs/pkgs/development/tools/misc/elfutils/default.nix
new file mode 100644
index 000000000000..06f1e2895c02
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/elfutils/default.nix
@@ -0,0 +1,76 @@
+{ lib, stdenv, fetchurl, m4, zlib, bzip2, bison, flex, gettext, xz, setupDebugInfoDirs }:
+
+# TODO: Look at the hardcoded paths to kernel, modules etc.
+stdenv.mkDerivation rec {
+  pname = "elfutils";
+  version = "0.176";
+
+  src = fetchurl {
+    url = "https://sourceware.org/elfutils/ftp/${version}/${pname}-${version}.tar.bz2";
+    sha256 = "08qhrl4g6qqr4ga46jhh78y56a47p3msa5b2x1qhzbxhf71lfmzb";
+  };
+
+  patches = [ ./debug-info-from-env.patch ];
+
+  hardeningDisable = [ "format" ];
+
+  # We need bzip2 in NativeInputs because otherwise we can't unpack the src,
+  # as the host-bzip2 will be in the path.
+  nativeBuildInputs = [ m4 bison flex gettext bzip2 ];
+  buildInputs = [ zlib bzip2 xz ];
+
+  propagatedNativeBuildInputs = [ setupDebugInfoDirs ];
+
+  configureFlags =
+    [ "--program-prefix=eu-" # prevent collisions with binutils
+      "--enable-deterministic-archives"
+    ];
+
+  enableParallelBuilding = true;
+
+  # This program does not cross-build fine. So I only cross-build some parts
+  # I need for the linux perf tool.
+  # On the awful cross-building:
+  # http://comments.gmane.org/gmane.comp.sysutils.elfutils.devel/2005
+  #
+  # I wrote this testing for the nanonote.
+
+  buildPhase = stdenv.lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
+    pushd libebl
+    make
+    popd
+    pushd libelf
+    make
+    popd
+    pushd libdwfl
+    make
+    popd
+    pushd libdw
+    make
+    popd
+  '';
+
+  installPhase = stdenv.lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
+    pushd libelf
+    make install
+    popd
+    pushd libdwfl
+    make install
+    popd
+    pushd libdw
+    make install
+    popd
+    cp version.h $out/include
+  '';
+
+  doCheck = false; # fails 3 out of 174 tests
+  doInstallCheck = false; # fails 70 out of 174 tests
+
+  meta = {
+    homepage = https://sourceware.org/elfutils/;
+    description = "A set of utilities to handle ELF objects";
+    platforms = lib.platforms.linux;
+    license = lib.licenses.gpl3;
+    maintainers = [ lib.maintainers.eelco ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/epm/default.nix b/nixpkgs/pkgs/development/tools/misc/epm/default.nix
new file mode 100644
index 000000000000..b449c0a2d010
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/epm/default.nix
@@ -0,0 +1,27 @@
+{stdenv, fetchFromGitHub, rpm}:
+
+stdenv.mkDerivation rec {
+  pname = "epm";
+  version = "4.4";
+
+  src = fetchFromGitHub {
+    repo = "epm";
+    owner = "michaelrsweet";
+    rev = "v${version}";
+    sha256 = "0kaw7v2m20qirapkps4dna6nf9xibnwljvvv0l9vpvi920kw7j7p";
+  };
+
+  buildInputs = [ rpm ];
+
+  preInstall = ''
+    sed -i 's/README/README.md/' Makefile
+  '';
+
+  meta = with stdenv.lib; {
+    description = "The ESP Package Manager generates distribution archives for a variety of platforms";
+    homepage = https://www.msweet.org/projects.php?Z2;
+    license = licenses.gpl2;
+    maintainers = with maintainers; [ pSub ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/findnewest/default.nix b/nixpkgs/pkgs/development/tools/misc/findnewest/default.nix
new file mode 100644
index 000000000000..6dd7e90f8f77
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/findnewest/default.nix
@@ -0,0 +1,22 @@
+{ stdenv, fetchFromGitHub, autoreconfHook }:
+
+stdenv.mkDerivation rec {
+  pname = "findnewest";
+  version = "0.3";
+
+  src = fetchFromGitHub {
+    owner = "0-wiz-0";
+    repo = pname;
+    rev = "${pname}-${version}";
+    sha256 = "1x1cbn2b27h5r0ah5xc06fkalfdci2ngrgd4wibxjw0h88h0nvgq";
+  };
+
+  nativeBuildInputs = [ autoreconfHook ];
+
+  meta = with stdenv.lib; {
+    homepage = https://github.com/0-wiz-0/findnewest;
+    description = "Recursively find newest file in a hierarchy and print its timestamp";
+    license = licenses.bsd2;
+    maintainers = with maintainers; [ bhipple ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/fsatrace/default.nix b/nixpkgs/pkgs/development/tools/misc/fsatrace/default.nix
new file mode 100644
index 000000000000..152792dcee25
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/fsatrace/default.nix
@@ -0,0 +1,31 @@
+{ stdenv, fetchFromGitHub }:
+
+stdenv.mkDerivation rec {
+  pname = "fsatrace";
+  version = "0.0.1-160";
+
+  src = fetchFromGitHub {
+    owner = "jacereda";
+    repo = "fsatrace";
+    rev = "2bf89d836e0156e68f121b0ffeedade7c9381f77";
+    sha256 = "0bndfmm0y738azwzf6m6xg6gjnrwcqlfjsampk67vga40yylwkbw";
+  };
+
+  preConfigure = ''
+    mkdir -p $out/libexec/${pname}-${version}
+    export makeFlags=INSTALLDIR=$out/libexec/${pname}-${version}
+  '';
+
+  postInstall = ''
+    mkdir -p $out/bin
+    ln -s $out/libexec/${pname}-${version}/fsatrace $out/bin/
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = https://github.com/jacereda/fsatrace;
+    description = "filesystem access tracer";
+    license = licenses.isc;
+    maintainers = [ maintainers.peti ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/fswatch/default.nix b/nixpkgs/pkgs/development/tools/misc/fswatch/default.nix
new file mode 100644
index 000000000000..a5c32bd3dc1b
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/fswatch/default.nix
@@ -0,0 +1,33 @@
+{ stdenv
+, fetchFromGitHub
+, autoreconfHook
+                     # for xargs
+, gettext
+, libtool
+, makeWrapper
+, texinfo
+, CoreServices
+}:
+
+stdenv.mkDerivation rec {
+  pname = "fswatch";
+  version = "1.14.0";
+
+  src = fetchFromGitHub {
+    owner = "emcrisostomo";
+    repo = "fswatch";
+    rev = version;
+    sha256 = "1d1fvm36qgh6a5j9v24wai61d297pvzxr14jngjlhh4i474ff21i";
+  };
+
+  nativeBuildInputs = [ autoreconfHook ] ++ stdenv.lib.optionals stdenv.isDarwin [ CoreServices ];
+  buildInputs = [ gettext libtool makeWrapper texinfo ];
+
+  meta = with stdenv.lib; {
+    description = "A cross-platform file change monitor with multiple backends";
+    homepage = https://github.com/emcrisostomo/fswatch;
+    license = licenses.gpl3Plus;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ pSub ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/gdb/darwin-target-match.patch b/nixpkgs/pkgs/development/tools/misc/gdb/darwin-target-match.patch
new file mode 100644
index 000000000000..1328d919503a
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/gdb/darwin-target-match.patch
@@ -0,0 +1,11 @@
+--- a/configure	2017-06-05 00:51:26.000000000 +0900
++++ b/configure	2018-03-06 23:12:58.000000000 +0900
+@@ -3603,7 +3603,7 @@
+     noconfigdirs="$noconfigdirs ld gprof"
+     noconfigdirs="$noconfigdirs sim target-rda"
+     ;;
+-  x86_64-*-darwin[912]*)
++  x86_64-*-darwin*)
+     noconfigdirs="$noconfigdirs ld gas gprof"
+     noconfigdirs="$noconfigdirs sim target-rda"
+     ;;
diff --git a/nixpkgs/pkgs/development/tools/misc/gdb/debug-info-from-env.patch b/nixpkgs/pkgs/development/tools/misc/gdb/debug-info-from-env.patch
new file mode 100644
index 000000000000..a7eda2c7e173
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/gdb/debug-info-from-env.patch
@@ -0,0 +1,13 @@
+Initialize debug-file-directory from NIX_DEBUG_INFO_DIRS, a colon-separated list
+of directories with separate debugging information files.
+
+--- a/gdb/main.c
++++ b/gdb/main.c
+@@ -551,3 +551,6 @@ captured_main_1 (struct captured_main_args *context)
+ 
+-  debug_file_directory = relocate_gdb_directory (DEBUGDIR,
++  debug_file_directory = getenv("NIX_DEBUG_INFO_DIRS");
++
++  if (debug_file_directory == NULL)
++    debug_file_directory = relocate_gdb_directory (DEBUGDIR,
+ 						 DEBUGDIR_RELOCATABLE);
diff --git a/nixpkgs/pkgs/development/tools/misc/gdb/default.nix b/nixpkgs/pkgs/development/tools/misc/gdb/default.nix
new file mode 100644
index 000000000000..f7dc2874aff5
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/gdb/default.nix
@@ -0,0 +1,99 @@
+{ stdenv
+
+# Build time
+, fetchurl, pkgconfig, perl, texinfo, setupDebugInfoDirs, buildPackages
+
+# Run time
+, ncurses, readline, gmp, mpfr, expat, zlib, dejagnu
+
+, pythonSupport ? stdenv.hostPlatform == stdenv.buildPlatform && !stdenv.hostPlatform.isCygwin, python3 ? null
+, guile ? null
+
+}:
+
+let
+  basename = "gdb-${version}";
+  version = "8.3";
+in
+
+assert pythonSupport -> python3 != null;
+
+stdenv.mkDerivation rec {
+  name =
+    stdenv.lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform)
+                              (stdenv.targetPlatform.config + "-")
+    + basename;
+
+  src = fetchurl {
+    url = "mirror://gnu/gdb/${basename}.tar.xz";
+    sha256 = "0bnpzz0rl672xg5547q5qck2sxi6cnyixmk8bbb4gifw17ipwbw0";
+  };
+
+  postPatch = if stdenv.isDarwin then ''
+    substituteInPlace gdb/darwin-nat.c \
+      --replace '#include "bfd/mach-o.h"' '#include "mach-o.h"'
+  '' else null;
+
+  patches = [
+    ./debug-info-from-env.patch
+  ] ++ stdenv.lib.optionals stdenv.isDarwin [
+    ./darwin-target-match.patch
+  ];
+
+  nativeBuildInputs = [ pkgconfig texinfo perl setupDebugInfoDirs ];
+
+  buildInputs = [ ncurses readline gmp mpfr expat zlib guile ]
+    ++ stdenv.lib.optional pythonSupport python3
+    ++ stdenv.lib.optional doCheck dejagnu;
+
+  propagatedNativeBuildInputs = [ setupDebugInfoDirs ];
+
+  depsBuildBuild = [ buildPackages.stdenv.cc ];
+
+  enableParallelBuilding = true;
+
+  # darwin build fails with format hardening since v7.12
+  hardeningDisable = stdenv.lib.optionals stdenv.isDarwin [ "format" ];
+
+  NIX_CFLAGS_COMPILE = "-Wno-format-nonliteral";
+
+  # TODO(@Ericson2314): Always pass "--target" and always prefix.
+  configurePlatforms = [ "build" "host" ] ++ stdenv.lib.optional (stdenv.targetPlatform != stdenv.hostPlatform) "target";
+
+  configureFlags = with stdenv.lib; [
+    "--enable-targets=all" "--enable-64-bit-bfd"
+    "--disable-install-libbfd"
+    "--disable-shared" "--enable-static"
+    "--with-system-zlib"
+    "--with-system-readline"
+
+    "--with-gmp=${gmp.dev}"
+    "--with-mpfr=${mpfr.dev}"
+    "--with-expat" "--with-libexpat-prefix=${expat.dev}"
+  ] ++ stdenv.lib.optional (!pythonSupport) "--without-python";
+
+  postInstall =
+    '' # Remove Info files already provided by Binutils and other packages.
+       rm -v $out/share/info/bfd.info
+    '';
+
+  # TODO: Investigate & fix the test failures.
+  doCheck = false;
+
+  meta = with stdenv.lib; {
+    description = "The GNU Project debugger";
+
+    longDescription = ''
+      GDB, the GNU Project debugger, allows you to see what is going
+      on `inside' another program while it executes -- or what another
+      program was doing at the moment it crashed.
+    '';
+
+    homepage = https://www.gnu.org/software/gdb/;
+
+    license = stdenv.lib.licenses.gpl3Plus;
+
+    platforms = with platforms; linux ++ cygwin ++ darwin;
+    maintainers = with maintainers; [ pierron globin ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/gdbgui/default.nix b/nixpkgs/pkgs/development/tools/misc/gdbgui/default.nix
new file mode 100644
index 000000000000..b021a3e222b3
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/gdbgui/default.nix
@@ -0,0 +1,52 @@
+{ stdenv
+, buildPythonApplication
+, fetchPypi
+, gdb
+, flask
+, flask-socketio
+, flask-compress
+, pygdbmi
+, pygments
+, gevent
+, }:
+
+buildPythonApplication rec {
+  pname = "gdbgui";
+  version = "0.13.1.1";
+
+  buildInputs = [ gdb ];
+  propagatedBuildInputs = [
+    flask
+    flask-socketio
+    flask-compress
+    pygdbmi
+    pygments
+    gevent
+  ];
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "1ypxgkxwb443ndyrmsa7zx2hn0d9b3s7n2w49ngfghd3l8k0yvi2";
+  };
+
+  postPatch = ''
+    echo ${version} > gdbgui/VERSION.txt
+    # remove upper version bound
+    sed -ie 's!, <.*"!"!' setup.py
+  '';
+
+  postInstall = ''
+    wrapProgram $out/bin/gdbgui \
+      --prefix PATH : ${stdenv.lib.makeBinPath [ gdb ]}
+  '';
+
+  # tests do not work without stdout/stdin
+  doCheck = false;
+
+  meta = with stdenv.lib; {
+    description = "A browser-based frontend for GDB";
+    license = licenses.gpl3;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ yrashk ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/gede/default.nix b/nixpkgs/pkgs/development/tools/misc/gede/default.nix
new file mode 100644
index 000000000000..1484e54289e6
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/gede/default.nix
@@ -0,0 +1,33 @@
+{ stdenv, fetchurl, makeWrapper, python, qmake, ctags, gdb }:
+
+stdenv.mkDerivation rec {
+  pname = "gede";
+  version = "2.14.1";
+
+  src = fetchurl {
+    url = "http://gede.acidron.com/uploads/source/${pname}-${version}.tar.xz";
+    sha256 = "1z7577zwz7h03d58as93hyx99isi3p4i3rhxr8l01zgi65mz0mr9";
+  };
+
+  nativeBuildInputs = [ qmake makeWrapper python ];
+
+  buildInputs = [ ctags ];
+
+  dontUseQmakeConfigure = true;
+
+  buildPhase = ":";
+
+  installPhase = ''
+    python build.py install --verbose --prefix="$out"
+    wrapProgram $out/bin/gede \
+      --prefix PATH : ${stdenv.lib.makeBinPath [ ctags gdb ]}
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Graphical frontend (GUI) to GDB";
+    homepage = http://gede.acidron.com;
+    license = licenses.bsd2;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ juliendehos ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/gengetopt/default.nix b/nixpkgs/pkgs/development/tools/misc/gengetopt/default.nix
new file mode 100644
index 000000000000..a1a02632478c
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/gengetopt/default.nix
@@ -0,0 +1,41 @@
+{ fetchurl, stdenv, texinfo, help2man }:
+
+stdenv.mkDerivation rec {
+  pname = "gengetopt";
+  version = "2.23";
+
+  src = fetchurl {
+    url = "mirror://gnu/${pname}/${pname}-${version}.tar.xz";
+    sha256 = "1b44fn0apsgawyqa4alx2qj5hls334mhbszxsy6rfr0q074swhdr";
+  };
+
+  doCheck = true;
+
+  enableParallelBuilding = true;
+
+  nativeBuildInputs = [ texinfo help2man ];
+
+  #Fix, see #28255
+  postPatch = ''
+    substituteInPlace configure --replace \
+      'set -o posix' \
+      'set +o posix'
+  '';
+
+  meta = {
+    description = "Command-line option parser generator";
+
+    longDescription =
+      '' GNU Gengetopt program generates a C function that uses getopt_long
+         function to parse the command line options, to validate them and
+         fills a struct
+      '';
+
+    homepage = https://www.gnu.org/software/gengetopt/;
+
+    license = stdenv.lib.licenses.gpl3Plus;
+
+    maintainers = [ ];
+    platforms = stdenv.lib.platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/global/default.nix b/nixpkgs/pkgs/development/tools/misc/global/default.nix
new file mode 100644
index 000000000000..2d756a655a43
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/global/default.nix
@@ -0,0 +1,59 @@
+{ fetchurl, stdenv, libtool, makeWrapper
+, coreutils, ctags, ncurses, pythonPackages, sqlite, universal-ctags
+}:
+
+stdenv.mkDerivation rec {
+  pname = "global";
+  version = "6.6.3";
+
+  src = fetchurl {
+    url = "mirror://gnu/global/${pname}-${version}.tar.gz";
+    sha256 = "0735pj47dnspf20n0j1px24p59nwjinlmlb2n32ln1hvdkprivnb";
+  };
+
+  nativeBuildInputs = [ libtool makeWrapper ];
+
+  buildInputs = [ ncurses ];
+
+  propagatedBuildInputs = [ pythonPackages.pygments ];
+
+  configureFlags = [
+    "--with-ltdl-include=${libtool}/include"
+    "--with-ltdl-lib=${libtool.lib}/lib"
+    "--with-ncurses=${ncurses.dev}"
+    "--with-sqlite3=${sqlite.dev}"
+    "--with-exuberant-ctags=${ctags}/bin/ctags"
+    "--with-universal-ctags=${universal-ctags}/bin/ctags"
+    "--with-posix-sort=${coreutils}/bin/sort"
+  ];
+
+  doCheck = true;
+
+  postInstall = ''
+    mkdir -p "$out/share/emacs/site-lisp"
+    cp -v *.el "$out/share/emacs/site-lisp"
+
+    wrapProgram $out/bin/gtags \
+      --prefix PYTHONPATH : "$(toPythonPath ${pythonPackages.pygments})"
+    wrapProgram $out/bin/global \
+      --prefix PYTHONPATH : "$(toPythonPath ${pythonPackages.pygments})"
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Source code tag system";
+    longDescription = ''
+      GNU GLOBAL is a source code tagging system that works the same way
+      across diverse environments (Emacs, vi, less, Bash, web browser, etc).
+      You can locate specified objects in source files and move there easily.
+      It is useful for hacking a large project containing many
+      subdirectories, many #ifdef and many main() functions.  It is similar
+      to ctags or etags but is different from them at the point of
+      independence of any editor.  It runs on a UNIX (POSIX) compatible
+      operating system like GNU and BSD.
+    '';
+    homepage = https://www.gnu.org/software/global/;
+    license = licenses.gpl3Plus;
+    maintainers = with maintainers; [ pSub peterhoeg ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/gnum4/darwin-secure-format.patch b/nixpkgs/pkgs/development/tools/misc/gnum4/darwin-secure-format.patch
new file mode 100644
index 000000000000..b14d8be6ef16
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/gnum4/darwin-secure-format.patch
@@ -0,0 +1,15 @@
+With format string strictness, High Sierra also enforces that %n isn't used
+in dynamic format strings, but we should just disable its use on darwin in
+general.
+
+--- a/lib/vasnprintf.c	2017-06-22 15:19:15.000000000 -0700
++++ b/lib/vasnprintf.c	2017-06-22 15:20:20.000000000 -0700
+@@ -4869,7 +4869,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *
+ #endif
+                   *fbp = dp->conversion;
+ #if USE_SNPRINTF
+-# if !(((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) && !defined __UCLIBC__) || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__))
++# if !defined(__APPLE__) && !(((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) && !defined __UCLIBC__) || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__))
+                 fbp[1] = '%';
+                 fbp[2] = 'n';
+                 fbp[3] = '\0';
diff --git a/nixpkgs/pkgs/development/tools/misc/gnum4/default.nix b/nixpkgs/pkgs/development/tools/misc/gnum4/default.nix
new file mode 100644
index 000000000000..ab2ab0de9cf9
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/gnum4/default.nix
@@ -0,0 +1,44 @@
+{ stdenv, fetchurl }:
+
+stdenv.mkDerivation {
+  name = "gnum4-1.4.18";
+
+  src = fetchurl {
+    url = "mirror://gnu/m4/m4-1.4.18.tar.bz2";
+    sha256 = "1xkwwq0sgv05cla0g0a01yzhk0wpsn9y40w9kh9miiiv0imxfh36";
+  };
+
+  doCheck = false;
+
+  configureFlags = [ "--with-syscmd-shell=${stdenv.shell}" ];
+
+  # Upstream is aware of it; it may be in the next release.
+  patches = [ ./s_isdir.patch ]
+    ++ stdenv.lib.optional stdenv.isDarwin ./darwin-secure-format.patch;
+
+  meta = {
+    homepage = https://www.gnu.org/software/m4/;
+    description = "GNU M4, a macro processor";
+
+    longDescription = ''
+      GNU M4 is an implementation of the traditional Unix macro
+      processor.  It is mostly SVR4 compatible although it has some
+      extensions (for example, handling more than 9 positional
+      parameters to macros).  GNU M4 also has built-in functions for
+      including files, running shell commands, doing arithmetic, etc.
+
+      GNU M4 is a macro processor in the sense that it copies its
+      input to the output expanding macros as it goes.  Macros are
+      either builtin or user-defined and can take any number of
+      arguments.  Besides just doing macro expansion, m4 has builtin
+      functions for including named files, running UNIX commands,
+      doing integer arithmetic, manipulating text in various ways,
+      recursion etc...  m4 can be used either as a front-end to a
+      compiler or as a macro processor in its own right.
+    '';
+
+    license = stdenv.lib.licenses.gpl3Plus;
+    platforms = stdenv.lib.platforms.unix ++ stdenv.lib.platforms.windows;
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/gnum4/s_isdir.patch b/nixpkgs/pkgs/development/tools/misc/gnum4/s_isdir.patch
new file mode 100644
index 000000000000..a009a4ba4465
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/gnum4/s_isdir.patch
@@ -0,0 +1,14 @@
+Fails to build with glibc 2.12.1 without this patch.
+
+http://lists.gnu.org/archive/html/bug-m4/2010-05/msg00002.html
+
+--- a/src/path.c
++++ b/src/path.c
+@@ -22,6 +22,7 @@
+ /* Handling of path search of included files via the builtins "include"
+    and "sinclude".  */
+ 
+ #include "m4.h"
++#include "sys/stat.h"
+ 
+ struct includes
diff --git a/nixpkgs/pkgs/development/tools/misc/gob2/default.nix b/nixpkgs/pkgs/development/tools/misc/gob2/default.nix
new file mode 100644
index 000000000000..b1e107368ba7
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/gob2/default.nix
@@ -0,0 +1,29 @@
+{ stdenv, fetchurl, pkgconfig, glib, bison, flex, gnome3 }:
+
+stdenv.mkDerivation rec {
+  pname = "gob2";
+  version = "2.0.20";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "5fe5d7990fd65b0d4b617ba894408ebaa6df453f2781c15a1cfdf2956c0c5428";
+  };
+
+  # configure script looks for d-bus but it is only needed for tests
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ glib bison flex ];
+
+  passthru = {
+    updateScript = gnome3.updateScript {
+      packageName = pname;
+      versionPolicy = "none";
+    };
+  };
+
+  meta = {
+    description = "Preprocessor for making GObjects with inline C code";
+    homepage = "https://www.jirka.org/gob.html";
+    license = stdenv.lib.licenses.gpl2Plus;
+    platforms = stdenv.lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/gperf/3.0.x.nix b/nixpkgs/pkgs/development/tools/misc/gperf/3.0.x.nix
new file mode 100644
index 000000000000..4a8b2e8daaba
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/gperf/3.0.x.nix
@@ -0,0 +1,35 @@
+{stdenv, fetchurl, autoreconfHook }:
+
+stdenv.mkDerivation rec {
+  name = "gperf-3.0.4";
+
+  src = fetchurl {
+    url = "mirror://gnu/gperf/${name}.tar.gz";
+    sha256 = "0gnnm8iqcl52m8iha3sxrzrl9mcyhg7lfrhhqgdn4zj00ji14wbn";
+  };
+
+  nativeBuildInputs = [ autoreconfHook ];
+  patches = [ ./gperf-ar-fix.patch ];
+  meta = {
+    description = "Perfect hash function generator";
+
+    longDescription = ''
+      GNU gperf is a perfect hash function generator.  For a given
+      list of strings, it produces a hash function and hash table, in
+      form of C or C++ code, for looking up a value depending on the
+      input string.  The hash function is perfect, which means that
+      the hash table has no collisions, and the hash table lookup
+      needs a single string comparison only.
+
+      GNU gperf is highly customizable.  There are options for
+      generating C or C++ code, for emitting switch statements or
+      nested ifs instead of a hash table, and for tuning the algorithm
+      employed by gperf.
+    '';
+
+    license = stdenv.lib.licenses.gpl3Plus;
+
+    homepage = https://www.gnu.org/software/gperf/;
+    platforms = stdenv.lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/gperf/default.nix b/nixpkgs/pkgs/development/tools/misc/gperf/default.nix
new file mode 100644
index 000000000000..cd0854d2beb8
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/gperf/default.nix
@@ -0,0 +1,33 @@
+{stdenv, fetchurl}:
+
+stdenv.mkDerivation rec {
+  name = "gperf-3.1";
+
+  src = fetchurl {
+    url = "mirror://gnu/gperf/${name}.tar.gz";
+    sha256 = "1qispg6i508rq8pkajh26cznwimbnj06wq9sd85vg95v8nwld1aq";
+  };
+
+  meta = {
+    description = "Perfect hash function generator";
+
+    longDescription = ''
+      GNU gperf is a perfect hash function generator.  For a given
+      list of strings, it produces a hash function and hash table, in
+      form of C or C++ code, for looking up a value depending on the
+      input string.  The hash function is perfect, which means that
+      the hash table has no collisions, and the hash table lookup
+      needs a single string comparison only.
+
+      GNU gperf is highly customizable.  There are options for
+      generating C or C++ code, for emitting switch statements or
+      nested ifs instead of a hash table, and for tuning the algorithm
+      employed by gperf.
+    '';
+
+    license = stdenv.lib.licenses.gpl3Plus;
+
+    homepage = https://www.gnu.org/software/gperf/;
+    platforms = stdenv.lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/gperf/gperf-ar-fix.patch b/nixpkgs/pkgs/development/tools/misc/gperf/gperf-ar-fix.patch
new file mode 100644
index 000000000000..942d726d76ea
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/gperf/gperf-ar-fix.patch
@@ -0,0 +1,46 @@
+--- gperf-3.0.4/lib/configure.ac	2009-01-15 02:24:31.000000000 +0200
++++ gperf-3.0.4.patched/lib/configure.ac	2018-11-29 06:37:20.968627533 +0300
+@@ -21,10 +21,12 @@
+ 
+ AC_PREREQ([2.60])
+ AC_INIT([hash.cc])
++m4_include([../aclocal.m4])
+ AC_PROG_MAKE_SET
+ dnl
+ dnl           checks for programs
+ dnl
++AC_SUBST([AR])
+ AC_PROG_CC
+                       dnl sets variable CC
+ AC_PROG_CPP
+--- gperf-3.0.4/lib/Makefile.in	2008-08-23 21:52:48.000000000 +0300
++++ gperf-3.0.4.patched/lib/Makefile.in	2018-11-29 06:36:43.161998888 +0300
+@@ -41,7 +41,7 @@
+ # Both C and C++ compiler
+ OBJEXT = @OBJEXT@
+ # Other
+-AR = ar
++AR = @AR@
+ AR_FLAGS = rc
+ RANLIB = @RANLIB@
+ MV = mv
+--- gperf-3.0.4/doc/configure.ac	2009-01-15 02:24:31.000000000 +0200
++++ gperf-3.0.4.patched/doc/configure.ac	2018-11-29 06:36:00.961288421 +0300
+@@ -21,6 +21,7 @@
+ 
+ AC_PREREQ([2.60])
+ AC_INIT([gperf.1])
++m4_include([../aclocal.m4])
+ PACKAGE=gperf
+ AC_SUBST([PACKAGE])
+ AC_PROG_MAKE_SET
+--- gperf-3.0.4/src/configure.ac	2009-01-15 02:24:30.000000000 +0200
++++ gperf-3.0.4.patched/src/configure.ac	2018-11-29 06:34:21.718576658 +0300
+@@ -21,6 +21,7 @@
+ 
+ AC_PREREQ([2.60])
+ AC_INIT([main.cc])
++m4_include([../aclocal.m4])
+ AC_CONFIG_HEADER([config.h])
+ AC_PROG_MAKE_SET
+ dnl
diff --git a/nixpkgs/pkgs/development/tools/misc/gpshell/default.nix b/nixpkgs/pkgs/development/tools/misc/gpshell/default.nix
new file mode 100644
index 000000000000..108d6190cb7d
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/gpshell/default.nix
@@ -0,0 +1,27 @@
+{ stdenv, fetchurl, pkgconfig, globalplatform, pcsclite, gppcscconnectionplugin
+, makeWrapper
+}:
+
+stdenv.mkDerivation rec {
+  pname = "gpshell";
+  version = "1.4.4";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/globalplatform/gpshell-${version}.tar.gz";
+    sha256 = "19a77zvyf2vazbv17185s4pynhylk2ky8vhl4i8pg9zww29sicqi";
+  };
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ globalplatform pcsclite makeWrapper ];
+
+  postFixup = ''
+    wrapProgram "$out/bin/gpshell" --prefix LD_LIBRARY_PATH : "${gppcscconnectionplugin}/lib"
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = https://sourceforge.net/p/globalplatform/wiki/Home/;
+    description = "Smartcard management application";
+    license = licenses.gpl3;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/gputils/default.nix b/nixpkgs/pkgs/development/tools/misc/gputils/default.nix
new file mode 100644
index 000000000000..37a7a8c931c3
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/gputils/default.nix
@@ -0,0 +1,18 @@
+{ stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "gputils";
+  version = "1.5.0-1";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/gputils/${pname}-${version}.tar.bz2";
+    sha256 = "055v83fdgqljprapf7rmh8x66mr13fj0qypj49xba5spx0ca123g";
+  };
+
+  meta = with stdenv.lib; {
+    homepage = https://gputils.sourceforge.io/;
+    license = licenses.gpl2;
+    maintainers = with maintainers; [ yorickvp ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/gtkdialog/default.nix b/nixpkgs/pkgs/development/tools/misc/gtkdialog/default.nix
new file mode 100644
index 000000000000..02b4d1557678
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/gtkdialog/default.nix
@@ -0,0 +1,21 @@
+{stdenv, fetchurl, gtk2, pkgconfig, hicolor-icon-theme }:
+
+stdenv.mkDerivation {
+  name = "gtkdialog-0.8.3";
+
+  src = fetchurl {
+    url = "https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/gtkdialog/gtkdialog-0.8.3.tar.gz";
+    sha256 = "ff89d2d7f1e6488e5df5f895716ac1d4198c2467a2a5dc1f51ab408a2faec38e";
+  };
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ gtk2 hicolor-icon-theme ];
+
+  meta = {
+    homepage = https://code.google.com/archive/p/gtkdialog/;
+    # community links: http://murga-linux.com/puppy/viewtopic.php?t=111923 -> https://github.com/01micko/gtkdialog
+    description = "Small utility for fast and easy GUI building from many scripted and compiled languages";
+    license = stdenv.lib.licenses.gpl2Plus;
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/gtkperf/bench.patch b/nixpkgs/pkgs/development/tools/misc/gtkperf/bench.patch
new file mode 100644
index 000000000000..3d00a03e9a58
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/gtkperf/bench.patch
@@ -0,0 +1,60 @@
+--- gtkperf/src/callbacks.c	2005-10-30 11:33:42.000000000 +0000
++++ gtkperf-patched/src/callbacks.c	2008-05-23 23:41:17.000000000 +0100
+@@ -219,6 +219,13 @@
+ }
+
+
++void
++on_cmdline_test(char *optarg)
++{
++	appdata->test_type = atoi(optarg);
++}
++
++
+ /* Initialize appdata */
+ void
+ setup_appdata(AppData * appdata_in)
+@@ -398,7 +405,7 @@
+ 	appdata->pixbuf_drawing = gdk_pixbuf_new_from_file (filename, NULL);
+
+ 	gtk_combo_box_set_active (GTK_COMBO_BOX (appdata->combobox_testtype),
+-				  0);
++				  appdata->test_type);
+
+ 	/* create end mark to info textview */
+ 	GtkTextIter iter;
+--- gtkperf/src/callbacks.h	2005-10-30 10:21:23.000000000 +0000
++++ gtkperf-patched/src/callbacks.h	2008-05-23 23:22:30.000000000 +0100
+@@ -13,6 +13,7 @@
+ void on_cmdline_run_all ();
+ void on_cmdline_help () ;
+ void on_cmdline_count (char *optarg) ;
++void on_cmdline_test (char *optarg) ;
+ void on_window_main_show (AppData * data);
+
+ gboolean
+--- gtkperf/src/main.c	2005-10-30 11:26:42.000000000 +0000
++++ gtkperf-patched/src/main.c	2008-05-23 23:44:02.000000000 +0100
+@@ -65,9 +65,10 @@
+ 			{"help", 0, 0, 0},
+ 			{"automatic", 0, 0, 0},
+ 			{"count", 1, 0, 0},
++			{"test", 1, 0, 0},
+ 			{0, 0, 0, 0}
+ 		};
+-		c = getopt_long (argc, argv, "hac:",
++		c = getopt_long (argc, argv, "hac:t:",
+ 			long_options, &option_index);
+ 		if (c == -1)
+ 			break;
+@@ -104,6 +105,10 @@
+ 				on_cmdline_count(optarg);
+ 				break;
+
++			case 't':
++				on_cmdline_test(optarg);
++				break;
++
+ 			default:
+ 			case 'h':
+ 				on_cmdline_help ();
diff --git a/nixpkgs/pkgs/development/tools/misc/gtkperf/default.nix b/nixpkgs/pkgs/development/tools/misc/gtkperf/default.nix
new file mode 100644
index 000000000000..5b47ce0bc247
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/gtkperf/default.nix
@@ -0,0 +1,24 @@
+{ stdenv, fetchurl, gtk2, pkgconfig, libintl }:
+
+stdenv.mkDerivation {
+  name = "gtkperf-0.40.0";
+  src = fetchurl {
+    url = "mirror://sourceforge//gtkperf/gtkperf_0.40.tar.gz";
+    sha256 = "0yxj3ap3yfi76vqg6xjvgc16nfi9arm9kp87s35ywf10fd73814p";
+  };
+
+  hardeningDisable = [ "format" ];
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ gtk2 libintl ];
+
+  # https://openbenchmarking.org/innhold/7e9780c11550d09aa67bdba71248facbe2d781db
+  patches = [ ./bench.patch ];
+
+  meta = with stdenv.lib; {
+    description = "Application designed to test GTK performance";
+    homepage = http://gtkperf.sourceforge.net/;
+    license = with licenses; [ gpl2 ];
+    maintainers = with maintainers; [ dtzWill ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/help2man/1.40.4-cygwin-nls.patch b/nixpkgs/pkgs/development/tools/misc/help2man/1.40.4-cygwin-nls.patch
new file mode 100644
index 000000000000..82f8cf1cb37b
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/help2man/1.40.4-cygwin-nls.patch
@@ -0,0 +1,165 @@
+LD_PRELOAD by itself only works with Cygwin builtin functions, but
+textdomain() and friends come from libintl.  In order to override
+those functions, we have to "replace" cygintl-?.dll since functions are
+bound to a DLL name at link time.  Our replacement will be used since
+it is loaded first by LD_PRELOAD.
+
+But as we are making this *the* libintl, we need to provide 
+pass-throughs for the other functions which we're not overriding,
+otherwise Locale::gettext won't load (not to mention the program
+that we're trying to help2man).
+
+--- help2man-1.46.5/Makefile.in	2014-10-09 13:03:01.000000000 +0200
++++ help2man-1.46.5/Makefile.in	2015-05-12 14:46:52.995521900 +0200
+@@ -76,7 +76,8 @@
+        fi
+
+ install_preload: install_dirs preload
+-	$(INSTALL_PROGRAM) $(preload).so $(DESTDIR)$(pkglibdir)
++	$(INSTALL_PROGRAM) lib/cygintl-9.dll $(DESTDIR)$(pkglibdir)
++	ln -sf cygintl-9.dll $(DESTDIR)$(pkglibdir)/$(preload).so
+
+ install_l10n: install_dirs msg_l10n man_l10n info_l10n
+        set -e; \
+@@ -144,7 +146,9 @@
+
+ preload: $(preload).so
+ $(preload).so: $(srcdir)/$(preload).c
+-	$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ -fPIC -shared $? $(LIBS)
++	mkdir -p lib
++	$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o lib/cygintl-9.dll -shared $? $(LIBS)
++	ln -sf lib/cygintl-9.dll $@
+
+ man: $(target).1
+ $(target).1: $(srcdir)/$(target).PL $(srcdir)/$(target).h2m.PL
+--- help2man-1.46.5/bindtextdomain.c	2009-11-13 00:01:34.000000000 -0600
++++ help2man-1.46.5/bindtextdomain.c	2011-12-29 00:24:33.608078600 -0600
+@@ -27,12 +27,34 @@ static char *(*r_textdomain)(char const
+ static char *(*r_bindtextdomain)(char const *, char const *) = 0;
+ static char *(*r_bind_textdomain_codeset)(char const *, char const *) = 0;
+ 
++#ifdef __CYGWIN__
++static void *RTLD_NEXT = 0;
++static char *(*r_gettext)(const char *) = 0;
++static char *(*r_dgettext)(const char *, const char *) = 0;
++static char *(*r_dcgettext)(const char *, const char *, int) = 0;
++static char *(*r_ngettext)(const char *, const char *, unsigned long int) = 0;
++static char *(*r_dngettext)(const char *, const char *, const char *,
++                            unsigned long int) = 0;
++static char *(*r_dcngettext)(const char *, const char *, const char *,
++                             unsigned long int, int) = 0;
++static char *(*r_setlocale)(int, const char *) = 0;
++
++#define SYM(sym) libintl_ ## sym
++#else
++#define SYM(sym) sym
++#endif
++
+ void setup()
+ {
+     static int done = 0;
+     if (done++)
+         return;
+ 
++#ifdef __CYGWIN__
++    if (!(RTLD_NEXT = dlopen("/usr/bin/cygintl-9.dll", RTLD_LAZY)))
++        die("libintl8 not found");
++#endif
++
+     if (!(e_textdomain = getenv("TEXTDOMAIN")))
+ 	die("TEXTDOMAIN not set");
+ 
+@@ -48,9 +70,19 @@ void setup()
+     if (!(r_bind_textdomain_codeset = dlsym(RTLD_NEXT,
+     					    "bind_textdomain_codeset")))
+ 	die("can't find symbol \"bind_textdomain_codeset\"");
++
++#ifdef __CYGWIN__
++    r_gettext = dlsym(RTLD_NEXT, "libintl_gettext");
++    r_dgettext = dlsym(RTLD_NEXT, "libintl_dgettext");
++    r_dcgettext = dlsym(RTLD_NEXT, "libintl_dcgettext");
++    r_ngettext = dlsym(RTLD_NEXT, "libintl_ngettext");
++    r_dngettext = dlsym(RTLD_NEXT, "libintl_dngettext");
++    r_dcngettext = dlsym(RTLD_NEXT, "libintl_dcngettext");
++    r_setlocale = dlsym(RTLD_NEXT, "libintl_setlocale");
++#endif
+ }
+ 
+-char *textdomain(char const *domainname)
++char *SYM(textdomain)(char const *domainname)
+ {
+     char *r;
+     setup();
+@@ -61,7 +93,7 @@ char *textdomain(char const *domainname)
+     return r;
+ }
+ 
+-char *bindtextdomain(char const *domainname, char const *dirname)
++char *SYM(bindtextdomain)(char const *domainname, char const *dirname)
+ {
+     char const *dir = dirname;
+     setup();
+@@ -71,7 +103,7 @@ char *bindtextdomain(char const *domainn
+     return r_bindtextdomain(domainname, dir);
+ }
+ 
+-char *bind_textdomain_codeset(char const *domainname, char const *codeset)
++char *SYM(bind_textdomain_codeset)(char const *domainname, char const *codeset)
+ {
+     char *r;
+     setup();
+@@ -81,3 +113,54 @@ char *bind_textdomain_codeset(char const
+ 
+     return r;
+ }
++
++#ifdef __CYGWIN__
++
++char *libintl_gettext(const char *msgid)
++{
++    setup();
++    return r_gettext(msgid);
++}
++
++char *libintl_dgettext (const char *domainname, const char *msgid)
++{
++    setup();
++    return r_dgettext(domainname, msgid);
++}
++
++char *libintl_dcgettext (const char *domainname, const char *msgid,
++                         int category)
++{
++    setup();
++    return r_dcgettext (domainname, msgid, category);
++}
++
++char *libintl_ngettext (const char *msgid1, const char *msgid2,
++                        unsigned long int n)
++{
++    setup();
++    return r_ngettext (msgid1, msgid2, n);
++}
++
++char *libintl_dngettext (const char *domainname, const char *msgid1,
++                         const char *msgid2, unsigned long int n)
++{
++    setup();
++    return r_dngettext (domainname, msgid1, msgid2, n);
++}
++
++char *libintl_dcngettext (const char *domainname,
++                          const char *msgid1, const char *msgid2,
++                          unsigned long int n, int category)
++{
++    setup();
++    return r_dcngettext (domainname, msgid1, msgid2, n, category);
++}
++
++char *libintl_setlocale (int i, const char *s)
++{
++    setup();
++    return r_setlocale (i, s);
++}
++
++#endif
diff --git a/nixpkgs/pkgs/development/tools/misc/help2man/default.nix b/nixpkgs/pkgs/development/tools/misc/help2man/default.nix
new file mode 100644
index 000000000000..c4cba5ffc69c
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/help2man/default.nix
@@ -0,0 +1,46 @@
+{ stdenv, fetchurl, perlPackages, gettext }:
+
+stdenv.mkDerivation rec {
+  name = "help2man-1.47.11";
+
+  src = fetchurl {
+    url = "mirror://gnu/help2man/${name}.tar.xz";
+    sha256 = "123vsimgx8zq1h077sbyh3bd0hbmlc3wih2231wwh133z1bv51ar";
+  };
+
+  nativeBuildInputs = [ gettext perlPackages.LocaleGettext ];
+  buildInputs = [ perlPackages.perl perlPackages.LocaleGettext ];
+
+  doCheck = false;                                # target `check' is missing
+
+  patches = if stdenv.hostPlatform.isCygwin then [ ./1.40.4-cygwin-nls.patch ] else null;
+
+  # We don't use makeWrapper here because it uses substitutions our
+  # bootstrap shell can't handle.
+  postInstall = ''
+    mv $out/bin/help2man $out/bin/.help2man-wrapped
+    cat > $out/bin/help2man <<EOF
+    #! $SHELL -e
+    export PERL5LIB=\''${PERL5LIB:+:}${perlPackages.LocaleGettext}/${perlPackages.perl.libPrefix}
+    ${stdenv.lib.optionalString stdenv.hostPlatform.isCygwin
+        ''export PATH=\''${PATH:+:}${gettext}/bin''}
+    exec -a \$0 $out/bin/.help2man-wrapped "\$@"
+    EOF
+    chmod +x $out/bin/help2man
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Generate man pages from `--help' output";
+
+    longDescription =
+      '' help2man produces simple manual pages from the ‘--help’ and
+         ‘--version’ output of other commands.
+      '';
+
+    homepage = https://www.gnu.org/software/help2man/;
+
+    license = licenses.gpl3Plus;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ pSub ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/hound/default.nix b/nixpkgs/pkgs/development/tools/misc/hound/default.nix
new file mode 100644
index 000000000000..d3afbbc1bc76
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/hound/default.nix
@@ -0,0 +1,41 @@
+{ stdenv
+, buildGoPackage
+, fetchFromGitHub
+, makeWrapper
+, mercurial
+, git
+}:
+
+buildGoPackage rec {
+  pname = "hound-unstable";
+  version = "2018-11-02";
+  rev = "74ec7448a234d8d09e800b92e52c92e378c07742";
+
+  nativeBuildInputs = [ makeWrapper ];
+
+  goPackagePath = "github.com/etsy/hound";
+
+  src = fetchFromGitHub {
+    inherit rev;
+    owner = "etsy";
+    repo = "hound";
+    sha256 = "0g6nvgqjabprcl9z5ci5frhbam1dzq978h1d6aanf8vvzslfgdpq";
+  };
+
+  goDeps = ./deps.nix;
+
+  postInstall = with stdenv; let
+    binPath = lib.makeBinPath [ mercurial git ];
+  in ''
+    wrapProgram $bin/bin/houndd --prefix PATH : ${binPath}
+  '';
+
+  meta = {
+    inherit (src.meta) homepage;
+
+    description = "Lightning fast code searching made easy";
+    license = stdenv.lib.licenses.mit;
+    maintainers = with stdenv.lib.maintainers; [ grahamc ];
+    platforms = stdenv.lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/hound/deps.nix b/nixpkgs/pkgs/development/tools/misc/hound/deps.nix
new file mode 100644
index 000000000000..fe51488c7066
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/hound/deps.nix
@@ -0,0 +1 @@
+[]
diff --git a/nixpkgs/pkgs/development/tools/misc/hydra/default.nix b/nixpkgs/pkgs/development/tools/misc/hydra/default.nix
new file mode 100644
index 000000000000..4a65d0888347
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/hydra/default.nix
@@ -0,0 +1,140 @@
+{ stdenv, nix, perlPackages, buildEnv, fetchFromGitHub
+, makeWrapper, autoconf, automake, libtool, unzip, pkgconfig, sqlite, libpqxx
+, gitAndTools, mercurial, darcs, subversion, bazaar, openssl, bzip2, libxslt
+, guile, perl, postgresql, nukeReferences, git, boehmgc, nlohmann_json
+, docbook_xsl, openssh, gnused, coreutils, findutils, gzip, lzma, gnutar
+, rpm, dpkg, cdrkit, pixz, lib, boost, autoreconfHook
+}:
+
+with stdenv;
+
+if lib.versions.major nix.version == "1"
+  then throw "This Hydra version doesn't support Nix 1.x"
+else
+
+let
+  perlDeps = buildEnv {
+    name = "hydra-perl-deps";
+    paths = with perlPackages;
+      [ ModulePluggable
+        CatalystActionREST
+        CatalystAuthenticationStoreDBIxClass
+        CatalystDevel
+        CatalystDispatchTypeRegex
+        CatalystPluginAccessLog
+        CatalystPluginAuthorizationRoles
+        CatalystPluginCaptcha
+        CatalystPluginSessionStateCookie
+        CatalystPluginSessionStoreFastMmap
+        CatalystPluginStackTrace
+        CatalystRuntime
+        CatalystTraitForRequestProxyBase
+        CatalystViewDownload
+        CatalystViewJSON
+        CatalystViewTT
+        CatalystXScriptServerStarman
+        CatalystXRoleApplicator
+        CryptRandPasswd
+        DBDPg
+        DBDSQLite
+        DataDump
+        DateTime
+        DigestSHA1
+        EmailMIME
+        EmailSender
+        FileSlurp
+        IOCompress
+        IPCRun
+        JSON
+        JSONAny
+        JSONXS
+        LWP
+        LWPProtocolHttps
+        NetAmazonS3
+        NetStatsd
+        PadWalker
+        Readonly
+        SQLSplitStatement
+        SetScalar
+        Starman
+        SysHostnameLong
+        TextDiff
+        TextTable
+        XMLSimple
+        nix
+        nix.perl-bindings
+        git
+        boehmgc
+      ];
+  };
+in stdenv.mkDerivation rec {
+  pname = "hydra";
+  version = "2019-08-30";
+
+  inherit stdenv;
+
+  src = fetchFromGitHub {
+    owner = "NixOS";
+    repo = pname;
+    rev = "242b8b7a314759ed33f69205d26a1b7c337511e0";
+    sha256 = "167ijcf9qdm10kjvqax3hcvs5mpa4mx2y2i9idwwc6xfvn8fhs84";
+  };
+
+  buildInputs =
+    [ makeWrapper autoconf automake libtool unzip nukeReferences sqlite libpqxx
+      gitAndTools.topGit mercurial darcs subversion bazaar openssl bzip2 libxslt
+      guile # optional, for Guile + Guix support
+      perlDeps perl nix
+      postgresql # for running the tests
+      nlohmann_json
+      boost
+    ];
+
+  hydraPath = lib.makeBinPath (
+    [ sqlite subversion openssh nix coreutils findutils pixz
+      gzip bzip2 lzma gnutar unzip git gitAndTools.topGit mercurial darcs gnused bazaar
+    ] ++ lib.optionals stdenv.isLinux [ rpm dpkg cdrkit ] );
+
+  nativeBuildInputs = [ autoreconfHook pkgconfig ];
+
+  configureFlags = [ "--with-docbook-xsl=${docbook_xsl}/xml/xsl/docbook" ];
+
+  NIX_CFLAGS_COMPILE = [ "-pthread" ];
+
+  shellHook = ''
+    PATH=$(pwd)/src/script:$(pwd)/src/hydra-eval-jobs:$(pwd)/src/hydra-queue-runner:$(pwd)/src/hydra-evaluator:$PATH
+    PERL5LIB=$(pwd)/src/lib:$PERL5LIB;
+  '';
+
+  enableParallelBuilding = true;
+
+  preCheck = ''
+    patchShebangs .
+    export LOGNAME=''${LOGNAME:-foo}
+  '';
+
+  postInstall = ''
+    mkdir -p $out/nix-support
+    for i in $out/bin/*; do
+        read -n 4 chars < $i
+        if [[ $chars =~ ELF ]]; then continue; fi
+        wrapProgram $i \
+            --prefix PERL5LIB ':' $out/libexec/hydra/lib:$PERL5LIB \
+            --prefix PATH ':' $out/bin:$hydraPath \
+            --set HYDRA_RELEASE ${version} \
+            --set HYDRA_HOME $out/libexec/hydra \
+            --set NIX_RELEASE ${nix.name or "unknown"}
+    done
+  ''; # */
+
+  dontStrip = true;
+
+  passthru.perlDeps = perlDeps;
+
+  meta = with stdenv.lib; {
+    description = "Nix-based continuous build system";
+    license = licenses.gpl3;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ ma27 ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/icon-naming-utils/default.nix b/nixpkgs/pkgs/development/tools/misc/icon-naming-utils/default.nix
new file mode 100644
index 000000000000..d7b2cd36492e
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/icon-naming-utils/default.nix
@@ -0,0 +1,25 @@
+{stdenv, fetchurl, perlPackages, librsvg}:
+
+stdenv.mkDerivation rec {
+  name = "icon-naming-utils-0.8.90";
+
+  src = fetchurl {
+    url = "http://tango.freedesktop.org/releases/${name}.tar.gz";
+    sha256 = "071fj2jm5kydlz02ic5sylhmw6h2p3cgrm3gwdfabinqkqcv4jh4";
+  };
+
+  buildInputs = [ librsvg ] ++ (with perlPackages; [ perl XMLSimple ]);
+
+  postInstall =
+    ''
+      # Add XML::Simple to the runtime search path.
+      substituteInPlace $out/libexec/icon-name-mapping \
+          --replace '/bin/perl' '/bin/perl -I${perlPackages.XMLSimple}/${perlPackages.perl.libPrefix}'
+    '';
+
+  meta = with stdenv.lib; {
+    homepage = http://tango.freedesktop.org/Standard_Icon_Naming_Specification;
+    platforms = with platforms; linux ++ darwin;
+    license = licenses.gpl2;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/igprof/default.nix b/nixpkgs/pkgs/development/tools/misc/igprof/default.nix
new file mode 100644
index 000000000000..996dda4ca941
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/igprof/default.nix
@@ -0,0 +1,43 @@
+{stdenv, fetchFromGitHub, libunwind, cmake, pcre, gdb}:
+
+stdenv.mkDerivation rec {
+  version = "5.9.16";
+  pname = "igprof";
+
+  src = fetchFromGitHub {
+    owner = "igprof";
+    repo = "igprof";
+    rev = "v${version}";
+    sha256 = "0rx3mv8zdh9bmcpfbzkib3d52skzfr8600gh5gv21wcsh50jnifx";
+  };
+
+  postPatch = ''
+    substituteInPlace src/igprof --replace libigprof.so $out/lib/libigprof.so
+    '';
+
+  buildInputs = [libunwind gdb pcre];
+  nativeBuildInputs = [cmake];
+  CXXFLAGS = ["-fPIC" "-O2" "-w" "-fpermissive"];
+
+  meta = {
+    description = "The Ignominous Profiler";
+
+    longDescription = ''
+      IgProf is a fast and light weight profiler. It correctly handles
+      dynamically loaded shared libraries, threads and sub-processes started by
+      the application.  We have used it routinely with large C++ applications
+      consisting of many hundreds of shared libraries and thousands of symbols
+      from millions of source lines of code. It requires no special privileges
+      to run. The performance reports provide full navigable call stacks and
+      can be customised by applying filters. Results from any number of
+      profiling runs can be included. This means you can both dig into the
+      details and see the big picture from combined workloads.
+    '';
+
+    license = stdenv.lib.licenses.gpl2;
+
+    homepage = https://igprof.org/;
+    platforms = stdenv.lib.platforms.linux;
+    maintainers = with stdenv.lib.maintainers; [ ktf ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/indent/darwin.patch b/nixpkgs/pkgs/development/tools/misc/indent/darwin.patch
new file mode 100644
index 000000000000..5458a0d93bff
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/indent/darwin.patch
@@ -0,0 +1,15 @@
+diff --git a/config.h.in b/config.h.in
+index 07e6fce..0c57e2a 100644
+--- a/config.h.in
++++ b/config.h.in
+@@ -432,8 +432,8 @@
+ # endif
+ # define _GL_EXTERN_INLINE extern
+ #else
+-# define _GL_INLINE static _GL_UNUSED
+-# define _GL_EXTERN_INLINE static _GL_UNUSED
++# define _GL_INLINE static
++# define _GL_EXTERN_INLINE static
+ #endif
+ 
+ #if 4 < __GNUC__ + (6 <= __GNUC_MINOR__)
diff --git a/nixpkgs/pkgs/development/tools/misc/indent/default.nix b/nixpkgs/pkgs/development/tools/misc/indent/default.nix
new file mode 100644
index 000000000000..c4b5fecca741
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/indent/default.nix
@@ -0,0 +1,27 @@
+{ stdenv, fetchurl, texinfo }:
+
+stdenv.mkDerivation rec {
+  name = "indent-2.2.12";
+
+  src = fetchurl {
+    url = "mirror://gnu/indent/${name}.tar.gz";
+    sha256 = "12xvcd16cwilzglv9h7sgh4h1qqjd1h8s48ji2dla58m4706hzg7";
+  };
+
+  patches = [ ./darwin.patch ];
+
+  buildInputs = [ texinfo ];
+
+  NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isClang
+    "-Wno-implicit-function-declaration";
+
+  hardeningDisable = [ "format" ];
+
+  meta = {
+    homepage = "https://www.gnu.org/software/indent/";
+    description = "A source code reformatter";
+    license = stdenv.lib.licenses.gpl3Plus;
+    maintainers = [ stdenv.lib.maintainers.mmahut ];
+    platforms = stdenv.lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/inotify-tools/default.nix b/nixpkgs/pkgs/development/tools/misc/inotify-tools/default.nix
new file mode 100644
index 000000000000..b04de1832abb
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/inotify-tools/default.nix
@@ -0,0 +1,22 @@
+{ stdenv, autoreconfHook, fetchFromGitHub }:
+
+stdenv.mkDerivation rec {
+  pname = "inotify-tools";
+  version = "3.20.1";
+
+  src = fetchFromGitHub {
+    repo = "inotify-tools";
+    owner = "rvoicilas";
+    rev = version;
+    sha256 = "14dci1i4mhsd5sa33k8h3ayphk19kizynh5ql9ryibdpmcanfiyq";
+  };
+
+  nativeBuildInputs = [ autoreconfHook ];
+
+  meta = with stdenv.lib; {
+    homepage = https://github.com/rvoicilas/inotify-tools/wiki;
+    license = licenses.gpl2;
+    maintainers = with maintainers; [ marcweber pSub ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/intel-gpu-tools/default.nix b/nixpkgs/pkgs/development/tools/misc/intel-gpu-tools/default.nix
new file mode 100644
index 000000000000..12197c2de40c
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/intel-gpu-tools/default.nix
@@ -0,0 +1,40 @@
+{ stdenv, fetchurl, pkgconfig, libdrm, libpciaccess, cairo, xorgproto, udev
+, libX11, libXext, libXv, libXrandr, glib, bison, libunwind, python3, kmod
+, procps, utilmacros, gtk-doc, openssl, peg }:
+
+stdenv.mkDerivation rec {
+  pname = "intel-gpu-tools";
+  version = "1.23";
+
+  src = fetchurl {
+    url = "https://xorg.freedesktop.org/archive/individual/app/igt-gpu-tools-${version}.tar.xz";
+    sha256 = "1l4s95m013p2wvddwr4cjqyvsgmc88zxx2887p1fbb1va5n0hjsd";
+  };
+
+  nativeBuildInputs = [ pkgconfig utilmacros ];
+  buildInputs = [ libdrm libpciaccess cairo xorgproto udev libX11 kmod
+    libXext libXv libXrandr glib bison libunwind python3 procps
+    gtk-doc openssl peg ];
+
+  preConfigure = ''
+    ./autogen.sh
+  '';
+
+  preBuild = ''
+    patchShebangs tests
+
+    patchShebangs debugger/system_routine/pre_cpp.py
+    substituteInPlace tools/Makefile.am --replace '$(CAIRO_CFLAGS)' '$(CAIRO_CFLAGS) $(GLIB_CFLAGS)'
+    substituteInPlace tests/Makefile.am --replace '$(CAIRO_CFLAGS)' '$(CAIRO_CFLAGS) $(GLIB_CFLAGS)'
+  '';
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    homepage = https://01.org/linuxgraphics/;
+    description = "Tools for development and testing of the Intel DRM driver";
+    license = licenses.mit;
+    platforms = [ "x86_64-linux" "i686-linux" ];
+    maintainers = with maintainers; [ pSub ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/intltool/default.nix b/nixpkgs/pkgs/development/tools/misc/intltool/default.nix
new file mode 100644
index 000000000000..c837728f72dd
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/intltool/default.nix
@@ -0,0 +1,29 @@
+{ stdenv, fetchurl, fetchpatch, gettext, perlPackages }:
+
+stdenv.mkDerivation rec {
+  pname = "intltool";
+  version = "0.51.0";
+
+  src = fetchurl {
+    url = "https://launchpad.net/intltool/trunk/${version}/+download/${pname}-${version}.tar.gz";
+    sha256 = "1karx4sb7bnm2j67q0q74hspkfn6lqprpy5r99vkn5bb36a4viv7";
+  };
+
+  # fix "unescaped left brace" errors when using intltool in some cases
+  patches = [(fetchpatch {
+    name = "perl5.26-regex-fixes.patch";
+    url = "https://sources.debian.org/data/main/i/intltool/0.51.0-5"
+      + "/debian/patches/perl5.26-regex-fixes.patch";
+    sha256 = "12q2140867r5d0dysly72khi7b0mm2gd7nlm1k81iyg7fxgnyz45";
+  })];
+
+  propagatedBuildInputs = [ gettext ] ++ (with perlPackages; [ perl XMLParser ]);
+
+  meta = with stdenv.lib; {
+    description = "Translation helper tool";
+    homepage = https://launchpad.net/intltool/;
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ raskin ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/iozone/default.nix b/nixpkgs/pkgs/development/tools/misc/iozone/default.nix
new file mode 100644
index 000000000000..1d5da65df7e0
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/iozone/default.nix
@@ -0,0 +1,61 @@
+{ stdenv, fetchurl, gnuplot }:
+
+let
+  target = if stdenv.hostPlatform.system == "i686-linux" then
+    "linux"
+  else if stdenv.hostPlatform.system == "x86_64-linux" then
+    "linux-AMD64"
+  else if stdenv.hostPlatform.system == "x86_64-darwin" then
+    "macosx"
+  else if stdenv.hostPlatform.system == "aarch64-linux" then
+    "linux-arm"
+  else throw "Platform ${stdenv.hostPlatform.system} not yet supported.";
+in
+
+stdenv.mkDerivation rec {
+  name = "iozone-3.471";
+
+  src = fetchurl {
+    url = http://www.iozone.org/src/current/iozone3_471.tar;
+    sha256 = "0w63b3d4ws1sm52lpdd08sl7n4ay438dl3wy0q9la12iq81rglid";
+  };
+
+  license = fetchurl {
+    url = http://www.iozone.org/docs/Iozone_License.txt;
+    sha256 = "1309sl1rqm8p9gll3z8zfygr2pmbcvzw5byf5ba8y12avk735zrv";
+  };
+
+  preBuild = "pushd src/current";
+  postBuild = "popd";
+
+  buildFlags = target;
+
+  enableParallelBuilding = true;
+
+  installPhase = ''
+    mkdir -p $out/{bin,share/doc,libexec,share/man/man1}
+    install docs/iozone.1 $out/share/man/man1/
+    install docs/Iozone_ps.gz $out/share/doc/
+    install -s src/current/{iozone,fileop,pit_server} $out/bin/
+    install src/current/{gnu3d.dem,Generate_Graphs,gengnuplot.sh} $out/libexec/
+    ln -s $out/libexec/Generate_Graphs $out/bin/iozone_generate_graphs
+    # License copy is mandated by the license, but it's not in the tarball.
+    install ${license} $out/share/doc/Iozone_License.txt
+  '';
+
+  preFixup = ''
+    sed -i "1i#! $shell" $out/libexec/Generate_Graphs
+    substituteInPlace $out/libexec/Generate_Graphs \
+      --replace ./gengnuplot.sh $out/libexec/gengnuplot.sh \
+      --replace 'gnuplot ' "${gnuplot}/bin/gnuplot " \
+      --replace gnu3d.dem $out/libexec/gnu3d.dem
+  '';
+
+  meta = {
+    description = "IOzone Filesystem Benchmark";
+    homepage    = http://www.iozone.org/;
+    license     = stdenv.lib.licenses.unfreeRedistributable;
+    platforms   = ["i686-linux" "x86_64-linux" "x86_64-darwin" "aarch64-linux" ];
+    maintainers = with stdenv.lib.maintainers; [ Baughn makefu ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/itstool/default.nix b/nixpkgs/pkgs/development/tools/misc/itstool/default.nix
new file mode 100644
index 000000000000..9368a3c1acf8
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/itstool/default.nix
@@ -0,0 +1,30 @@
+{ stdenv, fetchurl, python2, libxml2Python }:
+# We need the same Python as is used to build libxml2Python
+
+stdenv.mkDerivation rec {
+  # 2.0.3+ breaks the build of gnome3.gnome-desktop
+  # https://github.com/itstool/itstool/issues/17
+  name = "itstool-2.0.2";
+
+  src = fetchurl {
+    url = "http://files.itstool.org/itstool/${name}.tar.bz2";
+    sha256 = "bf909fb59b11a646681a8534d5700fec99be83bb2c57badf8c1844512227033a";
+  };
+
+  buildInputs = [ python2 libxml2Python ];
+
+  patchPhase =
+    ''
+      sed -e '/import libxml2/i import sys\
+      sys.path.append("${libxml2Python}/lib/${python2.libPrefix}/site-packages")' \
+      -i itstool.in
+    '';
+
+  meta = {
+    homepage = http://itstool.org/;
+    description = "XML to PO and back again";
+    license = stdenv.lib.licenses.gpl3Plus;
+    platforms = stdenv.lib.platforms.all;
+    maintainers = [ ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/jscoverage/default.nix b/nixpkgs/pkgs/development/tools/misc/jscoverage/default.nix
new file mode 100644
index 000000000000..af660561ee17
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/jscoverage/default.nix
@@ -0,0 +1,52 @@
+{ autoconf, fetchurl, makedepend, perl, python, stdenv, unzip, zip }:
+
+stdenv.mkDerivation rec {
+  name = "jscoverage-0.5.1";
+
+  src = fetchurl {
+    url = "https://siliconforks.com/jscoverage/download/${name}.tar.bz2";
+    sha256 = "c45f051cec18c10352f15f9844f47e37e8d121d5fd16680e2dd0f3b4420eb7f4";
+  };
+
+  patches = [
+    ./jsfalse_to_null.patch
+  ];
+
+  buildInputs = [ autoconf makedepend perl python unzip zip ];
+
+  # It works without MOZ_FIX_LINK_PATHS, circumventing an impurity
+  # issue.  Maybe we could kick js/ (spidermonkey) completely and
+  # instead use our spidermonkey via nix.
+  preConfigure = ''
+  sed -i 's/^MOZ_FIX_LINK_PATHS=.*$/MOZ_FIX_LINK_PATHS=""/' ./js/configure
+  '';
+
+  meta = {
+    description = "Code coverage for JavaScript";
+
+    longDescription = ''
+    JSCoverage is a tool that measures code coverage for JavaScript
+    programs.
+
+    Code coverage statistics show which lines of a program have been
+    executed (and which have been missed). This information is useful
+    for constructing comprehensive test suites (hence, it is often
+    called test coverage).
+
+    JSCoverage works by instrumenting the JavaScript code used in web
+    pages. Code coverage statistics are collected while the
+    instrumented JavaScript code is executed in a web browser.
+
+    JSCoverage supports the complete language syntax described in the
+    ECMAScript Language Specification (ECMA-262, 3rd
+    edition). JSCoverage works with any modern standards-compliant web
+    browser - including Internet Explorer (IE 6, 7, and 8), Firefox,
+    Opera, Safari, and Google Chrome - on Microsoft Windows and
+    GNU/Linux.
+    '';
+
+    homepage = http://siliconforks.com/jscoverage/;
+    license = stdenv.lib.licenses.gpl2;
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/jscoverage/jsfalse_to_null.patch b/nixpkgs/pkgs/development/tools/misc/jscoverage/jsfalse_to_null.patch
new file mode 100644
index 000000000000..b49594964e1f
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/jscoverage/jsfalse_to_null.patch
@@ -0,0 +1,26 @@
+diff --git i/js/jsstr.cpp w/js/jsstr.cpp
+index e662bf1..b18597e 100644
+--- i/js/jsstr.cpp
++++ w/js/jsstr.cpp
+@@ -3040,7 +3040,7 @@ js_InitStringClass(JSContext *cx, JSObject *obj)
+                                  JSVAL_VOID, NULL, NULL,
+                                  JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_SHARED, 0, 0,
+                                  NULL)) {
+-        return JS_FALSE;
++        return NULL;
+     }
+ 
+     return proto;
+diff --git i/js/jsxml.cpp w/js/jsxml.cpp
+index 5621ede..e00c97d 100644
+--- i/js/jsxml.cpp
++++ w/js/jsxml.cpp
+@@ -303,7 +303,7 @@ NewXMLNamespace(JSContext *cx, JSString *prefix, JSString *uri, JSBool declared)
+ 
+     obj = js_NewObject(cx, &js_NamespaceClass.base, NULL, NULL);
+     if (!obj)
+-        return JS_FALSE;
++        return NULL;
+     JS_ASSERT(JSVAL_IS_VOID(obj->fslots[JSSLOT_PREFIX]));
+     JS_ASSERT(JSVAL_IS_VOID(obj->fslots[JSSLOT_URI]));
+     JS_ASSERT(JSVAL_IS_VOID(obj->fslots[JSSLOT_DECLARED]));
diff --git a/nixpkgs/pkgs/development/tools/misc/kconfig-frontends/default.nix b/nixpkgs/pkgs/development/tools/misc/kconfig-frontends/default.nix
new file mode 100644
index 000000000000..e33259b416fa
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/kconfig-frontends/default.nix
@@ -0,0 +1,39 @@
+{ stdenv, fetchurl, pkgconfig, bison, flex, gperf, ncurses, pythonPackages }:
+
+stdenv.mkDerivation rec {
+  basename = "kconfig-frontends";
+  version = "4.11.0.1";
+  name = "${basename}-${version}";
+
+  src = fetchurl {
+    sha256 = "1xircdw3k7aaz29snf96q2fby1cs48bidz5l1kkj0a5gbivw31i3";
+    url = "http://ymorin.is-a-geek.org/download/${basename}/${name}.tar.xz";
+  };
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ bison flex gperf ncurses pythonPackages.python pythonPackages.wrapPython ];
+
+  configureFlags = [
+    "--enable-frontends=conf,mconf,nconf"
+  ];
+
+  postInstall = ''
+    wrapPythonPrograms
+  '';
+
+  NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isClang "-Wno-error=format-security";
+
+  meta = with stdenv.lib; {
+    description = "Out of Linux tree packaging of the kconfig infrastructure";
+    longDescription = ''
+      Configuration language and system for the Linux kernel and other
+      projects. Features simple syntax and grammar, limited yet adequate option
+      types, simple organization of options, and direct and reverse
+      dependencies.
+    '';
+    homepage = http://ymorin.is-a-geek.org/projects/kconfig-frontends;
+    license = licenses.gpl2;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ mbe ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/kdbg/default.nix b/nixpkgs/pkgs/development/tools/misc/kdbg/default.nix
new file mode 100644
index 000000000000..8da3cd57703c
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/kdbg/default.nix
@@ -0,0 +1,28 @@
+{ stdenv, fetchurl, cmake, extra-cmake-modules, qt5,
+  ki18n, kconfig, kiconthemes, kxmlgui, kwindowsystem,
+}:
+
+stdenv.mkDerivation rec {
+  pname = "kdbg";
+  version = "3.0.0";
+  src = fetchurl {
+    url = "mirror://sourceforge/kdbg/${version}/${pname}-${version}.tar.gz";
+    sha256 = "0lxfal6jijdcrf0hc81gmapfmz0kq4569d5qzfm4p72rq9s4r5in";
+  };
+
+  nativeBuildInputs = [ cmake extra-cmake-modules ];
+  buildInputs = [ qt5.qtbase ki18n kconfig kiconthemes kxmlgui kwindowsystem ];
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    homepage = http://www.kdbg.org/;
+    description = ''
+      A graphical user interface to gdb, the GNU debugger. It provides an
+      intuitive interface for setting breakpoints, inspecting variables, and
+      stepping through code.
+    '';
+    license = licenses.gpl2;
+    maintainers = [ maintainers.catern ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/kibana/6.x.nix b/nixpkgs/pkgs/development/tools/misc/kibana/6.x.nix
new file mode 100644
index 000000000000..9605a035be67
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/kibana/6.x.nix
@@ -0,0 +1,63 @@
+{ elk6Version
+, enableUnfree ? true
+, stdenv
+, makeWrapper
+, fetchurl
+, nodejs-10_x
+, coreutils
+, which
+}:
+
+with stdenv.lib;
+let
+  nodejs = nodejs-10_x;
+  inherit (builtins) elemAt;
+  info = splitString "-" stdenv.hostPlatform.system;
+  arch = elemAt info 0;
+  plat = elemAt info 1;
+  shas =
+    if enableUnfree
+    then {
+      x86_64-linux  = "1xwklhqxk5rmdrgy2simwvijzq29kyq5w2w3hy53xh2i1zlnyvq3";
+      x86_64-darwin = "1qpdn28mrpggd55khzqqld6r89l0hb870rigxcw2i8p2yx3jv106";
+    }
+    else {
+      x86_64-linux  = "1wpnwal2rq5v2bsp5qil9j6dplif7ql5394sy4ia5ghp2fzifxmf";
+      x86_64-darwin = "12z8i0wbw10c097glbpdy350p0h3957433f51qfx2p0ghgkzkhzv";
+    };
+
+in stdenv.mkDerivation rec {
+  name = "kibana-${optionalString (!enableUnfree) "oss-"}${version}";
+  version = elk6Version;
+
+  src = fetchurl {
+    url = "https://artifacts.elastic.co/downloads/kibana/${name}-${plat}-${arch}.tar.gz";
+    sha256 = shas.${stdenv.hostPlatform.system} or (throw "Unknown architecture");
+  };
+
+  patches = [
+    # Kibana specifies it specifically needs nodejs 10.15.2 but nodejs in nixpkgs is at 10.15.3.
+    # The <nixpkgs/nixos/tests/elk.nix> test succeeds with this newer version so lets just
+    # disable the version check.
+    ./disable-nodejs-version-check.patch
+  ];
+
+  buildInputs = [ makeWrapper ];
+
+  installPhase = ''
+    mkdir -p $out/libexec/kibana $out/bin
+    mv * $out/libexec/kibana/
+    rm -r $out/libexec/kibana/node
+    makeWrapper $out/libexec/kibana/bin/kibana $out/bin/kibana \
+      --prefix PATH : "${stdenv.lib.makeBinPath [ nodejs coreutils which ]}"
+    sed -i 's@NODE=.*@NODE=${nodejs}/bin/node@' $out/libexec/kibana/bin/kibana
+  '';
+
+  meta = {
+    description = "Visualize logs and time-stamped data";
+    homepage = http://www.elasticsearch.org/overview/kibana;
+    license = if enableUnfree then licenses.elastic else licenses.asl20;
+    maintainers = with maintainers; [ offline basvandijk ];
+    platforms = with platforms; unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/kibana/7.x.nix b/nixpkgs/pkgs/development/tools/misc/kibana/7.x.nix
new file mode 100644
index 000000000000..83651e6d17ee
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/kibana/7.x.nix
@@ -0,0 +1,63 @@
+{ elk7Version
+, enableUnfree ? true
+, stdenv
+, makeWrapper
+, fetchurl
+, nodejs-10_x
+, coreutils
+, which
+}:
+
+with stdenv.lib;
+let
+  nodejs = nodejs-10_x;
+  inherit (builtins) elemAt;
+  info = splitString "-" stdenv.hostPlatform.system;
+  arch = elemAt info 0;
+  plat = elemAt info 1;
+  shas =
+    if enableUnfree
+    then {
+      x86_64-linux  = "0sc5709k3z7lb8qcjpj49s6vfv69ds2wc8319ag9x776nyz1pqxi";
+      x86_64-darwin = "0zh4q46vfdwaihs838ck8fap92i3b4x10wbpmx8mcwyfk5v0fkch";
+    }
+    else {
+      x86_64-linux  = "1pq17fasryharvw4byybvmcf5172hcmy6cp0m8bxhkxagwilprba";
+      x86_64-darwin = "11crpx2qs2nzkzv6fvs1gqn9v4zalxkzsc5br0fy1y02lzm26zbm";
+    };
+
+in stdenv.mkDerivation rec {
+  name = "kibana-${optionalString (!enableUnfree) "oss-"}${version}";
+  version = elk7Version;
+
+  src = fetchurl {
+    url = "https://artifacts.elastic.co/downloads/kibana/${name}-${plat}-${arch}.tar.gz";
+    sha256 = shas.${stdenv.hostPlatform.system} or (throw "Unknown architecture");
+  };
+
+  patches = [
+    # Kibana specifies it specifically needs nodejs 10.15.2 but nodejs in nixpkgs is at 10.15.3.
+    # The <nixpkgs/nixos/tests/elk.nix> test succeeds with this newer version so lets just
+    # disable the version check.
+    ./disable-nodejs-version-check-7.patch
+  ];
+
+  buildInputs = [ makeWrapper ];
+
+  installPhase = ''
+    mkdir -p $out/libexec/kibana $out/bin
+    mv * $out/libexec/kibana/
+    rm -r $out/libexec/kibana/node
+    makeWrapper $out/libexec/kibana/bin/kibana $out/bin/kibana \
+      --prefix PATH : "${stdenv.lib.makeBinPath [ nodejs coreutils which ]}"
+    sed -i 's@NODE=.*@NODE=${nodejs}/bin/node@' $out/libexec/kibana/bin/kibana
+  '';
+
+  meta = {
+    description = "Visualize logs and time-stamped data";
+    homepage = http://www.elasticsearch.org/overview/kibana;
+    license = if enableUnfree then licenses.elastic else licenses.asl20;
+    maintainers = with maintainers; [ offline basvandijk ];
+    platforms = with platforms; unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/kibana/disable-nodejs-version-check-7.patch b/nixpkgs/pkgs/development/tools/misc/kibana/disable-nodejs-version-check-7.patch
new file mode 100644
index 000000000000..ef4c207764c1
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/kibana/disable-nodejs-version-check-7.patch
@@ -0,0 +1,19 @@
+diff --git a/src/setup_node_env/node_version_validator.js b/src/setup_node_env/node_version_validator.js
+index 3f611e5a..f5c60c85 100644
+--- a/src/setup_node_env/node_version_validator.js
++++ b/src/setup_node_env/node_version_validator.js
+@@ -25,11 +25,11 @@ var pkg = require('../../package.json'); // Note: This is written in ES5 so we c
+ var currentVersion = process && process.version || null;
+ var rawRequiredVersion = pkg && pkg.engines && pkg.engines.node || null;
+ var requiredVersion = rawRequiredVersion ? 'v' + rawRequiredVersion : rawRequiredVersion;
+-var isVersionValid = !!currentVersion && !!requiredVersion && currentVersion === requiredVersion; // Validates current the NodeJS version compatibility when Kibana starts.
++var isVersionValid = !!currentVersion && !!requiredVersion; // Validates current the NodeJS version compatibility when Kibana starts.
+ 
+ if (!isVersionValid) {
+   var errorMessage = 'Kibana does not support the current Node.js version ' + currentVersion + '. Please use Node.js ' + requiredVersion + '.'; // Actions to apply when validation fails: error report + exit.
+ 
+   console.error(errorMessage);
+   process.exit(1);
+-}
+\ No newline at end of file
++}
diff --git a/nixpkgs/pkgs/development/tools/misc/kibana/disable-nodejs-version-check.patch b/nixpkgs/pkgs/development/tools/misc/kibana/disable-nodejs-version-check.patch
new file mode 100644
index 000000000000..12a81566a72c
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/kibana/disable-nodejs-version-check.patch
@@ -0,0 +1,19 @@
+diff -Naur a/src/setup_node_env/node_version_validator.js b/src/setup_node_env/node_version_validator.js
+--- a/src/setup_node_env/node_version_validator.js	2018-11-16 03:28:42.000000000 +0100
++++ b/src/setup_node_env/node_version_validator.js	2018-12-01 12:19:48.238337176 +0100
+@@ -26,7 +26,7 @@
+ var currentVersion = process && process.version || null;
+ var rawRequiredVersion = pkg && pkg.engines && pkg.engines.node || null;
+ var requiredVersion = rawRequiredVersion ? 'v' + rawRequiredVersion : rawRequiredVersion;
+-var isVersionValid = !!currentVersion && !!requiredVersion && currentVersion === requiredVersion;
++var isVersionValid = !!currentVersion && !!requiredVersion;
+ 
+ // Validates current the NodeJS version compatibility when Kibana starts.
+ if (!isVersionValid) {
+@@ -35,4 +35,4 @@
+   // Actions to apply when validation fails: error report + exit.
+   console.error(errorMessage);
+   process.exit(1);
+-}
+\ No newline at end of file
++}
diff --git a/nixpkgs/pkgs/development/tools/misc/libtool/default.nix b/nixpkgs/pkgs/development/tools/misc/libtool/default.nix
new file mode 100644
index 000000000000..f56a59c42704
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/libtool/default.nix
@@ -0,0 +1,36 @@
+{stdenv, fetchurl, m4, perl}:
+
+stdenv.mkDerivation rec {
+  name = "libtool-1.5.26";
+
+  src = fetchurl {
+    url = "mirror://gnu/libtool/${name}.tar.gz";
+    sha256 = "029ggq5kri1gjn6nfqmgw4w920gyfzscjjxbsxxidal5zqsawd8w";
+  };
+
+  nativeBuildInputs = [m4];
+  buildInputs = [perl];
+
+  # Don't fixup "#! /bin/sh" in Libtool, otherwise it will use the
+  # "fixed" path in generated files!
+  dontPatchShebangs = true;
+
+  meta = {
+    description = "Generic library support script";
+
+    longDescription = ''
+      GNU libtool is a generic library support script.  Libtool hides
+      the complexity of using shared libraries behind a consistent,
+      portable interface.
+
+      To use libtool, add the new generic library building commands to
+      your Makefile, Makefile.in, or Makefile.am.  See the
+      documentation for details.
+    '';
+
+    homepage = https://www.gnu.org/software/libtool/;
+
+    license = stdenv.lib.licenses.gpl2Plus;
+    platforms = stdenv.lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/libtool/libtool2.nix b/nixpkgs/pkgs/development/tools/misc/libtool/libtool2.nix
new file mode 100644
index 000000000000..0424b9012519
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/libtool/libtool2.nix
@@ -0,0 +1,49 @@
+{ stdenv, fetchurl, m4, perl, help2man
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libtool";
+  version = "2.4.6";
+
+  src = fetchurl {
+    url = "mirror://gnu/libtool/${pname}-${version}.tar.gz";
+    sha256 = "1qq61k6lp1fp75xs398yzi6wvbx232l7xbyn3p13cnh27mflvgg3";
+  };
+
+  outputs = [ "out" "lib" ];
+
+  nativeBuildInputs = [ perl help2man m4 ];
+  propagatedBuildInputs = [ m4 ];
+
+  # Don't fixup "#! /bin/sh" in Libtool, otherwise it will use the
+  # "fixed" path in generated files!
+  dontPatchShebangs = true;
+
+  # XXX: The GNU ld wrapper does all sorts of nasty things wrt. RPATH, which
+  # leads to the failure of a number of tests.
+  doCheck = false;
+  doInstallCheck = false;
+
+  enableParallelBuilding = true;
+
+  # Don't run the native `strip' when cross-compiling.  This breaks at least
+  # with `.a' files for MinGW.
+  dontStrip = stdenv.hostPlatform != stdenv.buildPlatform;
+
+  meta = with stdenv.lib; {
+    description = "GNU Libtool, a generic library support script";
+    longDescription = ''
+      GNU libtool is a generic library support script.  Libtool hides
+      the complexity of using shared libraries behind a consistent,
+      portable interface.
+
+      To use libtool, add the new generic library building commands to
+      your Makefile, Makefile.in, or Makefile.am.  See the
+      documentation for details.
+    '';
+    homepage = https://www.gnu.org/software/libtool/;
+    license = licenses.gpl2Plus;
+    maintainers = [ ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/libwhich/default.nix b/nixpkgs/pkgs/development/tools/misc/libwhich/default.nix
new file mode 100644
index 000000000000..c751c2755587
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/libwhich/default.nix
@@ -0,0 +1,24 @@
+{ stdenv, fetchFromGitHub }:
+
+stdenv.mkDerivation rec {
+  pname = "libwhich";
+  version = "1.1.0";
+
+  src = fetchFromGitHub {
+    owner = "vtjnash";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "0s0pqai61jszmi495k621rdlf288ij67adkz72hwqqarqp54idhb";
+  };
+
+  installPhase = ''
+    install -Dm755 -t $out/bin libwhich
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Like `which`, for dynamic libraries";
+    homepage = https://github.com/vtjnash/libwhich;
+    license = licenses.mit;
+    maintainers = with maintainers; [ dtzWill ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/linuxkit/default.nix b/nixpkgs/pkgs/development/tools/misc/linuxkit/default.nix
new file mode 100644
index 000000000000..5dd6f422713b
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/linuxkit/default.nix
@@ -0,0 +1,29 @@
+{ lib, buildGoPackage, fetchFromGitHub }:
+
+buildGoPackage rec {
+  pname   = "linuxkit";
+  version = "0.7";
+
+  goPackagePath = "github.com/linuxkit/linuxkit";
+
+  src = fetchFromGitHub {
+    owner = "linuxkit";
+    repo = "linuxkit";
+    rev = "v${version}";
+    sha256 = "1mnaqzd4r0fdgjhjvbi4p0wwvz69i82b33iizz81wvkr1mkakgl2";
+  };
+
+  subPackages = [ "src/cmd/linuxkit" ];
+
+  preBuild = ''
+    buildFlagsArray+=("-ldflags" "-X github.com/linuxkit/linuxkit/src/cmd/linuxkit/version.Version=${src.rev}")
+  '';
+
+  meta = with lib; {
+    description = "A toolkit for building secure, portable and lean operating systems for containers";
+    license = licenses.asl20;
+    homepage = https://github.com/linuxkit/linuxkit;
+    maintainers = [ maintainers.nicknovitski ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/lit/default.nix b/nixpkgs/pkgs/development/tools/misc/lit/default.nix
new file mode 100644
index 000000000000..c4164b414331
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/lit/default.nix
@@ -0,0 +1,21 @@
+{ lib, python2 }:
+
+python2.pkgs.buildPythonApplication rec {
+  pname = "lit";
+  version = "0.8.0";
+
+  src = python2.pkgs.fetchPypi {
+    inherit pname version;
+    sha256 = "0lwx1w1vk3a0pc237chwycl8qc6lwq8bzf13036wnmk74m9kwi7c";
+  };
+
+  # Non-standard test suite. Needs custom checkPhase.
+  doCheck = false;
+
+  meta = {
+    description = "Portable tool for executing LLVM and Clang style test suites";
+    homepage = http://llvm.org/docs/CommandGuide/lit.html;
+    license = lib.licenses.ncsa;
+    maintainers = with lib.maintainers; [ dtzWill ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/loccount/default.nix b/nixpkgs/pkgs/development/tools/misc/loccount/default.nix
new file mode 100644
index 000000000000..ace34f350599
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/loccount/default.nix
@@ -0,0 +1,35 @@
+{ stdenv, buildGoPackage, fetchFromGitLab }:
+buildGoPackage rec {
+  pname = "loccount";
+  version = "1.2";
+
+  goPackagePath = "gitlab.com/esr/loccount";
+  excludedPackages = "tests";
+
+  src = fetchFromGitLab {
+    owner = "esr";
+    repo = "loccount";
+    rev = version;
+    sha256 = "18z7ai7wy2k9yd3w65d37apfqs3h9bc2c15y7v1bydppi44zfsdk";
+  };
+
+  meta = with stdenv.lib; {
+    description = "Re-implementation of sloccount in Go";
+    longDescription = ''
+      loccount is a re-implementation of David A. Wheeler's sloccount tool
+      in Go.  It is faster and handles more different languages. Because
+      it's one source file in Go, it is easier to maintain and extend than the
+      multi-file, multi-language implementation of the original.
+
+      The algorithms are largely unchanged and can be expected to produce
+      identical numbers for languages supported by both tools.  Python is
+      an exception; loccount corrects buggy counting of single-quote multiline
+      literals in sloccount 2.26.
+    '';
+    homepage="https://gitlab.com/esr/loccount";
+    downloadPage="https://gitlab.com/esr/loccount/tree/master";
+    license = licenses.bsd2;
+    maintainers = with maintainers; [ calvertvl ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/lsof/default.nix b/nixpkgs/pkgs/development/tools/misc/lsof/default.nix
new file mode 100644
index 000000000000..1298346ef31c
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/lsof/default.nix
@@ -0,0 +1,54 @@
+{ stdenv, fetchFromGitHub, buildPackages, ncurses }:
+
+let dialect = with stdenv.lib; last (splitString "-" stdenv.hostPlatform.system); in
+
+stdenv.mkDerivation rec {
+  pname = "lsof";
+  version = "4.93.2";
+
+  depsBuildBuild = [ buildPackages.stdenv.cc ];
+  buildInputs = [ ncurses ];
+
+  src = fetchFromGitHub {
+    owner = "lsof-org";
+    repo = "lsof";
+    rev = version;
+    sha256 = "1gd6r0nv8xz76pmvk52dgmfl0xjvkxl0s51b4jk4a0lphw3393yv";
+  };
+
+  patches = [ ./no-build-info.patch ];
+
+  postPatch = stdenv.lib.optionalString stdenv.hostPlatform.isMusl ''
+    substituteInPlace dialects/linux/dlsof.h --replace "defined(__UCLIBC__)" 1
+  '' + stdenv.lib.optionalString stdenv.isDarwin ''
+    sed -i 's|lcurses|lncurses|g' Configure
+  '';
+
+  # Stop build scripts from searching global include paths
+  LSOF_INCLUDE = "${stdenv.lib.getDev stdenv.cc.libc}/include";
+  configurePhase = "LINUX_CONF_CC=$CC_FOR_BUILD LSOF_CC=$CC LSOF_AR=\"$AR cr\" LSOF_RANLIB=$RANLIB ./Configure -n ${dialect}";
+  preBuild = ''
+    for filepath in $(find dialects/${dialect} -type f); do
+      sed -i "s,/usr/include,$LSOF_INCLUDE,g" $filepath
+    done
+  '';
+
+  installPhase = ''
+    mkdir -p $out/bin $out/man/man8
+    cp Lsof.8 $out/man/man8/lsof.8
+    cp lsof $out/bin
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = "https://github.com/lsof-org/lsof";
+    description = "A tool to list open files";
+    longDescription = ''
+      List open files. Can show what process has opened some file,
+      socket (IPv6/IPv4/UNIX local), or partition (by opening a file
+      from it).
+    '';
+    maintainers = [ maintainers.dezgeg ];
+    platforms = platforms.unix;
+    license = licenses.purdueBsd;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/lsof/no-build-info.patch b/nixpkgs/pkgs/development/tools/misc/lsof/no-build-info.patch
new file mode 100644
index 000000000000..cf785e248f2a
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/lsof/no-build-info.patch
@@ -0,0 +1,43 @@
+diff -ru -x '*~' lsof_4.91_src-orig/usage.c lsof_4.91_src/usage.c
+--- lsof_4.91_src-orig/usage.c	2018-02-14 15:20:32.000000000 +0100
++++ lsof_4.91_src/usage.c	2018-10-08 21:57:45.718560869 +0200
+@@ -930,26 +930,6 @@
+ 		(void) fprintf(stderr, "    configuration info: %s\n", cp);
+ #endif	/* defined(LSOF_CINFO) */
+ 
+-	    if ((cp = isnullstr(LSOF_CCDATE)))
+-		(void) fprintf(stderr, "    constructed: %s\n", cp);
+-	    cp = isnullstr(LSOF_HOST);
+-	    if (!(cp1 = isnullstr(LSOF_LOGNAME)))
+-		cp1 = isnullstr(LSOF_USER);
+-	    if (cp || cp1) {
+-		if (cp && cp1)
+-		    cp2 = "by and on";
+-		else if (cp)
+-		    cp2 = "on";
+-		else
+-		    cp2 = "by";
+-		(void) fprintf(stderr, "    constructed %s: %s%s%s\n",
+-		    cp2,
+-		    cp1 ? cp1 : "",
+-		    (cp && cp1) ? "@" : "",
+-		    cp  ? cp  : ""
+-		);
+-	    }
+-
+ #if	defined(LSOF_BLDCMT)
+ 	    if ((cp = isnullstr(LSOF_BLDCMT)))
+ 		(void) fprintf(stderr, "    builder's comment: %s\n", cp);
+@@ -959,12 +939,8 @@
+ 		(void) fprintf(stderr, "    compiler: %s\n", cp);
+ 	    if ((cp = isnullstr(LSOF_CCV)))
+ 		(void) fprintf(stderr, "    compiler version: %s\n", cp);
+-	    if ((cp = isnullstr(LSOF_CCFLAGS)))
+-		(void) fprintf(stderr, "    compiler flags: %s\n", cp);
+ 	    if ((cp = isnullstr(LSOF_LDFLAGS)))
+ 		(void) fprintf(stderr, "    loader flags: %s\n", cp);
+-	    if ((cp = isnullstr(LSOF_SYSINFO)))
+-		(void) fprintf(stderr, "    system info: %s\n", cp);
+ 	    (void) report_SECURITY("    ", ".\n");
+ 	    (void) report_WARNDEVACCESS("    ", "are", ".\n");
+ 	    (void) report_HASKERNIDCK("    K", "is");
diff --git a/nixpkgs/pkgs/development/tools/misc/ltrace/default.nix b/nixpkgs/pkgs/development/tools/misc/ltrace/default.nix
new file mode 100644
index 000000000000..b8fa02306c4d
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/ltrace/default.nix
@@ -0,0 +1,29 @@
+{ stdenv, fetchurl, elfutils, libunwind }:
+
+stdenv.mkDerivation {
+  name = "ltrace-0.7.3";
+
+  src = fetchurl {
+    url = mirror://debian/pool/main/l/ltrace/ltrace_0.7.3.orig.tar.bz2;
+    sha256 = "00wmbdghqbz6x95m1mcdd3wd46l6hgcr4wggdp049dbifh3qqvqf";
+  };
+
+  buildInputs = [ elfutils libunwind ];
+
+  prePatch = let
+      debian = fetchurl {
+        url = mirror://debian/pool/main/l/ltrace/ltrace_0.7.3-6.debian.tar.xz;
+        sha256 = "0xc4pfd8qw53crvdxr29iwl8na53zmknca082kziwpvlzsick4kp";
+      };
+    in ''
+      tar xf '${debian}'
+      patches="$patches $(cat debian/patches/series | sed 's|^|debian/patches/|')"
+    '';
+
+  meta = with stdenv.lib; {
+    description = "Library call tracer";
+    homepage = https://www.ltrace.org/;
+    platforms = [ "i686-linux" "x86_64-linux" ];
+    license = licenses.gpl2;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/lttng-tools/default.nix b/nixpkgs/pkgs/development/tools/misc/lttng-tools/default.nix
new file mode 100644
index 000000000000..17837a548772
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/lttng-tools/default.nix
@@ -0,0 +1,23 @@
+{ stdenv, fetchurl, pkgconfig, popt, libuuid, liburcu, lttng-ust, kmod, libxml2 }:
+
+stdenv.mkDerivation rec {
+  pname = "lttng-tools";
+  version = "2.10.7";
+
+  src = fetchurl {
+    url = "https://lttng.org/files/lttng-tools/${pname}-${version}.tar.bz2";
+    sha256 = "04hkga0hnyjmv42mxj3njaykqmq9x4abd5qfyds5r62x1khfnwgd";
+  };
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ popt libuuid liburcu lttng-ust libxml2 kmod ];
+
+  meta = with stdenv.lib; {
+    description = "Tracing tools (kernel + user space) for Linux";
+    homepage = https://lttng.org/;
+    license = licenses.lgpl21;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.bjornfor ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/lttng-ust/default.nix b/nixpkgs/pkgs/development/tools/misc/lttng-ust/default.nix
new file mode 100644
index 000000000000..ad5276e5e1a9
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/lttng-ust/default.nix
@@ -0,0 +1,39 @@
+{ stdenv, fetchurl, liburcu, python }:
+
+# NOTE:
+#   ./configure ...
+#   [...]
+#   LTTng-UST will be built with the following options:
+#
+#   Java support (JNI): Disabled
+#   sdt.h integration:  Disabled
+#   [...]
+#
+# Debian builds with std.h (systemtap).
+
+stdenv.mkDerivation rec {
+  pname = "lttng-ust";
+  version = "2.10.4";
+
+  src = fetchurl {
+    url = "https://lttng.org/files/lttng-ust/${pname}-${version}.tar.bz2";
+    sha256 = "0rx9q5r9qcdx3i9i0rx28p33yl52sd6f35qj7qs4li2w42xv9mbm";
+  };
+
+  buildInputs = [ python ];
+
+  preConfigure = ''
+    patchShebangs .
+  '';
+  
+  propagatedBuildInputs = [ liburcu ];
+
+  meta = with stdenv.lib; {
+    description = "LTTng Userspace Tracer libraries";
+    homepage = https://lttng.org/;
+    license = licenses.lgpl21Plus;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.bjornfor ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/lttv/default.nix b/nixpkgs/pkgs/development/tools/misc/lttv/default.nix
new file mode 100644
index 000000000000..36a89726e81c
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/lttv/default.nix
@@ -0,0 +1,24 @@
+{ stdenv, fetchurl, pkgconfig, glib, gtk2, popt, babeltrace }:
+
+stdenv.mkDerivation rec {
+  name = "lttv-1.5";
+
+  src = fetchurl {
+    url = "https://lttng.org/files/packages/${name}.tar.bz2";
+    sha256 = "1faldxnh9dld5k0vxckwpqw241ya1r2zv286l6rpgqr500zqw7r1";
+  };
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ glib gtk2 popt babeltrace ];
+
+  meta = with stdenv.lib; {
+    description = "Graphical trace viewer for LTTng trace files";
+    homepage = https://lttng.org/;
+    # liblttvtraceread (ltt/ directory) is distributed under the GNU LGPL v2.1.
+    # The rest of the LTTV package is distributed under the GNU GPL v2.
+    license = with licenses; [ gpl2 lgpl21 ];
+    platforms = platforms.linux;
+    maintainers = [ maintainers.bjornfor ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/luarocks/darwin-3.1.3.patch b/nixpkgs/pkgs/development/tools/misc/luarocks/darwin-3.1.3.patch
new file mode 100644
index 000000000000..4ba883f01130
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/luarocks/darwin-3.1.3.patch
@@ -0,0 +1,24 @@
+diff --git a/src/luarocks/core/cfg.lua b/src/luarocks/core/cfg.lua
+index c5af5a2..1949fdc 100644
+--- a/src/luarocks/core/cfg.lua
++++ b/src/luarocks/core/cfg.lua
+@@ -425,7 +425,7 @@ local function make_defaults(lua_version, target_cpu, platforms, home)
+       defaults.external_lib_extension = "dylib"
+       defaults.arch = "macosx-"..target_cpu
+       defaults.variables.LIBFLAG = "-bundle -undefined dynamic_lookup -all_load"
+-      local version = util.popen_read("sw_vers -productVersion")
++      local version = os.getenv("MACOSX_DEPLOYMENT_TARGET") or "10.12"
+       version = tonumber(version and version:match("^[^.]+%.([^.]+)")) or 3
+       if version >= 10 then
+          version = 8
+@@ -434,8 +434,8 @@ local function make_defaults(lua_version, target_cpu, platforms, home)
+       else
+          defaults.gcc_rpath = false
+       end
+-      defaults.variables.CC = "env MACOSX_DEPLOYMENT_TARGET=10."..version.." gcc"
+-      defaults.variables.LD = "env MACOSX_DEPLOYMENT_TARGET=10."..version.." gcc"
++      defaults.variables.CC = "env MACOSX_DEPLOYMENT_TARGET=10."..version.." clang"
++      defaults.variables.LD = "env MACOSX_DEPLOYMENT_TARGET=10."..version.." clang"
+       defaults.web_browser = "open"
+    end
+ 
diff --git a/nixpkgs/pkgs/development/tools/misc/luarocks/default.nix b/nixpkgs/pkgs/development/tools/misc/luarocks/default.nix
new file mode 100644
index 000000000000..fa19b2494076
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/luarocks/default.nix
@@ -0,0 +1,74 @@
+{stdenv, fetchFromGitHub
+, curl, makeWrapper, which, unzip
+, lua
+# for 'luarocks pack'
+, zip
+# some packages need to be compiled with cmake
+, cmake
+}:
+
+stdenv.mkDerivation rec {
+  pname = "luarocks";
+  version = "3.2.1";
+
+  src = fetchFromGitHub {
+    owner = "luarocks";
+    repo = "luarocks";
+    rev = "v${version}";
+    sha256 = "0viiafmb8binksda79ah828q1dfnb6jsqlk7vyndl2xvx9yfn4y2";
+  };
+
+  patches = [ ./darwin-3.1.3.patch ];
+  preConfigure = ''
+    lua -e "" || {
+        luajit -e "" && {
+            export LUA_SUFFIX=jit
+            configureFlags="$configureFlags --lua-suffix=$LUA_SUFFIX"
+        }
+    }
+    lua_inc="$(echo "${lua}/include"/*/)"
+    if test -n "$lua_inc"; then
+        configureFlags="$configureFlags --with-lua-include=$lua_inc"
+    fi
+  '';
+
+  buildInputs = [
+    lua curl makeWrapper which
+  ];
+
+  postInstall = ''
+    sed -e "1s@.*@#! ${lua}/bin/lua$LUA_SUFFIX@" -i "$out"/bin/*
+    for i in "$out"/bin/*; do
+        test -L "$i" || {
+            wrapProgram "$i" \
+              --suffix LUA_PATH ";" "$(echo "$out"/share/lua/*/)?.lua" \
+              --suffix LUA_PATH ";" "$(echo "$out"/share/lua/*/)?/init.lua" \
+              --suffix LUA_CPATH ";" "$(echo "$out"/lib/lua/*/)?.so" \
+              --suffix LUA_CPATH ";" "$(echo "$out"/share/lua/*/)?/init.lua"
+        }
+    done
+  '';
+
+  propagatedBuildInputs = [ zip unzip cmake ];
+
+  # unpack hook for src.rock and rockspec files
+  setupHook = ./setup-hook.sh;
+
+  # cmake is just to compile packages with "cmake" buildType, not luarocks itself
+  dontUseCmakeConfigure = true;
+
+  shellHook = ''
+    export PATH="src/bin:''${PATH:-}"
+    export LUA_PATH="src/?.lua;''${LUA_PATH:-}"
+  '';
+
+  meta = with stdenv.lib; {
+    inherit version;
+    description = ''A package manager for Lua'';
+    license = licenses.mit ;
+    maintainers = with maintainers; [raskin teto];
+    platforms = platforms.linux ++ platforms.darwin;
+    downloadPage = "http://luarocks.org/releases/";
+    updateWalker = true;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/luarocks/default.upstream b/nixpkgs/pkgs/development/tools/misc/luarocks/default.upstream
new file mode 100644
index 000000000000..e69de1fe8895
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/luarocks/default.upstream
@@ -0,0 +1 @@
+url http://luarocks.org/releases/
diff --git a/nixpkgs/pkgs/development/tools/misc/luarocks/luarocks-nix.nix b/nixpkgs/pkgs/development/tools/misc/luarocks/luarocks-nix.nix
new file mode 100644
index 000000000000..21611f05579b
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/luarocks/luarocks-nix.nix
@@ -0,0 +1,14 @@
+{ luarocks, fetchFromGitHub }:
+luarocks.overrideAttrs(old: {
+  pname = "luarocks-nix";
+  version = "2019-09-07";
+  src = fetchFromGitHub {
+    owner = "nix-community";
+    repo = "luarocks";
+    rev = "fa7c367bcdad36768db5f19fd4fcdd9681a14429";
+    sha256 = "0kziwfw5gqq5xsckl7qf9wasaiy8rp42h5qrcnjx07qp47a9ldx7";
+  };
+  patches = [
+    ./darwin-3.1.3.patch
+  ];
+})
diff --git a/nixpkgs/pkgs/development/tools/misc/luarocks/setup-hook.sh b/nixpkgs/pkgs/development/tools/misc/luarocks/setup-hook.sh
new file mode 100644
index 000000000000..587d5413c3ed
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/luarocks/setup-hook.sh
@@ -0,0 +1,16 @@
+unpackCmdHooks+=(_trySourceRock)
+unpackCmdHooks+=(_tryRockSpec)
+
+_tryRockSpec() {
+    if ! [[ "$curSrc" =~ \.rockspec$ ]]; then return 1; fi
+}
+
+_trySourceRock() {
+    if ! [[ "$curSrc" =~ \.src.rock$ ]]; then return 1; fi
+
+    # luarocks expects a clean <name>.rock.spec name to be the package name
+    # so we have to strip the hash
+    renamed="$(stripHash $curSrc)"
+    cp "$curSrc" "$renamed"
+    luarocks unpack --force "$renamed"
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/macdylibbundler/default.nix b/nixpkgs/pkgs/development/tools/misc/macdylibbundler/default.nix
new file mode 100644
index 000000000000..518d128890a9
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/macdylibbundler/default.nix
@@ -0,0 +1,32 @@
+{ stdenv, fetchFromGitHub }:
+
+stdenv.mkDerivation {
+  pname = "macdylibbundler";
+  version = "20180825";
+
+  src = fetchFromGitHub {
+    owner = "auriamg";
+    repo = "macdylibbundler";
+    rev = "ce13cb585ead5237813b85e68fe530f085fc0a9e";
+    sha256 = "149p3dcnap4hs3nhq5rfvr3m70rrb5hbr5xkj1h0gsfp0d7gvxnj";
+  };
+
+  makeFlags = [ "PREFIX=$(out)" ];
+
+  meta = with stdenv.lib; {
+    description = "Utility to ease bundling libraries into executables for OSX";
+    longDescription = ''
+      dylibbundler is a small command-line programs that aims to make bundling
+      .dylibs as easy as possible. It automatically determines which dylibs are
+      needed by your program, copies these libraries inside the app bundle, and
+      fixes both them and the executable to be ready for distribution... all
+      this with a single command on the teminal! It will also work if your
+      program uses plug-ins that have dependencies too.
+    '';
+    homepage = https://github.com/auriamg/macdylibbundler;
+    license = licenses.mit;
+    platforms = platforms.all;
+    maintainers = [ maintainers.nomeata ];
+
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/md2man/default.nix b/nixpkgs/pkgs/development/tools/misc/md2man/default.nix
new file mode 100644
index 000000000000..7cbd92460817
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/md2man/default.nix
@@ -0,0 +1,25 @@
+{ lib, buildGoPackage, fetchFromGitHub }:
+
+with lib;
+
+buildGoPackage rec {
+  pname = "go-md2man";
+  version = "1.0.6";
+
+  goPackagePath = "github.com/cpuguy83/go-md2man";
+
+  src = fetchFromGitHub {
+    rev = "v${version}";
+    owner = "cpuguy83";
+    repo = "go-md2man";
+    sha256 = "1rm3zjrmfpzy0l3qp02xmd5pqzl77pdql9pbxhl0k1qw2vfzrjv6";
+  };
+
+  meta = {
+    description = "Go tool to convert markdown to man pages";
+    license = licenses.mit;
+    homepage = https://github.com/cpuguy83/go-md2man;
+    maintainers = with maintainers; [offline];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/mdl/Gemfile b/nixpkgs/pkgs/development/tools/misc/mdl/Gemfile
new file mode 100644
index 000000000000..15b33c53a653
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/mdl/Gemfile
@@ -0,0 +1,3 @@
+source "https://rubygems.org"
+
+gem "mdl"
diff --git a/nixpkgs/pkgs/development/tools/misc/mdl/Gemfile.lock b/nixpkgs/pkgs/development/tools/misc/mdl/Gemfile.lock
new file mode 100644
index 000000000000..aabcd784d867
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/mdl/Gemfile.lock
@@ -0,0 +1,21 @@
+GEM
+  remote: https://rubygems.org/
+  specs:
+    kramdown (1.17.0)
+    mdl (0.5.0)
+      kramdown (~> 1.12, >= 1.12.0)
+      mixlib-cli (~> 1.7, >= 1.7.0)
+      mixlib-config (~> 2.2, >= 2.2.1)
+    mixlib-cli (1.7.0)
+    mixlib-config (2.2.18)
+      tomlrb
+    tomlrb (1.2.8)
+
+PLATFORMS
+  ruby
+
+DEPENDENCIES
+  mdl
+
+BUNDLED WITH
+   1.16.3
diff --git a/nixpkgs/pkgs/development/tools/misc/mdl/default.nix b/nixpkgs/pkgs/development/tools/misc/mdl/default.nix
new file mode 100644
index 000000000000..eda2fabd9c67
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/mdl/default.nix
@@ -0,0 +1,17 @@
+{ lib, bundlerApp, bundlerUpdateScript }:
+
+bundlerApp {
+  pname = "mdl";
+  gemdir = ./.;
+  exes = [ "mdl" ];
+
+  passthru.updateScript = bundlerUpdateScript "mdl";
+
+  meta = with lib; {
+    description = "A tool to check markdown files and flag style issues";
+    homepage = https://github.com/markdownlint/markdownlint;
+    license = licenses.mit;
+    maintainers = with maintainers; [ gerschtli manveru nicknovitski ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/mdl/gemset.nix b/nixpkgs/pkgs/development/tools/misc/mdl/gemset.nix
new file mode 100644
index 000000000000..6d48be1cbcb0
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/mdl/gemset.nix
@@ -0,0 +1,54 @@
+{
+  kramdown = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1n1c4jmrh5ig8iv1rw81s4mw4xsp4v97hvf8zkigv4hn5h542qjq";
+      type = "gem";
+    };
+    version = "1.17.0";
+  };
+  mdl = {
+    dependencies = ["kramdown" "mixlib-cli" "mixlib-config"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "047hp8z1ma630wp38bm1giklkf385rp6wly8aidn825q831w2g4i";
+      type = "gem";
+    };
+    version = "0.5.0";
+  };
+  mixlib-cli = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0647msh7kp7lzyf6m72g6snpirvhimjm22qb8xgv9pdhbcrmcccp";
+      type = "gem";
+    };
+    version = "1.7.0";
+  };
+  mixlib-config = {
+    dependencies = ["tomlrb"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1gm6yj9cbbgsl9x4xqxga0vz5w0ksq2jnq1wj8hvgm5c4wfcrswb";
+      type = "gem";
+    };
+    version = "2.2.18";
+  };
+  tomlrb = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0g28ssfal6vry3cmhy509ba3vi5d5aggz1gnffnvvmc8ml8vkpiv";
+      type = "gem";
+    };
+    version = "1.2.8";
+  };
+}
\ No newline at end of file
diff --git a/nixpkgs/pkgs/development/tools/misc/mkcert/default.nix b/nixpkgs/pkgs/development/tools/misc/mkcert/default.nix
new file mode 100644
index 000000000000..7a3ccaa9fbc4
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/mkcert/default.nix
@@ -0,0 +1,22 @@
+{ lib, buildGoModule, fetchFromGitHub }:
+
+buildGoModule rec {
+  pname = "mkcert";
+  version = "1.4.0";
+
+  src = fetchFromGitHub {
+    owner = "FiloSottile";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "0xcmvzh5lq8vs3b0f1zw645fxdr8471v7prl1656q02v38f58ly7";
+  };
+
+  modSha256 = "0an12l15a82mks6gipczdpcf2vklk14wjjnk0ccl3kdjwiw7f4wd";
+
+  meta = with lib; {
+    homepage = https://github.com/FiloSottile/mkcert;
+    description = "A simple tool for making locally-trusted development certificates";
+    license = licenses.bsd3;
+    maintainers = [ maintainers.marsam ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/moby/default.nix b/nixpkgs/pkgs/development/tools/misc/moby/default.nix
new file mode 100644
index 000000000000..a5e4572d18dd
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/moby/default.nix
@@ -0,0 +1,27 @@
+{ lib, buildGoPackage, fetchFromGitHub }:
+
+buildGoPackage rec {
+  pname = "moby";
+  version = "2017-07-06";
+  rev = "d87a3f9990ed24ebbb51695879cd640cb07a4b40";
+
+  goPackagePath = "github.com/moby/tool";
+
+  src = fetchFromGitHub {
+    owner = "moby";
+    repo = "tool";
+    inherit rev;
+    sha256 = "0xhasm69g5gwihcm8g7rff9nkx7iffvd642bknky6j3w133gs5lp";
+  };
+
+  preBuild = ''
+    buildFlagsArray+=("-ldflags" "-X main.GitCommit=${builtins.substring 0 7 rev} -X main.Version=0.0.0")
+  '';
+
+  meta = {
+    description = "Assembly tool for the Moby project, an open framework to assemble specialized container systems without reinventing the wheel";
+    license = lib.licenses.asl20;
+    homepage = https://mobyproject.org;
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/msitools/default.nix b/nixpkgs/pkgs/development/tools/misc/msitools/default.nix
new file mode 100644
index 000000000000..5c2b0ad0ee33
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/msitools/default.nix
@@ -0,0 +1,27 @@
+{ stdenv, fetchurl, intltool, glib, pkgconfig, libgsf, libuuid, gcab, bzip2, gnome3 }:
+
+stdenv.mkDerivation rec {
+  pname = "msitools";
+  version = "0.98";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "19wb3n3nwkpc6bjr0q3f1znaxsfaqgjbdxxnbx8ic8bb5b49hwac";
+  };
+
+  nativeBuildInputs = [ intltool pkgconfig ];
+  buildInputs = [ glib libgsf libuuid gcab bzip2 ];
+
+  passthru = {
+    updateScript = gnome3.updateScript {
+      packageName = pname;
+    };
+  };
+
+  meta = with stdenv.lib; {
+    description = "Set of programs to inspect and build Windows Installer (.MSI) files";
+    homepage = https://wiki.gnome.org/msitools;
+    license = [ licenses.gpl2 licenses.lgpl21 ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/ninka/default.nix b/nixpkgs/pkgs/development/tools/misc/ninka/default.nix
new file mode 100644
index 000000000000..8af121707986
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/ninka/default.nix
@@ -0,0 +1,36 @@
+{ stdenv, fetchFromGitHub, perl, perlPackages }:
+
+assert stdenv ? glibc;
+
+perlPackages.buildPerlPackage {
+  pname = "ninka";
+  version = "2.0-pre";
+
+  src = fetchFromGitHub {
+    owner = "dmgerman";
+    repo = "ninka";
+    rev = "b89b59ecd057dfc939d0c75acaddebb58fcd8cba";
+    sha256 = "1grlis1kycbcjvjgqvn7aw81q1qx49ahvxg2k7cgyr79mvgpgi9m";
+  };
+
+  buildInputs = with perlPackages; [ perl TestOutput DBDSQLite DBI TestPod TestPodCoverage SpreadsheetParseExcel ];
+
+  doCheck = false;    # hangs
+
+  preConfigure = ''
+    sed -i.bak -e 's;#!/usr/bin/perl;#!${perl}/bin/perl;g' \
+        ./bin/ninka-excel ./bin/ninka ./bin/ninka-sqlite \
+        ./scripts/unify.pl ./scripts/parseLicense.pl \
+        ./scripts/license_matcher_modified.pl \
+        ./scripts/sort_package_license_list.pl
+    perl Makefile.PL
+  '';
+
+  meta = with stdenv.lib; {
+    description = "A sentence based license detector";
+    homepage = http://ninka.turingmachine.org/;
+    license = licenses.gpl2;
+    maintainers = [ maintainers.vrthra ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/nixbang/default.nix b/nixpkgs/pkgs/development/tools/misc/nixbang/default.nix
new file mode 100644
index 000000000000..164e0e80b60c
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/nixbang/default.nix
@@ -0,0 +1,22 @@
+{ lib, pythonPackages, fetchFromGitHub }:
+
+let version = "0.1.2"; in
+pythonPackages.buildPythonApplication {
+  pname = "nixbang";
+  inherit version;
+  namePrefix = "";
+
+  src = fetchFromGitHub {
+    owner = "madjar";
+    repo = "nixbang";
+    rev = version;
+    sha256 = "1kzk53ry60i814wa6n9y2ni0bcxhbi9p8gdv10b974gf23mhi8vc";
+  };
+
+  meta = {
+    homepage = https://github.com/madjar/nixbang;
+    description = "A special shebang to run scripts in a nix-shell";
+    maintainers = [ lib.maintainers.madjar ];
+    platforms = lib.platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/nrfutil/default.nix b/nixpkgs/pkgs/development/tools/misc/nrfutil/default.nix
new file mode 100644
index 000000000000..0a6155e649e5
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/nrfutil/default.nix
@@ -0,0 +1,33 @@
+{ stdenv, python2Packages, fetchFromGitHub }:
+
+with python2Packages; buildPythonApplication rec {
+  pname = "nrfutil";
+  version = "5.2.0";
+
+  src = fetchFromGitHub {
+    owner = "NordicSemiconductor";
+    repo = "pc-nrfutil";
+    rev = "v${version}";
+    sha256 = "1hajjgz8r4fjbwqr22p5dvb6k83dpxf8k7mhx20gkbrrx9ivqh79";
+  };
+
+  propagatedBuildInputs = [ pc-ble-driver-py six pyserial enum34 click ecdsa
+    protobuf tqdm piccata pyspinel intelhex pyyaml crcmod libusb1 ipaddress ];
+
+  checkInputs = [ nose behave ];
+
+  postPatch = ''
+    # remove version bound on pyyaml
+    sed -i /pyyaml/d requirements.txt
+
+    mkdir test-reports
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Device Firmware Update tool for nRF chips";
+    homepage = "https://github.com/NordicSemiconductor/pc-nrfutil";
+    license = licenses.unfreeRedistributable;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ gebner ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/objconv/default.nix b/nixpkgs/pkgs/development/tools/misc/objconv/default.nix
new file mode 100644
index 000000000000..dea6256824df
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/objconv/default.nix
@@ -0,0 +1,39 @@
+{ stdenv, fetchurl, unzip }:
+
+stdenv.mkDerivation rec {
+  pname = "objconv";
+  version = "2.51";
+
+  src = fetchurl {
+    # Versioned archive of objconv sources maintained by orivej.
+    url = "https://archive.org/download/objconv/${pname}-${version}.zip";
+    sha256 = "0wp6ld9vk11f4nnkn56627zmlv9k5vafi99qa3yyn1pgcd61zcfs";
+  };
+
+  nativeBuildInputs = [ unzip ];
+
+  outputs = [ "out" "doc" ];
+
+  unpackPhase = ''
+    mkdir -p "$name"
+    cd "$name"
+    unpackFile "$src"
+    unpackFile source.zip
+  '';
+
+  buildPhase = "c++ -o objconv -O2 *.cpp";
+
+  installPhase = ''
+    mkdir -p $out/bin $out/doc/objconv
+    mv objconv $out/bin
+    mv objconv-instructions.pdf $out/doc/objconv
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Object and executable file converter, modifier and disassembler";
+    homepage = https://www.agner.org/optimize/;
+    license = licenses.gpl2;
+    maintainers = with maintainers; [ orivej vrthra ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/one_gadget/Gemfile b/nixpkgs/pkgs/development/tools/misc/one_gadget/Gemfile
new file mode 100644
index 000000000000..bf4378d58ce2
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/one_gadget/Gemfile
@@ -0,0 +1,2 @@
+source 'https://rubygems.org'
+gem 'one_gadget'
diff --git a/nixpkgs/pkgs/development/tools/misc/one_gadget/Gemfile.lock b/nixpkgs/pkgs/development/tools/misc/one_gadget/Gemfile.lock
new file mode 100644
index 000000000000..ea31cc3704fa
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/one_gadget/Gemfile.lock
@@ -0,0 +1,17 @@
+GEM
+  remote: https://rubygems.org/
+  specs:
+    bindata (2.4.4)
+    elftools (1.1.0)
+      bindata (~> 2)
+    one_gadget (1.7.2)
+      elftools (>= 1.0.2, < 1.2.0)
+
+PLATFORMS
+  ruby
+
+DEPENDENCIES
+  one_gadget
+
+BUNDLED WITH
+   1.17.2
diff --git a/nixpkgs/pkgs/development/tools/misc/one_gadget/default.nix b/nixpkgs/pkgs/development/tools/misc/one_gadget/default.nix
new file mode 100644
index 000000000000..1c2cbe35439d
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/one_gadget/default.nix
@@ -0,0 +1,17 @@
+{ lib, bundlerApp, bundlerUpdateScript }:
+
+bundlerApp {
+  pname = "one_gadget";
+  gemdir = ./.;
+  exes = [ "one_gadget" ];
+
+  passthru.updateScript = bundlerUpdateScript "one_gadget";
+
+  meta = with lib; {
+    description = "The best tool for finding one gadget RCE in libc.so.6";
+    homepage    = https://github.com/david942j/one_gadget;
+    license     = licenses.mit;
+    maintainers = with maintainers; [ artemist nicknovitski ];
+    platforms   = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/one_gadget/gemset.nix b/nixpkgs/pkgs/development/tools/misc/one_gadget/gemset.nix
new file mode 100644
index 000000000000..26507a26e915
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/one_gadget/gemset.nix
@@ -0,0 +1,34 @@
+{
+  bindata = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0kz42nvxnk1j9cj0i8lcnhprcgdqsqska92g6l19ziadydfk2gqy";
+      type = "gem";
+    };
+    version = "2.4.4";
+  };
+  elftools = {
+    dependencies = ["bindata"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0kdf0ck4rzxpd006y09rfwppdrqb3sxww4gzfpv2053yq4mkimbn";
+      type = "gem";
+    };
+    version = "1.1.0";
+  };
+  one_gadget = {
+    dependencies = ["elftools"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "07s2nigjw1yik895gliz3a7ps0m9j5nccq82zwdd30sv740jmf5b";
+      type = "gem";
+    };
+    version = "1.7.2";
+  };
+}
\ No newline at end of file
diff --git a/nixpkgs/pkgs/development/tools/misc/opengrok/default.nix b/nixpkgs/pkgs/development/tools/misc/opengrok/default.nix
new file mode 100644
index 000000000000..21e825ac0bf0
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/opengrok/default.nix
@@ -0,0 +1,32 @@
+{ stdenv, fetchurl, jre, ctags, makeWrapper, coreutils, git, runtimeShell }:
+
+stdenv.mkDerivation rec {
+  pname = "opengrok";
+  version = "1.0";
+
+  # binary distribution
+  src = fetchurl {
+    url = "https://github.com/oracle/opengrok/releases/download/${version}/${pname}-${version}.tar.gz";
+    sha256 = "0h4rwfh8m41b7ij931gcbmkihri25m48373qf6ig0714s66xwc4i";
+  };
+
+  nativeBuildInputs = [ makeWrapper ];
+
+  installPhase = ''
+    mkdir -p $out
+    cp -a * $out/
+    substituteInPlace $out/bin/OpenGrok --replace "/bin/uname" "${coreutils}/bin/uname"
+    substituteInPlace $out/bin/Messages --replace "#!/bin/ksh" "#!${runtimeShell}"
+    wrapProgram $out/bin/OpenGrok \
+      --prefix PATH : "${stdenv.lib.makeBinPath [ ctags git ]}" \
+      --set JAVA_HOME "${jre}" \
+      --set OPENGROK_TOMCAT_BASE "/var/tomcat"
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Source code search and cross reference engine";
+    homepage = https://opengrok.github.io/OpenGrok/;
+    license = licenses.cddl;
+    maintainers = [ maintainers.lethalman ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/openocd/default.nix b/nixpkgs/pkgs/development/tools/misc/openocd/default.nix
new file mode 100644
index 000000000000..80203dd0df9c
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/openocd/default.nix
@@ -0,0 +1,61 @@
+{ stdenv, lib, fetchurl, libftdi1, libusb1, pkgconfig, hidapi }:
+
+stdenv.mkDerivation rec {
+  pname = "openocd";
+  version = "0.10.0";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/openocd/openocd-${version}.tar.bz2";
+    sha256 = "1bhn2c85rdz4gf23358kg050xlzh7yxbbwmqp24c0akmh3bff4kk";
+  };
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ libftdi1 libusb1 hidapi ];
+
+  configureFlags = [
+    "--enable-jtag_vpi"
+    "--enable-usb_blaster_libftdi"
+    (lib.enableFeature (! stdenv.isDarwin) "amtjtagaccel")
+    (lib.enableFeature (! stdenv.isDarwin) "gw16012")
+    "--enable-presto_libftdi"
+    "--enable-openjtag_ftdi"
+    (lib.enableFeature (! stdenv.isDarwin) "oocd_trace")
+    "--enable-buspirate"
+    (lib.enableFeature stdenv.isLinux "sysfsgpio")
+    "--enable-remote-bitbang"
+  ];
+
+  NIX_CFLAGS_COMPILE = lib.optionals stdenv.cc.isGNU [
+    "-Wno-implicit-fallthrough"
+    "-Wno-format-truncation"
+    "-Wno-format-overflow"
+    "-Wno-error=tautological-compare"
+  ];
+
+  postInstall = lib.optionalString stdenv.isLinux ''
+    mkdir -p "$out/etc/udev/rules.d"
+    rules="$out/share/openocd/contrib/60-openocd.rules"
+    if [ ! -f "$rules" ]; then
+        echo "$rules is missing, must update the Nix file."
+        exit 1
+    fi
+    ln -s "$rules" "$out/etc/udev/rules.d/"
+  '';
+
+  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
+      architecture of JTAG interface and TAP support, debug target support
+      (e.g. ARM, MIPS), and flash chip drivers (e.g. CFI, NAND, etc.).  Several
+      network interfaces are available for interactiving with OpenOCD: HTTP,
+      telnet, TCL, and GDB.  The GDB server enables OpenOCD to function as a
+      "remote target" for source-level debugging of embedded systems using the
+      GNU GDB program.
+    '';
+    homepage = http://openocd.sourceforge.net/;
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ bjornfor ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/pahole/default.nix b/nixpkgs/pkgs/development/tools/misc/pahole/default.nix
new file mode 100644
index 000000000000..5b17f111b45a
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/pahole/default.nix
@@ -0,0 +1,26 @@
+{ stdenv, fetchgit, cmake, elfutils, zlib }:
+
+stdenv.mkDerivation rec {
+  pname = "pahole";
+  version = "1.15";
+  src = fetchgit {
+    url = https://git.kernel.org/pub/scm/devel/pahole/pahole.git;
+    rev = "v${version}";
+    sha256 = "10af9mh3qxbx0hgjcmh0vjbg22bgxzhbpd9395ymasyw4npg6l9x";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ elfutils zlib ];
+
+  # Put libraries in "lib" subdirectory, not top level of $out
+  cmakeFlags = [ "-D__LIB=lib" ];
+
+  meta = with stdenv.lib; {
+    homepage = https://git.kernel.org/cgit/devel/pahole/pahole.git/;
+    description = "Pahole and other DWARF utils";
+    license = licenses.gpl2;
+
+    platforms = platforms.linux;
+    maintainers = [ maintainers.bosu ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/patchelf/default.nix b/nixpkgs/pkgs/development/tools/misc/patchelf/default.nix
new file mode 100644
index 000000000000..77d03f299f4a
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/patchelf/default.nix
@@ -0,0 +1,22 @@
+{ stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  name = "patchelf-0.9";
+
+  src = fetchurl {
+    url = "https://nixos.org/releases/patchelf/${name}/${name}.tar.bz2";
+    sha256 = "a0f65c1ba148890e9f2f7823f4bedf7ecad5417772f64f994004f59a39014f83";
+  };
+
+  setupHook = [ ./setup-hook.sh ];
+
+  doCheck = false; # fails 8 out of 24 tests, problems when loading libc.so.6
+
+  meta = with stdenv.lib; {
+    homepage = https://nixos.org/patchelf.html;
+    license = licenses.gpl3;
+    description = "A small utility to modify the dynamic linker and RPATH of ELF executables";
+    maintainers = [ maintainers.eelco ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/patchelf/setup-hook.sh b/nixpkgs/pkgs/development/tools/misc/patchelf/setup-hook.sh
new file mode 100644
index 000000000000..bc1cddd4879c
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/patchelf/setup-hook.sh
@@ -0,0 +1,22 @@
+# This setup hook calls patchelf to automatically remove unneeded
+# directories from the RPATH of every library or executable in every
+# output.
+
+fixupOutputHooks+=('if [ -z "$dontPatchELF" ]; then patchELF "$prefix"; fi')
+
+patchELF() {
+    local dir="$1"
+    [ -e "$dir" ] || return 0
+
+    header "shrinking RPATHs of ELF executables and libraries in $dir"
+
+    local i
+    while IFS= read -r -d $'\0' i; do
+        if [[ "$i" =~ .build-id ]]; then continue; fi
+        if ! isELF "$i"; then continue; fi
+        echo "shrinking $i"
+        patchelf --shrink-rpath "$i" || true
+    done < <(find "$dir" -type f -print0)
+
+    stopNest
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/patchelf/unstable.nix b/nixpkgs/pkgs/development/tools/misc/patchelf/unstable.nix
new file mode 100644
index 000000000000..c673bd261098
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/patchelf/unstable.nix
@@ -0,0 +1,38 @@
+{ stdenv, fetchFromGitHub, autoreconfHook }:
+
+stdenv.mkDerivation rec {
+  pname = "patchelf";
+  version = "0.10-pre-20190328";
+
+  src = fetchFromGitHub {
+    owner = "NixOS";
+    repo = "patchelf";
+    rev = "e1e39f3639e39360ceebb2f7ed533cede4623070";
+    sha256 = "09q1b1yqfzg1ih51v7qjh55vxfdbd8x5anycl8sfz6qy107wr02k";
+  };
+
+  # Drop test that fails on musl (?)
+  postPatch = stdenv.lib.optionalString stdenv.hostPlatform.isMusl ''
+    substituteInPlace tests/Makefile.am \
+      --replace "set-rpath-library.sh" ""
+  '' +
+  # extend version identifier to more informative than "0.10".
+  ''
+    echo -n ${version} > version
+  '';
+
+  setupHook = [ ./setup-hook.sh ];
+
+  nativeBuildInputs = [ autoreconfHook ];
+  buildInputs = [ ];
+
+  doCheck = !stdenv.isDarwin;
+
+  meta = {
+    homepage = https://nixos.org/patchelf.html;
+    license = "GPL";
+    description = "A small utility to modify the dynamic linker and RPATH of ELF executables";
+    maintainers = [ stdenv.lib.maintainers.eelco ];
+    platforms = stdenv.lib.platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/pkg-config/2.36.3-not-win32.patch b/nixpkgs/pkgs/development/tools/misc/pkg-config/2.36.3-not-win32.patch
new file mode 100644
index 000000000000..c1dd808e6008
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/pkg-config/2.36.3-not-win32.patch
@@ -0,0 +1,324 @@
+--- a/glib/configure.ac	2013-08-04 20:21:20.808722600 -0500
++++ b/glib/configure.ac	2013-08-04 18:30:21.852852200 -0500
+@@ -1880,7 +1880,7 @@ dnl ************************************
+ 
+ AC_MSG_CHECKING(for platform-dependent source)
+ case "$host" in
+-  *-*-cygwin*|*-*-mingw*)
++  *-*-mingw*)
+     PLATFORMDEP=gwin32.lo
+     ;;
+   *)
+@@ -2594,9 +2594,6 @@ dnl *** Win32 API libs ***
+ dnl **********************
+ 
+ case $host in
+-  *-*-cygwin*)
+-	G_LIBS_EXTRA="-luser32 -lkernel32"
+-    ;;
+   *-*-mingw*)
+ 	G_LIBS_EXTRA="-lws2_32 -lole32 -lwinmm -lshlwapi"
+     ;;
+--- a/glib/glib/gatomic.c	2013-08-04 20:21:20.907728300 -0500
++++ b/glib/glib/gatomic.c	2013-08-04 18:11:14.000000000 -0500
+@@ -464,7 +464,7 @@ gsize
+   return g_atomic_pointer_xor ((volatile gpointer *) atomic, val);
+ }
+ 
+-#elif defined (G_PLATFORM_WIN32)
++#elif defined (G_OS_WIN32)
+ 
+ #include <windows.h>
+ #if !defined(_M_AMD64) && !defined (_M_IA64) && !defined(_M_X64) && !(defined _MSC_VER && _MSC_VER <= 1200)
+--- a/glib/glib/gcharset.c	2013-08-04 20:21:20.925729300 -0500
++++ b/glib/glib/gcharset.c	2013-08-04 18:11:14.000000000 -0500
+@@ -496,7 +496,7 @@ guess_category_value (const gchar *categ
+   if ((retval != NULL) && (retval[0] != '\0'))
+     return retval;
+ 
+-#ifdef G_PLATFORM_WIN32
++#ifdef G_OS_WIN32
+   /* g_win32_getlocale() first checks for LC_ALL, LC_MESSAGES and
+    * LANG, which we already did above. Oh well. The main point of
+    * calling g_win32_getlocale() is to get the thread's locale as used
+--- a/glib/glib/gconvert.c	2013-08-04 20:21:20.933729800 -0500
++++ b/glib/glib/gconvert.c	2013-08-04 18:11:14.000000000 -0500
+@@ -33,9 +33,6 @@
+ 
+ #ifdef G_OS_WIN32
+ #include "win_iconv.c"
+-#endif
+-
+-#ifdef G_PLATFORM_WIN32
+ #define STRICT
+ #include <windows.h>
+ #undef STRICT
+@@ -1258,7 +1255,7 @@ g_locale_from_utf8 (const gchar *utf8str
+ 		      charset, "UTF-8", bytes_read, bytes_written, error);
+ }
+ 
+-#ifndef G_PLATFORM_WIN32
++#ifndef G_OS_WIN32
+ 
+ typedef struct _GFilenameCharsetCache GFilenameCharsetCache;
+ 
+@@ -1374,7 +1371,7 @@ g_get_filename_charsets (const gchar ***
+   return cache->is_utf8;
+ }
+ 
+-#else /* G_PLATFORM_WIN32 */
++#else /* G_OS_WIN32 */
+ 
+ gboolean
+ g_get_filename_charsets (const gchar ***filename_charsets) 
+@@ -1403,7 +1400,7 @@ g_get_filename_charsets (const gchar ***
+ #endif
+ }
+ 
+-#endif /* G_PLATFORM_WIN32 */
++#endif /* G_OS_WIN32 */
+ 
+ static gboolean
+ get_filename_charset (const gchar **filename_charset)
+--- a/glib/glib/gfileutils.c	2013-08-04 20:21:20.942730300 -0500
++++ b/glib/glib/gfileutils.c	2013-08-04 18:11:14.000000000 -0500
+@@ -2153,7 +2153,7 @@ g_path_skip_root (const gchar *file_name
+ {
+   g_return_val_if_fail (file_name != NULL, NULL);
+ 
+-#ifdef G_PLATFORM_WIN32
++#ifdef G_OS_WIN32
+   /* Skip \\server\share or //server/share */
+   if (G_IS_DIR_SEPARATOR (file_name[0]) &&
+       G_IS_DIR_SEPARATOR (file_name[1]) &&
+@@ -2163,7 +2163,6 @@ g_path_skip_root (const gchar *file_name
+       gchar *p;
+       p = strchr (file_name + 2, G_DIR_SEPARATOR);
+ 
+-#ifdef G_OS_WIN32
+       {
+         gchar *q;
+ 
+@@ -2171,7 +2170,6 @@ g_path_skip_root (const gchar *file_name
+         if (p == NULL || (q != NULL && q < p))
+         p = q;
+       }
+-#endif
+ 
+       if (p && p > file_name + 2 && p[1])
+         {
+--- a/glib/glib/glib.h	2013-08-04 20:21:20.949730700 -0500
++++ b/glib/glib/glib.h	2013-08-04 18:11:14.000000000 -0500
+@@ -96,7 +96,7 @@
+ #include <glib/gvariant.h>
+ #include <glib/gversion.h>
+ #include <glib/gversionmacros.h>
+-#ifdef G_PLATFORM_WIN32
++#ifdef G_OS_WIN32
+ #include <glib/gwin32.h>
+ #endif
+ 
+--- a/glib/glib/gutf8.c	2013-08-04 20:21:20.984732700 -0500
++++ b/glib/glib/gutf8.c	2013-08-04 18:11:14.000000000 -0500
+@@ -27,7 +27,7 @@
+ #endif
+ #include <string.h>
+ 
+-#ifdef G_PLATFORM_WIN32
++#ifdef G_OS_WIN32
+ #include <stdio.h>
+ #define STRICT
+ #include <windows.h>
+--- a/glib/glib/gutils.c	2013-08-04 20:21:21.015734500 -0500
++++ b/glib/glib/gutils.c	2013-08-04 18:11:14.000000000 -0500
+@@ -72,7 +72,7 @@
+ #include "garray.h"
+ #include "glibintl.h"
+ 
+-#ifdef G_PLATFORM_WIN32
++#ifdef G_OS_WIN32
+ #include "gconvert.h"
+ #include "gwin32.h"
+ #endif
+@@ -86,16 +86,13 @@
+  * These are portable utility functions.
+  */
+ 
+-#ifdef G_PLATFORM_WIN32
++#ifdef G_OS_WIN32
+ #  include <windows.h>
+ #  ifndef GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS
+ #    define GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT 2
+ #    define GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS 4
+ #  endif
+ #  include <lmcons.h>		/* For UNLEN */
+-#endif /* G_PLATFORM_WIN32 */
+-
+-#ifdef G_OS_WIN32
+ #  include <direct.h>
+ #  include <shlobj.h>
+    /* older SDK (e.g. msvc 5.0) does not have these*/
+@@ -131,7 +128,7 @@
+ #include <langinfo.h>
+ #endif
+ 
+-#ifdef G_PLATFORM_WIN32
++#ifdef G_OS_WIN32
+ 
+ gchar *
+ _glib_get_dll_directory (void)
+--- a/glib/glib/gutils.h	2013-08-04 20:21:21.067737500 -0500
++++ b/glib/glib/gutils.h	2013-08-04 18:11:14.000000000 -0500
+@@ -350,7 +350,7 @@ g_bit_storage (gulong number)
+  * On non-Windows platforms, expands to nothing.
+  */
+ 
+-#ifndef G_PLATFORM_WIN32
++#ifndef G_OS_WIN32
+ # define G_WIN32_DLLMAIN_FOR_DLL_NAME(static, dll_name)
+ #else
+ # define G_WIN32_DLLMAIN_FOR_DLL_NAME(static, dll_name)			\
+@@ -378,7 +378,7 @@ DllMain (HINSTANCE hinstDLL,						\
+ 
+ #endif	/* !G_DISABLE_DEPRECATED */
+ 
+-#endif /* G_PLATFORM_WIN32 */
++#endif /* G_OS_WIN32 */
+ 
+ G_END_DECLS
+ 
+--- a/glib/glib/gwin32.h	2013-08-04 20:21:21.081738300 -0500
++++ b/glib/glib/gwin32.h	2013-08-04 18:11:14.000000000 -0500
+@@ -33,7 +33,7 @@
+ 
+ #include <glib/gtypes.h>
+ 
+-#ifdef G_PLATFORM_WIN32
++#ifdef G_OS_WIN32
+ 
+ G_BEGIN_DECLS
+ 
+@@ -41,8 +41,6 @@ G_BEGIN_DECLS
+ #define MAXPATHLEN 1024
+ #endif
+ 
+-#ifdef G_OS_WIN32
+-
+ /*
+  * To get prototypes for the following POSIXish functions, you have to
+  * include the indicated non-POSIX headers. The functions are defined
+@@ -68,7 +66,6 @@ G_BEGIN_DECLS
+ GLIB_AVAILABLE_IN_ALL
+ gint		g_win32_ftruncate	(gint		 f,
+ 					 guint		 size);
+-#endif /* G_OS_WIN32 */
+ 
+ /* The MS setlocale uses locale names of the form "English_United
+  * States.1252" etc. We want the Unixish standard form "en", "zh_TW"
+@@ -112,7 +109,7 @@ gchar*          g_win32_locale_filename_
+ 
+ G_END_DECLS
+ 
+-#endif	 /* G_PLATFORM_WIN32 */
++#endif	 /* G_OS_WIN32 */
+ 
+ #ifdef G_OS_WIN32
+ #ifdef _WIN64
+--- a/glib/glib/libcharset/localcharset.c	2013-08-04 20:21:21.095739100 -0500
++++ b/glib/glib/libcharset/localcharset.c	2013-08-04 18:11:14.000000000 -0500
+@@ -46,10 +46,6 @@
+ #   include <locale.h>
+ #  endif
+ # endif
+-# ifdef __CYGWIN__
+-#  define WIN32_LEAN_AND_MEAN
+-#  include <windows.h>
+-# endif
+ #elif defined WIN32_NATIVE
+ # define WIN32_LEAN_AND_MEAN
+ # include <windows.h>
+@@ -111,7 +107,7 @@ _g_locale_get_charset_aliases (void)
+   cp = charset_aliases;
+   if (cp == NULL)
+     {
+-#if !(defined VMS || defined WIN32_NATIVE || defined __CYGWIN__)
++#if !(defined VMS || defined WIN32_NATIVE)
+       FILE *fp;
+       const char *dir;
+       const char *base = "charset.alias";
+@@ -237,7 +233,7 @@ _g_locale_get_charset_aliases (void)
+ 	   "DECKOREAN" "\0" "EUC-KR" "\0";
+ # endif
+ 
+-# if defined WIN32_NATIVE || defined __CYGWIN__
++# if defined WIN32_NATIVE
+       /* To avoid the troubles of installing a separate file in the same
+ 	 directory as the DLL and of retrieving the DLL's directory at
+ 	 runtime, simply inline the aliases here.  */
+@@ -292,53 +288,6 @@ _g_locale_charset_raw (void)
+   /* Most systems support nl_langinfo (CODESET) nowadays.  */
+   codeset = nl_langinfo (CODESET);
+ 
+-#  ifdef __CYGWIN__
+-  /* Cygwin 2006 does not have locales.  nl_langinfo (CODESET) always
+-     returns "US-ASCII".  As long as this is not fixed, return the suffix
+-     of the locale name from the environment variables (if present) or
+-     the codepage as a number.  */
+-  if (codeset != NULL && strcmp (codeset, "US-ASCII") == 0)
+-    {
+-      const char *locale;
+-      static char buf[2 + 10 + 1];
+-
+-      locale = getenv ("LC_ALL");
+-      if (locale == NULL || locale[0] == '\0')
+-	{
+-	  locale = getenv ("LC_CTYPE");
+-	  if (locale == NULL || locale[0] == '\0')
+-	    locale = getenv ("LANG");
+-	}
+-      if (locale != NULL && locale[0] != '\0')
+-	{
+-	  /* If the locale name contains an encoding after the dot, return
+-	     it.  */
+-	  const char *dot = strchr (locale, '.');
+-
+-	  if (dot != NULL)
+-	    {
+-	      const char *modifier;
+-
+-	      dot++;
+-	      /* Look for the possible @... trailer and remove it, if any.  */
+-	      modifier = strchr (dot, '@');
+-	      if (modifier == NULL)
+-		return dot;
+-	      if (modifier - dot < sizeof (buf))
+-		{
+-		  memcpy (buf, dot, modifier - dot);
+-		  buf [modifier - dot] = '\0';
+-		  return buf;
+-		}
+-	    }
+-	}
+-
+-      /* Woe32 has a function returning the locale's codepage as a number.  */
+-      sprintf (buf, "CP%u", GetACP ());
+-      codeset = buf;
+-    }
+-#  endif
+-
+ # else
+ 
+   /* On old systems which lack it, use setlocale or getenv.  */
+diff --git a/glib/gtypes.h b/glib/gtypes.h
+index c18e0bf..816685a 100644
+--- a/glib/glib/gtypes.h
++++ b/glib/glib/gtypes.h
+@@ -462,7 +462,7 @@ G_END_DECLS
+  * properly get exported in Windows DLLs.
+  */
+ #ifndef GLIB_VAR
+-#  ifdef G_PLATFORM_WIN32
++#  ifdef G_OS_WIN32
+ #    ifdef GLIB_STATIC_COMPILATION
+ #      define GLIB_VAR extern
+ #    else /* !GLIB_STATIC_COMPILATION */
diff --git a/nixpkgs/pkgs/development/tools/misc/pkg-config/default.nix b/nixpkgs/pkgs/development/tools/misc/pkg-config/default.nix
new file mode 100644
index 000000000000..13855eb4e742
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/pkg-config/default.nix
@@ -0,0 +1,49 @@
+{ stdenv, fetchurl, libiconv, vanilla ? false }:
+
+with stdenv.lib;
+
+stdenv.mkDerivation rec {
+  pname = "pkg-config";
+  version = "0.29.2";
+
+  setupHook = ./setup-hook.sh;
+
+  src = fetchurl {
+    url = "https://pkgconfig.freedesktop.org/releases/${pname}-${version}.tar.gz";
+    sha256 = "14fmwzki1rlz8bs2p810lk6jqdxsk966d8drgsjmi54cd00rrikg";
+  };
+
+  # Process Requires.private properly, see
+  # http://bugs.freedesktop.org/show_bug.cgi?id=4738.
+  patches = optional (!vanilla) ./requires-private.patch
+    ++ optional stdenv.isCygwin ./2.36.3-not-win32.patch;
+
+  # These three tests fail due to a (desired) behavior change from our ./requires-private.patch
+  postPatch = ''
+    rm -f check/check-requires-private check/check-gtk check/missing
+  '';
+
+  buildInputs = optional (stdenv.isCygwin || stdenv.isDarwin || stdenv.isSunOS) libiconv;
+
+  configureFlags = [ "--with-internal-glib" ]
+    ++ optional (stdenv.isSunOS) [ "--with-libiconv=gnu" "--with-system-library-path" "--with-system-include-path" "CFLAGS=-DENABLE_NLS" ]
+       # Can't run these tests while cross-compiling
+    ++ optional (stdenv.hostPlatform != stdenv.buildPlatform)
+       [ "glib_cv_stack_grows=no"
+         "glib_cv_uscore=no"
+         "ac_cv_func_posix_getpwuid_r=yes"
+         "ac_cv_func_posix_getgrgid_r=yes"
+       ];
+
+  enableParallelBuilding = true;
+  doCheck = true;
+
+  postInstall = ''rm -f "$out"/bin/*-pkg-config''; # clean the duplicate file
+
+  meta = {
+    description = "A tool that allows packages to find out information about other packages";
+    homepage = http://pkg-config.freedesktop.org/wiki/;
+    platforms = platforms.all;
+    license = licenses.gpl2Plus;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/pkg-config/requires-private.patch b/nixpkgs/pkgs/development/tools/misc/pkg-config/requires-private.patch
new file mode 100644
index 000000000000..d40aa9801379
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/pkg-config/requires-private.patch
@@ -0,0 +1,17 @@
+diff --git a/main.c b/main.c
+index b61ca34..5a420c2 100644
+--- a/main.c
++++ b/main.c
+@@ -602,10 +602,10 @@ main (int argc, char **argv)
+   else
+     disable_private_libs();
+ 
+-  /* honor Requires.private if any Cflags are requested or any static
++  /* honor Requires.private if any any static
+    * libs are requested */
+ 
+-  if (pkg_flags & CFLAGS_ANY || want_requires_private || want_exists ||
++  if (want_requires_private ||
+       (want_static_lib_list && (pkg_flags & LIBS_ANY)))
+     enable_requires_private();
+ 
diff --git a/nixpkgs/pkgs/development/tools/misc/pkg-config/setup-hook.sh b/nixpkgs/pkgs/development/tools/misc/pkg-config/setup-hook.sh
new file mode 100644
index 000000000000..34a9b9f1173b
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/pkg-config/setup-hook.sh
@@ -0,0 +1,6 @@
+addPkgConfigPath () {
+    addToSearchPath PKG_CONFIG_PATH $1/lib/pkgconfig
+    addToSearchPath PKG_CONFIG_PATH $1/share/pkgconfig
+}
+
+addEnvHooks "$targetOffset" addPkgConfigPath
diff --git a/nixpkgs/pkgs/development/tools/misc/pkgconf/default.nix b/nixpkgs/pkgs/development/tools/misc/pkgconf/default.nix
new file mode 100644
index 000000000000..e4a6416129e8
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/pkgconf/default.nix
@@ -0,0 +1,19 @@
+{ stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "pkgconf";
+  version = "1.6.3";
+
+  src = fetchurl {
+    url = "https://distfiles.dereferenced.org/${pname}/${pname}-${version}.tar.xz";
+    sha256 = "04525vv0y849vvc2pi60g5wd9fjp1wbhra2lniifi82y1ldv7w31";
+  };
+
+  meta = with stdenv.lib; {
+    description = "Package compiler and linker metadata toolkit";
+    homepage = https://git.dereferenced.org/pkgconf/pkgconf;
+    platforms = platforms.all;
+    license = licenses.isc;
+    maintainers = with maintainers; [ zaninime ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/pmccabe/default.nix b/nixpkgs/pkgs/development/tools/misc/pmccabe/default.nix
new file mode 100644
index 000000000000..0b91953a7c7f
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/pmccabe/default.nix
@@ -0,0 +1,48 @@
+{ stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "pmccabe";
+  version = "2.6";
+
+  src = fetchurl {
+    url = "http://http.debian.net/debian/pool/main/p/pmccabe/pmccabe_${version}.tar.gz";
+    sha256 = "0a3h1b9fb87c82d5fbql5lc4gp338pa5s9i66dhw7zk8jdygx474";
+  };
+
+  patches = [
+    ./getopt_on_darwin.patch
+  ];
+
+  configurePhase = ''
+    sed -i -r Makefile \
+      -e 's,/usr/,/,g' \
+      -e "s,^DESTDIR =.*$,DESTDIR = $out," \
+      -e "s,^INSTALL = install.*$,INSTALL = install," \
+      -e "s,^all:.*$,all: \$(PROGS),"
+    '';
+
+  checkPhase = "make test";
+
+  doCheck = true;
+
+  meta = with stdenv.lib; {
+    description = "McCabe-style function complexity and line counting for C and C++";
+    homepage = https://people.debian.org/~bame/pmccabe/;
+    license = licenses.gpl2Plus;
+
+    longDescription = ''
+      pmccabe calculates McCabe-style cyclomatic complexity for C and
+      C++ source code.  Per-function complexity may be used for
+      spotting likely trouble spots and for estimating testing
+      effort.
+
+      pmccabe also includes a non-commented line counter, decomment which
+      only removes comments from source code; codechanges, a program to
+      calculate the amount of change which has occurred between two source
+      trees or files; and vifn, to invoke vi given a function name rather
+      than a file name.
+    '';
+    maintainers = with maintainers; [ peterhoeg ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/pmccabe/getopt_on_darwin.patch b/nixpkgs/pkgs/development/tools/misc/pmccabe/getopt_on_darwin.patch
new file mode 100644
index 000000000000..534d6c1d6ef7
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/pmccabe/getopt_on_darwin.patch
@@ -0,0 +1,15 @@
+diff --git a/decomment.c b/decomment.c
+index 400707a..aea29fd 100644
+--- a/decomment.c
++++ b/decomment.c
+@@ -11,6 +11,10 @@
+ #include "getopt.h"
+ #endif
+ 
++#ifdef __APPLE__
++#include "getopt.h"
++#endif
++
+ #ifdef NEED_OPTIND
+ extern int optind;
+ #endif
diff --git a/nixpkgs/pkgs/development/tools/misc/prelink/default.nix b/nixpkgs/pkgs/development/tools/misc/prelink/default.nix
new file mode 100644
index 000000000000..7bfff6328269
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/prelink/default.nix
@@ -0,0 +1,25 @@
+{ stdenv, fetchurl, libelf }:
+
+let
+  version = "20130503";
+in
+stdenv.mkDerivation {
+  pname = "prelink";
+  inherit version;
+
+  buildInputs = [
+    libelf stdenv.cc.libc (stdenv.lib.getOutput "static" stdenv.cc.libc)
+  ];
+
+  src = fetchurl {
+    url = "https://people.redhat.com/jakub/prelink/prelink-${version}.tar.bz2";
+    sha256 = "1w20f6ilqrz8ca51qhrn1n13h7q1r34k09g33d6l2vwvbrhcffb3";
+  };
+
+  meta = {
+    homepage = https://people.redhat.com/jakub/prelink/;
+    license = "GPL";
+    description = "ELF prelinking utility to speed up dynamic linking";
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/premake/3.nix b/nixpkgs/pkgs/development/tools/misc/premake/3.nix
new file mode 100644
index 000000000000..a94614af7967
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/premake/3.nix
@@ -0,0 +1,30 @@
+{stdenv, fetchurl, unzip}:
+
+let baseName = "premake";
+  version  = "3.7";
+in
+
+stdenv.mkDerivation {
+  name = "${baseName}-${version}";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/sourceforge/premake/${baseName}-src-${version}.zip";
+    sha256 = "b59841a519e75d5b6566848a2c5be2f91455bf0cc6ae4d688fcbd4c40db934d5";
+  };
+
+  buildInputs = [unzip];
+
+  installPhase = ''
+    install -Dm755 bin/premake $out/bin/premake
+  '';
+
+  premake_cmd = "premake";
+  setupHook = ./setup-hook.sh;
+
+  meta = {
+    homepage = http://industriousone.com/premake;
+    description = "A simple build configuration and project generation tool using lua";
+    license = stdenv.lib.licenses.bsd3;
+    platforms = stdenv.lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/premake/5.nix b/nixpkgs/pkgs/development/tools/misc/premake/5.nix
new file mode 100644
index 000000000000..d9d28580210b
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/premake/5.nix
@@ -0,0 +1,43 @@
+{ stdenv, fetchFromGitHub, Foundation, readline }:
+
+with stdenv.lib;
+
+stdenv.mkDerivation rec {
+  pname = "premake5";
+  version = "5.0.0-alpha12";
+
+  src = fetchFromGitHub {
+    owner = "premake";
+    repo = "premake-core";
+    rev = "v${version}";
+    sha256 = "1h3hr96pdz94njn4bg02ldcz0k5j1x017d8svc7fdyvl2b77nqzf";
+  };
+
+  buildInputs = optionals stdenv.isDarwin [ Foundation readline ];
+
+  patchPhase = optional stdenv.isDarwin ''
+    substituteInPlace premake5.lua \
+      --replace -mmacosx-version-min=10.4 -mmacosx-version-min=10.5
+  '';
+
+  buildPhase =
+    if stdenv.isDarwin then ''
+       make -f Bootstrap.mak osx
+    '' else ''
+       make -f Bootstrap.mak linux
+    '';
+
+  installPhase = ''
+    install -Dm755 bin/release/premake5 $out/bin/premake5
+  '';
+
+  premake_cmd = "premake5";
+  setupHook = ./setup-hook.sh;
+
+  meta = {
+    homepage = https://premake.github.io;
+    description = "A simple build configuration and project generation tool using lua";
+    license = stdenv.lib.licenses.bsd3;
+    platforms = platforms.darwin ++ platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/premake/default.nix b/nixpkgs/pkgs/development/tools/misc/premake/default.nix
new file mode 100644
index 000000000000..99bf8cac81fa
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/premake/default.nix
@@ -0,0 +1,35 @@
+{ stdenv, fetchurl, unzip }:
+
+let baseName = "premake";
+  version  = "4.3";
+in
+
+stdenv.mkDerivation {
+  name = "${baseName}-${version}";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/${baseName}/${baseName}-${version}-src.zip";
+    sha256 = "1017rd0wsjfyq2jvpjjhpszaa7kmig6q1nimw76qx3cjz2868lrn";
+  };
+
+  nativeBuildInputs = [ unzip ];
+
+  buildPhase = ''
+    make -C build/gmake.unix/
+  '';
+
+  installPhase = ''
+    install -Dm755 bin/release/premake4 $out/bin/premake4
+  '';
+
+  premake_cmd = "premake4";
+  setupHook = ./setup-hook.sh;
+
+  meta = with stdenv.lib; {
+    homepage = http://industriousone.com/premake;
+    description = "A simple build configuration and project generation tool using lua";
+    license = stdenv.lib.licenses.bsd3;
+    platforms = platforms.unix;
+    maintainers = [ maintainers.bjornfor ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/premake/setup-hook.sh b/nixpkgs/pkgs/development/tools/misc/premake/setup-hook.sh
new file mode 100644
index 000000000000..ba06ea2c7617
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/premake/setup-hook.sh
@@ -0,0 +1,19 @@
+premakeConfigurePhase() {
+    runHook preConfigure
+
+    local flagsArray=(
+        ${premakefile:+--file=$premakefile}
+        $premakeFlags ${premakeFlagsArray[@]}
+        ${premakeBackend:-gmake}
+    )
+
+    echoCmd 'configure flags' "${flagsArray[@]}"
+
+    @premake_cmd@ "${flagsArray[@]}"
+
+    runHook postConfigure
+}
+
+if [ -z "$configurePhase" ]; then
+    configurePhase=premakeConfigurePhase
+fi
diff --git a/nixpkgs/pkgs/development/tools/misc/pwndbg/default.nix b/nixpkgs/pkgs/development/tools/misc/pwndbg/default.nix
new file mode 100644
index 000000000000..7182144fd200
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/pwndbg/default.nix
@@ -0,0 +1,62 @@
+{ stdenv
+, fetchFromGitHub
+, makeWrapper
+, gdb
+, future
+, isort
+, psutil
+, pycparser
+, pyelftools
+, python-ptrace
+, ROPGadget
+, six
+, unicorn
+, pygments
+, }:
+
+stdenv.mkDerivation rec {
+  pname = "pwndbg";
+  version = "2019.01.25";
+
+  src = fetchFromGitHub {
+    owner = "pwndbg";
+    repo = "pwndbg";
+    rev = version;
+    sha256 = "0k7n6pcrj62ccag801yzf04a9mj9znghpkbnqwrzz0qn3rs42vgs";
+  };
+
+  nativeBuildInputs = [ makeWrapper ];
+
+  propagatedBuildInputs = [
+    future
+    isort
+    psutil
+    pycparser
+    pyelftools
+    python-ptrace
+    ROPGadget
+    six
+    unicorn
+    pygments
+  ];
+
+  installPhase = ''
+    mkdir -p $out/share/pwndbg
+    cp -r *.py pwndbg $out/share/pwndbg
+    makeWrapper ${gdb}/bin/gdb $out/bin/pwndbg \
+      --add-flags "-q -x $out/share/pwndbg/gdbinit.py"
+  '';
+
+  preFixup = ''
+    sed -i "/import sys/a import sys; sys.path[0:0] = '$PYTHONPATH'.split(':')" \
+      $out/share/pwndbg/gdbinit.py
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Exploit Development and Reverse Engineering with GDB Made Easy";
+    homepage = http://pwndbg.com;
+    license = licenses.mit;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ mic92 ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/reviewdog/default.nix b/nixpkgs/pkgs/development/tools/misc/reviewdog/default.nix
new file mode 100644
index 000000000000..65a7c9eef397
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/reviewdog/default.nix
@@ -0,0 +1,26 @@
+{ lib, buildGoModule, fetchFromGitHub }:
+
+buildGoModule rec {
+  pname = "reviewdog";
+  version = "0.9.12";
+
+  src = fetchFromGitHub {
+    owner = pname;
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "0r7y8nbpwfbvinpapv6lgnlc93kwn4b6722cp5ihyf361fklcd02";
+  };
+
+  modSha256 = "1ydfirjhw238zbia5mk90fx9rrg3kvm2h54zjhiimlvnpls5y8c9";
+
+  subPackages = [ "cmd/reviewdog" ];
+
+  buildFlagsArray = [ "-ldflags=-X github.com/reviewdog/reviewdog/commands.Version=${version}" ];
+
+  meta = with lib; {
+    description = "Automated code review tool integrated with any code analysis tools regardless of programming language";
+    homepage = "https://github.com/reviewdog/reviewdog";
+    maintainers = [ maintainers.marsam ];
+    license = licenses.mit;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/rman/default.nix b/nixpkgs/pkgs/development/tools/misc/rman/default.nix
new file mode 100644
index 000000000000..8093846780d2
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/rman/default.nix
@@ -0,0 +1,32 @@
+{stdenv, fetchurl}:
+
+stdenv.mkDerivation {
+  name = "rman-3.2";
+
+  src = fetchurl {
+    url = mirror://sourceforge/polyglotman/3.2/rman-3.2.tar.gz;
+    sha256 = "0prdld6nbkdlkcgc2r1zp13h2fh8r0mlwxx423dnc695ddlk18b8";
+  };
+
+  postPatch = ''
+    substituteInPlace Makefile \
+      --replace ginstall install
+  '';
+
+  makeFlags = [ "BINDIR=$(out)/bin" "MANDIR=$(out)/share/man" ];
+
+  preInstall = ''
+    mkdir -p $out/bin
+    mkdir -p $out/share/man
+  '';
+
+  hardeningDisable = [ "format" ];
+
+  doCheck = false; # "check" target is probably meant to do "installcheck" or something
+
+  meta = {
+    description = "Parse formatted man pages and man page source from most flavors of UNIX and converts them to HTML, ASCII, TkMan, DocBook, and other formats";
+    license = "artistic";
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/rolespec/default.nix b/nixpkgs/pkgs/development/tools/misc/rolespec/default.nix
new file mode 100644
index 000000000000..1e85e87c5378
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/rolespec/default.nix
@@ -0,0 +1,49 @@
+{ stdenv, fetchFromGitHub, makeWrapper }:
+
+stdenv.mkDerivation rec {
+
+  name = "rolespec-${meta.version}";
+
+  src = fetchFromGitHub {
+    owner = "nickjj";
+    repo = "rolespec";
+    rev = "d9ee530cd709168882059776c482fc37f46cb743";
+    sha256 = "1jkidw6aqr0zfqwmcvlpi9qa140z2pxcfsd43xm5ikx6jcwjdrzl";
+    inherit name;
+  };
+
+  buildInputs = [ makeWrapper ];
+
+  # The default build phase (`make`) runs the test code. It's difficult to do
+  # the test in the build environment because it depends on the system package
+  # managers (apt/yum/pacman). We simply skip this phase since RoleSpec is
+  # shell based.
+  dontBuild = true;
+
+  # Wrap the program because `ROLESPEC_LIB` defaults to
+  # `/usr/local/lib/rolespec`.
+  installPhase = ''
+    make install PREFIX=$out
+    wrapProgram $out/bin/rolespec --set ROLESPEC_LIB $out/lib/rolespec
+  '';
+
+  # Since RoleSpec installs the shell script files in `lib` directory, the
+  # fixup phase shows some warnings. Disable these actions.
+  dontPatchELF = true;
+  dontStrip = true;
+
+  meta = with stdenv.lib; {
+    homepage = https://github.com/nickjj/rolespec;
+    description = "A test library for testing Ansible roles";
+    longDescription = ''
+      A shell based test library for Ansible that works both locally and over
+      Travis-CI.
+    '';
+    downloadPage = "https://github.com/nickjj/rolespec";
+    license = licenses.gpl3;
+    version = "20161104";
+    maintainers = [ maintainers.dochang ];
+    platforms = platforms.unix;
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/saleae-logic/default.nix b/nixpkgs/pkgs/development/tools/misc/saleae-logic/default.nix
new file mode 100644
index 000000000000..0519e4d05e04
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/saleae-logic/default.nix
@@ -0,0 +1,97 @@
+# Saleae logic analyzer software
+#
+# Suggested udev rules to be able to access the Logic device without being root:
+#   SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ATTR{idVendor}=="0925", ATTR{idProduct}=="3881", MODE="0666"
+#   SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ATTR{idVendor}=="21a9", ATTR{idProduct}=="1001", MODE="0666"
+#
+# In NixOS, simply add this package to services.udev.packages.
+
+{ stdenv, fetchurl, unzip, glib, libSM, libICE, gtk2, libXext, libXft
+, fontconfig, libXrender, libXfixes, libX11, libXi, libXrandr, libXcursor
+, freetype, libXinerama, libxcb, zlib, pciutils
+, makeDesktopItem, xkeyboardconfig, dbus, runtimeShell, libGL
+}:
+
+let
+
+  libPath = stdenv.lib.makeLibraryPath [
+    glib libSM libICE gtk2 libXext libXft fontconfig libXrender libXfixes libX11
+    libXi libXrandr libXcursor freetype libXinerama libxcb zlib stdenv.cc.cc.lib
+    dbus libGL
+  ];
+
+in
+
+assert stdenv.hostPlatform.system == "x86_64-linux";
+
+stdenv.mkDerivation rec {
+  pname = "saleae-logic";
+  version = "1.2.18";
+
+  src = fetchurl {
+    name = "saleae-logic-${version}-64bit.zip";
+    url = "http://downloads.saleae.com/logic/${version}/Logic%20${version}%20(64-bit).zip";
+    sha256 = "0lhair2vsg8sjvzicvfcjfmvy30q7i01xj4z02iqh7pgzpb025h8";
+  };
+
+  desktopItem = makeDesktopItem {
+    name = "saleae-logic";
+    exec = "saleae-logic";
+    icon = ""; # the package contains no icon
+    comment = "Software for Saleae logic analyzers";
+    desktopName = "Saleae Logic";
+    genericName = "Logic analyzer";
+    categories = "Application;Development";
+  };
+
+  buildInputs = [ unzip ];
+
+  installPhase = ''
+    # Copy prebuilt app to $out
+    mkdir "$out"
+    cp -r * "$out"
+
+    # Patch it
+    patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" "$out/Logic"
+    for bin in "$out/Logic"              \
+               "$out/libQt5Widgets.so.5" \
+               "$out/libQt5Gui.so.5"     \
+               "$out/libQt5Core.so.5"    \
+               "$out/libQt5Network.so.5" ; do
+        patchelf --set-rpath "${stdenv.cc.cc.lib}/lib:${stdenv.cc.cc.lib}/lib64:${libPath}:\$ORIGIN/Analyzers:\$ORIGIN" "$bin"
+    done
+
+    patchelf --set-rpath "${stdenv.cc.cc.lib}/lib:${stdenv.cc.cc.lib}/lib64:${libPath}:\$ORIGIN/../" "$out/platforms/libqxcb.so"
+
+    # Build the LD_PRELOAD library that makes Logic work from a read-only directory
+    mkdir -p "$out/lib"
+    gcc -shared -fPIC -DOUT=\"$out\" "${./preload.c}" -o "$out/lib/preload.so" -ldl
+
+    # Make wrapper script that uses the LD_PRELOAD library
+    mkdir -p "$out/bin"
+    cat > "$out/bin/saleae-logic" << EOF
+    #!${runtimeShell}
+    export LD_PRELOAD="$out/lib/preload.so"
+    export QT_XKB_CONFIG_ROOT="${xkeyboardconfig}/share/X11/xkb"
+    export PATH="${pciutils}/bin:\$PATH"
+    exec "$out/Logic" "\$@"
+    EOF
+    chmod a+x "$out"/bin/saleae-logic
+
+    # Copy the generated .desktop file
+    mkdir -p "$out/share/applications"
+    cp "$desktopItem"/share/applications/* "$out/share/applications/"
+
+    # Install provided udev rules
+    mkdir -p "$out/etc/udev/rules.d"
+    cp Drivers/99-SaleaeLogic.rules "$out/etc/udev/rules.d/"
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Software for Saleae logic analyzers";
+    homepage = http://www.saleae.com/;
+    license = licenses.unfree;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.bjornfor ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/saleae-logic/preload.c b/nixpkgs/pkgs/development/tools/misc/saleae-logic/preload.c
new file mode 100644
index 000000000000..b4451e4d99f7
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/saleae-logic/preload.c
@@ -0,0 +1,341 @@
+/*
+ * LD_PRELOAD trick to make Saleae Logic work from a read-only installation
+ * directory.
+ *
+ * Saleae Logic tries to write to a few directories inside its installation
+ * directory. Because the Nix store is read-only, we have to redirect access to
+ * this file somewhere else. Here's the map:
+ *
+ *   $out/Settings/    => $HOME/.saleae-logic/Settings/
+ *   $out/Databases/   => $HOME/.saleae-logic/Databases/
+ *   $out/Errors/      => $HOME/.saleae-logic/Errors/
+ *   $out/Calibration/ => $HOME/.saleae-logic/Calibration/
+ *
+ * This also makes the software multi-user aware :-)
+ *
+ * NOTE: AFAIK (Bjørn Forsman), Logic version 1.2+ was supposed to have a
+ * command line parameter for redirecting these write operations, but
+ * apparently that feature got postponed.
+ *
+ * Usage:
+ *   gcc -shared -fPIC -DOUT="$out" preload.c -o preload.so -ldl
+ *   LD_PRELOAD=$PWD/preload.so ./result/Logic
+ *
+ * To see the paths that are modified at runtime, set the environment variable
+ * PRELOAD_DEBUG to 1 (or anything really; debugging is on as long as the
+ * variable exists).
+ */
+
+#define _GNU_SOURCE
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <dlfcn.h>
+#include <limits.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <errno.h>
+
+#ifndef OUT
+#error Missing OUT define - path to the installation directory.
+#endif
+
+/*
+ * TODO: How to properly wrap "open", which is declared as a variadic function
+ * in glibc? The man page lists these signatures:
+ *
+ *   int open(const char *pathname, int flags);
+ *   int open(const char *pathname, int flags, mode_t mode);
+ *
+ * But using either signature in this code cause a compile error, because
+ * glibc has declared the function as "int open(const char *, int, ...)".
+ * Same thing with "openat".
+ *
+ * For now we discard the variadic args. It seems to work.
+ *
+ * Relevant:
+ * http://stackoverflow.com/questions/28462523/how-to-wrap-ioctlint-d-unsigned-long-request-using-ld-preload
+ */
+typedef FILE *(*fopen_func_t)(const char *path, const char *mode);
+typedef FILE *(*fopen64_func_t)(const char *path, const char *mode);
+typedef int (*open_func_t)(const char *pathname, int flags, ...);
+typedef int (*open64_func_t)(const char *pathname, int flags, ...);
+typedef int (*openat_func_t)(int dirfd, const char *pathname, int flags, ...);
+typedef int (*openat64_func_t)(int dirfd, const char *pathname, int flags, ...);
+typedef int (*xstat_func_t)(int vers, const char *pathname, struct stat *buf);
+typedef int (*xstat64_func_t)(int vers, const char *pathname, struct stat64 *buf);
+typedef int (*access_func_t)(const char *pathname, int mode);
+typedef int (*faccessat_func_t)(int dirfd, const char *pathname, int mode, int flags);
+typedef int (*unlink_func_t)(const char *pathname);
+
+/*
+ * Redirect $out/{Settings,Databases,Errors,Calibration}/ => $HOME/.saleae-logic/.
+ * Path is truncated if bigger than PATH_MAX.
+ *
+ * @param pathname Original file path.
+ * @param buffer Pointer to a buffer of size PATH_MAX bytes that this function
+ * will write the new redirected path to (if needed).
+ *
+ * @return Pointer to the resulting path. It will either be equal to the
+ * pathname (no redirect) or buffer argument (was redirected).
+ */
+static const char *redirect(const char *pathname, char *buffer)
+{
+	const char *homepath;
+	const char *new_path;
+	static char have_warned;
+	const char *remainder;
+	static char have_initialized;
+	static size_t out_strlen;
+	static size_t settings_strlen;
+	static size_t databases_strlen;
+	static size_t errors_strlen;
+	static size_t calibration_strlen;
+	int ret;
+	int i;
+
+	homepath = getenv("HOME");
+	if (!homepath) {
+		homepath = "/";
+		if (!have_warned && getenv("PRELOAD_DEBUG")) {
+			fprintf(stderr, "preload_debug: WARNING: HOME is unset, using \"/\" (root) instead.\n");
+			have_warned = 1;
+		}
+	}
+
+	if (!have_initialized) {
+		/*
+		 * The directories that Saleae Logic expects to find.
+		 * The first element is intentionally empty (create base dir).
+		 */
+		char *dirs[] = {"", "/Settings", "/Databases", "/Errors", "/Calibration"};
+		char old_settings_path[PATH_MAX];
+		access_func_t orig_access;
+
+		out_strlen = strlen(OUT);
+		settings_strlen = out_strlen + strlen("/Settings");
+		databases_strlen = out_strlen + strlen("/Databases");
+		errors_strlen = out_strlen + strlen("/Errors");
+		calibration_strlen = out_strlen + strlen("/Calibration");
+		for (i = 0; i < sizeof dirs / sizeof dirs[0]; i++) {
+			snprintf(buffer, PATH_MAX, "%s/.saleae-logic%s", homepath, dirs[i]);
+			buffer[PATH_MAX-1] = '\0';
+			ret = mkdir(buffer, 0755);
+			if (0 != ret && errno != EEXIST) {
+				fprintf(stderr, "ERROR: Failed to create directory \"%s\": %s\n",
+						buffer, strerror(errno));
+				return NULL;
+			}
+		}
+
+		/*
+		 * Automatic migration of the settings file:
+		 * ~/.saleae-logic-settings.xml => ~/.saleae-logic/Settings/settings.xml
+		 */
+		snprintf(old_settings_path, PATH_MAX, "%s/.saleae-logic-settings.xml", homepath);
+		old_settings_path[PATH_MAX-1] = '\0';
+		orig_access = (access_func_t)dlsym(RTLD_NEXT, "access");
+		if (orig_access(old_settings_path, F_OK) == 0) {
+			snprintf(buffer, PATH_MAX, "%s/.saleae-logic/Settings/settings.xml", homepath);
+			buffer[PATH_MAX-1] = '\0';
+			ret = rename(old_settings_path, buffer);
+			if (ret != 0) {
+				fprintf(stderr, "WARN: Failed to move %s to %s",
+						old_settings_path, buffer);
+			}
+		}
+
+		have_initialized = 1;
+	}
+
+	new_path = pathname;
+	remainder = pathname + out_strlen;
+
+	if ((strncmp(OUT "/Settings", pathname, settings_strlen) == 0) ||
+	    (strncmp(OUT "/Databases", pathname, databases_strlen) == 0) ||
+	    (strncmp(OUT "/Errors", pathname, errors_strlen) == 0) ||
+	    (strncmp(OUT "/Calibration", pathname, calibration_strlen) == 0)) {
+		snprintf(buffer, PATH_MAX, "%s/.saleae-logic%s", homepath, remainder);
+		buffer[PATH_MAX-1] = '\0';
+		new_path = buffer;
+	}
+
+	return new_path;
+}
+
+FILE *fopen(const char *pathname, const char *mode)
+{
+	const char *path;
+	char buffer[PATH_MAX];
+	fopen_func_t orig_fopen;
+
+	orig_fopen = (fopen_func_t)dlsym(RTLD_NEXT, "fopen");
+	path = redirect(pathname, buffer);
+	if (path != pathname && getenv("PRELOAD_DEBUG")) {
+		fprintf(stderr, "preload_debug: fopen(\"%s\", \"%s\") => \"%s\"\n", pathname, mode, path);
+	}
+
+	return orig_fopen(path, mode);
+}
+
+FILE *fopen64(const char *pathname, const char *mode)
+{
+	const char *path;
+	char buffer[PATH_MAX];
+	fopen64_func_t orig_fopen64;
+
+	orig_fopen64 = (fopen64_func_t)dlsym(RTLD_NEXT, "fopen64");
+	path = redirect(pathname, buffer);
+	if (path != pathname && getenv("PRELOAD_DEBUG")) {
+		fprintf(stderr, "preload_debug: fopen64(\"%s\", \"%s\") => \"%s\"\n", pathname, mode, path);
+	}
+
+	return orig_fopen64(path, mode);
+}
+
+int open(const char *pathname, int flags, ...)
+{
+	const char *path;
+	char buffer[PATH_MAX];
+	open_func_t orig_open;
+
+	orig_open = (open_func_t)dlsym(RTLD_NEXT, "open");
+	path = redirect(pathname, buffer);
+	if (path != pathname && getenv("PRELOAD_DEBUG")) {
+		fprintf(stderr, "preload_debug: open(\"%s\", ...) => \"%s\"\n", pathname, path);
+	}
+
+	return orig_open(path, flags);
+}
+
+int open64(const char *pathname, int flags, ...)
+{
+	const char *path;
+	char buffer[PATH_MAX];
+	open64_func_t orig_open64;
+
+	orig_open64 = (open64_func_t)dlsym(RTLD_NEXT, "open64");
+	path = redirect(pathname, buffer);
+	if (path != pathname && getenv("PRELOAD_DEBUG")) {
+		fprintf(stderr, "preload_debug: open64(\"%s\", ...) => \"%s\"\n", pathname, path);
+	}
+
+	return orig_open64(path, flags);
+}
+
+int openat(int dirfd, const char *pathname, int flags, ...)
+{
+	const char *path;
+	char buffer[PATH_MAX];
+	openat_func_t orig_openat;
+
+	orig_openat = (openat_func_t)dlsym(RTLD_NEXT, "openat");
+	path = redirect(pathname, buffer);
+	if (path != pathname && getenv("PRELOAD_DEBUG")) {
+		fprintf(stderr, "preload_debug: openat(%d, \"%s\", %#x) => \"%s\"\n", dirfd, pathname, flags, path);
+	}
+
+	return orig_openat(dirfd, path, flags);
+}
+
+int openat64(int dirfd, const char *pathname, int flags, ...)
+{
+	const char *path;
+	char buffer[PATH_MAX];
+	openat64_func_t orig_openat64;
+
+	orig_openat64 = (openat64_func_t)dlsym(RTLD_NEXT, "openat64");
+	path = redirect(pathname, buffer);
+	if (path != pathname && getenv("PRELOAD_DEBUG")) {
+		fprintf(stderr, "preload_debug: openat64(%d, \"%s\", %#x) => \"%s\"\n", dirfd, pathname, flags, path);
+	}
+
+	return orig_openat64(dirfd, path, flags);
+}
+
+/*
+ * Notes about "stat".
+ *
+ * The stat function is special, at least in glibc, in that it cannot be
+ * directly overridden by LD_PRELOAD, due to it being inline wrapper around
+ * __xstat. The __xstat functions take one extra parameter, a version number,
+ * to indicate what "struct stat" should look like. This trick allows changing
+ * the contents of mode_t without changing the shared library major number. See
+ * sys/stat.h header for more info.
+ */
+int __xstat(int vers, const char *pathname, struct stat *buf)
+{
+	const char *path;
+	char buffer[PATH_MAX];
+	xstat_func_t orig_xstat;
+
+	orig_xstat = (xstat_func_t)dlsym(RTLD_NEXT, "__xstat");
+	path = redirect(pathname, buffer);
+	if (path != pathname && getenv("PRELOAD_DEBUG")) {
+		fprintf(stderr, "preload_debug: (__x)stat(\"%s\", ...) => \"%s\"\n", pathname, path);
+	}
+
+	return orig_xstat(vers, path, buf);
+}
+
+int __xstat64(int vers, const char *pathname, struct stat64 *buf)
+{
+	const char *path;
+	char buffer[PATH_MAX];
+	xstat64_func_t orig_xstat64;
+
+	orig_xstat64 = (xstat64_func_t)dlsym(RTLD_NEXT, "__xstat64");
+	path = redirect(pathname, buffer);
+	if (path != pathname && getenv("PRELOAD_DEBUG")) {
+		fprintf(stderr, "preload_debug: (__x)stat64(\"%s\", ...) => \"%s\"\n", pathname, path);
+	}
+
+	return orig_xstat64(vers, path, buf);
+}
+
+int access(const char *pathname, int mode)
+{
+	const char *path;
+	char buffer[PATH_MAX];
+	access_func_t orig_access;
+
+	orig_access = (access_func_t)dlsym(RTLD_NEXT, "access");
+	path = redirect(pathname, buffer);
+	if (path != pathname && getenv("PRELOAD_DEBUG")) {
+		fprintf(stderr, "preload_debug: access(\"%s\", ...) => \"%s\"\n", pathname, path);
+	}
+
+	return orig_access(path, mode);
+}
+
+int faccessat(int dirfd, const char *pathname, int mode, int flags)
+{
+	const char *path;
+	char buffer[PATH_MAX];
+	faccessat_func_t orig_faccessat;
+
+	orig_faccessat = (faccessat_func_t)dlsym(RTLD_NEXT, "faccessat");
+	path = redirect(pathname, buffer);
+	if (path != pathname && getenv("PRELOAD_DEBUG")) {
+		fprintf(stderr, "preload_debug: faccessat(\"%s\", ...) => \"%s\"\n", pathname, path);
+	}
+
+	return orig_faccessat(dirfd, path, mode, flags);
+}
+
+int unlink(const char *pathname)
+{
+	const char *path;
+	char buffer[PATH_MAX];
+	unlink_func_t orig_unlink;
+
+	orig_unlink = (unlink_func_t)dlsym(RTLD_NEXT, "unlink");
+	path = redirect(pathname, buffer);
+	if (path != pathname && getenv("PRELOAD_DEBUG")) {
+		fprintf(stderr, "preload_debug: unlink(\"%s\") => \"%s\"\n", pathname, path);
+	}
+
+	return orig_unlink(path);
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/sccache/default.nix b/nixpkgs/pkgs/development/tools/misc/sccache/default.nix
new file mode 100644
index 000000000000..998abe112a6f
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/sccache/default.nix
@@ -0,0 +1,33 @@
+{ stdenv, fetchFromGitHub, cargo, rustc, rustPlatform, pkgconfig, glib, openssl, darwin }:
+
+rustPlatform.buildRustPackage rec {
+  version = "0.2.11";
+  pname = "sccache";
+
+  src = fetchFromGitHub {
+    owner = "mozilla";
+    repo = "sccache";
+    rev = version;
+    sha256 = "0084ddvzjgdpkwqc38kvzaz8n6av9ml3qqlkjma70hsis8w8gqjz";
+  };
+  cargoSha256 = "1bkglgrasyjyzjj9mwm32d3g3mg5yv74jj3zl7jf20dlq3rg3fh6";
+
+  cargoBuildFlags = [ "--features=all" ];
+  nativeBuildInputs = [
+    pkgconfig cargo rustc
+  ];
+  buildInputs = [
+    openssl
+  ] ++ stdenv.lib.optional stdenv.isDarwin darwin.apple_sdk.frameworks.Security;
+  # Tests fail because of client server setup which is not possible inside the pure environment,
+  # see https://github.com/mozilla/sccache/issues/460
+  checkPhase = null;
+
+  meta = with stdenv.lib; {
+    description = "Ccache with Cloud Storage";
+    homepage = https://github.com/mozilla/sccache;
+    maintainers = with maintainers; [ doronbehar ];
+    license = licenses.asl20;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/semver-tool/default.nix b/nixpkgs/pkgs/development/tools/misc/semver-tool/default.nix
new file mode 100644
index 000000000000..879346a2b796
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/semver-tool/default.nix
@@ -0,0 +1,32 @@
+{ stdenv, lib, fetchFromGitHub }:
+
+stdenv.mkDerivation rec {
+  pname = "semver-tool";
+  version = "2.1.0";
+
+  src = fetchFromGitHub {
+    owner = "fsaintjacques";
+    repo = pname;
+    rev = version;
+    sha256 = "0lpwsa86qb5w6vbnsn892nb3qpxxx9ifxch8pw3ahzx2dqhdgnrr";
+  };
+
+  dontBuild = true; # otherwise we try to 'make' which fails.
+
+  installPhase = ''
+    runHook preInstall
+
+    mkdir -p $out/bin
+    install src/semver $out/bin
+
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    homepage = https://github.com/fsaintjacques/semver-tool;
+    description = "semver bash implementation";
+    license = licenses.gpl3Plus;
+    platforms = platforms.unix;
+    maintainers = [ maintainers.qyliss ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/sipp/default.nix b/nixpkgs/pkgs/development/tools/misc/sipp/default.nix
new file mode 100644
index 000000000000..004975f10d8a
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/sipp/default.nix
@@ -0,0 +1,41 @@
+{stdenv, fetchFromGitHub, autoreconfHook, ncurses, libpcap }:
+
+stdenv.mkDerivation rec {
+  version = "3.5.1";
+
+  pname = "sipp";
+
+  src = fetchFromGitHub {
+    owner = "SIPp";
+    repo = "sipp";
+    rev = "v${version}";
+    sha256 = "179a1fvqyk3jpxbi28l1xfw22cw9vgvxrn19w5f38w74x0jwqg5k";
+  };
+
+  patchPhase = ''
+    sed -i "s@pcap/\(.*\).pcap@$out/share/pcap/\1.pcap@g" src/scenario.cpp
+    sed -i -e "s|AC_CHECK_LIB(curses|AC_CHECK_LIB(ncurses|" configure.ac
+    echo "#define SIPP_VERSION \"v${version}\"" > include/version.h
+  '';
+
+  configureFlags = [
+    "--with-pcap"
+  ];
+
+  postInstall = ''
+    mkdir -pv $out/share/pcap
+    cp pcap/* $out/share/pcap
+  '';
+
+  buildInputs = [ncurses libpcap];
+
+  nativeBuildInputs = [ autoreconfHook ];
+
+  meta = with stdenv.lib; {
+    homepage = http://sipp.sf.net;
+    description = "The SIPp testing tool";
+    license = licenses.gpl3;
+    platforms = platforms.unix;
+  };
+}
+
diff --git a/nixpkgs/pkgs/development/tools/misc/sloccount/default.nix b/nixpkgs/pkgs/development/tools/misc/sloccount/default.nix
new file mode 100644
index 000000000000..965f0ed096cd
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/sloccount/default.nix
@@ -0,0 +1,72 @@
+{ fetchurl, stdenv, perl, makeWrapper }:
+
+stdenv.mkDerivation rec {
+  name = "sloccount-2.26";
+
+  src = fetchurl {
+    url = "https://www.dwheeler.com/sloccount/${name}.tar.gz";
+    sha256 = "0ayiwfjdh1946asah861ah9269s5xkc8p5fv1wnxs9znyaxs4zzs";
+  };
+
+  nativeBuildInputs = [ makeWrapper ];
+  buildInputs = [ perl ];
+
+  # Make sure the Flex-generated files are newer than the `.l' files, so that
+  # Flex isn't needed to recompile them.
+  patchPhase = ''
+    for file in *
+    do
+      if grep -q /usr/bin/perl "$file"
+      then
+          echo "patching \`$file'..."
+          substituteInPlace "$file" --replace \
+            "/usr/bin/perl" "${perl}/bin/perl"
+      fi
+    done
+
+    for file in *.l
+    do
+      touch "$(echo $file | sed -es'/\.l$/.c/g')"
+    done
+  '';
+
+  makeFlags = "PREFIX=$(out) CC=cc";
+
+  doCheck = true;
+  checkPhase = ''HOME="$TMPDIR" PATH="$PWD:$PATH" make test'';
+
+  preInstall = ''
+    mkdir -p "$out/bin"
+    mkdir -p "$out/share/man/man1"
+    mkdir -p "$out/share/doc"
+  '';
+
+  postInstall = ''
+    for w in "$out/bin"/*; do
+      isScript "$w" || continue
+      wrapProgram "$w" --prefix PATH : "$out/bin"
+    done
+    '';
+
+  meta = {
+    description = "Set of tools for counting physical Source Lines of Code (SLOC)";
+
+    longDescription = ''
+      This is the home page of "SLOCCount", a set of tools for
+      counting physical Source Lines of Code (SLOC) in a large number
+      of languages of a potentially large set of programs.  This suite
+      of tools was used in my papers More than a Gigabuck: Estimating
+      GNU/Linux's Size and Estimating Linux's Size to measure the SLOC
+      of entire GNU/Linux distributions, and my essay Linux Kernel
+      2.6: It's Worth More!  Others have measured Debian GNU/Linux and
+      the Perl CPAN library using this tool suite.
+    '';
+
+    license = stdenv.lib.licenses.gpl2Plus;
+
+    homepage = https://www.dwheeler.com/sloccount/;
+
+    maintainers = [ ];
+    platforms = stdenv.lib.platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/sqitch/default.nix b/nixpkgs/pkgs/development/tools/misc/sqitch/default.nix
new file mode 100644
index 000000000000..a077367622eb
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/sqitch/default.nix
@@ -0,0 +1,28 @@
+{ name, stdenv, perl, makeWrapper, sqitchModule, databaseModule }:
+
+stdenv.mkDerivation {
+  name = "${name}-${sqitchModule.version}";
+
+  buildInputs = [ perl makeWrapper sqitchModule databaseModule ];
+
+  src = sqitchModule;
+  dontBuild = true;
+
+  installPhase = ''
+    mkdir -p $out/bin
+    for d in bin/sqitch etc lib share ; do
+      # make sure dest alreay exists before symlink
+      # this prevents installing a broken link into the path
+      if [ -e ${sqitchModule}/$d ]; then
+        ln -s ${sqitchModule}/$d $out/$d
+      fi
+    done
+  '';
+  dontStrip = true;
+  postFixup = "wrapProgram $out/bin/sqitch --prefix PERL5LIB : $PERL5LIB";
+
+  meta = {
+    platforms = stdenv.lib.platforms.unix;
+    inherit (sqitchModule.meta) license;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/srecord/default.nix b/nixpkgs/pkgs/development/tools/misc/srecord/default.nix
new file mode 100644
index 000000000000..a76a180741ef
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/srecord/default.nix
@@ -0,0 +1,24 @@
+{ stdenv, fetchurl, boost, libtool, groff, ghostscript, libgcrypt ? null }:
+
+stdenv.mkDerivation rec {
+  name = "srecord-1.64";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/srecord/${name}.tar.gz";
+    sha256 = "1qk75q0k5vzmm3932q9hqz2gp8n9rrdfjacsswxc02656f3l3929";
+  };
+
+  buildInputs = [ boost libtool groff ghostscript libgcrypt ];
+
+  configureFlags = [
+    (stdenv.lib.optional (libgcrypt == null) "--without-gcrypt")
+  ];
+
+  meta = with stdenv.lib; {
+    description = "Collection of powerful tools for manipulating EPROM load files";
+    homepage = http://srecord.sourceforge.net/;
+    license = licenses.gpl3Plus;
+    maintainers = [ maintainers.bjornfor ];
+    platforms = stdenv.lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/stlink/default.nix b/nixpkgs/pkgs/development/tools/misc/stlink/default.nix
new file mode 100644
index 000000000000..98c400d52851
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/stlink/default.nix
@@ -0,0 +1,36 @@
+{ stdenv, fetchFromGitHub, cmake, libusb1 }:
+
+# IMPORTANT: You need permissions to access the stlink usb devices. 
+# Add services.udev.pkgs = [ pkgs.stlink ] to your configuration.nix
+
+let
+  version = "1.5.1";
+in
+stdenv.mkDerivation {
+  pname = "stlink";
+  inherit version;
+
+  src = fetchFromGitHub {
+    owner = "texane";
+    repo = "stlink";
+    rev = "v1.5.1";
+    sha256 = "1d5gxiqpsm8fc105cxlp27af9fk339fap5h6nay21x5a7n61jgyc";
+  };
+
+  buildInputs = [ cmake libusb1 ];
+  patchPhase = ''
+    sed -i 's@/etc/udev/rules.d@$ENV{out}/etc/udev/rules.d@' CMakeLists.txt
+    sed -i 's@/etc/modprobe.d@$ENV{out}/etc/modprobe.d@' CMakeLists.txt
+  '';
+  preInstall = ''
+    mkdir -p $out/etc/udev/rules.d
+    mkdir -p $out/etc/modprobe.d
+  '';
+
+  meta = with stdenv.lib; {
+    description = "In-circuit debug and programming for ST-Link devices";
+    license = licenses.bsd3;
+    platforms = platforms.unix;
+    maintainers = [ maintainers.bjornfor maintainers.rongcuid ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/stm32flash/default.nix b/nixpkgs/pkgs/development/tools/misc/stm32flash/default.nix
new file mode 100644
index 000000000000..553ded815ef8
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/stm32flash/default.nix
@@ -0,0 +1,26 @@
+{ stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  name = "stm32flash-0.5";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/stm32flash/${name}.tar.gz";
+    sha256 = "01p396daqw3zh6nijffbfbwyqza33bi2k4q3m5yjzs02xwi99alp";
+  };
+
+  buildFlags = [ "CC=cc" ];
+
+  installPhase = ''
+    # Manually copy, make install copies to /usr/local/bin
+    mkdir -pv $out/bin/
+    cp stm32flash $out/bin/
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Open source flash program for the STM32 ARM processors using the ST bootloader";
+    homepage = https://sourceforge.net/projects/stm32flash/;
+    license = stdenv.lib.licenses.gpl2;
+    platforms = platforms.all; # Should work on all platforms
+    maintainers = with maintainers; [ the-kenny elitak ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/strace/default.nix b/nixpkgs/pkgs/development/tools/misc/strace/default.nix
new file mode 100644
index 000000000000..c809437f6fb9
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/strace/default.nix
@@ -0,0 +1,30 @@
+{ stdenv, fetchurl, perl, libunwind, buildPackages }:
+
+stdenv.mkDerivation rec {
+  pname = "strace";
+  version = "5.2";
+
+  src = fetchurl {
+    url = "https://strace.io/files/${version}/${pname}-${version}.tar.xz";
+    sha256 = "1li49i75wrdw91hchyyd8spnzfcmxcfyfb5g9zbaza89aq4bq4ym";
+  };
+
+  depsBuildBuild = [ buildPackages.stdenv.cc ];
+  nativeBuildInputs = [ perl ];
+
+  buildInputs = stdenv.lib.optional libunwind.supportsHost libunwind; # support -k
+
+  configureFlags = stdenv.lib.optional (!stdenv.hostPlatform.isx86) "--enable-mpers=check";
+
+  # fails 1 out of 523 tests with
+  # "strace-k.test: failed test: ../../strace -e getpid -k ../stack-fcall output mismatch"
+  doCheck = false;
+
+  meta = with stdenv.lib; {
+    homepage = https://strace.io/;
+    description = "A system call tracer for Linux";
+    license =  with licenses; [ lgpl21Plus gpl2Plus ]; # gpl2Plus is for the test suite
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ globin ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/swig/2.x.nix b/nixpkgs/pkgs/development/tools/misc/swig/2.x.nix
new file mode 100644
index 000000000000..80cfdc8b196d
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/swig/2.x.nix
@@ -0,0 +1,35 @@
+{ stdenv, fetchFromGitHub, autoconf, automake, libtool, bison, pcre }:
+
+stdenv.mkDerivation rec {
+  pname = "swig";
+  version = "2.0.12";
+
+  src = fetchFromGitHub {
+    owner = "swig";
+    repo = "swig";
+    rev = "rel-${version}";
+    sha256 = "0khm9gh5pczfcihr0pbicaicc4v9kjm5ip2alvkhmbb3ga6njkcm";
+  };
+
+  nativeBuildInputs = [ autoconf automake libtool bison ];
+  buildInputs = [ pcre ];
+
+  configureFlags = [ "--without-tcl" ];
+
+  # Disable ccache documentation as it needs yodl
+  postPatch = ''
+    sed -i '/man1/d' CCache/Makefile.in
+  '';
+
+  preConfigure = ''
+    ./autogen.sh
+  '';
+
+  meta = with stdenv.lib; {
+    description = "SWIG, an interface compiler that connects C/C++ code to higher-level languages";
+    homepage = http://swig.org/;
+    # Different types of licenses available: http://www.swig.org/Release/LICENSE .
+    license = licenses.gpl3Plus;
+    platforms = with platforms; linux ++ darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/swig/3.x.nix b/nixpkgs/pkgs/development/tools/misc/swig/3.x.nix
new file mode 100644
index 000000000000..262afe4f1891
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/swig/3.x.nix
@@ -0,0 +1,36 @@
+{ stdenv, fetchFromGitHub, autoconf, automake, libtool, bison, pcre }:
+
+stdenv.mkDerivation rec {
+  pname = "swig";
+  version = "3.0.12";
+
+  src = fetchFromGitHub {
+    owner = "swig";
+    repo = "swig";
+    rev = "rel-${version}";
+    sha256 = "1wyffskbkzj5zyhjnnpip80xzsjcr3p0q5486z3wdwabnysnhn8n";
+  };
+
+  PCRE_CONFIG = "${pcre.dev}/bin/pcre-config";
+  nativeBuildInputs = [ autoconf automake libtool bison ];
+  buildInputs = [ pcre ];
+
+  configureFlags = [ "--without-tcl" ];
+
+  # Disable ccache documentation as it needs yodl
+  postPatch = ''
+    sed -i '/man1/d' CCache/Makefile.in
+  '';
+
+  preConfigure = ''
+    ./autogen.sh
+  '';
+
+  meta = with stdenv.lib; {
+    description = "SWIG, an interface compiler that connects C/C++ code to higher-level languages";
+    homepage = http://swig.org/;
+    # Different types of licenses available: http://www.swig.org/Release/LICENSE .
+    license = licenses.gpl3Plus;
+    platforms = with platforms; linux ++ darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/swig/4.nix b/nixpkgs/pkgs/development/tools/misc/swig/4.nix
new file mode 100644
index 000000000000..68febba38134
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/swig/4.nix
@@ -0,0 +1,37 @@
+{ stdenv, fetchFromGitHub, autoconf, automake, libtool, bison, pcre }:
+
+stdenv.mkDerivation rec {
+  pname = "swig";
+  version = "4.0.0";
+
+  src = fetchFromGitHub {
+    owner = "swig";
+    repo = "swig";
+    rev = "rel-${version}";
+    sha256 = "0yx33972jd3214xr3mrap0j5clma9bvs42qz8x38dfz62xlsi78v";
+  };
+
+  PCRE_CONFIG = "${pcre.dev}/bin/pcre-config";
+  nativeBuildInputs = [ autoconf automake libtool bison ];
+  buildInputs = [ pcre ];
+
+  configureFlags = [ "--without-tcl" ];
+
+  # Disable ccache documentation as it needs yodl
+  postPatch = ''
+    sed -i '/man1/d' CCache/Makefile.in
+  '';
+
+  preConfigure = ''
+    ./autogen.sh
+  '';
+
+  meta = with stdenv.lib; {
+    description = "SWIG, an interface compiler that connects C/C++ code to higher-level languages";
+    homepage = http://swig.org/;
+    # Different types of licenses available: http://www.swig.org/Release/LICENSE .
+    license = licenses.gpl3Plus;
+    maintainers = with maintainers; [ orivej ];
+    platforms = with platforms; linux ++ darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/swig/default.nix b/nixpkgs/pkgs/development/tools/misc/swig/default.nix
new file mode 100644
index 000000000000..e74b2898498c
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/swig/default.nix
@@ -0,0 +1,26 @@
+{ stdenv, fetchurl, boost, tcl }:
+
+stdenv.mkDerivation rec {
+  pname = "swig";
+  version = "1.3.40";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/swig/${pname}-${version}.tar.gz";
+    sha256 = "02dc8g8wy75nd2is1974rl24c6mdl0ai1vszs1xpg9nd7dlv6i8r";
+  };
+
+  doCheck = !stdenv.isCygwin;
+  # 'make check' uses boost and tcl
+  buildInputs = stdenv.lib.optionals doCheck [ boost tcl ];
+
+  configureFlags = [ "--disable-ccache" ];
+
+
+  meta = with stdenv.lib; {
+    description = "SWIG, an interface compiler that connects C/C++ code to higher-level languages";
+    homepage = http://swig.org/;
+    # Different types of licenses available: http://www.swig.org/Release/LICENSE .
+    license = licenses.gpl3Plus;
+    platforms = with platforms; linux ++ darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/sysbench/default.nix b/nixpkgs/pkgs/development/tools/misc/sysbench/default.nix
new file mode 100644
index 000000000000..e2d507ab8013
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/sysbench/default.nix
@@ -0,0 +1,22 @@
+{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, vim, mysql
+, libaio }:
+
+stdenv.mkDerivation {
+  name = "sysbench-1.0.17";
+
+  nativeBuildInputs = [ autoreconfHook pkgconfig ];
+  buildInputs = [ vim mysql.connector-c libaio ];
+
+  src = fetchFromGitHub {
+    owner = "akopytov";
+    repo = "sysbench";
+    rev = "1.0.17";
+    sha256 = "02i9knvp0bjw6ri848xxiy2dbww2xv70nah9yn67a6zgw617hwa6";
+  };
+
+  meta = {
+    description = "Modular, cross-platform and multi-threaded benchmark tool";
+    license = stdenv.lib.licenses.gpl2;
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/tcptrack/default.nix b/nixpkgs/pkgs/development/tools/misc/tcptrack/default.nix
new file mode 100644
index 000000000000..9872c91ac4ba
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/tcptrack/default.nix
@@ -0,0 +1,25 @@
+{ stdenv, fetchFromGitHub, ncurses, libpcap }:
+
+stdenv.mkDerivation rec {
+  pname = "tcptrack";
+  version = "1.4.3";
+
+  src = fetchFromGitHub {
+    owner = "bchretien";
+    repo = "tcptrack";
+    rev = "d05fe08154ff1e46578e92be49e4cfa2c6543283";
+    sha256 = "08lh3l67wn4kq9q0nfspc7rj0jvp9dzwjgxpvqliwcif8cy5mi45";
+  };
+
+  buildInputs = [ ncurses libpcap ];
+
+  NIX_CFLAGS_COMPILE = "-Wno-error=cpp";
+
+  meta = with stdenv.lib; {
+    inherit (src.meta) homepage;
+    description = "libpcap based program for live TCP connection monitoring";
+    license = licenses.lgpl21;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.bjornfor maintainers.vrthra ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/teensy-loader-cli/default.nix b/nixpkgs/pkgs/development/tools/misc/teensy-loader-cli/default.nix
new file mode 100644
index 000000000000..2975d64113e8
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/teensy-loader-cli/default.nix
@@ -0,0 +1,27 @@
+{ stdenv, libusb, fetchgit }:
+let
+  version = "2.1";
+in
+stdenv.mkDerivation {
+  pname = "teensy-loader-cli";
+  inherit version;
+  src = fetchgit {
+    url = "git://github.com/PaulStoffregen/teensy_loader_cli.git";
+    rev = "f5b6d7aafda9a8b014b4bb08660833ca45c136d2";
+    sha256 = "1a663bv3lvm7bsf2wcaj2c0vpmniak7w5hwix5qgz608bvm2v781";
+  };
+
+  buildInputs = [ libusb ];
+
+  installPhase = ''
+    install -Dm755 teensy_loader_cli $out/bin/teensy-loader-cli
+  '';
+
+  meta = with stdenv.lib; {
+    license = licenses.gpl3;
+    description = "Firmware uploader for the Teensy microcontroller boards";
+    homepage = https://www.pjrc.com/teensy/;
+    maintainers = with maintainers; [ the-kenny ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/terracognita/default.nix b/nixpkgs/pkgs/development/tools/misc/terracognita/default.nix
new file mode 100644
index 000000000000..832a2285569d
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/terracognita/default.nix
@@ -0,0 +1,22 @@
+{ lib, buildGoModule, fetchFromGitHub }:
+
+buildGoModule rec {
+  pname = "terracognita";
+  version = "0.1.6";
+
+  src = fetchFromGitHub {
+    owner = "cycloidio";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "0ljh9dyn919k5f0yaca5an2vczj8cd5cb6qb4i5bdgmlh3wijiag";
+  };
+
+  modSha256 = "1ssz6rhdqma79x75qsxpa9is5zw1nlc0rv1h23dfsk8vla3p84ml";
+
+  meta = with lib; {
+    description = "Reads from existing Cloud Providers (reverse Terraform) and generates your infrastructure as code on Terraform configuration";
+    homepage = "https://github.com/cycloidio/terracognita";
+    license = licenses.mit;
+    maintainers = [ maintainers.marsam ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/terraform-lsp/default.nix b/nixpkgs/pkgs/development/tools/misc/terraform-lsp/default.nix
new file mode 100644
index 000000000000..333e413a4c49
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/terraform-lsp/default.nix
@@ -0,0 +1,22 @@
+{ lib, buildGoModule, fetchFromGitHub }:
+
+buildGoModule rec {
+  pname = "terraform-lsp";
+  version = "0.0.6";
+
+  src = fetchFromGitHub {
+    owner = "juliosueiras";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "1nalypaw64kdv5zmmb0xgkajhs2gf71ivbxvgwpgvlv2lyidawx5";
+  };
+
+  modSha256 = "1mb3169vdlv4h10k15pg88s48s2b6y7v5frk9j9ahg52grygcqb2";
+
+  meta = with lib; {
+    description = "Language Server Protocol for Terraform";
+    homepage = "https://github.com/juliosueiras/terraform-lsp";
+    license = licenses.mit;
+    maintainers = [ maintainers.marsam ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/tet/default.nix b/nixpkgs/pkgs/development/tools/misc/tet/default.nix
new file mode 100644
index 000000000000..fb38d096ab43
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/tet/default.nix
@@ -0,0 +1,29 @@
+{ fetchurl, stdenv }:
+
+stdenv.mkDerivation ({
+  version = "3.8";
+  pname = "tet";
+
+  src = fetchurl {
+    url = http://tetworks.opengroup.org/downloads/38/software/Sources/3.8/tet3.8-src.tar.gz ;
+    sha256 = "1j57hv56df38w249l595b8rsgmsyvjkbysai03a9724gax5jl9av" ;
+  };
+
+  buildInputs = [ ];
+
+  patchPhase = ''chmod +x configure'';
+
+  configurePhase = ''./configure -t lite'';
+
+  buildPhase = ''cd src; make; cd -'';
+
+  installPhase = ''cd src; make install; cd -; cp -vr $PWD $out'';
+
+  meta = {
+    description = "The Test Environment Toolkit is used in test applications like The Open Group's UNIX Certification program and the Free Standards Group's LSB Certification program";
+    homepage = http://tetworks.opengroup.org/Products/tet.htm ;
+    license = stdenv.lib.licenses.artistic1;
+    platforms = stdenv.lib.platforms.unix;
+    maintainers = [ ];
+  };
+})
diff --git a/nixpkgs/pkgs/development/tools/misc/texi2html/default.nix b/nixpkgs/pkgs/development/tools/misc/texi2html/default.nix
new file mode 100644
index 000000000000..247733b81baf
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/texi2html/default.nix
@@ -0,0 +1,27 @@
+{ stdenv, fetchurl, perl, gettext }:
+
+stdenv.mkDerivation rec {
+  pname = "texi2html";
+  version = "5.0";
+
+  src = fetchurl {
+    url = "mirror://savannah/texi2html/${pname}-${version}.tar.bz2";
+    sha256 = "1yprv64vrlcbksqv25asplnjg07mbq38lfclp1m5lj8cw878pag8";
+  };
+
+  nativeBuildInputs = [ gettext ];
+  buildInputs = [ perl ];
+
+  preBuild = ''
+    substituteInPlace separated_to_hash.pl \
+      --replace "/usr/bin/perl" "${perl}/bin/perl"
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Perl script which converts Texinfo source files to HTML output";
+    homepage = https://www.nongnu.org/texi2html/;
+    license = licenses.gpl2;
+    maintainers = [ maintainers.marcweber ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/texinfo/4.13a.nix b/nixpkgs/pkgs/development/tools/misc/texinfo/4.13a.nix
new file mode 100644
index 000000000000..5f4478bd4fbb
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/texinfo/4.13a.nix
@@ -0,0 +1,19 @@
+{ stdenv, fetchurl, texinfo, ncurses, lzma }:
+
+stdenv.mkDerivation rec {
+  pname = "texinfo";
+  version = "4.13a";
+
+  src = fetchurl {
+    url = "mirror://gnu/texinfo/${pname}-${version}.tar.lzma";
+    sha256 = "1rf9ckpqwixj65bw469i634897xwlgkm5i9g2hv3avl6mv7b0a3d";
+  };
+
+  buildInputs = [ ncurses ];
+  nativeBuildInputs = [ lzma ];
+
+  # Disabled because we don't have zdiff in the stdenv bootstrap.
+  #doCheck = true;
+
+  meta = texinfo.meta // { branch = version; };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/texinfo/5.2.nix b/nixpkgs/pkgs/development/tools/misc/texinfo/5.2.nix
new file mode 100644
index 000000000000..d395494984d5
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/texinfo/5.2.nix
@@ -0,0 +1,4 @@
+import ./common.nix {
+  version = "5.2";
+  sha256 = "1njfwh2z34r2c4r0iqa7v24wmjzvsfyz4vplzry8ln3479lfywal";
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/texinfo/6.5.nix b/nixpkgs/pkgs/development/tools/misc/texinfo/6.5.nix
new file mode 100644
index 000000000000..34596f306581
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/texinfo/6.5.nix
@@ -0,0 +1,4 @@
+import ./common.nix {
+  version = "6.5";
+  sha256 = "0qjzvbvnv9003xdrcpi3jp7y68j4hq2ciw9frh2hghh698zlnxvp";
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/texinfo/common.nix b/nixpkgs/pkgs/development/tools/misc/texinfo/common.nix
new file mode 100644
index 000000000000..7741f2d4ffbc
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/texinfo/common.nix
@@ -0,0 +1,68 @@
+{ version, sha256 }:
+
+{ stdenv, buildPackages, fetchurl, perl, xz
+
+# we are a dependency of gcc, this simplifies bootstraping
+, interactive ? false, ncurses, procps
+}:
+
+with stdenv.lib;
+
+stdenv.mkDerivation {
+  name = "texinfo-${optionalString interactive "interactive-"}${version}";
+  inherit version;
+
+  src = fetchurl {
+    url = "mirror://gnu/texinfo/texinfo-${version}.tar.xz";
+    inherit sha256;
+  };
+
+  patches = optional (version == "6.5") ./perl.patch;
+
+  # We need a native compiler to build perl XS extensions
+  # when cross-compiling.
+  depsBuildBuild = [ buildPackages.stdenv.cc perl ];
+
+  buildInputs = [ xz.bin ]
+    ++ optionals stdenv.isSunOS [ libiconv gawk ]
+    ++ optional interactive ncurses;
+
+  configureFlags = [ "PERL=${buildPackages.perl}/bin/perl" ]
+    ++ stdenv.lib.optional stdenv.isSunOS "AWK=${gawk}/bin/awk";
+
+  preInstall = ''
+    installFlags="TEXMF=$out/texmf-dist";
+    installTargets="install install-tex";
+  '';
+
+  checkInputs = [ procps ];
+
+  doCheck = interactive
+    && !stdenv.isDarwin
+    && !stdenv.isSunOS; # flaky
+
+  meta = {
+    homepage = https://www.gnu.org/software/texinfo/;
+    description = "The GNU documentation system";
+    license = licenses.gpl3Plus;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ vrthra oxij ];
+
+    longDescription = ''
+      Texinfo is the official documentation format of the GNU project.
+      It was invented by Richard Stallman and Bob Chassell many years
+      ago, loosely based on Brian Reid's Scribe and other formatting
+      languages of the time.  It is used by many non-GNU projects as
+      well.
+
+      Texinfo uses a single source file to produce output in a number
+      of formats, both online and printed (dvi, html, info, pdf, xml,
+      etc.).  This means that instead of writing different documents
+      for online information and another for a printed manual, you
+      need write only one document.  And when the work is revised, you
+      need revise only that one document.  The Texinfo system is
+      well-integrated with GNU Emacs.
+    '';
+    branch = version;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/texinfo/perl.patch b/nixpkgs/pkgs/development/tools/misc/texinfo/perl.patch
new file mode 100644
index 000000000000..e651b37371c7
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/texinfo/perl.patch
@@ -0,0 +1,43 @@
+Adapted from http://svn.savannah.gnu.org/viewvc/texinfo/
+Author: gavin
+--- trunk/tp/Texinfo/Parser.pm  2018-06-04 19:51:36 UTC (rev 8006)
++++ trunk/tp/Texinfo/Parser.pm  2018-07-13 15:31:28 UTC (rev 8007)
+@@ -5531,11 +5531,11 @@
+     }
+   } elsif ($command eq 'clickstyle') {
+     # REMACRO
+-    if ($line =~ /^\s+@([[:alnum:]][[:alnum:]\-]*)({})?\s*/) {
++    if ($line =~ /^\s+@([[:alnum:]][[:alnum:]\-]*)(\{\})?\s*/) {
+       $args = ['@'.$1];
+       $self->{'clickstyle'} = $1;
+       $remaining = $line;
+-      $remaining =~ s/^\s+@([[:alnum:]][[:alnum:]\-]*)({})?\s*(\@(c|comment)((\@|\s+).*)?)?//;
++      $remaining =~ s/^\s+@([[:alnum:]][[:alnum:]\-]*)(\{\})?\s*(\@(c|comment)((\@|\s+).*)?)?//;
+       $has_comment = 1 if (defined($4));
+     } else {
+       $self->line_error (sprintf($self->__(
+--- trunk/tp/Texinfo/Convert/XSParagraph/xspara.c       2018-07-13 15:31:28 UTC (rev 8007)
++++ trunk/tp/Texinfo/Convert/XSParagraph/xspara.c       2018-07-13 15:39:29 UTC (rev 8008)
+@@ -248,6 +248,11 @@
+ 
+   dTHX;
+ 
++#if PERL_VERSION > 27 || (PERL_VERSION == 27 && PERL_SUBVERSION > 8)
++  /* needed due to thread-safe locale handling in newer perls */
++  switch_to_global_locale();
++#endif
++
+   if (setlocale (LC_CTYPE, "en_US.UTF-8")
+       || setlocale (LC_CTYPE, "en_US.utf8"))
+     goto success;
+@@ -320,6 +325,10 @@
+     {
+ success: ;
+       free (utf8_locale);
++#if PERL_VERSION > 27 || (PERL_VERSION == 27 && PERL_SUBVERSION > 8)
++      /* needed due to thread-safe locale handling in newer perls */
++      sync_locale();
++#endif
+       /*
+       fprintf (stderr, "tried to set LC_CTYPE to UTF-8.\n");
+       fprintf (stderr, "character encoding is: %s\n",
diff --git a/nixpkgs/pkgs/development/tools/misc/tie/default.nix b/nixpkgs/pkgs/development/tools/misc/tie/default.nix
new file mode 100644
index 000000000000..5e40152df8df
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/tie/default.nix
@@ -0,0 +1,28 @@
+{ stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "tie";
+  version = "2.4";
+
+  src = fetchurl {
+    url = "http://mirrors.ctan.org/web/tie/${pname}-${version}.tar.gz";
+    sha256 = "1m5952kdfffiz33p1jw0wv7dh272mmw28mpxw9v7lkb352zv4xsj";
+  };
+
+  buildPhase = ''
+    cc tie.c -o tie
+  '';
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp tie $out/bin
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = https://www.ctan.org/tex-archive/web/tie;
+    description = "Allow multiple web change files";
+    platforms = with platforms; unix;
+    maintainers = with maintainers; [ vrthra ];
+    license = licenses.abstyles;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/tinyprog/default.nix b/nixpkgs/pkgs/development/tools/misc/tinyprog/default.nix
new file mode 100644
index 000000000000..10d067e2c618
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/tinyprog/default.nix
@@ -0,0 +1,42 @@
+{ lib
+, python3Packages
+, fetchFromGitHub
+}:
+
+with python3Packages; buildPythonApplication rec {
+  pname = "tinyprog";
+  # `python setup.py --version` from repo checkout
+  version = "1.0.24.dev99+ga77f828";
+
+  src = fetchFromGitHub {
+    owner = "tinyfpga";
+    repo = "TinyFPGA-Bootloader";
+    rev = "a77f828d3d6ae077e323ec96fc3925efab5aa9d7";
+    sha256 = "0jg47q0n1qkdrzri2q6n9a7czicj0qk58asz0xhzkajx1k9z3g5q";
+  };
+
+  sourceRoot = "source/programmer";
+
+  propagatedBuildInputs = [
+    pyserial
+    jsonmerge
+    intelhex
+    tqdm
+    six
+    packaging
+    pyusb
+  ];
+
+  nativeBuildInputs = [ setuptools_scm ];
+
+  preBuild = ''
+    export SETUPTOOLS_SCM_PRETEND_VERSION="${version}"
+  '';
+
+  meta = with lib; {
+    homepage = https://github.com/tinyfpga/TinyFPGA-Bootloader/tree/master/programmer;
+    description = "Programmer for FPGA boards using the TinyFPGA USB Bootloader";
+    maintainers = with maintainers; [ emily ];
+    license = licenses.asl20;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/tokei/Cargo.lock.patch b/nixpkgs/pkgs/development/tools/misc/tokei/Cargo.lock.patch
new file mode 100644
index 000000000000..46bd80a218da
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/tokei/Cargo.lock.patch
@@ -0,0 +1,13 @@
+diff --git a/Cargo.lock b/Cargo.lock
+index db09bc4..1e4892d 100644
+--- a/Cargo.lock
++++ b/Cargo.lock
+@@ -961,7 +961,7 @@ dependencies = [
+ 
+ [[package]]
+ name = "tokei"
+-version = "10.0.0"
++version = "10.0.1"
+ dependencies = [
+  "clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)",
+  "dirs 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
diff --git a/nixpkgs/pkgs/development/tools/misc/tokei/default.nix b/nixpkgs/pkgs/development/tools/misc/tokei/default.nix
new file mode 100644
index 000000000000..104aa4691ab1
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/tokei/default.nix
@@ -0,0 +1,36 @@
+{ stdenv, fetchFromGitHub, rustPlatform, libiconv, darwin }:
+
+rustPlatform.buildRustPackage rec {
+  pname = "tokei";
+  version = "10.0.1";
+
+  src = fetchFromGitHub {
+    owner = "XAMPPRocky";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "0g8p4f8g9zb1fqzzb1qi28idskahi5nldsma6rydjyrgi9gynpa0";
+  };
+
+  cargoSha256 = "0pwq1scll5ga8rw4lx97s915zvp7v171b6316cin54f2zzpbrxx5";
+
+  # Patch for v10.0.1 Cargo.lock issue
+  patches = [ ./Cargo.lock.patch ];
+
+  buildInputs = stdenv.lib.optionals stdenv.isDarwin [
+    libiconv darwin.apple_sdk.frameworks.Security
+  ];
+
+  # enable all output formats
+  cargoBuildFlags = [ "--features" "all" ];
+
+  meta = with stdenv.lib; {
+    description = "A program that allows you to count your code, quickly";
+    longDescription = ''
+      Tokei is a program that displays statistics about your code. Tokei will show number of files, total lines within those files and code, comments, and blanks grouped by language.
+    '';
+    homepage = https://github.com/XAMPPRocky/tokei;
+    license = with licenses; [ asl20 /* or */ mit ];
+    maintainers = with maintainers; [ gebner lilyball ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/travis/Gemfile b/nixpkgs/pkgs/development/tools/misc/travis/Gemfile
new file mode 100644
index 000000000000..0a470854aaf5
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/travis/Gemfile
@@ -0,0 +1,3 @@
+source "https://rubygems.org"
+
+gem "travis", "1.8.10"
diff --git a/nixpkgs/pkgs/development/tools/misc/travis/Gemfile.lock b/nixpkgs/pkgs/development/tools/misc/travis/Gemfile.lock
new file mode 100644
index 000000000000..c5ac09cb9e6a
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/travis/Gemfile.lock
@@ -0,0 +1,51 @@
+GEM
+  remote: https://rubygems.org/
+  specs:
+    addressable (2.4.0)
+    backports (3.15.0)
+    ethon (0.12.0)
+      ffi (>= 1.3.0)
+    faraday (0.15.4)
+      multipart-post (>= 1.2, < 3)
+    faraday_middleware (0.13.1)
+      faraday (>= 0.7.4, < 1.0)
+    ffi (1.11.1)
+    gh (0.15.1)
+      addressable (~> 2.4.0)
+      backports
+      faraday (~> 0.8)
+      multi_json (~> 1.0)
+      net-http-persistent (~> 2.9)
+      net-http-pipeline
+    highline (1.7.10)
+    json (2.2.0)
+    launchy (2.4.3)
+      addressable (~> 2.3)
+    multi_json (1.13.1)
+    multipart-post (2.1.1)
+    net-http-persistent (2.9.4)
+    net-http-pipeline (1.0.1)
+    pusher-client (0.6.2)
+      json
+      websocket (~> 1.0)
+    travis (1.8.10)
+      backports
+      faraday (~> 0.9)
+      faraday_middleware (~> 0.9, >= 0.9.1)
+      gh (~> 0.13)
+      highline (~> 1.6)
+      launchy (~> 2.1)
+      pusher-client (~> 0.4)
+      typhoeus (~> 0.6, >= 0.6.8)
+    typhoeus (0.8.0)
+      ethon (>= 0.8.0)
+    websocket (1.2.8)
+
+PLATFORMS
+  ruby
+
+DEPENDENCIES
+  travis (= 1.8.10)
+
+BUNDLED WITH
+   1.17.2
diff --git a/nixpkgs/pkgs/development/tools/misc/travis/default.nix b/nixpkgs/pkgs/development/tools/misc/travis/default.nix
new file mode 100644
index 000000000000..9020766fd865
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/travis/default.nix
@@ -0,0 +1,16 @@
+{ lib, bundlerEnv, ruby, bundlerUpdateScript }:
+
+bundlerEnv {
+  inherit ruby;
+  pname = "travis";
+  gemdir = ./.;
+
+  passthru.updateScript = bundlerUpdateScript "travis";
+
+  meta = with lib; {
+    description = "CLI and Ruby client library for Travis CI";
+    homepage    = https://github.com/travis-ci/travis.rb;
+    license     = licenses.mit;
+    maintainers = with maintainers; [ zimbatm nicknovitski ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/travis/gemset.nix b/nixpkgs/pkgs/development/tools/misc/travis/gemset.nix
new file mode 100644
index 000000000000..09d5d41454e5
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/travis/gemset.nix
@@ -0,0 +1,154 @@
+{
+  addressable = {
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0mpn7sbjl477h56gmxsjqb89r5s3w7vx5af994ssgc3iamvgzgvs";
+      type = "gem";
+    };
+    version = "2.4.0";
+  };
+  backports = {
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0cczfi1yp7a68bg7ipzi4lvrmi4xsi36n9a19krr4yb3nfwd8fn2";
+      type = "gem";
+    };
+    version = "3.15.0";
+  };
+  ethon = {
+    dependencies = ["ffi"];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0gggrgkcq839mamx7a8jbnp2h7x2ykfn34ixwskwb0lzx2ak17g9";
+      type = "gem";
+    };
+    version = "0.12.0";
+  };
+  faraday = {
+    dependencies = ["multipart-post"];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0s72m05jvzc1pd6cw1i289chas399q0a14xrwg4rvkdwy7bgzrh0";
+      type = "gem";
+    };
+    version = "0.15.4";
+  };
+  faraday_middleware = {
+    dependencies = ["faraday"];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1a93rs58bakqck7bcihasz66a1riy22h2zpwrpmb13gp8mw3wkmr";
+      type = "gem";
+    };
+    version = "0.13.1";
+  };
+  ffi = {
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "06mvxpjply8qh4j3fj9wh08kdzwkbnvsiysh0vrhlk5cwxzjmblh";
+      type = "gem";
+    };
+    version = "1.11.1";
+  };
+  gh = {
+    dependencies = ["addressable" "backports" "faraday" "multi_json" "net-http-persistent" "net-http-pipeline"];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0g4df0jsscq16g6f27flfmvk7p4sbq81d5mdylbz4ikqq60kywzg";
+      type = "gem";
+    };
+    version = "0.15.1";
+  };
+  highline = {
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "01ib7jp85xjc4gh4jg0wyzllm46hwv8p0w1m4c75pbgi41fps50y";
+      type = "gem";
+    };
+    version = "1.7.10";
+  };
+  json = {
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0sx97bm9by389rbzv8r1f43h06xcz8vwi3h5jv074gvparql7lcx";
+      type = "gem";
+    };
+    version = "2.2.0";
+  };
+  launchy = {
+    dependencies = ["addressable"];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "190lfbiy1vwxhbgn4nl4dcbzxvm049jwc158r2x7kq3g5khjrxa2";
+      type = "gem";
+    };
+    version = "2.4.3";
+  };
+  multi_json = {
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1rl0qy4inf1mp8mybfk56dfga0mvx97zwpmq5xmiwl5r770171nv";
+      type = "gem";
+    };
+    version = "1.13.1";
+  };
+  multipart-post = {
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1zgw9zlwh2a6i1yvhhc4a84ry1hv824d6g2iw2chs3k5aylpmpfj";
+      type = "gem";
+    };
+    version = "2.1.1";
+  };
+  net-http-persistent = {
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1y9fhaax0d9kkslyiqi1zys6cvpaqx9a0y0cywp24rpygwh4s9r4";
+      type = "gem";
+    };
+    version = "2.9.4";
+  };
+  net-http-pipeline = {
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0bxjy33yhxwsbnld8xj3zv64ibgfjn9rjpiqkyd5ipmz50pww8v9";
+      type = "gem";
+    };
+    version = "1.0.1";
+  };
+  pusher-client = {
+    dependencies = ["json" "websocket"];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "18ymxz34gmg7jff3h0nyzp5vdg5i06dbdxlrdl2nq4hf14qwj1f4";
+      type = "gem";
+    };
+    version = "0.6.2";
+  };
+  travis = {
+    dependencies = ["backports" "faraday" "faraday_middleware" "gh" "highline" "launchy" "pusher-client" "typhoeus"];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0ggdksipvnkl7s0g84l4wfpm9v70x9id8xvb9jmn3l0hhlk54dsk";
+      type = "gem";
+    };
+    version = "1.8.10";
+  };
+  typhoeus = {
+    dependencies = ["ethon"];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "03x3fxjsnhgayl4s96h0a9975awlvx2v9nmx2ba0cnliglyczdr8";
+      type = "gem";
+    };
+    version = "0.8.0";
+  };
+  websocket = {
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0f11rcn4qgffb1rq4kjfwi7di79w8840x9l74pkyif5arp0mb08x";
+      type = "gem";
+    };
+    version = "1.2.8";
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/travis/shell.nix b/nixpkgs/pkgs/development/tools/misc/travis/shell.nix
new file mode 100644
index 000000000000..ddcf493bb468
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/travis/shell.nix
@@ -0,0 +1,11 @@
+# Env to update Gemfile.lock / gemset.nix
+
+with import <nixpkgs> {};
+stdenv.mkDerivation {
+  name = "env";
+  buildInputs = [
+    ruby.devEnv
+    gnumake
+    bundix
+  ];
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/trv/default.nix b/nixpkgs/pkgs/development/tools/misc/trv/default.nix
new file mode 100644
index 000000000000..44744413138f
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/trv/default.nix
@@ -0,0 +1,37 @@
+{stdenv, fetchFromGitHub, ocaml, findlib, camlp4, core_p4, async_p4, async_unix_p4
+, re2_p4, async_extra_p4, sexplib_p4, async_shell, core_extended_p4, async_find
+, cohttp, conduit, magic-mime
+}:
+
+assert stdenv.lib.versionOlder "4.02" ocaml.version;
+
+stdenv.mkDerivation rec {
+  pname = "trv";
+  version = "0.1.3";
+
+  src = fetchFromGitHub {
+    owner = "afiniate";
+    repo = "trv";
+    rev = version;
+    sha256 = "0fv0zh76djqhkzfzwv6k60rnky50pw9gn01lwhijrggrcxrrphz1";
+  };
+
+
+  buildInputs = [ ocaml findlib camlp4 ];
+  propagatedBuildInputs = [ core_p4 async_p4 async_unix_p4
+                            async_extra_p4 sexplib_p4 async_shell core_extended_p4
+                            async_find cohttp conduit magic-mime re2_p4 ];
+
+  createFindlibDestdir = true;
+  dontStrip = true;
+
+  installFlags = "SEMVER=${version} PREFIX=$(out)";
+
+  meta = with stdenv.lib; {
+    homepage = https://github.com/afiniate/trv;
+    description = "Shim for vrt to enable bootstrapping";
+    license = licenses.asl20;
+    maintainers = [ maintainers.ericbmerritt ];
+    platforms = ocaml.meta.platforms or [];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/uisp/default.nix b/nixpkgs/pkgs/development/tools/misc/uisp/default.nix
new file mode 100644
index 000000000000..1727f772006e
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/uisp/default.nix
@@ -0,0 +1,19 @@
+{ stdenv, fetchurl }:
+
+stdenv.mkDerivation {
+  name = "uisp-20050207";
+
+  src = fetchurl {
+    url = http://mirror.switch.ch/mirror/gentoo/distfiles/uisp-20050207.tar.gz;
+    sha256 = "1bncxp5yxh9r1yrp04vvhfiva8livi1pwic7v8xj99q09zrwahvw";
+  };
+
+  NIX_CFLAGS_COMPILE = "-Wno-error";
+
+  meta = {
+    description = "Tool for AVR microcontrollers which can interface to many hardware in-system programmers";
+    license = stdenv.lib.licenses.gpl2;
+    homepage = https://savannah.nongnu.org/projects/uisp;
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/uncrustify/default.nix b/nixpkgs/pkgs/development/tools/misc/uncrustify/default.nix
new file mode 100644
index 000000000000..d85cd1a82164
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/uncrustify/default.nix
@@ -0,0 +1,26 @@
+{ stdenv, fetchFromGitHub, cmake }:
+
+stdenv.mkDerivation rec {
+  name = "${product}-${version}";
+  product = "uncrustify";
+  version = "0.67";
+
+  src = fetchFromGitHub {
+    owner = product;
+    repo = product;
+    rev = name;
+    sha256 = "0hf8c93aj1hjg6cc77x6p7nf7ddp8mn4b6a9gpcrvmx8w81afpd3";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    description = "Source code beautifier for C, C++, C#, ObjectiveC, D, Java, Pawn and VALA";
+    homepage = http://uncrustify.sourceforge.net/;
+    license = licenses.gpl2Plus;
+    platforms = platforms.unix;
+    maintainers = [ maintainers.bjornfor ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/unifdef/default.nix b/nixpkgs/pkgs/development/tools/misc/unifdef/default.nix
new file mode 100644
index 000000000000..8fc268423505
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/unifdef/default.nix
@@ -0,0 +1,31 @@
+{ fetchurl, stdenv }:
+
+stdenv.mkDerivation rec {
+  name = "unifdef-2.6";
+
+  src = fetchurl {
+    url    = "https://github.com/fanf2/unifdef/archive/${name}.tar.gz";
+    sha256 = "1p5wr5ms9w8kijy9h7qs1mz36dlavdj6ngz2bks588w7a20kcqxj";
+  };
+
+  postUnpack = ''
+    substituteInPlace $sourceRoot/unifdef.c \
+      --replace '#include "version.h"' ""
+
+    substituteInPlace $sourceRoot/Makefile \
+      --replace "unifdef.c: version.h" "unifdef.c:"
+  '';
+
+  preBuild = ''
+    unset HOME
+    export DESTDIR=$out
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = http://dotat.at/prog/unifdef/;
+    description = "Selectively remove C preprocessor conditionals";
+    license = licenses.bsd2;
+    platforms = platforms.unix;
+    maintainers = [ maintainers.vrthra ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/universal-ctags/default.nix b/nixpkgs/pkgs/development/tools/misc/universal-ctags/default.nix
new file mode 100644
index 000000000000..47aa49178141
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/universal-ctags/default.nix
@@ -0,0 +1,47 @@
+{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, perl, pythonPackages, libiconv }:
+
+stdenv.mkDerivation {
+  pname = "universal-ctags";
+  version = "unstable-2019-07-30";
+
+  src = fetchFromGitHub {
+    owner = "universal-ctags";
+    repo = "ctags";
+    rev = "920e7910146915e5cae367bc9f135ffd8b042042";
+    sha256 = "14n3ix77rkhq6vq6kspmgjrmm0kg0f8cxikyqdq281sbnfq8bajn";
+  };
+
+  nativeBuildInputs = [ autoreconfHook pkgconfig pythonPackages.docutils ];
+  buildInputs = stdenv.lib.optional stdenv.isDarwin libiconv;
+
+  # to generate makefile.in
+  autoreconfPhase = ''
+    ./autogen.sh
+  '';
+
+  configureFlags = [ "--enable-tmpdir=/tmp" ];
+
+  postPatch = ''
+    # Remove source of non-determinism
+    substituteInPlace main/options.c \
+      --replace "printf (\"  Compiled: %s, %s\n\", __DATE__, __TIME__);" ""
+  '';
+
+  postConfigure = ''
+    sed -i 's|/usr/bin/env perl|${perl}/bin/perl|' misc/optlib2c
+  '';
+
+  doCheck = true;
+
+  checkFlags = "units";
+
+  meta = with stdenv.lib; {
+    description = "A maintained ctags implementation";
+    homepage = https://ctags.io/;
+    license = licenses.gpl2Plus;
+    platforms = platforms.unix;
+    # universal-ctags is preferred over emacs's ctags
+    priority = 1;
+    maintainers = [ maintainers.mimame ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/universal-ctags/sed-test.patch b/nixpkgs/pkgs/development/tools/misc/universal-ctags/sed-test.patch
new file mode 100644
index 000000000000..7c44d699d79a
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/universal-ctags/sed-test.patch
@@ -0,0 +1,12 @@
+--- a/Tmain/sorted-help-message.d/run.sh	2017-01-10 11:20:51.515093465 +0100
++++ b/Tmain/sorted-help-message.d/run.sh	2017-01-10 11:17:56.639213720 +0100
+@@ -27,7 +27,7 @@
+ extract_long_options()
+ {
+     sed -n '/Usage:/,$p'  | \
+-    sed -n 's/\(^  --[:alnum:][<>[:alnum:]_-]*\).*/\1/p'
++    sed -n 's/\(^  --[[:alnum:]][<>[:alnum:]_-]*\).*/\1/p'
+ }
+
+ extract_debug_options()
+
diff --git a/nixpkgs/pkgs/development/tools/misc/usb-modeswitch/data.nix b/nixpkgs/pkgs/development/tools/misc/usb-modeswitch/data.nix
new file mode 100644
index 000000000000..fb43ff61a81c
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/usb-modeswitch/data.nix
@@ -0,0 +1,26 @@
+{ stdenv, fetchurl, tcl, usb-modeswitch }:
+
+stdenv.mkDerivation rec {
+  pname = "usb-modeswitch-data";
+  version = "20170806";
+
+  src = fetchurl {
+    url    = "http://www.draisberghof.de/usb_modeswitch/${pname}-${version}.tar.bz2";
+    sha256 = "0b1wari3aza6qjggqd0hk2zsh93k1q8scgmwh6f8wr0flpr3whff";
+  };
+
+  inherit (usb-modeswitch) makeFlags;
+
+  prePatch = ''
+    sed -i 's@usb_modeswitch@${usb-modeswitch}/bin/usb_modeswitch@g' 40-usb_modeswitch.rules
+  '';
+
+  # we add tcl here so we can patch in support for new devices by dropping config into
+  # the usb_modeswitch.d directory
+  nativeBuildInputs = [ tcl ];
+
+  meta = with stdenv.lib; {
+    description = "Device database and the rules file for 'multi-mode' USB devices";
+    inherit (usb-modeswitch.meta) license maintainers platforms;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/usb-modeswitch/default.nix b/nixpkgs/pkgs/development/tools/misc/usb-modeswitch/default.nix
new file mode 100644
index 000000000000..7c119c929431
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/usb-modeswitch/default.nix
@@ -0,0 +1,32 @@
+{ stdenv, fetchurl, pkgconfig, libusb1 }:
+
+stdenv.mkDerivation rec {
+  pname = "usb-modeswitch";
+  version = "2.5.2";
+
+  src = fetchurl {
+    url    = "http://www.draisberghof.de/usb_modeswitch/${pname}-${version}.tar.bz2";
+    sha256 = "19ifi80g9ns5dmspchjvfj4ykxssq9yrci8m227dgb3yr04srzxb";
+  };
+
+  makeFlags = [
+    "DESTDIR=$(out)"
+    "PREFIX=$(out)"
+  ];
+
+  # make clean: we always build from source. It should be necessary on x86_64 only
+  preConfigure = ''
+    find -type f | xargs sed 's@/bin/rm@rm@g' -i
+    make clean
+  '';
+
+  buildInputs = [ libusb1 ];
+  nativeBuildInputs = [ pkgconfig ];
+
+  meta = with stdenv.lib; {
+    description = "A mode switching tool for controlling 'multi-mode' USB devices";
+    license = licenses.gpl2;
+    maintainers = with maintainers; [ marcweber peterhoeg ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/vtable-dumper/default.nix b/nixpkgs/pkgs/development/tools/misc/vtable-dumper/default.nix
new file mode 100644
index 000000000000..2b6e349b9fde
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/vtable-dumper/default.nix
@@ -0,0 +1,24 @@
+{ stdenv, fetchFromGitHub, libelf }:
+
+stdenv.mkDerivation rec {
+  pname = "vtable-dumper";
+  version = "1.2";
+
+  src = fetchFromGitHub {
+    owner = "lvc";
+    repo = "vtable-dumper";
+    rev = version;
+    sha256 = "0sl7lnjr2l4c2f7qaazvpwpzsp4gckkvccfam88wcq9f7j9xxbyp";
+  };
+
+  buildInputs = [ libelf ];
+  makeFlags = [ "prefix=$(out)" ];
+
+  meta = with stdenv.lib; {
+    homepage = https://github.com/lvc/vtable-dumper;
+    description = "A tool to list content of virtual tables in a C++ shared library";
+    license = licenses.lgpl21;
+    maintainers = [ maintainers.bhipple ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/watson-ruby/Gemfile b/nixpkgs/pkgs/development/tools/misc/watson-ruby/Gemfile
new file mode 100644
index 000000000000..fc739389e84e
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/watson-ruby/Gemfile
@@ -0,0 +1,2 @@
+source 'https://rubygems.org'
+gem 'watson-ruby'
diff --git a/nixpkgs/pkgs/development/tools/misc/watson-ruby/Gemfile.lock b/nixpkgs/pkgs/development/tools/misc/watson-ruby/Gemfile.lock
new file mode 100644
index 000000000000..fa157d794f73
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/watson-ruby/Gemfile.lock
@@ -0,0 +1,15 @@
+GEM
+  remote: https://rubygems.org/
+  specs:
+    json (2.1.0)
+    watson-ruby (1.6.3)
+      json
+
+PLATFORMS
+  ruby
+
+DEPENDENCIES
+  watson-ruby
+
+BUNDLED WITH
+   1.14.4
diff --git a/nixpkgs/pkgs/development/tools/misc/watson-ruby/default.nix b/nixpkgs/pkgs/development/tools/misc/watson-ruby/default.nix
new file mode 100644
index 000000000000..e1726efc40c1
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/watson-ruby/default.nix
@@ -0,0 +1,31 @@
+{ stdenv, bundlerEnv, ruby, bundlerUpdateScript }:
+
+
+stdenv.mkDerivation rec {
+  pname = "watson-ruby";
+  version = (import ./gemset.nix).watson-ruby.version;
+
+  env = bundlerEnv {
+    name = "watson-ruby-gems-${version}";
+    inherit ruby;
+    # expects Gemfile, Gemfile.lock and gemset.nix in the same directory
+    gemdir = ./.;
+  };
+
+  phases = [ "installPhase" ];
+
+  installPhase = ''
+    mkdir -p $out/bin
+    ln -s ${env}/bin/watson $out/bin/watson
+  '';
+
+  passthru.updateScript = bundlerUpdateScript "watson-ruby";
+
+  meta = with stdenv.lib; {
+    description = "An inline issue manager";
+    homepage    = http://goosecode.com/watson/;
+    license     = with licenses; mit;
+    maintainers = with maintainers; [ robertodr nicknovitski ];
+    platforms   = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/watson-ruby/gemset.nix b/nixpkgs/pkgs/development/tools/misc/watson-ruby/gemset.nix
new file mode 100644
index 000000000000..a3bb144899c7
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/watson-ruby/gemset.nix
@@ -0,0 +1,18 @@
+{
+  json = {
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "01v6jjpvh3gnq6sgllpfqahlgxzj50ailwhj9b3cd20hi2dx0vxp";
+      type = "gem";
+    };
+    version = "2.1.0";
+  };
+  watson-ruby = {
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1d5m29nr0i030q8ygmbapwri5ndcg2q6lf8a15bk79lfcp9xyj9w";
+      type = "gem";
+    };
+    version = "1.6.3";
+  };
+}
\ No newline at end of file
diff --git a/nixpkgs/pkgs/development/tools/misc/whatstyle/default.nix b/nixpkgs/pkgs/development/tools/misc/whatstyle/default.nix
new file mode 100644
index 000000000000..0c6e4f568ffc
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/whatstyle/default.nix
@@ -0,0 +1,30 @@
+{ stdenv, python3, fetchFromGitHub, clang-unwrapped }:
+
+python3.pkgs.buildPythonApplication rec {
+  pname = "whatstyle";
+  version = "0.1.7";
+  src = fetchFromGitHub {
+    owner = "mikr";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "16ak4g149cr764c1lqakiyzmf5s98w8bdc4gk69m8qacimfg3mzm";
+  };
+
+  # Fix references to previous version, to avoid confusion:
+  postPatch = ''
+    substituteInPlace setup.py --replace 0.1.6 ${version}
+    substituteInPlace ${pname}.py --replace 0.1.6 ${version}
+  '';
+
+  checkInputs = [ clang-unwrapped /* clang-format */ ];
+
+  doCheck = false; # 3 or 4 failures depending on version, haven't investigated.
+
+  meta = with stdenv.lib; {
+    description = "Find a code format style that fits given source files";
+    homepage = https://github.com/mikr/whatstyle;
+    license = licenses.mit;
+    maintainers = with maintainers; [ dtzWill ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/wishbone-tool/default.nix b/nixpkgs/pkgs/development/tools/misc/wishbone-tool/default.nix
new file mode 100644
index 000000000000..6b2c944f7016
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/wishbone-tool/default.nix
@@ -0,0 +1,25 @@
+{ lib, fetchFromGitHub, rustPlatform, libusb }:
+let
+  version = "0.2.8";
+  src = fetchFromGitHub {
+    owner = "xobs";
+    repo = "wishbone-utils";
+    rev = "v${version}";
+    sha256 = "0v6s5yl0y6bd2snf12x6c77rwvqkg6ybi1sm4wr7qdgbwq563nxp";
+  };
+in
+rustPlatform.buildRustPackage {
+  pname = "wishbone-tool";
+  inherit version;
+  src = "${src}/wishbone-tool";
+  cargoSha256 = "0pj8kf6s1c666p4kc6q1hlvaqm0lm9aqnsx5r034g1y8sxnnyri2";
+  buildInputs = [ libusb ];
+
+  meta = with lib; {
+    description = "Manipulate a Wishbone device over some sort of bridge";
+    homepage = "https://github.com/xobs/wishbone-utils#wishbone-tool";
+    license = licenses.bsd2;
+    maintainers = with maintainers; [ edef ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/xc3sprog/default.nix b/nixpkgs/pkgs/development/tools/misc/xc3sprog/default.nix
new file mode 100644
index 000000000000..68897105f5c7
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/xc3sprog/default.nix
@@ -0,0 +1,25 @@
+{ stdenv, fetchsvn, cmake, libusb, libftdi }:
+
+# The xc3sprog project doesn't seem to make proper releases, they only put out
+# prebuilt binary subversion snapshots on sourceforge.
+
+stdenv.mkDerivation rec {
+  version = "787";
+  pname = "xc3sprog";
+
+  src = fetchsvn {
+    url = "https://svn.code.sf.net/p/xc3sprog/code/trunk";
+    sha256 = "1rfhms3i7375kdlg0sdg5k52ix3xv5llj2dr30vamyg7pk74y8rx";
+    rev = version;
+  };
+
+  buildInputs = [ cmake libusb libftdi ];
+
+  meta = with stdenv.lib; {
+    description = "Command-line tools for programming FPGAs, microcontrollers and PROMs via JTAG";
+    homepage = http://xc3sprog.sourceforge.net/;
+    license = licenses.gpl2Plus;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.bjornfor ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/xxdiff/default.nix b/nixpkgs/pkgs/development/tools/misc/xxdiff/default.nix
new file mode 100644
index 000000000000..c187ad42c0e9
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/xxdiff/default.nix
@@ -0,0 +1,51 @@
+{ lib, mkDerivation, fetchFromBitbucket, docutils, bison, flex, qmake
+, qtbase
+}:
+
+mkDerivation rec {
+  pname = "xxdiff";
+  version = "5.0b1";
+
+  src = fetchFromBitbucket {
+    owner = "blais";
+    repo = pname;
+    rev = "5e5f885dfc43559549a81c59e9e8c9525306356a";
+    sha256 = "0gbvxrkwkbvag3298j89smszghpr8ilxxfb0cvsknfqdf15b296w";
+  };
+
+  nativeBuildInputs = [ bison docutils flex qmake ];
+
+  buildInputs = [ qtbase ];
+
+  dontUseQmakeConfigure = true;
+
+  # c++11 and above is needed for building with Qt 5.9+
+  NIX_CFLAGS_COMPILE = [ "-std=c++14" ];
+
+  sourceRoot = "source/src";
+
+  postPatch = ''
+    substituteInPlace xxdiff.pro --replace ../bin ./bin
+  '';
+
+  preConfigure = ''
+    make -f Makefile.bootstrap
+  '';
+
+  installPhase = ''
+    runHook preInstall
+
+    install -Dm555 -t $out/bin                ./bin/xxdiff
+    install -Dm444 -t $out/share/doc/${pname} ${src}/README
+
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    description = "Graphical file and directories comparator and merge tool";
+    homepage = "http://furius.ca/xxdiff/";
+    license = licenses.gpl2;
+    maintainers = with maintainers; [ pSub raskin ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/ycmd/default.nix b/nixpkgs/pkgs/development/tools/misc/ycmd/default.nix
new file mode 100644
index 000000000000..12f0b13a6602
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/ycmd/default.nix
@@ -0,0 +1,83 @@
+{ stdenv, lib, fetchgit, cmake, llvmPackages, boost, python
+, gocode ? null
+, godef ? null
+, rustracerd ? null
+, fixDarwinDylibNames, Cocoa ? null
+}:
+
+stdenv.mkDerivation {
+  pname = "ycmd";
+  version = "2018-09-20";
+
+  src = fetchgit {
+    url = "https://github.com/Valloric/ycmd.git";
+    rev = "bf658fd78722c517674c0aaf2381e199bca8f163";
+    sha256 = "1lwa8xr76vapfpncvp81cn3m9219yw14fl7fzk5gnly60zkphbbl";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ boost llvmPackages.libclang ]
+    ++ stdenv.lib.optional stdenv.isDarwin [ fixDarwinDylibNames Cocoa ];
+
+  buildPhase = ''
+    export EXTRA_CMAKE_ARGS=-DPATH_TO_LLVM_ROOT=${llvmPackages.clang-unwrapped}
+    ${python.interpreter} build.py --system-libclang --clang-completer --system-boost
+  '';
+
+  dontConfigure = true;
+
+  # remove the tests
+  #
+  # make __main__.py executable and add shebang
+  #
+  # copy over third-party libs
+  # note: if we switch to using our packaged libs, we'll need to symlink them
+  # into the same spots, as YouCompleteMe (the vim plugin) expects those paths
+  # to be available
+  #
+  # symlink completion backends where ycmd expects them
+  installPhase = ''
+    rm -rf ycmd/tests
+
+    chmod +x ycmd/__main__.py
+    sed -i "1i #!${python.interpreter}\
+    " ycmd/__main__.py
+
+    mkdir -p $out/lib/ycmd
+    cp -r ycmd/ CORE_VERSION libclang.so.* libclang.dylib* ycm_core.so $out/lib/ycmd/
+
+    mkdir -p $out/bin
+    ln -s $out/lib/ycmd/ycmd/__main__.py $out/bin/ycmd
+
+    mkdir -p $out/lib/ycmd/third_party/{gocode,godef,racerd/target/release}
+
+    for p in jedi waitress frozendict bottle parso python-future requests; do
+      cp -r third_party/$p $out/lib/ycmd/third_party
+    done
+
+  '' + lib.optionalString (gocode != null) ''
+    ln -s ${gocode}/bin/gocode $out/lib/ycmd/third_party/gocode
+  '' + lib.optionalString (godef != null) ''
+    ln -s ${godef}/bin/godef $out/lib/ycmd/third_party/godef
+  '' + lib.optionalString (rustracerd != null) ''
+    ln -s ${rustracerd}/bin/racerd $out/lib/ycmd/third_party/racerd/target/release
+  '';
+
+  # fixup the argv[0] and replace __file__ with the corresponding path so
+  # python won't be thrown off by argv[0]
+  postFixup = ''
+    substituteInPlace $out/lib/ycmd/ycmd/__main__.py \
+      --replace $out/lib/ycmd/ycmd/__main__.py \
+                $out/bin/ycmd \
+      --replace __file__ \
+                "'$out/lib/ycmd/ycmd/__main__.py'"
+  '';
+
+  meta = with stdenv.lib; {
+    description = "A code-completion and comprehension server";
+    homepage = https://github.com/Valloric/ycmd;
+    license = licenses.gpl3;
+    maintainers = with maintainers; [ rasendubi cstrahan lnl7 ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/yodl/default.nix b/nixpkgs/pkgs/development/tools/misc/yodl/default.nix
new file mode 100644
index 000000000000..5520a4a30be0
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/yodl/default.nix
@@ -0,0 +1,52 @@
+{ stdenv, fetchFromGitLab, perl, icmake, utillinux }:
+
+stdenv.mkDerivation rec {
+  pname = "yodl";
+  version = "4.02.01";
+
+  nativeBuildInputs = [ icmake ];
+
+  buildInputs = [ perl ];
+
+  src = fetchFromGitLab {
+    sha256 = "0m8idd8m3z27rix55avchm21sd2spcxgrdf63w65zpvnywq0ydax";
+    rev = version;
+    repo = "yodl";
+    owner = "fbb-git";
+  };
+
+  setSourceRoot = ''
+    sourceRoot=$(echo */yodl)
+  '';
+
+  preConfigure = ''
+    patchShebangs ./build
+    patchShebangs scripts/
+    substituteInPlace INSTALL.im --replace /usr $out
+    substituteInPlace macros/rawmacros/startdoc.pl --replace /usr/bin/perl ${perl}/bin/perl
+    substituteInPlace scripts/yodl2whatever.in --replace getopt ${utillinux}/bin/getopt
+  '';
+
+  # Set TERM because icmbuild calls tput.
+  TERM = "xterm";
+
+  buildPhase = ''
+    ./build programs
+    ./build macros
+    ./build man
+  '';
+
+  installPhase = ''
+    ./build install programs
+    ./build install macros
+    ./build install man
+  '';
+
+  meta = with stdenv.lib; {
+    description = "A package that implements a pre-document language and tools to process it";
+    homepage = https://fbb-git.gitlab.io/yodl/;
+    license = licenses.gpl3;
+    maintainers = with maintainers; [ pSub ];
+    platforms = platforms.linux;
+  };
+}