From 613176666f3f414c2f0a4b3639aa47076aa824c5 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Wed, 22 Jun 2016 01:55:49 +0200 Subject: =?UTF-8?q?=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hel.nix | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/hel.nix b/hel.nix index d1b39371..f024d829 100644 --- a/hel.nix +++ b/hel.nix @@ -58,8 +58,16 @@ ''; samsung-unified-linux-driver = pkgs.stdenv.lib.overrideDerivation pkgs.samsung-unified-linux-driver (oldAttrs: { - installPhase = '' - ${oldAttrs.installPhase} + postInstall = '' + my_patchelf() { + opts=(); while [[ "$1" != - ]]; do opts+=( "$1" ); shift; done; shift + for binary in "$@"; do + echo "Patching ELF file: $binary" + patchelf "''${opts[@]}" $binary + ldd $binary | grep "not found" && exit 1 + done; true + } + my_patchelf \ --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \ --set-rpath ${pkgs.cups}/lib:$(cat $NIX_CC/nix-support/orig-cc)/lib:${pkgs.stdenv.glibc}/lib \ -- cgit v1.2.3