epson-escpr: restore correct install layout (#373003)

in 75ad852256, 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.
This commit is contained in:
Matt McHenry
2025-01-11 22:00:57 +01:00
committed by GitHub
parent 4408852cd4
commit 9692553cb5
+4 -17
View File
@@ -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/";