3
0
Fork 0
forked from mirrors/nixpkgs

Merge pull request #80784 from enolan/fix-eatmydata

libeatmydata: fix launcher script - find shell library properly
This commit is contained in:
Matthew Bauer 2020-03-22 14:42:52 -04:00 committed by GitHub
commit bacccb7823
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 6 deletions

View file

@ -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 = {

View file

@ -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 <http://www.gnu.org/licenses/>.
-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()
{