From 4e9b94836fb3b548685bab95d4c07caa03fc0748 Mon Sep 17 00:00:00 2001 From: Echo Nolan Date: Sat, 22 Feb 2020 02:16:29 -0800 Subject: [PATCH] libeatmydata: fix launcher script - find shell library properly The new version of the launcher script in version 105 doesn't have the #8665 bug, but it does try to find the shell library using Debian tools, which obviously doesn't work on Nix. Removed the now-unneccessary makeWrapper and patched out the Debian bits. --- .../libraries/libeatmydata/default.nix | 11 +++++----- .../libeatmydata/find-shell-lib.patch | 20 +++++++++++++++++++ 2 files changed, 25 insertions(+), 6 deletions(-) create mode 100644 pkgs/development/libraries/libeatmydata/find-shell-lib.patch diff --git a/pkgs/development/libraries/libeatmydata/default.nix b/pkgs/development/libraries/libeatmydata/default.nix index 5127231dab6..29ca85cdeb0 100644 --- a/pkgs/development/libraries/libeatmydata/default.nix +++ b/pkgs/development/libraries/libeatmydata/default.nix @@ -2,17 +2,16 @@ stdenv.mkDerivation rec { name = "libeatmydata-105"; - + src = fetchurl { url = "https://www.flamingspork.com/projects/libeatmydata/${name}.tar.gz"; sha256 = "1pd8sc73cgc41ldsvq6g8ics1m5k8gdcb91as9yg8z5jnrld1lmx"; }; - buildInputs = [ makeWrapper ]; - - postInstall = '' - wrapProgram $out/bin/eatmydata \ - --prefix PATH : $out/bin + patches = [ ./find-shell-lib.patch ]; + patchFlags = "-p0"; + postPatch = '' + substituteInPlace eatmydata.in --replace NIX_OUT_DIR $out ''; meta = { diff --git a/pkgs/development/libraries/libeatmydata/find-shell-lib.patch b/pkgs/development/libraries/libeatmydata/find-shell-lib.patch new file mode 100644 index 00000000000..a6320edda29 --- /dev/null +++ b/pkgs/development/libraries/libeatmydata/find-shell-lib.patch @@ -0,0 +1,20 @@ +--- eatmydata.in 2020-02-01 18:10:59.618679823 -0800 ++++ eatmydata.in.new 2020-02-01 18:08:25.092620247 -0800 +@@ -15,15 +15,8 @@ + # You should have received a copy of the GNU General Public License + # along with this program. If not, see . + +-export `dpkg-architecture|grep DEB_BUILD_MULTIARCH` +- +-shlib="/usr/lib/$DEB_BUILD_MULTIARCH/eatmydata.sh" +-if [ -f "$shlib" ]; then +- . "$shlib" +-else +- echo "Unable to locate eatmydata shell library, it was not enabled" >&2 +- exec "$@" +-fi ++shlib="NIX_OUT_DIR/libexec/eatmydata.sh" ++. "$shlib" + + usage() + {