lol
1{ stdenv, fetchgit, cmake, expat }:
2
3stdenv.mkDerivation rec {
4 name = "boomerang-${version}";
5 version = "0.3.2alpha";
6
7 src = fetchgit {
8 url = "https://github.com/nemerle/boomerang.git";
9 rev = "78c6b9dd33790be43dcb07edc549161398904006";
10 sha256 = "1hh8v0kcnipwrfz4d45d6pm5bzbm9wgbrdgg0ir2l7wyshbkff6i";
11 };
12
13 buildInputs = [ cmake expat ];
14
15 postPatch = ''
16 sed -i -e 's/-std=c++0x/-std=c++11 -fpermissive/' CMakeLists.txt
17
18 # Hardcode library base path ("lib/" is appended elsewhere)
19 sed -i -e 's|::m_base_path = "|&'"$out"'/|' loader/BinaryFileFactory.cpp
20 # Deactivate setting base path at runtime
21 sed -i -e 's/m_base_path *=[^}]*//' include/BinaryFile.h
22
23 # Fix up shared directory locations
24 shared="$out/share/boomerang/"
25 find frontend -name '*.cpp' -print | xargs sed -i -e \
26 's|Boomerang::get()->getProgPath()|std::string("'"$shared"'")|'
27
28 cat >> loader/CMakeLists.txt <<CMAKE
29 INSTALL(TARGETS bffDump BinaryFile
30 ElfBinaryFile Win32BinaryFile ExeBinaryFile HpSomBinaryFile
31 PalmBinaryFile DOS4GWBinaryFile MachOBinaryFile
32 RUNTIME DESTINATION bin
33 LIBRARY DESTINATION lib)
34 CMAKE
35
36 cat >> CMakeLists.txt <<CMAKE
37 INSTALL(TARGETS boomerang DESTINATION bin)
38 INSTALL(DIRECTORY signatures DESTINATION share/boomerang)
39 INSTALL(DIRECTORY frontend/machine DESTINATION share/boomerang/frontend)
40 CMAKE
41 '';
42
43 enableParallelBuilding = true;
44
45 meta = {
46 homepage = "http://boomerang.sourceforge.net/";
47 license = stdenv.lib.licenses.bsd3;
48 description = "A general, open source, retargetable decompiler";
49 };
50}