2021-01-21 17:00:13 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, cmake }:
|
2017-10-08 07:03:54 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2021-11-09 22:12:55 +00:00
|
|
|
pname = "hotpatch";
|
|
|
|
version = "0.2";
|
2017-10-08 07:03:54 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "vikasnkumar";
|
|
|
|
repo = "hotpatch";
|
|
|
|
rev = "4b65e3f275739ea5aa798d4ad083c4cb10e29149";
|
|
|
|
sha256 = "169vdh55wsbn6fl58lpzqx64v6ifzh7krykav33x1d9hsk98qjqh";
|
|
|
|
};
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake ];
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
substituteInPlace test/loader.c \
|
|
|
|
--replace \"/lib64/ld-linux-x86-64.so.2 \""$(cat $NIX_CC/nix-support/dynamic-linker)" \
|
|
|
|
--replace \"/lib/ld-linux-x86-64.so.2 \""$(cat $NIX_CC/nix-support/dynamic-linker)" \
|
|
|
|
--replace \"/lib/ld-linux.so.2 \""$(cat $NIX_CC/nix-support/dynamic-linker)" \
|
|
|
|
--replace \"/lib32/ld-linux.so.2 \""$(cat $NIX_CC/nix-support/dynamic-linker)"
|
|
|
|
'';
|
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
LD_LIBRARY_PATH=$(pwd)/src make test
|
|
|
|
'';
|
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
meta = with lib; {
|
2017-10-08 07:03:54 +01:00
|
|
|
description = "Hot patching executables on Linux using .so file injection";
|
|
|
|
homepage = src.meta.homepage;
|
|
|
|
license = licenses.bsd3;
|
2021-04-29 06:21:13 +01:00
|
|
|
maintainers = [ ];
|
2017-10-08 07:03:54 +01:00
|
|
|
platforms = ["i686-linux" "x86_64-linux"];
|
|
|
|
};
|
|
|
|
}
|