GNU bug report logs - #59276
[PATCH] gnu: Add smem.

Previous Next

Package: guix-patches;

Reported by: jgart <jgart <at> dismail.de>

Date: Tue, 15 Nov 2022 04:50:01 UTC

Severity: normal

Tags: patch

Done: Christopher Baines <mail <at> cbaines.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: jgart <jgart <at> dismail.de>
Subject: bug#59276: closed (Re: [bug#59276] [PATCH] gnu: Add smem.)
Date: Sat, 19 Nov 2022 14:08:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#59276: [PATCH] gnu: Add smem.

which was filed against the guix-patches package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 59276 <at> debbugs.gnu.org.

-- 
59276: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=59276
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Christopher Baines <mail <at> cbaines.net>
To: jgart <jgart <at> dismail.de>
Cc: 59276-done <at> debbugs.gnu.org, guix-patches <at> gnu.org
Subject: Re: [bug#59276] [PATCH] gnu: Add smem.
Date: Sat, 19 Nov 2022 14:04:41 +0000
       <#secure method=pgpmime mode=sign>

jgart via Guix-patches via <guix-patches <at> gnu.org> writes:

> * gnu/packages/admin.scm (smem): New variable.
> ---
>  gnu/packages/admin.scm | 44 ++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 44 insertions(+)

Thanks, I've made some tweaks and pushed this to master as
85f4d87b8154238480dc176b77b8c54dde84e1c4.

> +    (source (origin
> +             (method url-fetch)
> +             (uri (string-append "https://selenic.com/repo/smem/archive/"
> +                                 version ".tar.bz2"))
> +             (sha256
> +              (base32
> +               "19ibv1byxf2b68186ysrgrhy5shkc5mc69abark1h18yigp3j34m"))))

As the linter points out, "the source file name should contain the
package name".

> +               (replace 'install
> +                  (lambda _
> +                    (let ((bin (string-append #$output "/bin"))
> +                          (man1 (string-append #$output "/share/man/man8")))
> +                      (install-file "smemcap" bin)
> +                      (install-file "smem" bin)
> +                      (mkdir-p man1)
> +                      (copy-file "smem.8" (string-append man1 "/smem.8"))))))))

I tweaked the indentation above.

> +    (home-page "http://smem.sourceforge.net")

As the linter points out, this page doesn't currently work. As the
source is being fetched from selenic.com, I changed the homepage
accordingly.

> +    (description
> +"This package provides a command line tool that can give numerous reports
> +on memory usage on GNU/Linux systems.")

I also tweaked the indentation above.

[Message part 3 (message/rfc822, inline)]
From: jgart <jgart <at> dismail.de>
To: guix-patches <at> gnu.org
Cc: jgart <jgart <at> dismail.de>
Subject: [PATCH] gnu: Add smem.
Date: Mon, 14 Nov 2022 22:49:28 -0600
* gnu/packages/admin.scm (smem): New variable.
---
 gnu/packages/admin.scm | 44 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 44 insertions(+)

diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm
index ee730ac8e3..f493140ca7 100644
--- a/gnu/packages/admin.scm
+++ b/gnu/packages/admin.scm
@@ -54,6 +54,7 @@
 ;;; Copyright © 2022 Andreas Rammhold <andreas <at> rammhold.de>
 ;;; Copyright © 2022 ( <paren <at> disroot.org>
 ;;; Copyright © 2022 Matthew James Kraai <kraai <at> ftbfs.org>
+;;; Copyright © 2022 jgart <jgart <at> dismail.de>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -730,6 +731,49 @@ (define-public btop
 and processes.")
     (license license:asl2.0)))
 
+(define-public smem
+  (package
+    (name "smem")
+    (version "1.5")
+    (source (origin
+             (method url-fetch)
+             (uri (string-append "https://selenic.com/repo/smem/archive/"
+                                 version ".tar.bz2"))
+             (sha256
+              (base32
+               "19ibv1byxf2b68186ysrgrhy5shkc5mc69abark1h18yigp3j34m"))))
+    (build-system gnu-build-system)
+    (arguments
+     (list #:tests? #f ; There is no test suite.
+           #:make-flags #~(list "smemcap")
+           #:phases
+           #~(modify-phases %standard-phases
+               (delete 'configure)
+               (replace 'build
+                 (lambda _
+                   (let* ((system #$(cond ((target-x86?) "X86")
+                                          ((target-arm?) "ARM")
+                                          ((target-powerpc?) "POWER")
+                                          (else "CROSS_FINGERS"))))
+                     (format #t "Building for ~a~%" system)
+                     (invoke #$(cc-for-target) "-o" "smemcap" "smemcap.c"
+                             "-g" "-Wall" "-D" system))))
+               (replace 'install
+                  (lambda _
+                    (let ((bin (string-append #$output "/bin"))
+                          (man1 (string-append #$output "/share/man/man8")))
+                      (install-file "smemcap" bin)
+                      (install-file "smem" bin)
+                      (mkdir-p man1)
+                      (copy-file "smem.8" (string-append man1 "/smem.8"))))))))
+    (native-inputs (list python-minimal-wrapper))
+    (home-page "http://smem.sourceforge.net")
+    (synopsis "Memory reporting tool")
+    (description
+"This package provides a command line tool that can give numerous reports
+on memory usage on GNU/Linux systems.")
+    (license license:gpl2+)))
+
 (define-public htop
   (package
     (name "htop")
-- 
2.38.1




This bug report was last modified 2 years and 182 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.