boomerang: Refactor and fix build.

Thanks to @phreedom for reporting the broken URL used fetchgit, which
was because I deleted my fork repository. Fortunately, in the meantime
other forks got to a more "working" state and being more actively
maintained than my fork. So that's why I switched using @nemerle's fork
now, as it is the the most usable one out there, at least in our case.

One stupid thing I've done in the first place was to use "1.0pre" as the
version and the fork uses "alpha 0.3.2", so it essentially is some kind
of a "downgrade" if you just look at the version.

Fortunately, peer-unreviewed research based on guesswork has shown that
I'm the only one using Boomerang on NixOS, so this shouldn't have a big
impact on the other non-existent users.

Also, this drops dependencies on boehmgc and cppunit, because building
with either one or both will fail at the moment.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
This commit is contained in:
aszlig 2013-08-26 22:34:25 +02:00
parent efa748a166
commit 35229f0cf4
No known key found for this signature in database
GPG key ID: D0EBD0EC8C2DC961
2 changed files with 43 additions and 21 deletions

View file

@ -1,29 +1,49 @@
{ stdenv, fetchgit, cmake, boehmgc, expat, cppunit }:
{ stdenv, fetchgit, cmake, expat }:
stdenv.mkDerivation {
name = "boomerang-1.0pre";
buildInputs = [ cmake boehmgc expat cppunit ];
installPhase = ''
for loaderfile in loader/*.so
do
install -vD "$loaderfile" "$out/lib/$(basename "$loaderfile")"
done
install -vD boomerang "$out/bin/boomerang"
'';
patches = [ ./dlopen_path.patch ];
stdenv.mkDerivation rec {
name = "boomerang-${version}";
version = "0.3.2alpha";
src = fetchgit {
url = "git://github.com/aszlig/boomerang.git";
rev = "d0b147a5dfc915a5fa8fe6c517e66a049a37bf22";
sha256 = "6cfd95a3539ff45c18b17de76407568b0d0c17fde4e45dda54486c7eac113969";
url = "https://github.com/nemerle/boomerang.git";
rev = "78c6b9dd33790be43dcb07edc549161398904006";
sha256 = "1hh8v0kcnipwrfz4d45d6pm5bzbm9wgbrdgg0ir2l7wyshbkff6i";
};
buildInputs = [ cmake expat ];
postPatch = ''
sed -i -e 's/-std=c++0x/-std=c++11 -fpermissive/' CMakeLists.txt
# 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
# 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;
meta = {
homepage = http://boomerang.sourceforge.net/;
homepage = "http://boomerang.sourceforge.net/";
license = stdenv.lib.licenses.bsd3;
description = "A general, open source, retargetable decompiler";
};

View file

@ -515,7 +515,9 @@ let
bmon = callPackage ../tools/misc/bmon { };
boomerang = callPackage ../development/tools/boomerang { };
boomerang = callPackage ../development/tools/boomerang {
stdenv = overrideGCC stdenv gcc47;
};
bootchart = callPackage ../tools/system/bootchart { };