summary refs log tree commit diff
path: root/pkgs/development/tools/misc/elfutils/default.nix
diff options
context:
space:
mode:
authorLluís Batlle i Rossell <viric@vicerveza.homeunix.net>2012-01-06 16:45:14 +0000
committerLluís Batlle i Rossell <viric@vicerveza.homeunix.net>2012-01-06 16:45:14 +0000
commitcae619da08cd663f05d905cbbd3b47f7d56aaa0b (patch)
tree7fab45a402a673e26cd98837df31f9de3f8a4bed /pkgs/development/tools/misc/elfutils/default.nix
parent8c063fdfc77114bb3d34b79033f880005ec46552 (diff)
downloadnixpkgs-cae619da08cd663f05d905cbbd3b47f7d56aaa0b.tar
nixpkgs-cae619da08cd663f05d905cbbd3b47f7d56aaa0b.tar.gz
nixpkgs-cae619da08cd663f05d905cbbd3b47f7d56aaa0b.tar.bz2
nixpkgs-cae619da08cd663f05d905cbbd3b47f7d56aaa0b.tar.lz
nixpkgs-cae619da08cd663f05d905cbbd3b47f7d56aaa0b.tar.xz
nixpkgs-cae619da08cd663f05d905cbbd3b47f7d56aaa0b.tar.zst
nixpkgs-cae619da08cd663f05d905cbbd3b47f7d56aaa0b.zip
Updating elfutils/perf to cross-build. I tested this for the nanonote.
I add newt, checking that it cross-builds too.

I update perf to have newt support, and now it's also finding python, whatever
that means. I've not tested if 'python' as buildInputs is enough.


svn path=/nixpkgs/trunk/; revision=31353
Diffstat (limited to 'pkgs/development/tools/misc/elfutils/default.nix')
-rw-r--r--pkgs/development/tools/misc/elfutils/default.nix51
1 files changed, 48 insertions, 3 deletions
diff --git a/pkgs/development/tools/misc/elfutils/default.nix b/pkgs/development/tools/misc/elfutils/default.nix
index 79ba4a3732c..980ead10084 100644
--- a/pkgs/development/tools/misc/elfutils/default.nix
+++ b/pkgs/development/tools/misc/elfutils/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, zlib, bzip2, xz, m4}:
+{stdenv, fetchurl, m4, zlib, bzip2, xz, bison, flex, gettext}:
 
 # TODO: Look at the hardcoded paths to kernel, modules etc.
 stdenv.mkDerivation rec {
@@ -13,9 +13,54 @@ stdenv.mkDerivation rec {
     sha256 = "19mlgxyzcwiv64ynj2cibgkiw4qkm3n37kizvy6555dsmlaqfybq";
   };
 
-  buildInputs = [ zlib bzip2 xz ];
+  patches = [
+    (fetchurl {
+      url = https://fedorahosted.org/releases/e/l/elfutils/0.152/elfutils-portability.patch;
+      sha256 = "0q318w4cvvqv9ps4xcwphapj1gl31isgjyya4y9sm72qj68n61p0";
+    }) ];
 
-  buildNativeInputs = [m4];
+  # We need bzip2 in NativeInputs because otherwise we can't unpack the src,
+  # as the host-bzip2 will be in the path.
+  buildNativeInputs = [m4 bison flex gettext bzip2];
+  buildInputs = [zlib bzip2 xz];
+
+  crossAttrs = {
+
+    /* Having bzip2 will harm, because anything using elfutils 
+       as buildInput cross-building, will not be able to run 'bzip2' */
+    propagatedBuildInputs = [ zlib.hostDrv ];
+
+    # This program does not cross-build fine. So I only cross-build some parts
+    # I need for the linux perf tool.
+    # On the awful cross-building:
+    # http://comments.gmane.org/gmane.comp.sysutils.elfutils.devel/2005
+    #
+    # I wrote this testing for the nanonote.
+    buildPhase = ''
+      pushd libebl
+      make
+      popd
+      pushd libelf
+      make
+      popd
+      pushd libdwfl
+      make
+      popd
+      pushd libdw
+      make
+      popd
+    '';
+
+    installPhase = ''
+      pushd libelf
+      make install
+      popd
+      pushd libdw
+      make install
+      popd
+      cp version.h $out/include
+    '';
+  };
   
   dontAddDisableDepTrack = true;