diff --git a/pkgs/tools/X11/bumblebee/default.nix b/pkgs/tools/X11/bumblebee/default.nix index 480c929e941a..116a7a014eab 100644 --- a/pkgs/tools/X11/bumblebee/default.nix +++ b/pkgs/tools/X11/bumblebee/default.nix @@ -20,6 +20,7 @@ , glib, libbsd , libX11, libXext, xorgserver, xkbcomp, kmod, xkeyboard_config, xf86videonouveau , nvidia_x11, virtualgl, primusLib +, automake111x, autoconf # The below should only be non-null in a x86_64 system. On a i686 # system the above nvidia_x11 and virtualgl will be the i686 packages. # TODO: Confusing. Perhaps use "SubArch" instead of i686? @@ -48,6 +49,15 @@ let xmodules = lib.concatStringsSep "," (map (x: "${x.out or x}/lib/xorg/modules") ([ xorgserver ] ++ lib.optional (!useNvidia) xf86videonouveau)); + modprobePatch = fetchurl { + url = "https://github.com/Bumblebee-Project/Bumblebee/commit/1ada79fe5916961fc4e4917f8c63bb184908d986.patch"; + sha256 = "0x9qvhw6sn606dqcp3394irj6jjhw3h75k3lpbys6gha1yshgjps"; + }; + libkmodPatch = fetchurl { + url = "https://github.com/Bumblebee-Project/Bumblebee/commit/deceb14cdf2c90ff64ebd1010a674305464587da.patch"; + sha256 = "0j2v0lncjfn2nw3324q3n69lw3yz3hah6bscc8xn9a2df2dcawj1"; + }; + in stdenv.mkDerivation rec { name = "bumblebee-${version}"; @@ -56,7 +66,12 @@ in stdenv.mkDerivation rec { sha256 = "03p3gvx99lwlavznrpg9l7jnl1yfg2adcj8jcjj0gxp20wxp060h"; }; - patches = [ ./nixos.patch ]; + patches = [ + ./nixos.patch + + modprobePatch + libkmodPatch + ]; # By default we don't want to use a display device nvidiaDeviceOptions = lib.optionalString (!useDisplayDevice) '' @@ -75,13 +90,6 @@ in stdenv.mkDerivation rec { ''; preConfigure = '' - # Substitute the path to the actual modinfo program in module.c. - # Note: module.c also calls rmmod and modprobe, but those just have to - # be in PATH, and thus no action for them is required. - - substituteInPlace src/module.c \ - --replace "/sbin/modinfo" "${kmod}/sbin/modinfo" - # Don't use a special group, just reuse wheel. substituteInPlace configure \ --replace 'CONF_GID="bumblebee"' 'CONF_GID="wheel"' @@ -96,7 +104,8 @@ in stdenv.mkDerivation rec { # Build-time dependencies of bumblebeed and optirun. # Note that it has several runtime dependencies. - buildInputs = [ libX11 glib libbsd ]; + buildInputs = [ libX11 glib libbsd ] + ++ [ kmod automake111x autoconf ]; nativeBuildInputs = [ makeWrapper pkgconfig help2man ]; # The order of LDPATH is very specific: First X11 then the host