libtree: init at 2.0.0

This commit is contained in:
Pavol Rusnak 2021-12-04 11:11:21 +01:00
parent 86d00441b0
commit c549f68b7d
No known key found for this signature in database
GPG key ID: 91F3B339B9A02A3D
2 changed files with 59 additions and 0 deletions

View file

@ -0,0 +1,57 @@
{ lib
, stdenv
, fetchFromGitHub
, fetchpatch
, binutils
, chrpath
, cmake
, cxxopts
, elfio
, termcolor
, gtest
}:
stdenv.mkDerivation rec {
pname = "libtree";
version = "2.0.0";
src = fetchFromGitHub {
owner = "haampie";
repo = "libtree";
rev = "v${version}";
sha256 = "sha256-j54fUwMkX4x4MwL8gMraguK9GqQRBjCC+W6ojFnQdHQ=";
};
patches = [
# add missing include
# https://github.com/haampie/libtree/pull/42
(fetchpatch {
url = "https://github.com/haampie/libtree/commit/219643ff6edcae42c9546b8ba38cfec9d19b034e.patch";
sha256 = "sha256-vdFmmBdBiOT3QBcwd3SuiolcaFTFAb88kU1KN8229K0=";
})
];
postPatch = ''
substituteInPlace src/main.cpp \
--replace "std::string strip = \"strip\";" "std::string strip = \"${binutils}/bin/strip\";" \
--replace "std::string chrpath = \"chrpath\";" "std::string chrpath = \"${chrpath}/bin/chrpath\";"
'';
nativeBuildInputs = [ cmake ];
buildInputs = [ cxxopts elfio termcolor ];
doCheck = true;
checkInputs = [ gtest ];
cmakeFlags = [ "-DLIBTREE_BUILD_TESTS=ON" ];
meta = with lib; {
description = "Tree ldd with an option to bundle dependencies into a single folder";
homepage = "https://github.com/haampie/libtree";
license = licenses.mit;
platforms = platforms.linux;
maintainers = with maintainers; [ prusnak rardiol ];
};
}

View file

@ -7312,6 +7312,8 @@ with pkgs;
libtins = callPackage ../development/libraries/libtins { };
libtree = callPackage ../development/tools/misc/libtree { };
libshout = callPackage ../development/libraries/libshout { };
libqb = callPackage ../development/libraries/libqb { };