{ lib, stdenv, fetchurl, autoreconfHook, fetchFromGitHub, unstableGitUpdater }: stdenv.mkDerivation rec { pname = "patchelf"; version = "unstable-2023-03-18"; src = fetchFromGitHub { owner = "NixOS"; repo = "patchelf"; rev = "265b31ae22c6e1d20b01295aaa7bcf28fd31a5cf"; sha256 = "sha256-+iGvdjXvhk5mN8jp3u+M9fICKFqbtyZCx+WjQszaB1o="; }; # Drop test that fails on musl (?) postPatch = lib.optionalString stdenv.hostPlatform.isMusl '' substituteInPlace tests/Makefile.am \ --replace "set-rpath-library.sh" "" ''; setupHook = [ ./setup-hook.sh ]; nativeBuildInputs = [ autoreconfHook ]; buildInputs = [ ]; doCheck = !stdenv.isDarwin; passthru = { updateScript = unstableGitUpdater { url = "https://github.com/NixOS/patchelf.git"; }; }; meta = with lib; { homepage = "https://github.com/NixOS/patchelf"; license = licenses.gpl3; description = "A small utility to modify the dynamic linker and RPATH of ELF executables"; maintainers = [ maintainers.eelco ]; platforms = platforms.all; }; }