unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#52472] [PATCH] gnu: Add libtree
@ 2021-12-13 20:42 Artyom V. Poptsov
  2021-12-18  8:02 ` Artyom V. Poptsov
  0 siblings, 1 reply; 9+ messages in thread
From: Artyom V. Poptsov @ 2021-12-13 20:42 UTC (permalink / raw)
  To: 52472


[-- Attachment #1.1: Type: text/plain, Size: 113 bytes --]

Hello Guixers,

this patch adds libtree[1] v3.0.0-rc6.

- avp

References:
1: https://github.com/haampie/libtree

[-- Attachment #1.2: 0001-gnu-Add-libtree.patch --]
[-- Type: text/x-diff, Size: 2392 bytes --]

From 98428689a669def9499cce2883ac33202fa3ac84 Mon Sep 17 00:00:00 2001
From: "Artyom V. Poptsov" <poptsov.artyom@gmail.com>
Date: Mon, 13 Dec 2021 23:34:29 +0300
Subject: [PATCH] gnu: Add libtree

* gnu/packages/linux.scm (libtree): New variable.
---
 gnu/packages/linux.scm | 37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 1e51dd8d83..84e7042604 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -53,6 +53,7 @@
 ;;; Copyright © 2021 B. Wilson <elaexuotee@wilsonb.com>
 ;;; Copyright © 2021 Ivan Gankevich <i.gankevich@spbu.ru>
 ;;; Copyright © 2021 Olivier Dion <olivier.dion@polymtl.ca>
+;;; Copyright © 2021 Artyom V. Poptsov <poptsov.artyom@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -8690,3 +8691,39 @@ older system-wide @file{/sys} interface.")
     (license (list license:lgpl2.1+   ;; libgpiod
                    license:gpl2+      ;; gpio-tools
                    license:lgpl3+)))) ;; C++ bindings
+
+(define-public libtree
+  (package
+    (name "libtree")
+    (version "3.0.0-rc6")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/haampie/libtree")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "1i2v70n0pn7aqa4k2pr049zwp1sf8m975pgpgmnr3d53806zchgs"))))
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (delete 'check)
+         (delete 'configure)
+         (add-before 'build 'patch
+           (lambda* (#:key outputs #:allow-other-keys)
+             (substitute* "Makefile"
+               (("\\$\\(DESTDIR\\)\\$\\(BINDIR\\)")
+                (format #f "~a/bin/" (assoc-ref outputs "out"))))))
+         (replace 'build
+           (lambda _
+             (setenv "CC" "gcc")
+             (setenv "LDFLAGS" "-static")
+             (invoke "make"))))))
+    (build-system gnu-build-system)
+    (home-page "https://github.com/haampie/libtree")
+    (synopsis "@command{ldd} as a tree")
+    (description
+     "This tool turns @command{ldd} into a tree and explains how shared
+libraries are found or why they cannot be located.")
+    (license license:expat)))
-- 
2.25.1


[-- Attachment #1.3: Type: text/plain, Size: 207 bytes --]


-- 
Artyom "avp" Poptsov <poptsov.artyom@gmail.com>
Home page: https://memory-heap.org/~avp/
CADR Hackerspace co-founder: https://cadrspace.ru/
GPG: D0C2 EAC1 3310 822D 98DE  B57C E9C5 A2D9 0898 A02F

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [bug#52472] [PATCH] gnu: Add libtree
  2021-12-13 20:42 [bug#52472] [PATCH] gnu: Add libtree Artyom V. Poptsov
@ 2021-12-18  8:02 ` Artyom V. Poptsov
  2021-12-19  9:48   ` Mathieu Othacehe
  0 siblings, 1 reply; 9+ messages in thread
From: Artyom V. Poptsov @ 2021-12-18  8:02 UTC (permalink / raw)
  To: 52472


[-- Attachment #1.1: Type: text/plain, Size: 42 bytes --]

I've updated libtree to v3.0.1.

- Artyom

[-- Attachment #1.2: 0001-gnu-Add-libtree.patch --]
[-- Type: text/x-diff, Size: 2528 bytes --]

From 4deebbcc8be0352121b7cf42e6a39949601faa0f Mon Sep 17 00:00:00 2001
From: "Artyom V. Poptsov" <poptsov.artyom@gmail.com>
Date: Mon, 13 Dec 2021 23:34:29 +0300
Subject: [PATCH] gnu: Add libtree

* gnu/packages/linux.scm (libtree): New variable.
---
 gnu/packages/linux.scm | 40 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 055a37cb79..7503b10800 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -59,6 +59,8 @@
 ;;; Copyright © 2021 Josselin Poiret <josselin.poiret@protonmail.ch>
 ;;; Copyright © 2021 Olivier Dion <olivier.dion@polymtl.ca>
 ;;; Copyright © 2021 Solene Rapenne <solene@perso.pw>
+;;; Copyright © 2021 Artyom V. Poptsov <poptsov.artyom@gmail.com>
+
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -8754,3 +8756,41 @@ older system-wide @file{/sys} interface.")
     (license (list license:lgpl2.1+   ;; libgpiod
                    license:gpl2+      ;; gpio-tools
                    license:lgpl3+)))) ;; C++ bindings
+
+(define-public libtree
+  (package
+    (name "libtree")
+    (version "3.0.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/haampie/libtree")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "1j56j1k4rlm0wi6jvdmk7j7nf4wrmc5gyhgp6vjf180hpgwlqz92"))))
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (delete 'check)
+         (delete 'configure)
+         (add-before 'build 'patch
+           (lambda* (#:key outputs #:allow-other-keys)
+             (substitute* "Makefile"
+               (("\\$\\(DESTDIR\\)\\$\\(BINDIR\\)")
+                (format #f "~a/bin/" (assoc-ref outputs "out")))
+               (("\\$\\(DESTDIR\\)\\$\\(SHAREDIR\\)")
+                (format #f "~a/share/" (assoc-ref outputs "out"))))))
+         (replace 'build
+           (lambda _
+             (setenv "CC" "gcc")
+             (setenv "LDFLAGS" "-static")
+             (invoke "make"))))))
+    (build-system gnu-build-system)
+    (home-page "https://github.com/haampie/libtree")
+    (synopsis "@command{ldd} as a tree")
+    (description
+     "This tool turns @command{ldd} into a tree and explains how shared
+libraries are found or why they cannot be located.")
+    (license license:expat)))
-- 
2.25.1


[-- Attachment #1.3: Type: text/plain, Size: 207 bytes --]


-- 
Artyom "avp" Poptsov <poptsov.artyom@gmail.com>
Home page: https://memory-heap.org/~avp/
CADR Hackerspace co-founder: https://cadrspace.ru/
GPG: D0C2 EAC1 3310 822D 98DE  B57C E9C5 A2D9 0898 A02F

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [bug#52472] [PATCH] gnu: Add libtree
  2021-12-18  8:02 ` Artyom V. Poptsov
@ 2021-12-19  9:48   ` Mathieu Othacehe
  2021-12-19 12:50     ` Julien Lepiller
  0 siblings, 1 reply; 9+ messages in thread
From: Mathieu Othacehe @ 2021-12-19  9:48 UTC (permalink / raw)
  To: Artyom V. Poptsov; +Cc: 52472


Hey Artyom,

>  ;;; Copyright © 2021 Solene Rapenne <solene@perso.pw>
> +;;; Copyright © 2021 Artyom V. Poptsov <poptsov.artyom@gmail.com>
> +

No need for an extra new-line here.

> +           (lambda* (#:key outputs #:allow-other-keys)
> +             (substitute* "Makefile"
> +               (("\\$\\(DESTDIR\\)\\$\\(BINDIR\\)")
> +                (format #f "~a/bin/" (assoc-ref outputs "out")))
> +               (("\\$\\(DESTDIR\\)\\$\\(SHAREDIR\\)")
> +                (format #f "~a/share/" (assoc-ref outputs "out"))))))

You can now write:

--8<---------------cut here---------------start------------->8---
       ,#~(modify-phases %standard-phases
            (delete 'check)
            (delete 'configure)
            (add-before 'build 'patch
              (lambda* (#:key outputs #:allow-other-keys)
                (substitute* "Makefile"
                  (("\\$\\(DESTDIR\\)\\$\\(BINDIR\\)")
                   (string-append #$output "/bin/"))
                  (("\\$\\(DESTDIR\\)\\$\\(SHAREDIR\\)")
                   (string-append #$output "/share/")))))
--8<---------------cut here---------------end--------------->8---

> +         (replace 'build
> +           (lambda _
> +             (setenv "CC" "gcc")

That would break cross-compilation. You should use something like:

--8<---------------cut here---------------start------------->8---
(string-append "CC=" ,(cc-for-target)).
--8<---------------cut here---------------end--------------->8---

> +             (setenv "LDFLAGS" "-static")

Why are we building a static version of the program?

There's also this linter warning:

gnu/packages/linux.scm:8649:14: libtree@3.0.1: synopsis should start with an upper-case letter or digit

Thanks,

Mathieu




^ permalink raw reply	[flat|nested] 9+ messages in thread

* [bug#52472] [PATCH] gnu: Add libtree
  2021-12-19  9:48   ` Mathieu Othacehe
@ 2021-12-19 12:50     ` Julien Lepiller
  2022-01-13  3:30       ` Artyom V. Poptsov
  0 siblings, 1 reply; 9+ messages in thread
From: Julien Lepiller @ 2021-12-19 12:50 UTC (permalink / raw)
  To: 52472, othacehe, poptsov.artyom

Sorry if this is overwhelming, but also:

Le 19 décembre 2021 04:48:28 GMT-05:00, Mathieu Othacehe <othacehe@gnu.org> a écrit :
>
>Hey Artyom,
>
>>  ;;; Copyright © 2021 Solene Rapenne <solene@perso.pw>
>> +;;; Copyright © 2021 Artyom V. Poptsov <poptsov.artyom@gmail.com>
>> +
>
>No need for an extra new-line here.
>
>> +           (lambda* (#:key outputs #:allow-other-keys)
>> +             (substitute* "Makefile"
>> +               (("\\$\\(DESTDIR\\)\\$\\(BINDIR\\)")
>> +                (format #f "~a/bin/" (assoc-ref outputs "out")))
>> +               (("\\$\\(DESTDIR\\)\\$\\(SHAREDIR\\)")
>> +                (format #f "~a/share/" (assoc-ref outputs "out"))))))
>
>You can now write:
>
>--8<---------------cut here---------------start------------->8---
>       ,#~(modify-phases %standard-phases
>            (delete 'check)
>            (delete 'configure)
>            (add-before 'build 'patch
>              (lambda* (#:key outputs #:allow-other-keys)
>                (substitute* "Makefile"
>                  (("\\$\\(DESTDIR\\)\\$\\(BINDIR\\)")
>                   (string-append #$output "/bin/"))
>                  (("\\$\\(DESTDIR\\)\\$\\(SHAREDIR\\)")
>                   (string-append #$output "/share/")))))
>--8<---------------cut here---------------end--------------->8---
>

Don't remove the check phase. Use #:tests? #f instead and add a comment explaining why. If the tests fail, we should fix them, not put them under the rug ;)

Maybe it would be easier to pass BINDIR, SHAREDIR and CC with #:make-flags?

>> +         (replace 'build
>> +           (lambda _
>> +             (setenv "CC" "gcc")
>
>That would break cross-compilation. You should use something like:
>
>--8<---------------cut here---------------start------------->8---
>(string-append "CC=" ,(cc-for-target)).
>--8<---------------cut here---------------end--------------->8---
>
>> +             (setenv "LDFLAGS" "-static")
>
>Why are we building a static version of the program?
>
>There's also this linter warning:
>
>gnu/packages/linux.scm:8649:14: libtree@3.0.1: synopsis should start with an upper-case letter or digit
>
>Thanks,
>
>Mathieu
>

Could you send a new patch with these changes? Don't hesitate to ask if you're a bit lost or need help on some points :)




^ permalink raw reply	[flat|nested] 9+ messages in thread

* [bug#52472] [PATCH] gnu: Add libtree
  2021-12-19 12:50     ` Julien Lepiller
@ 2022-01-13  3:30       ` Artyom V. Poptsov
  2022-01-13  7:38         ` Maxime Devos
  0 siblings, 1 reply; 9+ messages in thread
From: Artyom V. Poptsov @ 2022-01-13  3:30 UTC (permalink / raw)
  To: Julien Lepiller; +Cc: othacehe, 52472


[-- Attachment #1.1: Type: text/plain, Size: 309 bytes --]

Hello,

this is the updated version of the patch with changes suggested by
Mathieu Othacehe and Julien Lepiller.

A note for Mathieu: I used to build libtree with "-static" flag as it is
recommended by the official documentation.  But libtree builds fine
without the flag so I removed it.

Thanks,

- Artyom


[-- Attachment #1.2: 0001-gnu-Add-libtree.patch --]
[-- Type: text/x-diff, Size: 2441 bytes --]

From 4ce9098e6fe8525e1e68d97458cb246ddc901266 Mon Sep 17 00:00:00 2001
From: "Artyom V. Poptsov" <poptsov.artyom@gmail.com>
Date: Mon, 13 Dec 2021 23:34:29 +0300
Subject: [PATCH] gnu: Add libtree

* gnu/packages/linux.scm (libtree): New variable.
---
 gnu/packages/linux.scm | 37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index da2ce602a7..f73e235a3c 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -60,6 +60,8 @@
 ;;; Copyright © 2021 Olivier Dion <olivier.dion@polymtl.ca>
 ;;; Copyright © 2021 Solene Rapenne <solene@perso.pw>
 ;;; Copyright © 2021 Petr Hodina <phodina@protonmail.com>
+;;; Copyright © 2022 Artyom V. Poptsov <poptsov.artyom@gmail.com>
+
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -8789,3 +8791,38 @@ older system-wide @file{/sys} interface.")
     (license (list license:lgpl2.1+   ;; libgpiod
                    license:gpl2+      ;; gpio-tools
                    license:lgpl3+)))) ;; C++ bindings
+
+(define-public libtree
+  (package
+    (name "libtree")
+    (version "3.0.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/haampie/libtree")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "1j56j1k4rlm0wi6jvdmk7j7nf4wrmc5gyhgp6vjf180hpgwlqz92"))))
+    (arguments
+     (list #:tests? #f
+           #:make-flags
+           ;; NOTE: Official documentation recommends to build libtree with
+           ;; "-static" flag.
+           #~(list (string-append "CC=" #$(cc-for-target))
+                   "PREFIX=/"
+                   (string-append "DESTDIR=" #$output))
+           #:phases
+           #~(modify-phases %standard-phases
+               (delete 'configure)
+               (replace 'build
+                 (lambda* (#:key make-flags #:allow-other-keys)
+                   (apply invoke "make" make-flags))))))
+    (build-system gnu-build-system)
+    (home-page "https://github.com/haampie/libtree")
+    (synopsis "Show output of @command{ldd} as a tree")
+    (description
+     "This tool turns @command{ldd} into a tree and explains how shared
+libraries are found or why they cannot be located.")
+    (license license:expat)))
-- 
2.25.1


[-- Attachment #1.3: Type: text/plain, Size: 205 bytes --]

-- 
Artyom "avp" Poptsov <poptsov.artyom@gmail.com>
Home page: https://memory-heap.org/~avp/
CADR Hackerspace co-founder: https://cadrspace.ru/
GPG: D0C2 EAC1 3310 822D 98DE  B57C E9C5 A2D9 0898 A02F

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [bug#52472] [PATCH] gnu: Add libtree
  2022-01-13  3:30       ` Artyom V. Poptsov
@ 2022-01-13  7:38         ` Maxime Devos
  2022-01-13 17:18           ` Artyom V. Poptsov
  0 siblings, 1 reply; 9+ messages in thread
From: Maxime Devos @ 2022-01-13  7:38 UTC (permalink / raw)
  To: Artyom V. Poptsov, Julien Lepiller; +Cc: othacehe, 52472

[-- Attachment #1: Type: text/plain, Size: 293 bytes --]

Hi,

Artyom V. Poptsov schreef op do 13-01-2022 om 06:30 [+0300]:
> +     (list #:tests? #f

There's a check target in
<https://github.com/haampie/libtree/blob/master/Makefile>
and a bunch of tests in
<https://github.com/haampie/libtree/tree/master/tests>.

Greetings,
Maxime.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [bug#52472] [PATCH] gnu: Add libtree
  2022-01-13  7:38         ` Maxime Devos
@ 2022-01-13 17:18           ` Artyom V. Poptsov
  2022-01-13 17:37             ` Maxime Devos
  0 siblings, 1 reply; 9+ messages in thread
From: Artyom V. Poptsov @ 2022-01-13 17:18 UTC (permalink / raw)
  To: Maxime Devos; +Cc: othacehe, Julien Lepiller, 52472

[-- Attachment #1: Type: text/plain, Size: 2486 bytes --]

Hello Maxime,

to my understanding some libtree tests (namely 07 and 08) are made in
such way that they finish with a non-zero code when they pass, that
makes Guix stop during the build with an error.  For example, the test
"07_origin_is_relative_to_symlink_location_not_realpath" expects that
libtree will fail.  I checked a compiled "exe" file from a failed build
and got this:

--8<---------------cut here---------------start------------->8---
$ libtree /tmp/guix-build-libtree-3.0.1.drv-0/source/tests/07_origin_is_relative_to_symlink_location_not_realpath/exe 
exe 
└── libg.so [runpath]
    └── libf.so not found
        ┊ Paths considered in this order:
        ┊ 1. rpath is skipped because runpath was set
        ┊ 2. LD_LIBRARY_PATH was not set
        ┊ 3. runpath:
        ┊    /tmp/guix-build-libtree-3.0.1.drv-0/source/tests/07_origin_is_relative_to_symlink_location_not_realpath/b
        ┊ 4. ld config files:
        ┊    /usr/lib/x86_64-linux-gnu/libfakeroot
        ┊    /usr/local/lib
        ┊    /usr/local/lib/x86_64-linux-gnu
        ┊    /lib/x86_64-linux-gnu
        ┊    /usr/lib/x86_64-linux-gnu
        ┊    /lib32
        ┊    /usr/lib32
        ┊ 5. Standard paths:
        ┊    /lib
        ┊    /lib64
        ┊    /usr/lib
        ┊    /usr/lib64
Error [/tmp/guix-build-libtree-3.0.1.drv-0/source/tests/07_origin_is_relative_to_symlink_location_not_realpath/exe]: Not all dependencies were found
$ echo $?
28
--8<---------------cut here---------------end--------------->8---

Yet libtree itself seems to work fine after installation from Guix.
Here's an example of the output for a correct binary:

--8<---------------cut here---------------start------------->8---
$ libtree guix-daemon 
guix-daemon 
├── libz.so.1 [runpath]
├── libbz2.so.1.0 [runpath]
├── libgcrypt.so.20 [runpath]
│   └── libgpg-error.so.0 [runpath]
└── libsqlite3.so.0 [runpath]
--8<---------------cut here---------------end--------------->8---

I suggest that we keep "#f" for tests unless the libtree author fix this
behavior.

For now I opened an issue for libtree:
  https://github.com/haampie/libtree/issues/65

Thanks!

- Artyom

-- 
Artyom "avp" Poptsov <poptsov.artyom@gmail.com>
Home page: https://memory-heap.org/~avp/
CADR Hackerspace co-founder: https://cadrspace.ru/
GPG: D0C2 EAC1 3310 822D 98DE  B57C E9C5 A2D9 0898 A02F

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [bug#52472] [PATCH] gnu: Add libtree
  2022-01-13 17:18           ` Artyom V. Poptsov
@ 2022-01-13 17:37             ` Maxime Devos
  2022-01-13 17:51               ` Artyom V. Poptsov
  0 siblings, 1 reply; 9+ messages in thread
From: Maxime Devos @ 2022-01-13 17:37 UTC (permalink / raw)
  To: Artyom V. Poptsov; +Cc: othacehe, Julien Lepiller, 52472

[-- Attachment #1: Type: text/plain, Size: 477 bytes --]

Artyom V. Poptsov schreef op do 13-01-2022 om 20:18 [+0300]:
> [...]
> 
> I suggest that we keep "#f" for tests unless the libtree author fix this
> behavior.
> 
> For now I opened an issue for libtree:
>   https://github.com/haampie/libtree/issues/65

Seems reasonable to me, though I would add a comment

  ;; See <https://github.com/haampie/libtree/issues/65>

next to the #:tests? #false such that the reasons won't be lost to
time.

Greetings,
Maxime.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [bug#52472] [PATCH] gnu: Add libtree
  2022-01-13 17:37             ` Maxime Devos
@ 2022-01-13 17:51               ` Artyom V. Poptsov
  0 siblings, 0 replies; 9+ messages in thread
From: Artyom V. Poptsov @ 2022-01-13 17:51 UTC (permalink / raw)
  To: Maxime Devos; +Cc: othacehe, Julien Lepiller, 52472


[-- Attachment #1.1: Type: text/plain, Size: 232 bytes --]

Hello,

> Seems reasonable to me, though I would add a comment

>   ;; See <https://github.com/haampie/libtree/issues/65>

> next to the #:tests? #false such that the reasons won't be lost to
> time.

I added the comment.

- Artyom

[-- Attachment #1.2: 0001-gnu-Add-libtree.patch --]
[-- Type: text/x-diff, Size: 2495 bytes --]

From 8367850d181a221cdf71911022c767d466009c5d Mon Sep 17 00:00:00 2001
From: "Artyom V. Poptsov" <poptsov.artyom@gmail.com>
Date: Mon, 13 Dec 2021 23:34:29 +0300
Subject: [PATCH] gnu: Add libtree

* gnu/packages/linux.scm (libtree): New variable.
---
 gnu/packages/linux.scm | 37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index da2ce602a7..07a64da679 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -60,6 +60,8 @@
 ;;; Copyright © 2021 Olivier Dion <olivier.dion@polymtl.ca>
 ;;; Copyright © 2021 Solene Rapenne <solene@perso.pw>
 ;;; Copyright © 2021 Petr Hodina <phodina@protonmail.com>
+;;; Copyright © 2022 Artyom V. Poptsov <poptsov.artyom@gmail.com>
+
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -8789,3 +8791,38 @@ older system-wide @file{/sys} interface.")
     (license (list license:lgpl2.1+   ;; libgpiod
                    license:gpl2+      ;; gpio-tools
                    license:lgpl3+)))) ;; C++ bindings
+
+(define-public libtree
+  (package
+    (name "libtree")
+    (version "3.0.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/haampie/libtree")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "1j56j1k4rlm0wi6jvdmk7j7nf4wrmc5gyhgp6vjf180hpgwlqz92"))))
+    (arguments
+     (list #:tests? #f  ; See <https://github.com/haampie/libtree/issues/65>
+           #:make-flags
+           ;; NOTE: Official documentation recommends to build libtree with
+           ;; "-static" flag.
+           #~(list (string-append "CC=" #$(cc-for-target))
+                   "PREFIX=/"
+                   (string-append "DESTDIR=" #$output))
+           #:phases
+           #~(modify-phases %standard-phases
+               (delete 'configure)
+               (replace 'build
+                 (lambda* (#:key make-flags #:allow-other-keys)
+                   (apply invoke "make" make-flags))))))
+    (build-system gnu-build-system)
+    (home-page "https://github.com/haampie/libtree")
+    (synopsis "Show output of @command{ldd} as a tree")
+    (description
+     "This tool turns @command{ldd} into a tree and explains how shared
+libraries are found or why they cannot be located.")
+    (license license:expat)))
-- 
2.25.1


[-- Attachment #1.3: Type: text/plain, Size: 207 bytes --]


-- 
Artyom "avp" Poptsov <poptsov.artyom@gmail.com>
Home page: https://memory-heap.org/~avp/
CADR Hackerspace co-founder: https://cadrspace.ru/
GPG: D0C2 EAC1 3310 822D 98DE  B57C E9C5 A2D9 0898 A02F

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2022-01-13 18:03 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-13 20:42 [bug#52472] [PATCH] gnu: Add libtree Artyom V. Poptsov
2021-12-18  8:02 ` Artyom V. Poptsov
2021-12-19  9:48   ` Mathieu Othacehe
2021-12-19 12:50     ` Julien Lepiller
2022-01-13  3:30       ` Artyom V. Poptsov
2022-01-13  7:38         ` Maxime Devos
2022-01-13 17:18           ` Artyom V. Poptsov
2022-01-13 17:37             ` Maxime Devos
2022-01-13 17:51               ` Artyom V. Poptsov

Code repositories for project(s) associated with this inbox:

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).