nixpkgs/pkgs/by-name/li/libmtp/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

73 lines
1.7 KiB
Nix

{ stdenv
, autoconf
, automake
, fetchFromGitHub
, fetchpatch
, gettext
, lib
, libiconv
, libtool
, libusb1
, pkg-config
, buildPackages
}:
stdenv.mkDerivation rec {
pname = "libmtp";
version = "1.1.21";
src = fetchFromGitHub {
owner = "libmtp";
repo = "libmtp";
rev = "libmtp-${builtins.replaceStrings [ "." ] [ "-" ] version}";
sha256 = "sha256-m9QFVD8udQ3SdGwn276BnIKqGeATA5QuokOK29Ykc1k=";
};
patches = [
# Backport cross fix.
(fetchpatch {
url = "https://github.com/libmtp/libmtp/commit/467fa26e6b14c0884b15cf6d191de97e5513fe05.patch";
sha256 = "2DrRrdcguJ9su4LxtT6YOjer8gUTxIoHVpk+6M9P4cg=";
})
];
outputs = [ "bin" "dev" "out" ];
nativeBuildInputs = [
autoconf
automake
gettext
libtool
pkg-config
];
buildInputs = [ libiconv ];
propagatedBuildInputs = [ libusb1 ];
preConfigure = "NOCONFIGURE=1 ./autogen.sh";
configureFlags = [ "--with-udev=${placeholder "out"}/lib/udev" ];
configurePlatforms = [ "build" "host" ];
makeFlags = lib.optionals (stdenv.hostPlatform.isLinux && !stdenv.buildPlatform.canExecute stdenv.hostPlatform) [
"MTP_HOTPLUG=${buildPackages.libmtp}/bin/mtp-hotplug"
];
enableParallelBuilding = true;
meta = with lib; {
homepage = "https://github.com/libmtp/libmtp";
description = "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.
'';
platforms = platforms.unix;
license = licenses.lgpl21;
maintainers = with maintainers; [ lovesegfault ];
};
}