all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#59276] [PATCH] gnu: Add smem.
@ 2022-11-15  4:49 jgart via Guix-patches via
  2022-11-19 14:04 ` bug#59276: " Christopher Baines
  0 siblings, 1 reply; 2+ messages in thread
From: jgart via Guix-patches via @ 2022-11-15  4:49 UTC (permalink / raw)
  To: 59276; +Cc: jgart

* 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@rammhold.de>
 ;;; Copyright © 2022 ( <paren@disroot.org>
 ;;; Copyright © 2022 Matthew James Kraai <kraai@ftbfs.org>
+;;; Copyright © 2022 jgart <jgart@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





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

* bug#59276: [PATCH] gnu: Add smem.
  2022-11-15  4:49 [bug#59276] [PATCH] gnu: Add smem jgart via Guix-patches via
@ 2022-11-19 14:04 ` Christopher Baines
  0 siblings, 0 replies; 2+ messages in thread
From: Christopher Baines @ 2022-11-19 14:04 UTC (permalink / raw)
  To: jgart; +Cc: 59276-done, guix-patches

       <#secure method=pgpmime mode=sign>

jgart via Guix-patches via <guix-patches@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.




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

end of thread, other threads:[~2022-11-19 14:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-15  4:49 [bug#59276] [PATCH] gnu: Add smem jgart via Guix-patches via
2022-11-19 14:04 ` bug#59276: " Christopher Baines

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.