From be84b9978a3916e6e480e24f04e1988ba3071fea Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Mon, 30 Jun 2025 07:19:45 +0100 Subject: [PATCH] libmtp: fix built against `gettext-0.25` Without the change the build fails as: configure.ac:265: the top level configure:14220: error: possibly undefined macro: AC_LIB_PREPARE_PREFIX If this token and others are legitimate, please use m4_pattern_allow. See the Autoconf documentation. --- pkgs/by-name/li/libmtp/package.nix | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/li/libmtp/package.nix b/pkgs/by-name/li/libmtp/package.nix index d3edc7c2cf41..f5c2eb548f08 100644 --- a/pkgs/by-name/li/libmtp/package.nix +++ b/pkgs/by-name/li/libmtp/package.nix @@ -3,6 +3,7 @@ autoconf, automake, fetchFromGitHub, + fetchpatch, gettext, lib, libiconv, @@ -23,6 +24,20 @@ stdenv.mkDerivation rec { sha256 = "sha256-hIH6W8qQ6DB4ST7SlFz6CCnLsEGOWgmUb9HoHMNA3wY="; }; + patches = [ + # gettext-0.25 support + (fetchpatch { + name = "gettext-0.25.patch"; + url = "https://github.com/libmtp/libmtp/commit/5e53ee68e61cc6547476b942b6aa9776da5d4eda.patch"; + hash = "sha256-eXDNDHg8K+ZiO9n4RqQPJrh4V9GNiK/ZxZOA/oIX83M="; + }) + (fetchpatch { + name = "gettext-0.25-p2.patch"; + url = "https://github.com/libmtp/libmtp/commit/122eb9d78b370955b9c4d7618b12a2429f01b81a.patch"; + hash = "sha256-Skqr6REBl/Egf9tS5q8k5qmEhFY+rG2fymbiu9e4Mho="; + }) + ]; + outputs = [ "bin" "dev" @@ -41,7 +56,10 @@ stdenv.mkDerivation rec { propagatedBuildInputs = [ libusb1 ]; - preConfigure = "NOCONFIGURE=1 ./autogen.sh"; + preConfigure = '' + autopoint -f + NOCONFIGURE=1 ./autogen.sh + ''; configureFlags = [ "--with-udev=${placeholder "out"}/lib/udev" ];