at 24.05-pre 76 lines 2.8 kB view raw
1{ stdenv, lib, fetchFromGitHub, which, openssl, readline, fetchpatch }: 2 3stdenv.mkDerivation rec { 4 pname = "eresi"; 5 version = "0.83-a3-phoenix"; 6 7 src = fetchFromGitHub { 8 owner = "thorkill"; 9 repo = "eresi"; 10 rev = version; 11 sha256 = "0a5a7mh2zw9lcdrl8n1mqccrc0xcgj7743l7l4kslkh722fxv625"; 12 }; 13 14 patches = [ 15 (fetchpatch { 16 url = "https://github.com/thorkill/eresi/commit/a79406344cc21d594d27fa5ec5922abe9f7475e7.patch"; 17 sha256 = "1mjjc6hj7r06iarvai7prcdvjk9g0k5vwrmkwcm7b8ivd5xzxp2z"; 18 }) 19 20 # Pull patch pending upstream inclusion for -fno-common toolchains: 21 # https://github.com/thorkill/eresi/pull/166 22 (fetchpatch { 23 url = "https://github.com/thorkill/eresi/commit/bc5b9a75c326f277e5f89e01a3b8f7f0519a99f6.patch"; 24 sha256 = "0lqwrnkkhhd3vi1r8ngvziyqkk09h98h93rrs3ndqi048a898ys1"; 25 }) 26 ]; 27 28 postPatch = '' 29 # Two occurences of fprintf() with only two arguments, which should really 30 # be fputs(). 31 # 32 # Upstream pull request: https://github.com/thorkill/eresi/pull/162 33 # 34 sed -i -e 's/fprintf(\(stderr\), *\([a-z0-9]\+\))/fputs(\2, \1)/g' \ 35 libe2dbg/common/common.c libe2dbg/user/threads.c 36 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 :-) 40 # 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 47 ''; 48 49 configureFlags = [ 50 (if stdenv.is64bit then "--enable-32-64" else "--enable-32") 51 "--enable-readline" 52 ]; 53 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; 59 60 nativeBuildInputs = [ which ]; 61 buildInputs = [ openssl readline ]; 62 enableParallelBuilding = true; 63 # ln: failed to create symbolic link '...-eresi-0.83-a3-phoenix//bin/elfsh': No such file or directory 64 # make: *** [Makefile:108: install64] Error 1 65 enableParallelInstalling = false; 66 67 installTargets = lib.singleton "install" 68 ++ lib.optional stdenv.is64bit "install64"; 69 70 meta = { 71 description = "The ERESI Reverse Engineering Software Interface"; 72 license = lib.licenses.gpl2Only; 73 homepage = "https://github.com/thorkill/eresi"; # Formerly http://www.eresi-project.org/ 74 platforms = lib.platforms.linux; 75 }; 76}