From 9692553cb583e8dca46b66ab76c0eb2ada1a4098 Mon Sep 17 00:00:00 2001 From: Matt McHenry Date: Sat, 11 Jan 2025 16:00:57 -0500 Subject: [PATCH] epson-escpr: restore correct install layout (#373003) in 75ad85225676171bb0743533f156b58b5023c35c, some new patches were added (to deal with gcc 14, among other things). these patches disagree with the source tarball about the line endings of the files being patches. in that commit, the solution was to run dos2unix across the entire source tree. however, that produced this failure: WARNING: 'aclocal-1.15' is missing on your system. You should only need it if you modified 'acinclude.m4' or 'configure.ac' or m4 files included by 'configure.ac'. so in that same commit, automake and autoconf were added to nativeBuildInputs. this fixed that error, but it meant that the 'configure' script was regenerated. and that's a problem, because cups-filter-ppd-dirs.patch patches the 'configure' script to ensure that the installPhase doesn't introduce weird partial store paths under $out. as it turns out, there is only one file that is both touched by the new patches and comes with dos line endings in the source tarball. so, we can be much more focused with our invocation of dos2unix. this prevents the build from seeing unexpected modifications and deciding to try to clobber our patch to the 'configure' script. further, if we shift our invocation of dos2unix from the unpack phase to the patch phase, we've already cd'd into the unpacked source directory, so we don't need any obscure bash voodoo to figure out its name. --- pkgs/by-name/ep/epson-escpr/package.nix | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/pkgs/by-name/ep/epson-escpr/package.nix b/pkgs/by-name/ep/epson-escpr/package.nix index 5d6882fe04fb..a90a7f95e675 100644 --- a/pkgs/by-name/ep/epson-escpr/package.nix +++ b/pkgs/by-name/ep/epson-escpr/package.nix @@ -5,8 +5,6 @@ cups, fetchpatch, dos2unix, - automake115x, - autoconf, }: let @@ -29,17 +27,10 @@ stdenv.mkDerivation { ]; sha256 = "sha256-hVbX4OXPe4y37Szju3uVdXlVdjX4DFSN/A2Emz3eCcQ="; }; - # DOS Line Endings in /lib directory and UNIX Line endings in /src directory. - # So convert everything to UNIX style line endings. - # Since the files are modified, autoconf and automake is required - postUnpack = '' - dir=''${src%-*} - cd ''${dir#*-} - local f - for f in $(find ./ -type f || die); do - ${dos2unix}/bin/dos2unix $f - done - cd .. + # the patches above are expecting unix line endings, but one of the files + # being patched has dos line endings in the source tarball + prePatch = '' + ${dos2unix}/bin/dos2unix lib/epson-escpr-api.h ''; patches = [ @@ -59,10 +50,6 @@ stdenv.mkDerivation { "-p1" ]; buildInputs = [ cups ]; - nativeBuildInputs = [ - automake115x - autoconf - ]; meta = with lib; { homepage = "http://download.ebz.epson.net/dsc/search/01/search/";