2017-07-28 15:10:59 +01:00
|
|
|
{ lib, stdenv, fetchurl, m4, zlib, bzip2, bison, flex, gettext, xz, setupDebugInfoDirs }:
|
2009-02-17 16:42:51 +00:00
|
|
|
|
2012-01-05 23:15:48 +00:00
|
|
|
# TODO: Look at the hardcoded paths to kernel, modules etc.
|
2009-02-17 16:42:51 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2012-01-05 23:15:48 +00:00
|
|
|
name = "elfutils-${version}";
|
2018-11-19 22:21:00 +00:00
|
|
|
version = "0.175";
|
2013-03-17 09:26:44 +00:00
|
|
|
|
2009-02-17 16:42:51 +00:00
|
|
|
src = fetchurl {
|
2017-01-08 22:30:05 +00:00
|
|
|
url = "https://sourceware.org/elfutils/ftp/${version}/${name}.tar.bz2";
|
2018-11-19 22:21:00 +00:00
|
|
|
sha256 = "0nx6nzbk0rw3pxbzxsfvrjjh37hibzd2gjz5bb8wccpf85ar5vzp";
|
2009-02-17 16:42:51 +00:00
|
|
|
};
|
|
|
|
|
2018-08-08 22:10:14 +01:00
|
|
|
patches = [ ./debug-info-from-env.patch ];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
patchShebangs tests
|
|
|
|
'';
|
2017-07-28 15:10:59 +01:00
|
|
|
|
2016-02-26 17:38:15 +00:00
|
|
|
hardeningDisable = [ "format" ];
|
2015-12-23 01:59:47 +00:00
|
|
|
|
2012-01-06 16:45:14 +00:00
|
|
|
# We need bzip2 in NativeInputs because otherwise we can't unpack the src,
|
|
|
|
# as the host-bzip2 will be in the path.
|
2016-01-15 13:59:53 +00:00
|
|
|
nativeBuildInputs = [ m4 bison flex gettext bzip2 ];
|
|
|
|
buildInputs = [ zlib bzip2 xz ];
|
|
|
|
|
2017-07-28 15:10:59 +01:00
|
|
|
propagatedNativeBuildInputs = [ setupDebugInfoDirs ];
|
|
|
|
|
2016-01-15 13:59:53 +00:00
|
|
|
configureFlags =
|
|
|
|
[ "--program-prefix=eu-" # prevent collisions with binutils
|
|
|
|
"--enable-deterministic-archives"
|
|
|
|
];
|
2012-01-06 16:45:14 +00:00
|
|
|
|
2016-01-15 13:59:53 +00:00
|
|
|
enableParallelBuilding = true;
|
2013-04-05 23:45:25 +01:00
|
|
|
|
2018-07-23 22:58:48 +01:00
|
|
|
# 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.
|
2012-01-06 16:45:14 +00:00
|
|
|
|
2018-07-25 01:11:51 +01:00
|
|
|
buildPhase = stdenv.lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
|
2018-07-23 22:58:48 +01:00
|
|
|
pushd libebl
|
|
|
|
make
|
|
|
|
popd
|
|
|
|
pushd libelf
|
|
|
|
make
|
|
|
|
popd
|
|
|
|
pushd libdwfl
|
|
|
|
make
|
|
|
|
popd
|
|
|
|
pushd libdw
|
|
|
|
make
|
|
|
|
popd
|
|
|
|
'';
|
2012-01-06 16:45:14 +00:00
|
|
|
|
2018-07-25 01:11:51 +01:00
|
|
|
installPhase = stdenv.lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
|
2018-07-23 22:58:48 +01:00
|
|
|
pushd libelf
|
|
|
|
make install
|
|
|
|
popd
|
|
|
|
pushd libdwfl
|
|
|
|
make install
|
|
|
|
popd
|
|
|
|
pushd libdw
|
|
|
|
make install
|
|
|
|
popd
|
|
|
|
cp version.h $out/include
|
|
|
|
'';
|
2013-04-05 23:45:25 +01:00
|
|
|
|
2018-08-08 22:10:14 +01:00
|
|
|
doCheck = false; # fails 3 out of 174 tests
|
|
|
|
doInstallCheck = false; # fails 70 out of 174 tests
|
|
|
|
|
2009-02-17 16:42:51 +00:00
|
|
|
meta = {
|
2017-01-08 22:30:05 +00:00
|
|
|
homepage = https://sourceware.org/elfutils/;
|
2016-01-15 13:59:53 +00:00
|
|
|
description = "A set of utilities to handle ELF objects";
|
|
|
|
platforms = lib.platforms.linux;
|
|
|
|
license = lib.licenses.gpl3;
|
2016-11-20 17:05:18 +00:00
|
|
|
maintainers = [ lib.maintainers.eelco ];
|
2009-02-17 16:42:51 +00:00
|
|
|
};
|
|
|
|
}
|