[PATCH] gnu: Add libtree

  • Done
  • quality assurance status badge
Details
5 participants
  • Julien Lepiller
  • Ludovic Courtès
  • Maxime Devos
  • Mathieu Othacehe
  • Artyom V. Poptsov
Owner
unassigned
Submitted by
Artyom V. Poptsov
Severity
normal
A
A
Artyom V. Poptsov wrote on 13 Dec 2021 21:42
(address . guix-patches@gnu.org)
87fsqw5j9h.fsf@gmail.com
Hello Guixers,

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

- avp

References:
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(+)

Toggle diff (54 lines)
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
--
Artyom "avp" Poptsov <poptsov.artyom@gmail.com>
CADR Hackerspace co-founder: https://cadrspace.ru/
GPG: D0C2 EAC1 3310 822D 98DE B57C E9C5 A2D9 0898 A02F
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEE0MLqwTMQgi2Y3rV86cWi2QiYoC8FAmG3sDoACgkQ6cWi2QiY
oC/TgggAj0rwqgmypMH1VWiWH5opUiHWiV1VRfaFgwJHqbAKGsF3Zjlto1BHNQx9
Cn9W3xS+l1cffbpcKoFHqYZDHF6arjwWt1Yjtf+06KHEdw1O29cznrVl2W+0U83i
Zzp3D+YA9mOeemc6FyqzkGAenC3N0lUsLNkObzgFx2t+168taq99KdZ7HW3jfeRa
bRrXg0JX7wVrmEP/5ipBQU2JvPj/BDKuFqAY1j92NI/OmUBbdJATpbQ0xHhbGcNu
2td8cURNCv05BG0viBUOCShCg+M4XBHLvBif4qFBU/UyhtHA44OyJeL5h7hMhNTX
6/5CEVIME2dpBiKo1C5YKjaIE+iIxw==
=sVzF
-----END PGP SIGNATURE-----

A
A
Artyom V. Poptsov wrote on 18 Dec 2021 09:02
(address . guix-patches@gnu.org)
87pmpu5oi8.fsf@gmail.com
I've updated libtree to v3.0.1.

- Artyom
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(+)

Toggle diff (57 lines)
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
--
Artyom "avp" Poptsov <poptsov.artyom@gmail.com>
CADR Hackerspace co-founder: https://cadrspace.ru/
GPG: D0C2 EAC1 3310 822D 98DE B57C E9C5 A2D9 0898 A02F
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEE0MLqwTMQgi2Y3rV86cWi2QiYoC8FAmG9la8ACgkQ6cWi2QiY
oC+0mAf+IkotJf57qW3huyHieYgpJeLUwfbJ02C+ey27tt/m0vVQAkW2zMpWXp78
wGZCyHnM+Mn+WahOZOFAmZIgWZ/EuYUSEEZFNIh4I8GUrxep3846sbxlBG94R0ca
TLqTDM6y1CJitA3YOXIE6whmp3+awL46JsiFdgztoIrtcZ0Ty5zJzQ2Dhhv8b1E9
42b3ehsXFiLj1WPRuYfPwE/4gFh9OPu1Uv4fpeBkfaA75LIeRRMsXOWQ0G7QAt3Y
4qLQKqeicR6NQuD6j6k6ZOfq24su6bLF36Ykn1ajp5NjCCwVTKYP/+5f3+RLFCxn
7wY0LJNZSVq6Zp2+6SS3Hr8/oSiwEQ==
=P9rc
-----END PGP SIGNATURE-----

M
M
Mathieu Othacehe wrote on 19 Dec 2021 10:48
Re: bug#52472: [PATCH] gnu: Add libtree
(name . Artyom V. Poptsov)(address . poptsov.artyom@gmail.com)(address . 52472@debbugs.gnu.org)
87bl1dsz6b.fsf_-_@gnu.org
Hey Artyom,

Toggle quote (4 lines)
> ;;; Copyright © 2021 Solene Rapenne <solene@perso.pw>
> +;;; Copyright © 2021 Artyom V. Poptsov <poptsov.artyom@gmail.com>
> +

No need for an extra new-line here.

Toggle quote (7 lines)
> + (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:

Toggle snippet (12 lines)
,#~(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/")))))

Toggle quote (4 lines)
> + (replace 'build
> + (lambda _
> + (setenv "CC" "gcc")

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

Toggle snippet (3 lines)
(string-append "CC=" ,(cc-for-target)).

Toggle quote (2 lines)
> + (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
J
J
Julien Lepiller wrote on 19 Dec 2021 13:50
Re: [bug#52472] [PATCH] gnu: Add libtree
(address . 52472@debbugs.gnu.org)
61183D53-CE3D-4A00-AC7D-294C0C98FC00@lepiller.eu
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 :
Toggle quote (32 lines)
>
>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?

Toggle quote (23 lines)
>> + (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 :)
A
A
Artyom V. Poptsov wrote on 13 Jan 2022 04:30
(name . Julien Lepiller)(address . julien@lepiller.eu)
87zgo0jori.fsf@gmail.com
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
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(+)

Toggle diff (54 lines)
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
--
Artyom "avp" Poptsov <poptsov.artyom@gmail.com>
CADR Hackerspace co-founder: https://cadrspace.ru/
GPG: D0C2 EAC1 3310 822D 98DE B57C E9C5 A2D9 0898 A02F
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEE0MLqwTMQgi2Y3rV86cWi2QiYoC8FAmHfnOEACgkQ6cWi2QiY
oC9L0gf+JPxs7FnhvHLo23creZipNkVGRC/cdIvdhXOAYuPH4ewcxayH4RVzM7dQ
OPGbogMpO0PZOgQ39oVq8afV5nBsb5XHpAsOPekiL9MhN+QtkNGGwuAWV0qQSqyT
j3VKD4PSP8B2GdWulqT4BWMf5W0ufMfsHP7o8GwhEASTgxZcEP6RLPPZ2rJjbZWj
5MvqnyblNNusP52AkKycizWSpGslcw3nocU9kezvX1OQDtcjXR5NJJGxtCj5t2fL
ZbEW0uL/6GSettcKsVDnZFrgx+D7N5c910w0fKCj1BKVeyPgmEPVrTgtjOljOgfX
/IdrmMVPDfGyKbbGUoI5lvIiFI50Xg==
=mauL
-----END PGP SIGNATURE-----

M
M
Maxime Devos wrote on 13 Jan 2022 08:38
2cabbfdeec3e063747dc8f852ec119ffe0cef1f6.camel@telenet.be
Hi,

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

-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYd/W+hccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7qxyAP0UNEh/KHFV2ZLQ627j1YIo3cxE
9c914yVbbWQzLffKmQD9FLLWMuI3smwpi2Tu6d9tqMqWfT93aUxe01yoU+D9Wg0=
=XDVQ
-----END PGP SIGNATURE-----


A
A
Artyom V. Poptsov wrote on 13 Jan 2022 18:18
(name . Maxime Devos)(address . maximedevos@telenet.be)
87v8ynk0zp.fsf@gmail.com
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:

Toggle snippet (27 lines)
$ 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

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

Toggle snippet (9 lines)
$ 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]

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

For now I opened an issue for libtree:

Thanks!

- Artyom

--
Artyom "avp" Poptsov <poptsov.artyom@gmail.com>
CADR Hackerspace co-founder: https://cadrspace.ru/
GPG: D0C2 EAC1 3310 822D 98DE B57C E9C5 A2D9 0898 A02F
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEE0MLqwTMQgi2Y3rV86cWi2QiYoC8FAmHgXvoACgkQ6cWi2QiY
oC8OyQgAhNrVBG2WukYe0cGyCF8h9yILROEDfdXDIMOBcWYMbcur9IjWiyNmvQI5
ZDSg1Tpw8AMPwuaVNSxQ2y7CmRxtgSAMRzO2ljdmFbLuQxGE+ZoHGr2It22bB1zr
lu8u1s98yri84fl/V6wIBNEwkop73UvPGoqVZrZhlUMCvUx+pUKGK5S0Dm/tLW2H
OQ0HT4OQkkcu1JH9AxrEWurQcXg0IQAI5xe/VJUqAtP3OCobd7ujOiOicVSEhxGo
466XlzYy7xyDX9EYN6Vszl4XDh7VUmKMHyOTj1AD/EKQs43sl1+FCXt/Ma6vBpu3
f9tOMQil4RBEVCmjRaVpQa5MImQBKg==
=pIQB
-----END PGP SIGNATURE-----

M
M
Maxime Devos wrote on 13 Jan 2022 18:37
(name . Artyom V. Poptsov)(address . poptsov.artyom@gmail.com)
f9ba4042840bed63c059b39057f18dcae3155899.camel@telenet.be
Artyom V. Poptsov schreef op do 13-01-2022 om 20:18 [+0300]:
Toggle quote (8 lines)
> [...]
>
> 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


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

Greetings,
Maxime.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYeBjSxccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7naeAQDSewgufeSRcEoMWHKP78/zDStd
ZWr+hEggQUFQaKzlQgD9G+CembadJ4rpRgtbFUxH85kIYvF49zNqzxiiRZa/6wg=
=ePWc
-----END PGP SIGNATURE-----


A
A
Artyom V. Poptsov wrote on 13 Jan 2022 18:51
(name . Maxime Devos)(address . maximedevos@telenet.be)
87r19bjzi1.fsf@gmail.com
Hello,

Toggle quote (7 lines)
> 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
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(+)

Toggle diff (54 lines)
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
--
Artyom "avp" Poptsov <poptsov.artyom@gmail.com>
CADR Hackerspace co-founder: https://cadrspace.ru/
GPG: D0C2 EAC1 3310 822D 98DE B57C E9C5 A2D9 0898 A02F
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEE0MLqwTMQgi2Y3rV86cWi2QiYoC8FAmHgZoYACgkQ6cWi2QiY
oC8dggf/cDyhxvERIAjx6CqrdTFXxfFWVOmXzK1V9PLzr+R40qCTPYdHm8V3AqaP
MLEvtE7+DFDH/j1C4VzcP/ecfMX4Z8SKBFQVqV5TfHVpZ9aZ9z7QIpnS7sy6wGxs
kt7+GFCr/hqWrB6xSeKWZM9sV2she48P6K9W73ORxQKd/GmfF1KGyy+7oYDC5PvR
5lR+H4p81nX37cVtBGrcriV8HVjXt3UfHlfiuWtg3mbR/ggrqW90Xu1y+kuTzwR2
e2BKmVpCoZCpBJ8cL/7GqR7akybQLPZxtwc0lDQiU766uUA77QY3R/aQQS2uXZkk
eWuhSk8g28i8WfkdvPBZq1iao6700g==
=1G5s
-----END PGP SIGNATURE-----

A
A
Artyom V. Poptsov wrote on 17 Jan 2022 19:09
(name . Maxime Devos)(address . maximedevos@telenet.be)
87mtjujkt9.fsf@gmail.com
Hello,

meanwhile the libtree author fixed the tests in 3.0.2:

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

Thanks,

- Artyom
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(+)

Toggle diff (54 lines)
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
--
Artyom "avp" Poptsov <poptsov.artyom@gmail.com>
CADR Hackerspace co-founder: https://cadrspace.ru/
GPG: D0C2 EAC1 3310 822D 98DE B57C E9C5 A2D9 0898 A02F
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEE0MLqwTMQgi2Y3rV86cWi2QiYoC8FAmHlsOIACgkQ6cWi2QiY
oC/4lQf7BOQC/8IXDi8ngSVLBqFvJop1Fvc+GEpIq0HJTC3qfDs365E9sgpyW50q
0Yzq4CI59jgTAqSpLZN6uFzurDMpyMgx6zSiVzdsgzC4Cy8n0S11G3SX1HW2mXP0
vAC0nRGgLU3DMCyf1HXrFA7x7iDvIhsZgoXuyCzNsbdW0m6wLJXS8D3P4wcHmArt
ulLfB9oR7sEjal3YuRUFgQoajwJLqqEe6TenhlboRSUz86WyOWQW5LIQVfmWloQu
EY7KYx4sygXXne/mGayl+9OF+NFLeZtvweNHrKO7/UV45fyNc5Uy4ziNO4ESn0Ee
gOvM5C5hLTe5eSxDmqI1ij1qNjYczQ==
=34m0
-----END PGP SIGNATURE-----

M
M
Maxime Devos wrote on 17 Jan 2022 20:02
(name . Artyom V. Poptsov)(address . poptsov.artyom@gmail.com)
b4910fd9166b93d64831b68536e7884a8d99673e.camel@telenet.be
Hi,

Artyom V. Poptsov schreef op ma 17-01-2022 om 21:09 [+0300]:
Toggle quote (2 lines)
> +     (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’.

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

Guix doesn't do staged installation
Doing (string-append "PREFIX=" $output) and dropping DESTDIR=... should
suffice.

Greetings,
Maxime
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYeW9NRccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7kXfAQDvj51ptZjsvYLqYZlnNlr6SPGk
Vdq5HDueVB5vbgClqwD/aYMae62Ps4PLwI8+bQbbjAHcFGDVpJCGyiIybjIJSAE=
=znuF
-----END PGP SIGNATURE-----


A
A
Artyom V. Poptsov wrote on 17 Jan 2022 20:14
(name . Maxime Devos)(address . maximedevos@telenet.be)
87iluijhtr.fsf@gmail.com
Hello,

Toggle quote (2 lines)
> I suggest removing '#:tests?

Okay, done.

Toggle quote (2 lines)
> 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:

Toggle snippet (7 lines)
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

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

- Artyom
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(+)

Toggle diff (53 lines)
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
--
Artyom "avp" Poptsov <poptsov.artyom@gmail.com>
CADR Hackerspace co-founder: https://cadrspace.ru/
GPG: D0C2 EAC1 3310 822D 98DE B57C E9C5 A2D9 0898 A02F
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEE0MLqwTMQgi2Y3rV86cWi2QiYoC8FAmHlwAAACgkQ6cWi2QiY
oC+klwf9F13PU0oxL+lKboWEcfpLeEtFyYMQAO0K4cKxeEm5bxAoYp4uB3eiaLMH
cL0XTcW4U19yAPZLENbZA9UDJu43yGJuts5RqPFoJ0iy7IsrWb4bFJLA2Sz9Lwjd
CGtVXG9c3BORD6vJACWyoi6Xq6N9iXhfz6cynYKY9bss+UhatSllPnUI9Wf+2J7m
lW++HIXTzQYb72N7nlu7hztfVI00WpL+vnxeagcssymhXkeOwyGIbINdRkM4cZin
79OrCX8rs1HVdTsq4ApV9qhDK93u1IJFKhbHPF52yUv9J7vmyIlhJWG50zCuIWrB
BSGqMGwMNsZHHdD+k1gvNl6Z+v+qHw==
=81KS
-----END PGP SIGNATURE-----

M
M
Maxime Devos wrote on 17 Jan 2022 20:22
(name . Artyom V. Poptsov)(address . poptsov.artyom@gmail.com)
b9ed068a0dbfb3c9798e2846473bfc27dda0b710.camel@telenet.be
Hi,

Artyom V. Poptsov schreef op ma 17-01-2022 om 22:14 [+0300]:
Toggle quote (18 lines)
> [...]
> > 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.
(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
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYeXCExccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7hxRAP4jExD4FAtUPpQTAeAsnFg8PHWF
RWkWycZKd2JfEiXbbgEA0I59TSt/rUKqxgargwwVsdqiB5a8luqVeKc/d+o1kgs=
=YBWU
-----END PGP SIGNATURE-----


A
A
Artyom V. Poptsov wrote on 28 Jan 2022 19:30
(name . Maxime Devos)(address . maximedevos@telenet.be)
87zgnfg1c2.fsf@gmail.com
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>
CADR Hackerspace co-founder: https://cadrspace.ru/
GPG: D0C2 EAC1 3310 822D 98DE B57C E9C5 A2D9 0898 A02F
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEE0MLqwTMQgi2Y3rV86cWi2QiYoC8FAmH0Nj0ACgkQ6cWi2QiY
oC+YOgf/aolyjqXmM75S2tcTDujw00ZZ8YZzSVeATj9NCa1nqVWU4PQBjHvEjYKA
1pSO0M+lvIl7uxtm5FQMNDwdkYyFOOQdYcsTkiN8RG0zfPMJe0nBj+yhQJcudHGx
yOupqAm1q+JAYw2b3CHlbYwWoDILj2ZE9JEmvBfiNRv94CfMtumlw2iBfy0dBvcx
HpnrY0whnRdKO8nwbq/HUEfuvCCxVWfpzBPdNAf3Nd0akxvOeGJY+RH3x3WQ7BRm
SM0vTEn5FfbKtwI+3R+2PG/o9vaX33KPhxIQQtVNEmiUOC76tnBam2H38GnY/Jdh
w6LgUi0u/7P/H3S+uwdidm66vkonMA==
=p+Kl
-----END PGP SIGNATURE-----

M
M
Maxime Devos wrote on 28 Jan 2022 19:54
(name . Artyom V. Poptsov)(address . poptsov.artyom@gmail.com)
3c3cc605d110d977d10b0e7ed7d6f17d3af89f29.camel@telenet.be
Artyom V. Poptsov schreef op vr 28-01-2022 om 21:30 [+0300]:
Toggle quote (6 lines)
> 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.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYfQ72BccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7jt9AP9FRp6cPcnwxWMHK8xZ4ALGSHRp
g8ym2vTXEEdL/RLRVQD/b81UuN5WF1WnlLKdwQokwR3RQHt89DE0kaNrGVqizAU=
=K4mF
-----END PGP SIGNATURE-----


A
A
Artyom V. Poptsov wrote on 4 Feb 2022 19:25
(name . Maxime Devos)(address . maximedevos@telenet.be)
87v8xufq0x.fsf@gmail.com
Hello Maxime!

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

Please find the updated patch attached.

- Artyom
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(+)

Toggle diff (52 lines)
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
--
Artyom "avp" Poptsov <poptsov.artyom@gmail.com>
CADR Hackerspace co-founder: https://cadrspace.ru/
GPG: D0C2 EAC1 3310 822D 98DE B57C E9C5 A2D9 0898 A02F
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEE0MLqwTMQgi2Y3rV86cWi2QiYoC8FAmH9b34ACgkQ6cWi2QiY
oC9wNAf+O30l5+JNk/YkdDme7EwZgld6mvCZIX/XLrW9I5kzjx9RJGPdfUr9TJTH
WjIMoHr/s0eYUiOWnC9pblyKuFOxYMHE5akyXWu28cXsXuAC0eBWfU83NNmeGOEC
GE0z103sSC23toPIzvNfkLhAneYrp0PA7c0YDvtkYHM+joipGqQYk1w0d+y4tAf9
4SfkVh3755qBG6DCYlDf/Ge0NGaOkwRnwZofwYApfIuq5zubgknyzTpDGMjgfj85
aDUgHy8MK6hIGDwfM1JAVKnClhvEZsOB28x7swG6G3WJDituJUU5ogp6KmbbQBJh
hFkiEmxgnvVPu/QICNt+xXshRgrBWQ==
=sQ+C
-----END PGP SIGNATURE-----

M
M
Maxime Devos wrote on 4 Feb 2022 20:19
(name . Artyom V. Poptsov)(address . poptsov.artyom@gmail.com)
1d4a8ba63e8a9a6c76fc8c4b3999e6695644da48.camel@telenet.be
Artyom V. Poptsov schreef op vr 04-02-2022 om 21:25 [+0300]:
Toggle quote (7 lines)
> 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)
(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
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYf18KhccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7uUtAPwOE2qQJDZMran4ONyOfcVjFEeg
y2SYKdbn+EsKeAvSOAD/YE2bARPrfue/swdXkh0SABfCL/BxtKqtVilL9gu6OgA=
=frt+
-----END PGP SIGNATURE-----


A
A
Artyom V. Poptsov wrote on 5 Feb 2022 06:50
(name . Maxime Devos)(address . maximedevos@telenet.be)
87r18hg8v1.fsf@gmail.com
Hello Maxime,

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

Toggle snippet (8 lines)
$ ./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

Toggle quote (2 lines)
> 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>
CADR Hackerspace co-founder: https://cadrspace.ru/
GPG: D0C2 EAC1 3310 822D 98DE B57C E9C5 A2D9 0898 A02F
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEE0MLqwTMQgi2Y3rV86cWi2QiYoC8FAmH+ECMACgkQ6cWi2QiY
oC8FBQf/SgWFgRdDISeCc3KLkpzA3Xj6s0PZtfYGmjtCWQ9vXcFe1S+nVMC+cNWb
sIw4jaFe0NLHiNJ1Bdybjw7IdE8D9pyruw4Z/pxULHXg6ZCcH0TzeTKX9ZP4uaCi
sLC8KWiOX1dqXwB3g3tnOt70gL6UTM39IJddzI48aGfoey/vHL/6+/toLPsVSCa3
yXuNqC7cBNYVUQhqLQkHq3+27xP3CbGFl51Nn+FTOy+PcOtpmShTH9q5IQ5+/Bco
UTp4VOWYEtSVSMU2RmlBob3aXsi9BO53B+D+lnT0at6jBC0hR0o5ZtFtvmY2UbNr
QuYvyJ2lKpw7fGSwnNY/53RC+EwTzQ==
=LUbD
-----END PGP SIGNATURE-----

M
M
Maxime Devos wrote on 5 Feb 2022 11:56
(name . Artyom V. Poptsov)(address . poptsov.artyom@gmail.com)
abe48feccca50344ed43396100d3108b474cb24f.camel@telenet.be
Artyom V. Poptsov schreef op za 05-02-2022 om 08:50 [+0300]:
Toggle quote (15 lines)
> 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.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYf5X5hccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7nFsAP4xcrsDKRBsnsFvxfgXeWRRRKWX
KCexNBJBE3j6SVSIwQD/cxjLHREyYhg4O5UaWRabcr6l3A0+LTdgAq8IMvCPDgM=
=+D0G
-----END PGP SIGNATURE-----


A
A
Artyom V. Poptsov wrote on 5 Feb 2022 12:34
(name . Maxime Devos)(address . maximedevos@telenet.be)
87mtj5fsx7.fsf@gmail.com
Hello Maxime!

Toggle quote (4 lines)
> 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
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(+)

Toggle diff (49 lines)
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
--
Artyom "avp" Poptsov <poptsov.artyom@gmail.com>
CADR Hackerspace co-founder: https://cadrspace.ru/
GPG: D0C2 EAC1 3310 822D 98DE B57C E9C5 A2D9 0898 A02F
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEE0MLqwTMQgi2Y3rV86cWi2QiYoC8FAmH+YNQACgkQ6cWi2QiY
oC//Jgf/W7DKeCX9nULQWLC7j52ZfcW3CV7NOq56zA73IMSXpVFubl4JjQC/YLg+
D5vTjY0lkGEBf3i4skS6Ewu6s0z8UGNPGt55t+hayuQjHzatWO51wrs0SX5g4Sop
S4gZDJwtz6811ks5SYigsTryoPBo9W2+sCcKmi5xLRqqLE3Nr8oOcsY1JHAx1hGf
zMnemdQ81H6T53sYXLMJPGbT9DOFQA0MlYEA8Sd8zlyy7q34Qq1KvWoBxwR/vDtp
1XWayiH+Sh7X5Lqmv7DEgkiWGOexgCsKeSsbMma3j3aeGjKmF+f8SS84i4xgsb3M
X8P0mkMgazUsjYdXkfXT438DAU38QA==
=4C7+
-----END PGP SIGNATURE-----

L
L
Ludovic Courtès wrote on 9 Mar 2022 23:06
Re: bug#52472: [PATCH] gnu: Add libtree
(name . Artyom V. Poptsov)(address . poptsov.artyom@gmail.com)
87a6dy3hms.fsf_-_@gnu.org
Hi Artyom and all,

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

Toggle quote (2 lines)
> * gnu/packages/linux.scm (libtree): New variable.

Finally applied.

Thanks you and thanks everyone for reviewing!

Ludo’.
Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 52472@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 52472
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch