Merge pull request #80784 from enolan/fix-eatmydata

libeatmydata: fix launcher script - find shell library properly

authored by

Matthew Bauer and committed by
GitHub
bacccb78 58858fab

+25 -6
+5 -6
pkgs/development/libraries/libeatmydata/default.nix
··· 2 2 3 3 stdenv.mkDerivation rec { 4 4 name = "libeatmydata-105"; 5 - 5 + 6 6 src = fetchurl { 7 7 url = "https://www.flamingspork.com/projects/libeatmydata/${name}.tar.gz"; 8 8 sha256 = "1pd8sc73cgc41ldsvq6g8ics1m5k8gdcb91as9yg8z5jnrld1lmx"; 9 9 }; 10 10 11 - buildInputs = [ makeWrapper ]; 12 - 13 - postInstall = '' 14 - wrapProgram $out/bin/eatmydata \ 15 - --prefix PATH : $out/bin 11 + patches = [ ./find-shell-lib.patch ]; 12 + patchFlags = "-p0"; 13 + postPatch = '' 14 + substituteInPlace eatmydata.in --replace NIX_OUT_DIR $out 16 15 ''; 17 16 18 17 meta = {
+20
pkgs/development/libraries/libeatmydata/find-shell-lib.patch
··· 1 + --- eatmydata.in 2020-02-01 18:10:59.618679823 -0800 2 + +++ eatmydata.in.new 2020-02-01 18:08:25.092620247 -0800 3 + @@ -15,15 +15,8 @@ 4 + # You should have received a copy of the GNU General Public License 5 + # along with this program. If not, see <http://www.gnu.org/licenses/>. 6 + 7 + -export `dpkg-architecture|grep DEB_BUILD_MULTIARCH` 8 + - 9 + -shlib="/usr/lib/$DEB_BUILD_MULTIARCH/eatmydata.sh" 10 + -if [ -f "$shlib" ]; then 11 + - . "$shlib" 12 + -else 13 + - echo "Unable to locate eatmydata shell library, it was not enabled" >&2 14 + - exec "$@" 15 + -fi 16 + +shlib="NIX_OUT_DIR/libexec/eatmydata.sh" 17 + +. "$shlib" 18 + 19 + usage() 20 + {