forked from mirrors/nixpkgs
ghidra: 9.04 -> 9.1
* ghidra: 9.04 -> 9.1 Update Ghidra from 9.04 to 9.1 * ghidra: Added desktop file Add a desktop file for Ghidra Ghidra ships its icons as a .ico file, which isn't support by freedesktop. This means that to have icons, we need to extract the pngs from ghidra.ico, then copy them to the relevant folders. This adds a requirement on a library to extract them, and also requires them to be copied over, which isn't ideal.
This commit is contained in:
parent
d52cfb7661
commit
fdca231242
|
@ -1,16 +1,26 @@
|
|||
{ stdenv, fetchurl, unzip, lib, makeWrapper, autoPatchelfHook
|
||||
, openjdk11, pam
|
||||
, 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 {
|
||||
|
||||
name = "ghidra-9.0.4";
|
||||
name = "ghidra-9.1";
|
||||
|
||||
src = fetchurl {
|
||||
url = https://ghidra-sre.org/ghidra_9.0.4_PUBLIC_20190516.zip;
|
||||
sha256 = "1gqqxk57hswwgr97qisqivcfgjdxjipfdshyh4r76dyrfpa0q3d5";
|
||||
url = https://ghidra-sre.org/ghidra_9.1_PUBLIC_20191023.zip;
|
||||
sha256 = "0pl7s59008gvgwz4mxp7rz3xr3vaa12a6s5zvx2yr9jxx3gk1l99";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
|
@ -22,13 +32,24 @@ in stdenv.mkDerivation {
|
|||
buildInputs = [
|
||||
stdenv.cc.cc.lib
|
||||
pam
|
||||
icoutils
|
||||
];
|
||||
|
||||
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 = ''
|
||||
|
|
Loading…
Reference in a new issue