summary refs log tree commit diff
path: root/pkgs/development/tools
diff options
context:
space:
mode:
authoraszlig <aszlig@nix.build>2018-07-31 08:08:33 +0200
committeraszlig <aszlig@nix.build>2018-07-31 08:17:39 +0200
commitc8b973d3186082f7fd3f3663eea1415556a1ba63 (patch)
treedd4e475d4aa554f85708061fd08b3d2136cda6e1 /pkgs/development/tools
parent7ae2ba173f3938170778d1a913e415e2ff78c9e6 (diff)
downloadnixlib-c8b973d3186082f7fd3f3663eea1415556a1ba63.tar
nixlib-c8b973d3186082f7fd3f3663eea1415556a1ba63.tar.gz
nixlib-c8b973d3186082f7fd3f3663eea1415556a1ba63.tar.bz2
nixlib-c8b973d3186082f7fd3f3663eea1415556a1ba63.tar.lz
nixlib-c8b973d3186082f7fd3f3663eea1415556a1ba63.tar.xz
nixlib-c8b973d3186082f7fd3f3663eea1415556a1ba63.tar.zst
nixlib-c8b973d3186082f7fd3f3663eea1415556a1ba63.zip
eresi: init at 0.83-a3-phoenix
While I'm not sure whether it's suitable for my tasks it might be useful
for others doing reverse engineering, so I decided to package it.

The software seems to have stalled development since a while but became
active again recently, so hopefully some of the issues with packaging
will be fixed and they might want to move away from their handwritten
configure script.

I've tested the package on both i686-linux and x86_64-linux, however the
automated test suite seems to be broken upstream at the moment so I
didn't set doCheck to true, but once this is fixed, we can enable them
in a future update.

Signed-off-by: aszlig <aszlig@nix.build>
Diffstat (limited to 'pkgs/development/tools')
-rw-r--r--pkgs/development/tools/analysis/eresi/default.nix60
1 files changed, 60 insertions, 0 deletions
diff --git a/pkgs/development/tools/analysis/eresi/default.nix b/pkgs/development/tools/analysis/eresi/default.nix
new file mode 100644
index 000000000000..00c020e3f404
--- /dev/null
+++ b/pkgs/development/tools/analysis/eresi/default.nix
@@ -0,0 +1,60 @@
+{ stdenv, lib, fetchFromGitHub, which, openssl, readline }:
+
+stdenv.mkDerivation rec {
+  name = "eresi-${version}";
+  version = "0.83-a3-phoenix";
+
+  src = fetchFromGitHub {
+    owner = "thorkill";
+    repo = "eresi";
+    rev = version;
+    sha256 = "0a5a7mh2zw9lcdrl8n1mqccrc0xcgj7743l7l4kslkh722fxv625";
+  };
+
+  postPatch = ''
+    # Two occurences of fprintf() with only two arguments, which should really
+    # be fputs().
+    #
+    # Upstream pull request: https://github.com/thorkill/eresi/pull/162
+    #
+    sed -i -e 's/fprintf(\(stderr\), *\([a-z0-9]\+\))/fputs(\2, \1)/g' \
+      libe2dbg/common/common.c libe2dbg/user/threads.c
+
+    # We need to patch out a few ifs here, because it tries to create a series
+    # of configuration files in ~/.something. However, our builds are sandboxed
+    # and also don't contain a valid home, so let's NOP it out :-)
+    #
+    # The second fix we need to make is that we need to pretend being Gentoo
+    # because otherwise the build process tries to link against libtermcap,
+    # which I think is solely for historic reasons (nowadays Terminfo should
+    # have largely superseded it).
+    sed -i -e '/^if \[ ! -e/c if false; then' \
+           -e 's/^GENTOO=.*/GENTOO=1/' configure
+  '';
+
+  configureFlags = [
+    (if stdenv.is64bit then "--enable-32-64" else "--enable-32")
+    "--enable-readline"
+  ];
+
+  # The configure script is not generated by autoconf but is hand-rolled, so it
+  # has --enable-static but no --disabled-static and also doesn't support the
+  # equals sign in --prefix.
+  prefixKey = "--prefix ";
+  dontDisableStatic = true;
+
+  nativeBuildInputs = [ which ];
+  buildInputs = [ openssl readline ];
+  enableParallelBuilding = true;
+
+  installTargets = lib.singleton "install"
+                ++ lib.optional stdenv.is64bit "install64";
+
+  meta = {
+    description = "The ERESI Reverse Engineering Software Interface";
+    license = lib.licenses.gpl2;
+    homepage = http://www.eresi-project.org/;
+    maintainers = [ lib.maintainers.aszlig ];
+    platforms = lib.platforms.linux;
+  };
+}