diff --git a/default.nix b/default.nix index 7687427..057bb11 100644 --- a/default.nix +++ b/default.nix @@ -21,4 +21,5 @@ with pkgs; ieda = callPackage ./pkgs/ieda { }; abstract-machine = callPackage ./pkgs/abstract-machine { }; pcap2socks = callPackage ./pkgs/pcap2socks { }; + mini-gdbstub = callPackage ./pkgs/mini-gdbstub { }; } diff --git a/pkgs/mini-gdbstub/default.nix b/pkgs/mini-gdbstub/default.nix new file mode 100644 index 0000000..2b291c6 --- /dev/null +++ b/pkgs/mini-gdbstub/default.nix @@ -0,0 +1,36 @@ +{ lib +, stdenv +, fetchFromGitHub +, gnumake +}: + +stdenv.mkDerivation rec { + pname = "mini-gdbstub"; + version = "2024-04-25"; + + src = fetchFromGitHub { + owner = "xinyangli"; + repo = "mini-gdbstub"; + rev = "b434a22822b1d2f5a067faf621f9d246c70f3a93"; + hash = "sha256-tnnpwfYpVhIufbz+2rgiUhspo+Cuqco35b+eax20vQo="; + }; + + nativeBuildInputs = [ + gnumake + ]; + + installPhase = '' + mkdir -p $out/lib $out/include + cp build/libgdbstub.a $out/lib + cp include/gdbstub.h $out/include + ''; + + meta = with lib; { + description = "An implementation of the GDB Remote Serial Protocol to help you adding debug mode on emulator"; + homepage = "https://github.com/xinyangli/mini-gdbstub"; + license = licenses.mit; + maintainers = with maintainers; [ xinyangli ]; + mainProgram = "mini-gdbstub"; + platforms = platforms.all; + }; +}