diff --git a/pkgs/development/libraries/libmtp/default.nix b/pkgs/development/libraries/libmtp/default.nix index 4ca15f01a6d3..ff6f889ee3e9 100644 --- a/pkgs/development/libraries/libmtp/default.nix +++ b/pkgs/development/libraries/libmtp/default.nix @@ -2,12 +2,14 @@ , autoconf , automake , fetchFromGitHub +, fetchpatch , gettext , lib , libiconv , libtool , libusb1 , pkg-config +, buildPackages }: stdenv.mkDerivation rec { @@ -21,6 +23,14 @@ stdenv.mkDerivation rec { sha256 = "sha256-/tyCoEW/rCLfZH2HhA3Nxuij9d/ZJgsfyP4fLlfyNRA="; }; + patches = [ + # Backport cross fix. + (fetchpatch { + url = "https://github.com/libmtp/libmtp/commit/467fa26e6b14c0884b15cf6d191de97e5513fe05.patch"; + sha256 = "2DrRrdcguJ9su4LxtT6YOjer8gUTxIoHVpk+6M9P4cg="; + }) + ]; + outputs = [ "bin" "dev" "out" ]; nativeBuildInputs = [ @@ -41,6 +51,10 @@ stdenv.mkDerivation rec { configurePlatforms = [ "build" "host" ]; + makeFlags = lib.optionals (stdenv.isLinux && !stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ + "MTP_HOTPLUG=${buildPackages.libmtp}/bin/mtp-hotplug" + ]; + enableParallelBuilding = true; meta = with lib; {