diff mbox series

[bug#52472] gnu: Add libtree

Message ID 87v8xufq0x.fsf@gmail.com
State Accepted
Headers show
Series [bug#52472] gnu: Add libtree | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue

Commit Message

Artyom V. Poptsov Feb. 4, 2022, 6:25 p.m. UTC
Hello Maxime!

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

Please find the updated patch attached.

- Artyom

Comments

M Feb. 4, 2022, 7:19 p.m. UTC | #1
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)
Artyom V. Poptsov Feb. 5, 2022, 5:50 a.m. UTC | #2
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
M Feb. 5, 2022, 10:56 a.m. UTC | #3
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.
diff mbox series

Patch

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