nixpkgs/pkgs/tools/security/ghidra/default.nix
2019-07-24 17:02:03 +01:00

49 lines
1.0 KiB
Nix

{ stdenv, fetchurl, unzip, lib, makeWrapper, autoPatchelfHook
, openjdk11, pam
}: let
pkg_path = "$out/lib/ghidra";
in stdenv.mkDerivation {
name = "ghidra-9.0.2";
src = fetchurl {
url = https://ghidra-sre.org/ghidra_9.0.2_PUBLIC_20190403.zip;
sha256 = "10ffd65c266e9f5b631c8ed96786c41ef30e2de939c3c42770573bb3548f8e9f";
};
nativeBuildInputs = [
makeWrapper
autoPatchelfHook
unzip
];
buildInputs = [
stdenv.cc.cc.lib
pam
];
dontStrip = true;
installPhase = ''
mkdir -p "${pkg_path}"
cp -a * "${pkg_path}"
'';
postFixup = ''
mkdir -p "$out/bin"
makeWrapper "${pkg_path}/ghidraRun" "$out/bin/ghidra" \
--prefix PATH : ${lib.makeBinPath [ openjdk11 ]}
'';
meta = with lib; {
description = "A software reverse engineering (SRE) suite of tools developed by NSA's Research Directorate in support of the Cybersecurity mission";
homepage = "https://ghidra-sre.org/";
platforms = [ "x86_64-linux" ];
license = licenses.asl20;
maintainers = [ maintainers.ck3d ];
};
}