2013-08-26 22:34:25 +02:00
|
|
|
{ stdenv, fetchgit, cmake, expat }:
|
2012-08-09 18:58:51 +02:00
|
|
|
|
2013-08-26 22:34:25 +02:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "boomerang-${version}";
|
|
|
|
version = "0.3.2alpha";
|
2012-08-09 18:58:51 +02:00
|
|
|
|
2013-08-26 22:34:25 +02:00
|
|
|
src = fetchgit {
|
|
|
|
url = "https://github.com/nemerle/boomerang.git";
|
|
|
|
rev = "78c6b9dd33790be43dcb07edc549161398904006";
|
2016-06-02 13:26:44 +02:00
|
|
|
sha256 = "1n49wx2v9r40mh5kdkspqvc8rccpb4s004qxqvn4fwc59dm0pqbs";
|
2013-08-26 22:34:25 +02:00
|
|
|
};
|
2012-08-09 18:58:51 +02:00
|
|
|
|
2013-08-26 22:34:25 +02:00
|
|
|
buildInputs = [ cmake expat ];
|
2012-08-09 18:58:51 +02:00
|
|
|
|
2013-08-26 22:34:25 +02:00
|
|
|
postPatch = ''
|
|
|
|
sed -i -e 's/-std=c++0x/-std=c++11 -fpermissive/' CMakeLists.txt
|
2012-08-09 18:58:51 +02:00
|
|
|
|
2013-08-26 22:34:25 +02:00
|
|
|
# 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
|
2012-08-10 15:02:19 +02:00
|
|
|
|
2013-08-26 22:34:25 +02:00
|
|
|
# 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"'")|'
|
|
|
|
|
|
|
|
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
|
|
|
|
'';
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
2012-08-09 18:58:51 +02:00
|
|
|
|
|
|
|
meta = {
|
2013-08-26 22:34:25 +02:00
|
|
|
homepage = "http://boomerang.sourceforge.net/";
|
2012-08-09 18:58:51 +02:00
|
|
|
license = stdenv.lib.licenses.bsd3;
|
|
|
|
description = "A general, open source, retargetable decompiler";
|
|
|
|
};
|
|
|
|
}
|