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