1 { stdenv, lib, fetchFromGitHub, which, openssl, readline, fetchpatch }:
3 stdenv.mkDerivation rec {
5 version = "0.83-a3-phoenix";
7 src = fetchFromGitHub {
11 sha256 = "0a5a7mh2zw9lcdrl8n1mqccrc0xcgj7743l7l4kslkh722fxv625";
16 url = "https://github.com/thorkill/eresi/commit/a79406344cc21d594d27fa5ec5922abe9f7475e7.patch";
17 sha256 = "1mjjc6hj7r06iarvai7prcdvjk9g0k5vwrmkwcm7b8ivd5xzxp2z";
20 # Pull patch pending upstream inclusion for -fno-common toolchains:
21 # https://github.com/thorkill/eresi/pull/166
23 url = "https://github.com/thorkill/eresi/commit/bc5b9a75c326f277e5f89e01a3b8f7f0519a99f6.patch";
24 sha256 = "0lqwrnkkhhd3vi1r8ngvziyqkk09h98h93rrs3ndqi048a898ys1";
29 # Two occurences of fprintf() with only two arguments, which should really
32 # Upstream pull request: https://github.com/thorkill/eresi/pull/162
34 sed -i -e 's/fprintf(\(stderr\), *\([a-z0-9]\+\))/fputs(\2, \1)/g' \
35 libe2dbg/common/common.c libe2dbg/user/threads.c
37 # We need to patch out a few ifs here, because it tries to create a series
38 # of configuration files in ~/.something. However, our builds are sandboxed
39 # and also don't contain a valid home, so let's NOP it out :-)
41 # The second fix we need to make is that we need to pretend being Gentoo
42 # because otherwise the build process tries to link against libtermcap,
43 # which I think is solely for historic reasons (nowadays Terminfo should
44 # have largely superseded it).
45 sed -i -e '/^if \[ ! -e/c if false; then' \
46 -e 's/^GENTOO=.*/GENTOO=1/' configure
50 (if stdenv.is64bit then "--enable-32-64" else "--enable-32")
54 # The configure script is not generated by autoconf but is hand-rolled, so it
55 # has --enable-static but no --disabled-static and also doesn't support the
56 # equals sign in --prefix.
57 prefixKey = "--prefix ";
58 dontDisableStatic = true;
60 nativeBuildInputs = [ which ];
61 buildInputs = [ openssl readline ];
62 enableParallelBuilding = true;
64 installTargets = lib.singleton "install"
65 ++ lib.optional stdenv.is64bit "install64";
68 description = "The ERESI Reverse Engineering Software Interface";
69 license = lib.licenses.gpl2Only;
70 homepage = "https://github.com/thorkill/eresi"; # Formerly http://www.eresi-project.org/
71 platforms = lib.platforms.linux;