New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ghidra: build from source #105636
ghidra: build from source #105636
Conversation
@@ -0,0 +1,70 @@ | |||
{ stdenv, fetchzip, lib, makeWrapper, autoPatchelfHook |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{ stdenv, fetchzip, lib, makeWrapper, autoPatchelfHook | |
{ stdenv, fetchzip, makeWrapper, autoPatchelfHook |
lib can be replaced with stdenv.lib.
|
||
|
||
in stdenv.mkDerivation rec { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in stdenv.mkDerivation rec { | |
in stdenv.mkDerivation rec { |
|
||
pname = "ghidra"; | ||
version = "9.2"; | ||
versiondate = "20201113"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please leave a comment here when to update which and where this can be found.
dontStrip = true; | ||
|
||
installPhase = '' | ||
mkdir -p "${pkg_path}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mkdir -p "${pkg_path}" |
installPhase = '' | ||
mkdir -p "${pkg_path}" | ||
mkdir -p "${pkg_path}" "$out/share/applications" | ||
cp -a * "${pkg_path}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cp -a * "${pkg_path}" | |
cp -a . "${pkg_path}" |
Isn't this the same with the difference that yours fails if the path contains 1024 chars of files?
pkg_path = "$out/lib/ghidra"; | ||
let | ||
|
||
# To update: Install gradle2nix from https://github.com/tadfisher/gradle2nix |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we convert this to a nix-shell comamnd?
]; | ||
envSpec = ./gradle-env.json; | ||
nativeBuildInputs = [ bison flex icoutils libarchive makeWrapper ]; | ||
buildJdk = jdk; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This variable is not used anywhere and has no special meaning in buildGradle. Please define it in the other derviation as an default input instead of here.
mkdir -p $sourceRoot/flatRepo | ||
ln -s ${dex2jar}/lib/dex2jar/lib/dex-*.jar $sourceRoot/flatRepo/ | ||
ln -s ${axmlprinter2} $sourceRoot/flatRepo/AXMLPrinter2.jar | ||
ln -s ${hfsexplorer}/lib/{csframework.jar,hfsx_dmglib.jar,hfsx.jar,iharder-base64.jar} $sourceRoot/flatRepo/ | ||
|
||
mkdir -p $sourceRoot/Ghidra/Features/GhidraServer/build/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mkdir -p $sourceRoot/flatRepo | |
ln -s ${dex2jar}/lib/dex2jar/lib/dex-*.jar $sourceRoot/flatRepo/ | |
ln -s ${axmlprinter2} $sourceRoot/flatRepo/AXMLPrinter2.jar | |
ln -s ${hfsexplorer}/lib/{csframework.jar,hfsx_dmglib.jar,hfsx.jar,iharder-base64.jar} $sourceRoot/flatRepo/ | |
mkdir -p $sourceRoot/Ghidra/Features/GhidraServer/build/ | |
mkdir -p $sourceRoot/flatRepo $sourceRoot/Ghidra/Features/GhidraServer/build/ | |
ln -s ${dex2jar}/lib/dex2jar/lib/dex-*.jar $sourceRoot/flatRepo/ | |
ln -s ${axmlprinter2} $sourceRoot/flatRepo/AXMLPrinter2.jar | |
ln -s ${hfsexplorer}/lib/{csframework.jar,hfsx_dmglib.jar,hfsx.jar,iharder-base64.jar} $sourceRoot/flatRepo/ | |
mkdir -p "${pkg_path}" | ||
mkdir -p "${pkg_path}" "$out/share/applications" | ||
cp -a * "${pkg_path}" | ||
mkdir -p $out/{bin,share/applications,share/ghidra} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mkdir -p $out/{bin,share/applications,share/ghidra} | |
mkdir -p $out/bin $out/share/applications $out/share/ghidra |
This is easier to read while only marginally longer.
@@ -2184,7 +2184,11 @@ in | |||
|
|||
gh-ost = callPackage ../tools/misc/gh-ost { }; | |||
|
|||
ghidra-bin = callPackage ../tools/security/ghidra { }; | |||
ghidra = callPackage ../tools/security/ghidra { | |||
jdk = jdk11; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it make any difference when you overwrite this at runtime? If not this can be removed.
I marked this as stale due to inactivity. → More info |
Motivation for this change
ghidra-bin
is currently a patched binary release. This change adds aghidra
derivation which builds Ghidra from source using a configuration generated by gradle2nix.Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)