uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead
https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948 this can do it nicely. Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
commit
56de2bcd43
30691 changed files with 3076956 additions and 0 deletions
80
pkgs/tools/security/ghidra/default.nix
Normal file
80
pkgs/tools/security/ghidra/default.nix
Normal file
|
|
@ -0,0 +1,80 @@
|
|||
{ stdenv
|
||||
, fetchzip
|
||||
, lib
|
||||
, makeWrapper
|
||||
, autoPatchelfHook
|
||||
, openjdk11
|
||||
, pam
|
||||
, makeDesktopItem
|
||||
, icoutils
|
||||
}:
|
||||
|
||||
let
|
||||
|
||||
pkg_path = "$out/lib/ghidra";
|
||||
|
||||
desktopItem = makeDesktopItem {
|
||||
name = "ghidra";
|
||||
exec = "ghidra";
|
||||
icon = "ghidra";
|
||||
desktopName = "Ghidra";
|
||||
genericName = "Ghidra Software Reverse Engineering Suite";
|
||||
categories = [ "Development" ];
|
||||
};
|
||||
|
||||
in stdenv.mkDerivation rec {
|
||||
pname = "ghidra";
|
||||
version = "10.1.4";
|
||||
versiondate = "20220519";
|
||||
|
||||
src = fetchzip {
|
||||
url = "https://github.com/NationalSecurityAgency/ghidra/releases/download/Ghidra_${version}_build/ghidra_${version}_PUBLIC_${versiondate}.zip";
|
||||
sha256 = "sha256-cOrmM+uE2ajGaYg9CmDHT3/hje7K9cmsq6u9MjkCHWk=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
makeWrapper
|
||||
icoutils
|
||||
]
|
||||
++ lib.optionals stdenv.isLinux [ autoPatchelfHook ];
|
||||
|
||||
buildInputs = [
|
||||
stdenv.cc.cc.lib
|
||||
pam
|
||||
];
|
||||
|
||||
dontStrip = true;
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p "${pkg_path}"
|
||||
mkdir -p "${pkg_path}" "$out/share/applications"
|
||||
cp -a * "${pkg_path}"
|
||||
ln -s ${desktopItem}/share/applications/* $out/share/applications
|
||||
|
||||
icotool -x "${pkg_path}/support/ghidra.ico"
|
||||
rm ghidra_4_40x40x32.png
|
||||
for f in ghidra_*.png; do
|
||||
res=$(basename "$f" ".png" | cut -d"_" -f3 | cut -d"x" -f1-2)
|
||||
mkdir -pv "$out/share/icons/hicolor/$res/apps"
|
||||
mv "$f" "$out/share/icons/hicolor/$res/apps/ghidra.png"
|
||||
done;
|
||||
'';
|
||||
|
||||
postFixup = ''
|
||||
mkdir -p "$out/bin"
|
||||
ln -s "${pkg_path}/ghidraRun" "$out/bin/ghidra"
|
||||
|
||||
wrapProgram "${pkg_path}/support/launch.sh" \
|
||||
--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://github.com/NationalSecurityAgency/ghidra";
|
||||
platforms = [ "x86_64-linux" "x86_64-darwin" ];
|
||||
sourceProvenance = with sourceTypes; [ binaryBytecode ];
|
||||
license = licenses.asl20;
|
||||
maintainers = with maintainers; [ ck3d govanify mic92 ];
|
||||
};
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue