Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at 22.05-pre 36 lines 1.1 kB view raw
1{ lib, stdenv, fetchFromGitHub, cmake }: 2 3stdenv.mkDerivation rec { 4 name = "hotpatch-0.2"; 5 6 src = fetchFromGitHub { 7 owner = "vikasnkumar"; 8 repo = "hotpatch"; 9 rev = "4b65e3f275739ea5aa798d4ad083c4cb10e29149"; 10 sha256 = "169vdh55wsbn6fl58lpzqx64v6ifzh7krykav33x1d9hsk98qjqh"; 11 }; 12 13 doCheck = true; 14 15 nativeBuildInputs = [ cmake ]; 16 17 preConfigure = '' 18 substituteInPlace test/loader.c \ 19 --replace \"/lib64/ld-linux-x86-64.so.2 \""$(cat $NIX_CC/nix-support/dynamic-linker)" \ 20 --replace \"/lib/ld-linux-x86-64.so.2 \""$(cat $NIX_CC/nix-support/dynamic-linker)" \ 21 --replace \"/lib/ld-linux.so.2 \""$(cat $NIX_CC/nix-support/dynamic-linker)" \ 22 --replace \"/lib32/ld-linux.so.2 \""$(cat $NIX_CC/nix-support/dynamic-linker)" 23 ''; 24 25 checkPhase = '' 26 LD_LIBRARY_PATH=$(pwd)/src make test 27 ''; 28 29 meta = with lib; { 30 description = "Hot patching executables on Linux using .so file injection"; 31 homepage = src.meta.homepage; 32 license = licenses.bsd3; 33 maintainers = [ ]; 34 platforms = ["i686-linux" "x86_64-linux"]; 35 }; 36}