nur-packages

My NUR packages
git clone git://git.sikmir.ru/nur-packages
Log | Files | Refs | README | LICENSE

default.nix (1358B)


      1 { lib
      2 , stdenv
      3 , fetchFromGitHub
      4 , runtimeShell
      5 , writeScript
      6 , procps
      7 , binutils-unwrapped
      8 , gdb
      9 , python3
     10 }:
     11 let
     12   initGef = writeScript "init-gef" ''
     13     source @out@/share/gef/gef.py
     14   '';
     15 
     16   gdbGef = writeScript "gdb-gef" (
     17     with lib; ''
     18       #!${runtimeShell}
     19       export PATH="${makeBinPath [ procps binutils-unwrapped python3 ]}:$PATH"
     20       export NIX_PYTHONPATH="${pythonPath}"
     21       ${gdb}/bin/gdb -x @out@/share/gef/init-gef "$@"
     22     ''
     23   );
     24 
     25   pythonPath = with python3.pkgs; makePythonPath [
     26     capstone
     27     unicorn
     28   ];
     29 in
     30 stdenv.mkDerivation rec {
     31   pname = "gef";
     32   version = "2021.07";
     33 
     34   src = fetchFromGitHub {
     35     owner = "hugsy";
     36     repo = pname;
     37     rev = version;
     38     hash = "sha256-zKn3yS9h8bzjsb/iPgNU8g5IgXFBaKvM7osTqzzv16s=";
     39   };
     40 
     41   dontBuild = true;
     42   doCheck = false;
     43 
     44   installPhase = ''
     45     install -Dm644 gef.py -t $out/share/gef
     46     install -Dm644 ${initGef} $out/share/gef/init-gef
     47     install -Dm755 ${gdbGef} $out/bin/gdb-gef
     48   '';
     49 
     50   postFixup = ''
     51     substituteInPlace $out/share/gef/init-gef --subst-var out
     52     substituteInPlace $out/bin/gdb-gef --subst-var out
     53   '';
     54 
     55   meta = with lib; {
     56     description = "GDB Enhanced Features for exploit devs & reversers";
     57     homepage = "http://gef.rtfd.io/";
     58     license = licenses.mit;
     59     platforms = platforms.all;
     60     maintainers = [ maintainers.sikmir ];
     61   };
     62 }