1{ lib
2, stdenv
3, fetchFromGitHub
4, testers
5, libtree
6, runCommand
7, coreutils
8, dieHook
9}:
10
11stdenv.mkDerivation (finalAttrs: {
12 pname = "libtree";
13 version = "3.1.1";
14
15 src = fetchFromGitHub {
16 owner = "haampie";
17 repo = "libtree";
18 rev = "v${finalAttrs.version}";
19 hash = "sha256-q3JtQ9AxoP0ma9K96cC3gf6QmQ1FbS7T7I59qhkwbMk=";
20 };
21
22 makeFlags = [ "PREFIX=$(out)" ];
23
24 # Fails at https://github.com/haampie/libtree/blob/v3.1.1/tests/07_origin_is_relative_to_symlink_location_not_realpath/Makefile#L28
25 doCheck = false;
26
27 passthru.tests = {
28 version = testers.testVersion {
29 package = libtree;
30 command = "libtree --version";
31 version = finalAttrs.version;
32 };
33 checkCoreUtils = runCommand "${finalAttrs.pname}-ls-test" {
34 nativeBuildInputs = [ finalAttrs.finalPackage dieHook ];
35 } ''
36 libtree ${coreutils}/bin/ls > $out || die "libtree failed to show dependencies."
37 [ -s $out ]
38 '';
39 };
40
41 meta = with lib; {
42 description = "Tree ldd with an option to bundle dependencies into a single folder";
43 homepage = "https://github.com/haampie/libtree";
44 license = licenses.mit;
45 platforms = platforms.linux;
46 maintainers = with maintainers; [ prusnak rardiol ];
47 };
48})