all messages for Guix-related lists mirrored at yhetil.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; 21+ 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 related	[flat|nested] 21+ 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; 21+ 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 related	[flat|nested] 21+ 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; 21+ 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] 21+ 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; 21+ 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] 21+ 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; 21+ 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 related	[flat|nested] 21+ 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; 21+ 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] 21+ 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; 21+ 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] 21+ 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; 21+ 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] 21+ messages in thread

* [bug#52472] [PATCH] gnu: Add libtree
  2022-01-13 17:37             ` Maxime Devos
@ 2022-01-13 17:51               ` Artyom V. Poptsov
  2022-01-17 18:09                 ` Artyom V. Poptsov
  0 siblings, 1 reply; 21+ 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 related	[flat|nested] 21+ messages in thread

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


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

Hello,

meanwhile the libtree author fixed the tests in 3.0.2:
  https://github.com/haampie/libtree/issues/65

So I've updated the patch to add libtree 3.0.2.

Thanks,

- Artyom

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

From 6a21b02af62ce27cedd1f3f02d47362b434616f7 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 5f471beaaf..0a1e0d829b 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.
 ;;;
@@ -8761,3 +8763,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.2")
+    (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 "072624anz9g01mp5vfkahfmzy0nb7axg5rwk3n1yrdm4hr3d4zrb"))))
+    (arguments
+     (list #:tests? #t
+           #: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 related	[flat|nested] 21+ messages in thread

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

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

Hi,

Artyom V. Poptsov schreef op ma 17-01-2022 om 21:09 [+0300]:
> +     (list #:tests? #t

Tests can almost never be run when cross-compiling,
so this needs to be #false when cross-compiling.  This should
be detected by the 'tests-true' linter.  I suggest removing '#:tests?
#t’.

> +           #~(list (string-append "CC=" #$(cc-for-target))
> +                   "PREFIX=/"
> +                   (string-append "DESTDIR=" #$output))

Guix doesn't do staged installation
(https://www.gnu.org/software/automake/manual/html_node/DESTDIR.html).
Doing (string-append "PREFIX=" $output) and dropping DESTDIR=... should
suffice.

Greetings,
Maxime

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

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

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


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

Hello,

> I suggest removing '#:tests?

Okay, done.

> Guix doesn't do staged installation

Unfortunately it seems to me that libtree fails when I remove
'(string-append "DESTDIR=" #$output)' from the make flags.

The reason is this code from libtree Makefile:

--8<---------------cut here---------------start------------->8---
install: all
	mkdir -p $(DESTDIR)$(BINDIR)
	cp -p libtree $(DESTDIR)$(BINDIR)
	mkdir -p $(DESTDIR)$(SHAREDIR)/man/man1
	cp -p doc/libtree.1 $(DESTDIR)$(SHAREDIR)/man/man1
--8<---------------cut here---------------end--------------->8---

As you can see it's using 'DESTDIR' as prefix for the installation.

- Artyom

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

From 1808690c43044fdd9340c75c6d726a5f71dd8c64 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 | 36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 5f471beaaf..a68f35ebf0 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.
 ;;;
@@ -8761,3 +8763,37 @@ 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.2")
+    (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 "072624anz9g01mp5vfkahfmzy0nb7axg5rwk3n1yrdm4hr3d4zrb"))))
+    (arguments
+     (list #: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 related	[flat|nested] 21+ messages in thread

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


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

Hi,

Artyom V. Poptsov schreef op ma 17-01-2022 om 22:14 [+0300]:
> [...]
> > Guix doesn't do staged installation
> 
> Unfortunately it seems to me that libtree fails when I remove
> '(string-append "DESTDIR=" #$output)' from the make flags.
> 
> The reason is this code from libtree Makefile:
> 
> --8<---------------cut here---------------start------------->8---
> install: all
> 	mkdir -p $(DESTDIR)$(BINDIR)
> 	cp -p libtree $(DESTDIR)$(BINDIR)
> 	mkdir -p $(DESTDIR)$(SHAREDIR)/man/man1
> 	cp -p doc/libtree.1 $(DESTDIR)$(SHAREDIR)/man/man1
> --8<---------------cut here---------------end--------------->8---
> 
> As you can see it's using 'DESTDIR' as prefix for the installation.

SHAREDIR is set to $(PREFIX)/share in the Makefile.

It seems to work for me, the attached package definition builds
and the store item has a man page and a binary.

Greetings,
Maxime.

[-- Attachment #1.2: libtree.scm --]
[-- Type: text/x-scheme, Size: 1393 bytes --]

(use-modules (guix packages) (guix) (guix git-download) (guix build-system gnu)
  ((guix licenses) #:prefix license:))
(define-public libtree
  (package
    (name "libtree")
    (version "3.0.2")
    (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 "072624anz9g01mp5vfkahfmzy0nb7axg5rwk3n1yrdm4hr3d4zrb"))))
    (arguments
     (list #:make-flags
           ;; NOTE: Official documentation recommends to build libtree with
           ;; "-static" flag.
           #~(list (string-append "CC=" #$(cc-for-target))
                   (string-append "PREFIX=" #$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)))

libtree

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

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

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

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

Hello,

sorry for bugging you but are there any problems left with the package
that I should solve?  As far as I understand now the package is fine and
can be merged to Guix.  Am I mistaken?

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] 21+ messages in thread

* [bug#52472] [PATCH] gnu: Add libtree
  2022-01-28 18:30                         ` Artyom V. Poptsov
@ 2022-01-28 18:54                           ` Maxime Devos
  2022-02-04 18:25                             ` Artyom V. Poptsov
  0 siblings, 1 reply; 21+ messages in thread
From: Maxime Devos @ 2022-01-28 18:54 UTC (permalink / raw)
  To: Artyom V. Poptsov; +Cc: othacehe, Julien Lepiller, 52472

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

Artyom V. Poptsov schreef op vr 28-01-2022 om 21:30 [+0300]:
> Hello,
> 
> sorry for bugging you but are there any problems left with the package
> that I should solve?  As far as I understand now the package is fine and
> can be merged to Guix.  Am I mistaken?

As I wrote in <https://issues.guix.gnu.org/52472#12>, setting DESTDIR
is unnecessary.  I haven't seen a revised patch not setting DESTDIR.
Aside from that, the patch looks reasonable.  However, I didn't look at
all the source code (for hash mismatches etc.).

Greetings,
Maxime.

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

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

* [bug#52472] [PATCH] gnu: Add libtree
  2022-01-28 18:54                           ` Maxime Devos
@ 2022-02-04 18:25                             ` Artyom V. Poptsov
  2022-02-04 19:19                               ` Maxime Devos
  0 siblings, 1 reply; 21+ messages in thread
From: Artyom V. Poptsov @ 2022-02-04 18:25 UTC (permalink / raw)
  To: Maxime Devos; +Cc: othacehe, Julien Lepiller, 52472


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

Hello Maxime!

I think I figured out how to properly remove DESTDIR setting in my
libtree patch.

Please find the updated patch attached.

- Artyom


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

From d481bf6df007e75df0fec118eadc448ac3f4af5a 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 | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 7df64bbdae..eea2fea59b 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.
 ;;;
@@ -8830,3 +8832,36 @@ 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.2")
+    (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 "072624anz9g01mp5vfkahfmzy0nb7axg5rwk3n1yrdm4hr3d4zrb"))))
+    (arguments
+     (list #:make-flags
+           ;; NOTE: Official documentation recommends to build libtree with
+           ;; "-static" flag.
+           #~(list (string-append "CC=" #$(cc-for-target))
+                   (string-append "PREFIX=" #$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 related	[flat|nested] 21+ messages in thread

* [bug#52472] [PATCH] gnu: Add libtree
  2022-02-04 18:25                             ` Artyom V. Poptsov
@ 2022-02-04 19:19                               ` Maxime Devos
  2022-02-05  5:50                                 ` Artyom V. Poptsov
  0 siblings, 1 reply; 21+ messages in thread
From: Maxime Devos @ 2022-02-04 19:19 UTC (permalink / raw)
  To: Artyom V. Poptsov; +Cc: othacehe, Julien Lepiller, 52472


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

Artyom V. Poptsov schreef op vr 04-02-2022 om 21:25 [+0300]:
> Hello Maxime!
> 
> I think I figured out how to properly remove DESTDIR setting in my
> libtree patch.
>
> Please find the updated patch attached.

Unless libtree's Makefile doesn't support parallel compilation,
replacing the build phase has now become unnecessary, right?
The attached simplified package definition builds succesfully for me.

The patch seems to be ready now, I believe?

Greetings,
Maxime (not a committer)

[-- Attachment #1.2: libtree.scm --]
[-- Type: text/x-scheme, Size: 1263 bytes --]

(use-modules (guix packages) (guix build-system gnu) (guix utils)
  (guix git-download)
  ((guix licenses) #:prefix license:)(guix gexp))

(define-public libtree
  (package
    (name "libtree")
    (version "3.0.2")
    (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 "072624anz9g01mp5vfkahfmzy0nb7axg5rwk3n1yrdm4hr3d4zrb"))))
    (arguments
     (list #:make-flags
           ;; NOTE: Official documentation recommends to build libtree with
           ;; "-static" flag.
           #~(list (string-append "CC=" #$(cc-for-target))
                   (string-append "PREFIX=" #$output))
           #:phases
           #~(modify-phases %standard-phases
               (delete 'configure))))
    (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)))

libtree

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

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

* [bug#52472] [PATCH] gnu: Add libtree
  2022-02-04 19:19                               ` Maxime Devos
@ 2022-02-05  5:50                                 ` Artyom V. Poptsov
  2022-02-05 10:56                                   ` Maxime Devos
  0 siblings, 1 reply; 21+ messages in thread
From: Artyom V. Poptsov @ 2022-02-05  5:50 UTC (permalink / raw)
  To: Maxime Devos; +Cc: othacehe, Julien Lepiller, 52472

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

Hello Maxime,

sorry but libtree refuses to build when I use your patch instead of mine:

--8<---------------cut here---------------start------------->8---
$ ./pre-inst-env guix build libtree --check --no-offload
;;; note: source file /home/avp/src/dist/guix/gnu/packages/linux.scm
;;;       newer than compiled /home/avp/src/dist/guix/gnu/packages/linux.go
The following derivation will be built:
   /gnu/store/2ndjq2b7z1wqwx6mv91ygkslaziz1sw6-libtree-3.0.2.drv
guix build: error: some outputs of `/gnu/store/2ndjq2b7z1wqwx6mv91ygkslaziz1sw6-libtree-3.0.2.drv' are not valid, so checking is not possible
--8<---------------cut here---------------end--------------->8---

> The patch seems to be ready now, I believe?

Are you asking me or the Guix community?  If you're asking me, I think
that since libtree builds and runs OK with my last patch it is ready for
the merge.

But I'd love to hear feedback from the community as well; if someone
find another flaw in the patch I'll try to fix it.

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] 21+ messages in thread

* [bug#52472] [PATCH] gnu: Add libtree
  2022-02-05  5:50                                 ` Artyom V. Poptsov
@ 2022-02-05 10:56                                   ` Maxime Devos
  2022-02-05 11:34                                     ` Artyom V. Poptsov
  0 siblings, 1 reply; 21+ messages in thread
From: Maxime Devos @ 2022-02-05 10:56 UTC (permalink / raw)
  To: Artyom V. Poptsov; +Cc: othacehe, Julien Lepiller, 52472

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

Artyom V. Poptsov schreef op za 05-02-2022 om 08:50 [+0300]:
> sorry but libtree refuses to build when I use your patch instead of
> mine:
> 
> --8<---------------cut here---------------start------------->8---
> $ ./pre-inst-env guix build libtree --check --no-offload
> ;;; note: source file /home/avp/src/dist/guix/gnu/packages/linux.scm
> ;;;       newer than compiled
> /home/avp/src/dist/guix/gnu/packages/linux.go
> The following derivation will be built:
>    /gnu/store/2ndjq2b7z1wqwx6mv91ygkslaziz1sw6-libtree-3.0.2.drv
> guix build: error: some outputs of
> `/gnu/store/2ndjq2b7z1wqwx6mv91ygkslaziz1sw6-libtree-3.0.2.drv' are
> not valid, so checking is not possible
> --8<---------------cut here---------------end--------------->8---

I've seen this before (for something non-libtree), IIUC you can only
run '--check' after it has been built (or substituted) for the first
time.

Greetings,
Maxime.



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

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

* [bug#52472] [PATCH] gnu: Add libtree
  2022-02-05 10:56                                   ` Maxime Devos
@ 2022-02-05 11:34                                     ` Artyom V. Poptsov
  2022-03-09 22:06                                       ` bug#52472: " Ludovic Courtès
  0 siblings, 1 reply; 21+ messages in thread
From: Artyom V. Poptsov @ 2022-02-05 11:34 UTC (permalink / raw)
  To: Maxime Devos; +Cc: othacehe, Julien Lepiller, 52472


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

Hello Maxime!

> I've seen this before (for something non-libtree), IIUC you can only
> run '--check' after it has been built (or substituted) for the first
> time.

Thanks for pointing that out, I overlooked this little detail somehow.

When I removed '--check' from Guix options it built libtree without
errors with your version of the patch.

Please find the updated patch attached.

- Artyom


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

From 44971155b6b7d05e4d9b052b5ffc02022f3a97e9 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 | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 7df64bbdae..da3ee63e12 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.
 ;;;
@@ -8830,3 +8832,33 @@ 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.2")
+    (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 "072624anz9g01mp5vfkahfmzy0nb7axg5rwk3n1yrdm4hr3d4zrb"))))
+    (arguments
+     (list #:make-flags
+           ;; NOTE: Official documentation recommends to build libtree with
+           ;; "-static" flag.
+           #~(list (string-append "CC=" #$(cc-for-target))
+                   (string-append "PREFIX=" #$output))
+           #:phases
+           #~(modify-phases %standard-phases
+               (delete 'configure))))
+    (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 related	[flat|nested] 21+ messages in thread

* bug#52472: [PATCH] gnu: Add libtree
  2022-02-05 11:34                                     ` Artyom V. Poptsov
@ 2022-03-09 22:06                                       ` Ludovic Courtès
  0 siblings, 0 replies; 21+ messages in thread
From: Ludovic Courtès @ 2022-03-09 22:06 UTC (permalink / raw)
  To: Artyom V. Poptsov; +Cc: othacehe, Julien Lepiller, Maxime Devos, 52472-done

Hi Artyom and all,

"Artyom V. Poptsov" <poptsov.artyom@gmail.com> skribis:

> * gnu/packages/linux.scm (libtree): New variable.

Finally applied.

Thanks you and thanks everyone for reviewing!

Ludo’.




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

end of thread, other threads:[~2022-03-09 22:08 UTC | newest]

Thread overview: 21+ 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
2022-01-17 18:09                 ` Artyom V. Poptsov
2022-01-17 19:02                   ` Maxime Devos
2022-01-17 19:14                     ` Artyom V. Poptsov
2022-01-17 19:22                       ` Maxime Devos
2022-01-28 18:30                         ` Artyom V. Poptsov
2022-01-28 18:54                           ` Maxime Devos
2022-02-04 18:25                             ` Artyom V. Poptsov
2022-02-04 19:19                               ` Maxime Devos
2022-02-05  5:50                                 ` Artyom V. Poptsov
2022-02-05 10:56                                   ` Maxime Devos
2022-02-05 11:34                                     ` Artyom V. Poptsov
2022-03-09 22:06                                       ` bug#52472: " Ludovic Courtès

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.