boomerang: update to latest git, un-mark broken

* Now with Qt UI
* Rework kludges to help boomerang find itself
* update/rework cmake bits for installation
* Fix output directory path defaults
This commit is contained in:
Will Dietz 2017-03-30 10:57:59 -05:00
parent f9a1060199
commit 6778aa8690
3 changed files with 87 additions and 28 deletions

View File

@ -1,43 +1,31 @@
{ stdenv, fetchgit, cmake, expat }:
{ stdenv, fetchgit, cmake, expat, qt5, boost }:
stdenv.mkDerivation rec {
name = "boomerang-${version}";
version = "0.3.2alpha";
version = "0.3.99-alpha-2016-11-02";
src = fetchgit {
url = "https://github.com/nemerle/boomerang.git";
rev = "78c6b9dd33790be43dcb07edc549161398904006";
sha256 = "1n49wx2v9r40mh5kdkspqvc8rccpb4s004qxqvn4fwc59dm0pqbs";
rev = "f95d6436845e9036c8cfbd936731449475f79b7a";
sha256 = "1q3q92lfj24ij5sxdbdhcqyan28r6db1w80yrks4csf9zjij1ixh";
};
buildInputs = [ cmake expat ];
buildInputs = [ cmake expat qt5.qtbase boost ];
patches = [ ./fix-install.patch ./fix-output.patch ];
postPatch = ''
sed -i -e 's/-std=c++0x/-std=c++11 -fpermissive/' CMakeLists.txt
substituteInPlace loader/BinaryFileFactory.cpp \
--replace '"lib"' '"../lib"'
# Hardcode library base path ("lib/" is appended elsewhere)
sed -i -e 's|::m_base_path = "|&'"$out"'/|' loader/BinaryFileFactory.cpp
# Deactivate setting base path at runtime
sed -i -e 's/m_base_path *=[^}]*//' include/BinaryFile.h
substituteInPlace ui/DecompilerThread.cpp \
--replace '"output"' '"./output"'
# Fix up shared directory locations
shared="$out/share/boomerang/"
find frontend -name '*.cpp' -print | xargs sed -i -e \
's|Boomerang::get()->getProgPath()|std::string("'"$shared"'")|'
substituteInPlace boomerang.cpp \
--replace 'progPath("./")' "progPath(\"$out/share/boomerang/\")"
cat >> loader/CMakeLists.txt <<CMAKE
INSTALL(TARGETS bffDump BinaryFile
ElfBinaryFile Win32BinaryFile ExeBinaryFile HpSomBinaryFile
PalmBinaryFile DOS4GWBinaryFile MachOBinaryFile
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib)
CMAKE
cat >> CMakeLists.txt <<CMAKE
INSTALL(TARGETS boomerang DESTINATION bin)
INSTALL(DIRECTORY signatures DESTINATION share/boomerang)
INSTALL(DIRECTORY frontend/machine DESTINATION share/boomerang/frontend)
CMAKE
substituteInPlace ui/commandlinedriver.cpp \
--replace "QFileInfo(args[0]).absolutePath()" "\"$out/share/boomerang/\""
'';
enableParallelBuilding = true;
@ -46,6 +34,5 @@ stdenv.mkDerivation rec {
homepage = "http://boomerang.sourceforge.net/";
license = stdenv.lib.licenses.bsd3;
description = "A general, open source, retargetable decompiler";
broken = true;
};
}

View File

@ -0,0 +1,48 @@
From 5851256422a4debc34c956439d8129a4d5f80722 Mon Sep 17 00:00:00 2001
From: Will Dietz <w@wdtz.org>
Date: Thu, 30 Mar 2017 10:06:03 -0500
Subject: [PATCH] cmake: add install bits
---
CMakeLists.txt | 3 +++
loader/CMakeLists.txt | 2 ++
ui/CMakeLists.txt | 2 ++
3 files changed, 7 insertions(+)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 826fe307..740861db 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -113,3 +113,6 @@ SET_PROPERTY(TARGET boom_base PROPERTY CXX_STANDARD_REQUIRED ON)
ADD_SUBDIRECTORY(loader)
ADD_SUBDIRECTORY(ui)
+
+INSTALL(DIRECTORY signatures DESTINATION share/boomerang)
+INSTALL(DIRECTORY frontend/machine DESTINATION share/boomerang/frontend)
diff --git a/loader/CMakeLists.txt b/loader/CMakeLists.txt
index b371d366..dcf715fd 100644
--- a/loader/CMakeLists.txt
+++ b/loader/CMakeLists.txt
@@ -6,6 +6,8 @@ macro(BOOMERANG_ADD_LOADER name)
endif()
qt5_use_modules(${target_name} Core)
set_target_properties(${target_name} PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}/out/lib")
+ install(TARGETS "${target_name}"
+ LIBRARY DESTINATION lib)
endmacro()
BOOMERANG_ADD_LOADER(Elf elf/ElfBinaryFile.cpp elf/ElfBinaryFile.h)
diff --git a/ui/CMakeLists.txt b/ui/CMakeLists.txt
index f6fe3271..8729b522 100644
--- a/ui/CMakeLists.txt
+++ b/ui/CMakeLists.txt
@@ -26,3 +26,5 @@ boom_base frontend db type boomerang_DSLs codegen util boom_base
${CMAKE_THREAD_LIBS_INIT} boomerang_passes
)
qt5_use_modules(boomerang Core Xml Widgets)
+
+INSTALL(TARGETS boomerang DESTINATION bin)
--
2.11.0

View File

@ -0,0 +1,24 @@
From f3f5f888a1b1fe72ea8fc8cc96ef4ee386011e1c Mon Sep 17 00:00:00 2001
From: Will Dietz <w@wdtz.org>
Date: Thu, 30 Mar 2017 11:21:38 -0500
Subject: [PATCH] don't default to writing to program directory
---
boomerang.cpp | 1 -
1 file changed, 1 deletion(-)
diff --git a/boomerang.cpp b/boomerang.cpp
index 5951ed91..b592f482 100644
--- a/boomerang.cpp
+++ b/boomerang.cpp
@@ -601,7 +601,6 @@ int Boomerang::processCommand(QStringList &args) {
*/
void Boomerang::setProgPath(const QString &p) {
progPath = p + "/";
- outputPath = progPath + "/output/"; // Default output path (can be overridden with -o below)
}
/**
--
2.11.0