2018-06-25 17:13:02 +02:00
|
|
|
{ stdenv, fetchFromGitHub
|
|
|
|
# nativeBuildInputs
|
2018-07-11 01:12:30 +02:00
|
|
|
, qmake, pkgconfig, makeWrapper
|
2018-06-25 17:13:02 +02:00
|
|
|
# Qt
|
|
|
|
, qtbase, qtsvg, qtwebengine
|
|
|
|
# buildInputs
|
|
|
|
, radare2
|
|
|
|
, python3 }:
|
2017-12-05 02:33:51 +01:00
|
|
|
|
2018-03-04 07:50:42 +01:00
|
|
|
|
2017-12-05 02:33:51 +01:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "radare2-cutter-${version}";
|
2018-07-10 23:53:00 +02:00
|
|
|
version = "1.5";
|
2017-12-05 02:33:51 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "radareorg";
|
|
|
|
repo = "cutter";
|
|
|
|
rev = "v${version}";
|
2018-07-10 23:53:00 +02:00
|
|
|
sha256 = "0xwls8jhhigdkwyq3nf9xwcz4inm5smwinkyliwmfzvfflbbci5c";
|
2017-12-05 02:33:51 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
postUnpack = "export sourceRoot=$sourceRoot/src";
|
|
|
|
|
2018-07-11 00:09:36 +02:00
|
|
|
# Remove this "very helpful" helper file intended for discovering r2,
|
|
|
|
# as it's a doozy of harddcoded paths and unexpected behavior.
|
|
|
|
# Happily Nix has everything all set so we don't need it,
|
|
|
|
# other than as basis for the qmakeFlags set below.
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace Cutter.pro \
|
|
|
|
--replace "include(lib_radare2.pri)" ""
|
|
|
|
'';
|
|
|
|
|
2018-07-11 01:12:30 +02:00
|
|
|
nativeBuildInputs = [ qmake pkgconfig makeWrapper ];
|
2018-06-25 17:13:02 +02:00
|
|
|
buildInputs = [ qtbase qtsvg qtwebengine radare2 python3 ];
|
2017-12-05 02:33:51 +01:00
|
|
|
|
2018-07-11 00:09:36 +02:00
|
|
|
qmakeFlags = [ "CONFIG+=link_pkgconfig" "PKGCONFIG+=r_core" ];
|
|
|
|
|
2018-07-11 01:12:30 +02:00
|
|
|
# Fix crash on startup in some situations
|
|
|
|
postInstall = ''
|
|
|
|
wrapProgram $out/bin/Cutter \
|
|
|
|
--prefix QT_PLUGIN_PATH : ${qtbase.bin}/${qtbase.qtPluginPrefix} \
|
|
|
|
--prefix LD_LIBRARY_PATH : ${qtbase.out}/lib
|
|
|
|
'';
|
|
|
|
|
2017-12-05 02:33:51 +01:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "A Qt and C++ GUI for radare2 reverse engineering framework";
|
|
|
|
homepage = src.meta.homepage;
|
|
|
|
license = licenses.gpl3;
|
|
|
|
maintainers = with maintainers; [ dtzWill ];
|
|
|
|
};
|
|
|
|
}
|