2021-11-02 22:14:34 +00:00
|
|
|
{ stdenv
|
|
|
|
, autoconf
|
|
|
|
, automake
|
|
|
|
, fetchFromGitHub
|
2023-04-24 20:34:25 +00:00
|
|
|
, fetchpatch
|
2021-11-02 22:14:34 +00:00
|
|
|
, gettext
|
|
|
|
, lib
|
2020-11-16 21:38:56 +00:00
|
|
|
, libiconv
|
2021-11-02 22:14:34 +00:00
|
|
|
, libtool
|
|
|
|
, libusb1
|
|
|
|
, pkg-config
|
2023-04-24 20:34:25 +00:00
|
|
|
, buildPackages
|
2020-11-16 21:38:56 +00:00
|
|
|
}:
|
2010-09-26 19:39:28 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2020-11-16 21:38:56 +00:00
|
|
|
pname = "libmtp";
|
2023-04-27 05:48:33 +00:00
|
|
|
version = "1.1.21";
|
2010-09-26 19:39:28 +00:00
|
|
|
|
2020-11-16 21:38:56 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "libmtp";
|
|
|
|
repo = "libmtp";
|
|
|
|
rev = "libmtp-${builtins.replaceStrings [ "." ] [ "-" ] version}";
|
2023-04-27 05:48:33 +00:00
|
|
|
sha256 = "sha256-m9QFVD8udQ3SdGwn276BnIKqGeATA5QuokOK29Ykc1k=";
|
2010-09-26 19:39:28 +00:00
|
|
|
};
|
|
|
|
|
2023-04-24 20:34:25 +00:00
|
|
|
patches = [
|
|
|
|
# Backport cross fix.
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/libmtp/libmtp/commit/467fa26e6b14c0884b15cf6d191de97e5513fe05.patch";
|
|
|
|
sha256 = "2DrRrdcguJ9su4LxtT6YOjer8gUTxIoHVpk+6M9P4cg=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2016-08-29 00:30:01 +00:00
|
|
|
outputs = [ "bin" "dev" "out" ];
|
2015-10-17 21:24:10 +00:00
|
|
|
|
2020-11-16 21:38:56 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
autoconf
|
|
|
|
automake
|
|
|
|
gettext
|
|
|
|
libtool
|
2021-01-19 06:50:56 +00:00
|
|
|
pkg-config
|
2020-11-16 21:38:56 +00:00
|
|
|
];
|
|
|
|
|
2021-11-02 22:14:34 +00:00
|
|
|
buildInputs = [ libiconv ];
|
2020-11-16 21:38:56 +00:00
|
|
|
|
2021-11-02 22:14:34 +00:00
|
|
|
propagatedBuildInputs = [ libusb1 ];
|
|
|
|
|
2022-11-08 19:47:31 +00:00
|
|
|
preConfigure = "NOCONFIGURE=1 ./autogen.sh";
|
2020-11-16 21:38:56 +00:00
|
|
|
|
2021-11-02 22:14:34 +00:00
|
|
|
configureFlags = [ "--with-udev=${placeholder "out"}/lib/udev" ];
|
2015-10-17 21:24:10 +00:00
|
|
|
|
2022-11-08 19:47:31 +00:00
|
|
|
configurePlatforms = [ "build" "host" ];
|
|
|
|
|
2023-04-24 20:34:25 +00:00
|
|
|
makeFlags = lib.optionals (stdenv.isLinux && !stdenv.buildPlatform.canExecute stdenv.hostPlatform) [
|
|
|
|
"MTP_HOTPLUG=${buildPackages.libmtp}/bin/mtp-hotplug"
|
|
|
|
];
|
|
|
|
|
2021-11-02 22:14:34 +00:00
|
|
|
enableParallelBuilding = true;
|
2015-10-17 21:24:10 +00:00
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
meta = with lib; {
|
2021-11-02 22:14:34 +00:00
|
|
|
homepage = "https://github.com/libmtp/libmtp";
|
2010-09-26 19:39:28 +00:00
|
|
|
description = "An implementation of Microsoft's Media Transfer Protocol";
|
|
|
|
longDescription = ''
|
|
|
|
libmtp is an implementation of Microsoft's Media Transfer Protocol (MTP)
|
|
|
|
in the form of a library suitable primarily for POSIX compliant operating
|
|
|
|
systems. We implement MTP Basic, the stuff proposed for standardization.
|
2021-11-02 22:14:34 +00:00
|
|
|
'';
|
2018-10-18 19:06:37 +00:00
|
|
|
platforms = platforms.unix;
|
|
|
|
license = licenses.lgpl21;
|
2021-11-02 22:14:34 +00:00
|
|
|
maintainers = with maintainers; [ lovesegfault ];
|
2010-09-26 19:39:28 +00:00
|
|
|
};
|
|
|
|
}
|