Subject: [bug#72957] [PATCH] gnu: Add bin-graph.

From: Zheng Junjie <[email-masked]>
Date: Wed, 04 Sep 2024 10:43:52 +0800

"Artyom V. Poptsov" <[email-masked]> writes:

maybe gnu/packages/graph.scm better here

> * gnu/packages/linux.scm (bin-graph): New variable.
>
> Change-Id: I7405cbc00e038d024d035fb100473352c9a7b59d
> ---
>  gnu/packages/linux.scm | 37 +++++++++++++++++++++++++++++++++++++
>  1 file changed, 37 insertions(+)
>
> diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
> index 318c6ccf13..38f3d6fc2f 100644
> --- a/gnu/packages/linux.scm
> +++ b/gnu/packages/linux.scm
> @@ -1776,6 +1776,43 @@ (define-public bbswitch-module
>  graphics card on Optimus laptops.")
>        (license license:gpl2))))
>  
> +(define-public bin-graph
> +  ;; XXX: The upstream does not have tags yet.
> +  (let ((commit "1dd42e3e8e123e993d6c287967502c8d4b36f9ba")
> +        (revision "0"))
> +    (package
> +      (name "bin-graph")
> +      (version (git-version "0.0.0" revision commit))
> +      (source
> +       (origin
> +         (method git-fetch)
> +         (uri (git-reference
> +               (url "https://github.com/8dcc/bin-graph")
> +               (commit commit)))
> +         (file-name (git-file-name name version))
> +         (sha256
> +          (base32 "1wjkl789r7iys3nnyk813gsdxwwy2ryxgxirx5xw02lzk790dywl"))))
> +      (arguments
> +       (list #:tests? #f                ; no tests
> +             #:make-flags
> +             #~(list (string-append "CC=" #$(cc-for-target))
> +                     (string-append "PREFIX=" #$output))

see https://github.com/8dcc/bin-graph/blob/f5c53c427248d3fe10c1c921ea134f4592fbe8b7/Makefile#L10C1-L10C12

when use (string-append "INSTALL_DIR=" #$output "/bin") , not need to
replace install phase.

> +             #:phases
> +             #~(modify-phases %standard-phases
> +                 (delete 'configure)

please add a comment, ; no configure script

> +                 (replace 'install
> +                   (lambda _
> +                     (install-file "bin-graph"
> +                                   (string-append #$output "/bin")))))))
> +      (build-system gnu-build-system)
> +      (inputs (list libpng))
> +      (home-page "https://github.com/8dcc/bin-graph")
> +      (synopsis "Visualize binary files")
> +      (description
> +       "@code{bin-graph} provides a simple way of visualizing the different regions
> +of a binary file.")
> +      (license license:gpl3))))
> +
>  (define-public ddcci-driver-linux
>    (package
>      (name "ddcci-driver-linux")
>
> base-commit: a977900d76b7585c401222a3ce8bbb82e5f6da45