summary refs log tree commit diff
path: root/pkgs/development
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development')
-rw-r--r--pkgs/development/libraries/glib-networking/default.nix2
-rw-r--r--pkgs/development/libraries/gvfs/default.nix6
-rw-r--r--pkgs/development/libraries/libfm/default.nix11
-rw-r--r--pkgs/development/libraries/libwnck/3.x.nix4
-rw-r--r--pkgs/development/libraries/pipewire/default.nix2
-rw-r--r--pkgs/development/libraries/science/math/sympow/default.nix6
-rw-r--r--pkgs/development/libraries/spice-gtk/default.nix2
-rw-r--r--pkgs/development/libraries/umockdev/default.nix4
-rw-r--r--pkgs/development/python-modules/backports_lzma/default.nix5
-rw-r--r--pkgs/development/python-modules/buttersink/default.nix28
-rw-r--r--pkgs/development/python-modules/docker-registry-core/default.nix26
-rw-r--r--pkgs/development/python-modules/plotly/default.nix2
-rw-r--r--pkgs/development/python-modules/pytorch/default.nix6
-rw-r--r--pkgs/development/python-modules/pywatchman/default.nix26
-rw-r--r--pkgs/development/tools/corgi/default.nix28
-rw-r--r--pkgs/development/tools/corgi/deps.nix47
-rw-r--r--pkgs/development/tools/kythe/default.nix47
-rw-r--r--pkgs/development/tools/rust/bindgen/default.nix49
-rwxr-xr-xpkgs/development/tools/rust/bindgen/wrapper.sh36
19 files changed, 247 insertions, 90 deletions
diff --git a/pkgs/development/libraries/glib-networking/default.nix b/pkgs/development/libraries/glib-networking/default.nix
index e0bbae69c4ff..3deaf28373dd 100644
--- a/pkgs/development/libraries/glib-networking/default.nix
+++ b/pkgs/development/libraries/glib-networking/default.nix
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
     })
   ];
 
-  PKG_CONFIG_GIO_2_0_GIOMODULEDIR = "lib/gio/modules";
+  PKG_CONFIG_GIO_2_0_GIOMODULEDIR = "${placeholder "out"}/lib/gio/modules";
 
   postPatch = ''
     chmod +x meson_post_install.py # patchShebangs requires executable file
diff --git a/pkgs/development/libraries/gvfs/default.nix b/pkgs/development/libraries/gvfs/default.nix
index 86cbd01a6026..360c1fb41f4e 100644
--- a/pkgs/development/libraries/gvfs/default.nix
+++ b/pkgs/development/libraries/gvfs/default.nix
@@ -63,9 +63,9 @@ stdenv.mkDerivation rec {
 
   # Uncomment when switching back to meson
   # mesonFlags = [
-  #   "-Dgio_module_dir=lib/gio/modules"
-  #   "-Dsystemduserunitdir=lib/systemd/user"
-  #   "-Ddbus_service_dir=share/dbus-1/services"
+  #   "-Dgio_module_dir=${placeholder "out"}/lib/gio/modules"
+  #   "-Dsystemduserunitdir=${placeholder "out"}/lib/systemd/user"
+  #   "-Ddbus_service_dir=${placeholder "out"}/share/dbus-1/services"
   #   "-Dtmpfilesdir=no"
   # ] ++ stdenv.lib.optionals (!gnomeSupport) [
   #   "-Dgcr=false" "-Dgoa=false" "-Dkeyring=false" "-Dhttp=false"
diff --git a/pkgs/development/libraries/libfm/default.nix b/pkgs/development/libraries/libfm/default.nix
index ce1d3b138f88..796c03dab5ee 100644
--- a/pkgs/development/libraries/libfm/default.nix
+++ b/pkgs/development/libraries/libfm/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, glib, intltool, menu-cache, pango, pkgconfig, vala_0_34
+{ stdenv, fetchurl, glib, intltool, menu-cache, pango, pkgconfig, vala
 , extraOnly ? false
 , withGtk3 ? false, gtk2, gtk3 }:
 let
@@ -16,12 +16,11 @@ stdenv.mkDerivation rec {
     sha256 = "0wkwbi1nyvqza3r1dhrq846axiiq0fy0dqgngnagh76fjrwnzl0q";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
-  buildInputs = [ glib gtk intltool pango vala_0_34 ]
-                ++ optional (!extraOnly) menu-cache;
+  nativeBuildInputs = [ vala pkgconfig intltool ];
+  buildInputs = [ glib gtk pango ] ++ optional (!extraOnly) menu-cache;
 
-  configureFlags = [ (optional extraOnly "--with-extra-only")
-                     (optional withGtk3 "--with-gtk=3") ];
+  configureFlags = optional extraOnly "--with-extra-only"
+    ++ optional withGtk3 "--with-gtk=3";
 
   enableParallelBuilding = true;
 
diff --git a/pkgs/development/libraries/libwnck/3.x.nix b/pkgs/development/libraries/libwnck/3.x.nix
index 8efd908584e1..f2d05d14d693 100644
--- a/pkgs/development/libraries/libwnck/3.x.nix
+++ b/pkgs/development/libraries/libwnck/3.x.nix
@@ -19,8 +19,8 @@ in stdenv.mkDerivation rec{
   nativeBuildInputs = [ pkgconfig intltool gobjectIntrospection ];
   propagatedBuildInputs = [ libX11 gtk3 ];
 
-  PKG_CONFIG_GOBJECT_INTROSPECTION_1_0_GIRDIR = "$(dev)/share/gir-1.0";
-  PKG_CONFIG_GOBJECT_INTROSPECTION_1_0_TYPELIBDIR = "$(out)/lib/girepository-1.0";
+  PKG_CONFIG_GOBJECT_INTROSPECTION_1_0_GIRDIR = "${placeholder "dev"}/share/gir-1.0";
+  PKG_CONFIG_GOBJECT_INTROSPECTION_1_0_TYPELIBDIR = "${placeholder "out"}/lib/girepository-1.0";
 
   passthru = {
     updateScript = gnome3.updateScript {
diff --git a/pkgs/development/libraries/pipewire/default.nix b/pkgs/development/libraries/pipewire/default.nix
index c50fc9fb35c8..e87ed8e48a98 100644
--- a/pkgs/development/libraries/pipewire/default.nix
+++ b/pkgs/development/libraries/pipewire/default.nix
@@ -34,7 +34,7 @@ in stdenv.mkDerivation rec {
     "-Denable_gstreamer=true"
   ];
 
-  PKG_CONFIG_SYSTEMD_SYSTEMDUSERUNITDIR = "lib/systemd/user";
+  PKG_CONFIG_SYSTEMD_SYSTEMDUSERUNITDIR = "${placeholder "out"}/lib/systemd/user";
 
   FONTCONFIG_FILE = fontsConf; # Fontconfig error: Cannot load default config file
 
diff --git a/pkgs/development/libraries/science/math/sympow/default.nix b/pkgs/development/libraries/science/math/sympow/default.nix
index c34701e3f913..f421755b6182 100644
--- a/pkgs/development/libraries/science/math/sympow/default.nix
+++ b/pkgs/development/libraries/science/math/sympow/default.nix
@@ -34,13 +34,11 @@ stdenv.mkDerivation rec {
     makeWrapper "$out/share/sympow/sympow" "$out/bin/sympow" \
       --run 'export SYMPOW_LOCAL="$HOME/.local/share/sympow"' \
       --run 'if [ ! -d "$SYMPOW_LOCAL" ]; then
-        mkdir -p "$SYMPOW_LOCAL"
-        cp -r @out@/share/sympow/* "$SYMPOW_LOCAL"
+        mkdir -p "$SYMPOW_LOCAL" 
+        cp -r ${placeholder "out"}/share/sympow/* "$SYMPOW_LOCAL"
         chmod -R +xw "$SYMPOW_LOCAL"
     fi' \
       --run 'cd "$SYMPOW_LOCAL"'
-    substituteInPlace $out/bin/sympow --subst-var out
-
     runHook postInstall
   '';
 
diff --git a/pkgs/development/libraries/spice-gtk/default.nix b/pkgs/development/libraries/spice-gtk/default.nix
index f4f10978ec13..f5258c1cd6d8 100644
--- a/pkgs/development/libraries/spice-gtk/default.nix
+++ b/pkgs/development/libraries/spice-gtk/default.nix
@@ -52,7 +52,7 @@ in stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ pkgconfig gettext libsoup autoreconfHook vala gobjectIntrospection ];
 
-  PKG_CONFIG_POLKIT_GOBJECT_1_POLICYDIR = "$(out)/share/polkit-1/actions";
+  PKG_CONFIG_POLKIT_GOBJECT_1_POLICYDIR = "${placeholder "out"}/share/polkit-1/actions";
 
   configureFlags = [
     "--with-gtk3"
diff --git a/pkgs/development/libraries/umockdev/default.nix b/pkgs/development/libraries/umockdev/default.nix
index b89450b810b8..912bcac55cd0 100644
--- a/pkgs/development/libraries/umockdev/default.nix
+++ b/pkgs/development/libraries/umockdev/default.nix
@@ -3,7 +3,7 @@
 
 stdenv.mkDerivation rec {
   name = "umockdev-${version}";
-  version = "0.11.3";
+  version = "0.12";
 
   outputs = [ "bin" "out" "dev" "doc" ];
 
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
     owner  = "martinpitt";
     repo   = "umockdev";
     rev    = version;
-    sha256 = "1z101yw7clxz39im3y435s3rj1gna3kp0fkj9wd62vxqvk68lhik";
+    sha256 = "1j7kkxpqs991w3qdlb779gzv38l1vpnlk3laabi2ndk83j1wl5k2";
   };
 
   # autoreconfHook complains if we try to build the documentation
diff --git a/pkgs/development/python-modules/backports_lzma/default.nix b/pkgs/development/python-modules/backports_lzma/default.nix
index 409546e559a6..82025df8b9e9 100644
--- a/pkgs/development/python-modules/backports_lzma/default.nix
+++ b/pkgs/development/python-modules/backports_lzma/default.nix
@@ -20,9 +20,8 @@ if !(pythonOlder "3.3") then null else buildPythonPackage rec {
 
   buildInputs = [ lzma ];
 
-  # Needs the compiled module in $out
   checkPhase = ''
-    PYTHONPATH=$out/${python.sitePackages}:$PYTHONPATH ${python.interpreter} -m unittest discover -s test
+    ${python.interpreter} test/test_lzma.py
   '';
 
   # Relative import does not seem to function.
@@ -33,4 +32,4 @@ if !(pythonOlder "3.3") then null else buildPythonPackage rec {
     homepage = https://github.com/peterjc/backports.lzma;
     license = lib.licenses.bsd3;
   };
-}
\ No newline at end of file
+}
diff --git a/pkgs/development/python-modules/buttersink/default.nix b/pkgs/development/python-modules/buttersink/default.nix
deleted file mode 100644
index b13251e1ca75..000000000000
--- a/pkgs/development/python-modules/buttersink/default.nix
+++ /dev/null
@@ -1,28 +0,0 @@
-{ stdenv, buildPythonPackage, fetchPypi, isPy3k, boto, crcmod, psutil }:
-
-buildPythonPackage rec {
-  pname = "buttersink";
-  version = "0.6.9";
-  disabled = isPy3k;
-
-  src = fetchPypi {
-    inherit pname version;
-    sha256 = "c9c05982c44fbb85f17b7ef0e8bee11f375c03d89bcba50cbc2520013512107a";
-  };
-
-  propagatedBuildInputs = [ boto crcmod psutil ];
-
-  meta = with stdenv.lib; {
-    description = "Synchronise btrfs snapshots";
-    longDescription = ''
-      ButterSink is like rsync, but for btrfs subvolumes instead of files,
-      which makes it much more efficient for things like archiving backup
-      snapshots. It is built on top of btrfs send and receive capabilities.
-      Sources and destinations can be local btrfs file systems, remote btrfs
-      file systems over SSH, or S3 buckets.
-    '';
-    homepage = https://github.com/AmesCornish/buttersink/wiki;
-    license = licenses.gpl3;
-    platforms = platforms.linux;
-  };
-}
diff --git a/pkgs/development/python-modules/docker-registry-core/default.nix b/pkgs/development/python-modules/docker-registry-core/default.nix
deleted file mode 100644
index ad9968af173c..000000000000
--- a/pkgs/development/python-modules/docker-registry-core/default.nix
+++ /dev/null
@@ -1,26 +0,0 @@
-{ stdenv, buildPythonPackage, fetchPypi, isPy3k
-, boto, redis, setuptools, simplejson }:
-
-buildPythonPackage rec {
-  pname = "docker-registry-core";
-  version = "2.0.3";
-  disabled = isPy3k;
-
-  src = fetchPypi {
-    inherit pname version;
-    sha256 = "0q036rr0b5734szkj883hkb2kjhgcc5pm3dz4yz8vcim3x7q0zil";
-  };
-
-  DEPS = "loose";
-
-  doCheck = false;
-  propagatedBuildInputs = [ boto redis setuptools simplejson ];
-
-  patchPhase = "> requirements/main.txt";
-
-  meta = with stdenv.lib; {
-    description = "Docker registry core package";
-    homepage = https://github.com/docker/docker-registry;
-    license = licenses.asl20;
-  };
-}
diff --git a/pkgs/development/python-modules/plotly/default.nix b/pkgs/development/python-modules/plotly/default.nix
index 79648c8104b7..30293e9798b3 100644
--- a/pkgs/development/python-modules/plotly/default.nix
+++ b/pkgs/development/python-modules/plotly/default.nix
@@ -5,6 +5,7 @@
 , nbformat
 , pytz
 , requests
+, retrying
 , six
 }:
 
@@ -22,6 +23,7 @@ buildPythonPackage rec {
     nbformat
     pytz
     requests
+    retrying
     six
   ];
 
diff --git a/pkgs/development/python-modules/pytorch/default.nix b/pkgs/development/python-modules/pytorch/default.nix
index 962ebbecbaaa..d31719efa172 100644
--- a/pkgs/development/python-modules/pytorch/default.nix
+++ b/pkgs/development/python-modules/pytorch/default.nix
@@ -25,7 +25,7 @@ let
     "LD_LIBRARY_PATH=${cudaStub}\${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} ";
 
 in buildPythonPackage rec {
-  version = "0.4.0";
+  version = "0.4.1";
   pname = "pytorch";
 
   src = fetchFromGitHub {
@@ -33,7 +33,7 @@ in buildPythonPackage rec {
     repo   = "pytorch";
     rev    = "v${version}";
     fetchSubmodules = true;
-    sha256 = "12d5vqqaprk0igmih7fwa65ldmaawgijxl58h6dnw660wysc132j";
+    sha256 = "1cr8h47jxgfar5bamyvlayvqymnb2qvp7rr0ka2d2d4rdldf9lrp";
   };
 
   preConfigure = lib.optionalString cudaSupport ''
@@ -56,7 +56,7 @@ in buildPythonPackage rec {
   ] ++ lib.optional (pythonOlder "3.5") typing;
 
   checkPhase = ''
-    ${cudaStubEnv}python test/run_test.py --exclude distributed
+    ${cudaStubEnv}python test/run_test.py --exclude distributed autograd distributions jit sparse torch utils nn
   '';
 
   meta = {
diff --git a/pkgs/development/python-modules/pywatchman/default.nix b/pkgs/development/python-modules/pywatchman/default.nix
new file mode 100644
index 000000000000..40aaea9c01a7
--- /dev/null
+++ b/pkgs/development/python-modules/pywatchman/default.nix
@@ -0,0 +1,26 @@
+{ stdenv, buildPythonPackage, fetchPypi, watchman }:
+
+buildPythonPackage rec {
+  pname = "pywatchman";
+  version = "1.4.1";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "1yf2gm20wc3djpb5larxii3l55xxby0il2ns3q0v1byyfnr7w16h";
+  };
+
+  postPatch = ''
+    substituteInPlace pywatchman/__init__.py \
+      --replace "'watchman'" "'${watchman}/bin/watchman'"
+  '';
+
+  # No tests in archive
+  doCheck = false;
+
+  meta = with stdenv.lib; {
+    description = "Watchman client for Python";
+    homepage = https://facebook.github.io/watchman/;
+    license = licenses.bsd3;
+  };
+
+}
diff --git a/pkgs/development/tools/corgi/default.nix b/pkgs/development/tools/corgi/default.nix
new file mode 100644
index 000000000000..94596ab68afa
--- /dev/null
+++ b/pkgs/development/tools/corgi/default.nix
@@ -0,0 +1,28 @@
+{ stdenv, buildGoPackage, fetchFromGitHub }:
+
+buildGoPackage rec {
+  name = "corgi-${rev}";
+  rev = "v0.2.3";
+
+  goPackagePath = "github.com/DrakeW/corgi";
+
+  src = fetchFromGitHub {
+    owner = "DrakeW";
+    repo = "corgi";
+    inherit rev;
+    sha256 = "0ahwpyd6dac04qw2ak51xfbwkr42sab1gkhh52i7hlcy12jpwl8q";
+  };
+
+  goDeps = ./deps.nix;
+
+  meta = with stdenv.lib; {
+    description = "CLI workflow manager";
+    longDescription = ''
+      Corgi is a command-line tool that helps with your repetitive command usages by organizing them into reusable snippet.
+    '';
+    homepage = https://github.com/DrakeW/corgi;
+    license = licenses.mit;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ kalbasit ];
+  };
+}
diff --git a/pkgs/development/tools/corgi/deps.nix b/pkgs/development/tools/corgi/deps.nix
new file mode 100644
index 000000000000..d48b141627c7
--- /dev/null
+++ b/pkgs/development/tools/corgi/deps.nix
@@ -0,0 +1,47 @@
+[
+  {
+    goPackagePath = "github.com/chzyer/readline";
+    fetch = {
+      type = "git";
+      url = "https://github.com/chzyer/readline";
+      rev = "2972be24d48e78746da79ba8e24e8b488c9880de";
+      sha256 = "104q8dazj8yf6b089jjr82fy9h1g80zyyzvp3g8b44a7d8ngjj6r";
+    };
+  }
+  {
+    goPackagePath = "github.com/fatih/color";
+    fetch = {
+      type = "git";
+      url = "https://github.com/fatih/color";
+      rev = "2d684516a8861da43017284349b7e303e809ac21";
+      sha256 = "1fcfmz4wji3gqmmsdx493r7d101s58hwjalqps6hy25nva5pvmfs";
+    };
+  }
+  {
+    goPackagePath = "github.com/mitchellh/go-homedir";
+    fetch = {
+      type = "git";
+      url = "https://github.com/mitchellh/go-homedir";
+      rev = "ae18d6b8b3205b561c79e8e5f69bff09736185f4";
+      sha256 = "0f0z0aa4wivk4z1y503dmnw0k0g0g403dly8i4q263gfshs82sbq";
+    };
+  }
+  {
+    goPackagePath = "github.com/spf13/cobra";
+    fetch = {
+      type = "git";
+      url = "https://github.com/spf13/cobra";
+      rev = "99dc123558852f67743bd0b2caf8383cb3c6d720";
+      sha256 = "0b2rjgycgpkpvpsqgvilqkr66bfk477lyd6l0jxmgxb1h0za5s25";
+    };
+  }
+  {
+    goPackagePath = "github.com/spf13/pflag";
+    fetch = {
+      type = "git";
+      url = "https://github.com/spf13/pflag";
+      rev = "d929dcbb10863323c436af3cf76cb16a6dfc9b29";
+      sha256 = "1qjmqvszs9cmic7brm7pknq86zjra4hq923bn88blfvr3bap5bc4";
+    };
+  }
+]
diff --git a/pkgs/development/tools/kythe/default.nix b/pkgs/development/tools/kythe/default.nix
new file mode 100644
index 000000000000..5aae1d4f3bef
--- /dev/null
+++ b/pkgs/development/tools/kythe/default.nix
@@ -0,0 +1,47 @@
+{ stdenv, binutils , fetchurl, glibc }:
+
+stdenv.mkDerivation rec {
+  version = "0.0.28";
+  name = "kythe-${version}";
+
+  src = fetchurl {
+    url = "https://github.com/google/kythe/releases/download/v0.0.28/kythe-v0.0.28.tar.gz";
+    sha256 = "1qc7cngpxw66m3krpr5x50ns7gb3bpv2bdfzpb5afl12qp0mi6zm";
+  };
+
+  buildInputs =
+    [ binutils ];
+
+  doCheck = false;
+
+  dontBuild = true;
+
+  installPhase = ''
+    cd tools
+    for exe in http_server \
+                kythe read_entries triples verifier \
+                write_entries write_tables; do
+      echo "Patching:" $exe
+      patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $exe
+      patchelf --set-rpath "${stdenv.cc.cc.lib}/lib64" $exe
+    done
+    cd ../
+    cp -R ./ $out
+  '';
+
+  meta = with stdenv.lib; {
+    description = "A pluggable, (mostly) language-agnostic ecosystem for building tools that work with code.";
+    longDescription = ''
+    The Kythe project was founded to provide and support tools and standards
+      that encourage interoperability among programs that manipulate source
+      code. At a high level, the main goal of Kythe is to provide a standard,
+      language-agnostic interchange mechanism, allowing tools that operate on
+      source code — including build systems, compilers, interpreters, static
+      analyses, editors, code-review applications, and more — to share
+      information with each other smoothly.  '';
+    homepage = https://kythe.io/;
+    license = licenses.asl20;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.mpickering ];
+  };
+}
diff --git a/pkgs/development/tools/rust/bindgen/default.nix b/pkgs/development/tools/rust/bindgen/default.nix
index aeeae494e586..68df0af6ee46 100644
--- a/pkgs/development/tools/rust/bindgen/default.nix
+++ b/pkgs/development/tools/rust/bindgen/default.nix
@@ -1,6 +1,4 @@
-{ stdenv, fetchFromGitHub, rustPlatform, makeWrapper, llvmPackages }:
-
-# Future work: Automatically communicate NIX_CFLAGS_COMPILE to bindgen's tests and the bindgen executable itself.
+{ stdenv, fetchFromGitHub, fetchpatch, rustPlatform, clang, llvmPackages, rustfmt, writeScriptBin }:
 
 rustPlatform.buildRustPackage rec {
   name = "rust-bindgen-${version}";
@@ -13,23 +11,54 @@ rustPlatform.buildRustPackage rec {
     sha256 = "0cqjr7qspjrfgqcp4nqxljmhhbqyijb2jpw3lajgjj48y6wrnw93";
   };
 
-  nativeBuildInputs = [ makeWrapper ];
-  buildInputs = [ llvmPackages.clang-unwrapped.lib ];
+  cargoSha256 = "0b8v6c7q1abibzygrigldpd31lyd5ngmj4vq5d7zni96m20mm85w";
+
+  libclang = llvmPackages.libclang.lib; #for substituteAll
+
+  buildInputs = [ libclang ];
+
+  propagatedBuildInputs = [ clang ]; # to populate NIX_CXXSTDLIB_COMPILE
+
+  patches = [
+    # https://github.com/rust-lang-nursery/rust-bindgen/pull/1376
+    (fetchpatch {
+      url = https://github.com/rust-lang-nursery/rust-bindgen/commit/c8b5406f08af82a92bf8faf852c21ba941d9c176.patch;
+      sha256 = "16ibr2rplh0qz8rsq6gir45xlz5nasad4y8fprwhrb7ssv8wfkss";
+    })
+  ];
 
   configurePhase = ''
-    export LIBCLANG_PATH="${llvmPackages.clang-unwrapped.lib}/lib"
+    export LIBCLANG_PATH="${libclang}/lib"
   '';
 
   postInstall = ''
-    wrapProgram $out/bin/bindgen --set LIBCLANG_PATH "${llvmPackages.clang-unwrapped.lib}/lib"
+    mv $out/bin/{bindgen,.bindgen-wrapped};
+    substituteAll ${./wrapper.sh} $out/bin/bindgen
+    chmod +x $out/bin/bindgen
   '';
 
-  cargoSha256 = "0b8v6c7q1abibzygrigldpd31lyd5ngmj4vq5d7zni96m20mm85w";
-
-  doCheck = false; # A test fails because it can't find standard headers in NixOS
+  doCheck = false; # half the tests fail because our rustfmt is not nightly enough
+  checkInputs =
+    let fakeRustup = writeScriptBin "rustup" ''
+      #!${stdenv.shell}
+      shift
+      shift
+      exec "$@"
+    '';
+  in [
+    rustfmt
+    fakeRustup # the test suite insists in calling `rustup run nightly rustfmt`
+    clang
+  ];
 
   meta = with stdenv.lib; {
     description = "C and C++ binding generator";
+    longDescription = ''
+      Bindgen takes a c or c++ header file and turns them into
+      rust ffi declarations.
+      As with most compiler related software, this will only work
+      inside a nix-shell with the required libraries as buildInputs.
+    '';
     homepage = https://github.com/rust-lang-nursery/rust-bindgen;
     license = with licenses; [ bsd3 ];
     maintainers = [ maintainers.ralith ];
diff --git a/pkgs/development/tools/rust/bindgen/wrapper.sh b/pkgs/development/tools/rust/bindgen/wrapper.sh
new file mode 100755
index 000000000000..95cd0901cec8
--- /dev/null
+++ b/pkgs/development/tools/rust/bindgen/wrapper.sh
@@ -0,0 +1,36 @@
+#!/usr/bin/env bash
+sep='--'   # whether to add -- before new options
+cxx=0      # whether cxx was explicitly requested
+lastWasx=0 # whether the last argument passed was -x
+for e in "$@"; do
+  if [[ "$e" == "--" ]]; then
+    sep=
+  fi;
+  if [[ "$sep" == "" ]]; then
+    # we look for -x c++ after -- only
+    if [[ "$e" == "-x" ]]; then
+      lastWasx=1
+    fi;
+    if [[ $lastWasx -eq 1 && "$e" == "c++" ]]; then
+      lastWasx=0
+      cxx=1
+    fi;
+    if [[ "$e" == "-xc++" || "$e" == -std=c++* ]]; then
+      cxx=1
+    fi;
+  fi;
+done;
+cxxflags=
+if [[ $cxx -eq 1 ]]; then
+  cxxflags=$NIX_CXXSTDLIB_COMPILE
+fi;
+if [[ -n "$NIX_DEBUG" ]]; then
+  set -x;
+fi;
+export LIBCLANG_PATH="@libclang@/lib"
+# shellcheck disable=SC2086
+# cxxflags and NIX_CFLAGS_COMPILE should be word-split
+exec -a "$0" @out@/bin/.bindgen-wrapped "$@" $sep $cxxflags $NIX_CFLAGS_COMPILE
+# note that we add the flags after $@ which is incorrect. This is only for the sake
+# of simplicity.
+