unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Efraim Flashner <efraim@flashner.co.il>
To: phodina <phodina@protonmail.com>
Cc: 53583@debbugs.gnu.org
Subject: [bug#53583] [PATCH] gnu: Add ncdu-ng.
Date: Tue, 1 Feb 2022 13:03:41 +0200	[thread overview]
Message-ID: <YfkTjZs4XxhjVk98@3900XT> (raw)
In-Reply-To: <6vXo33nNBkLPCf4VQTY3L-RrWG8JHPVjtgprEQk8vcmVXfDXty5cr6Dyj_qkc21iYmzHrVTKJukBnNWkx6FebmPZJyUZk3KBHaG5b2DksCM=@protonmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 3519 bytes --]

On Thu, Jan 27, 2022 at 02:22:58PM +0000, phodina via Guix-patches via wrote:
> Hello,
> 
> here is a patch for the ncdu. As version 2.0.* are based on Zig I decided to create a new variable instead of updating the old one.
> 
> FIY this is my first encounter with Zig and I just briefly swept through the documentation and I don't know if cross-compilation won't be an issue since the previous versions are just plain C.
> 
> If you think there is no need to do this and we can just simply update let me know and I'll send updated patch.

I also packaged ncdu@2 locally, to try out packaging a zig program. I
was unable to build zig for aarch64 due to the memory requirements
during the linking stage, so for now I agree it makes sense to have a
separate zig version and not just upgrade to the new version.

Also I'm attaching my copy if you want to take a look and see about
merging the two.

> ----
> Petr

> From 3e6ad4ef4f928314bd69cae18a05be317e1b26ab Mon Sep 17 00:00:00 2001
> From: Petr Hodina <phodina@protonmail.com>
> Date: Thu, 27 Jan 2022 14:56:39 +0100
> Subject: [PATCH] gnu: Add ncdu-ng.
> 
> * gnu/packages/ncdu.scm (ncdu-ng): New variable.
> 
> diff --git a/gnu/packages/ncdu.scm b/gnu/packages/ncdu.scm
> index d6e4522bf0..01084976f0 100644
> --- a/gnu/packages/ncdu.scm
> +++ b/gnu/packages/ncdu.scm
> @@ -1,6 +1,7 @@
>  ;;; GNU Guix --- Functional package management for GNU
>  ;;; Copyright © 2014 John Darrington <jmd@gnu.org>
>  ;;; Copyright © 2018–2021 Tobias Geerinckx-Rice <me@tobias.gr>
> +;;; Copyright © 2022 Petr Hodina <phodina@protonmail.com>
>  ;;;
>  ;;; This file is part of GNU Guix.
>  ;;;
> @@ -20,8 +21,10 @@
>  (define-module (gnu packages ncdu)
>    #:use-module (gnu packages)
>    #:use-module (gnu packages ncurses)
> +  #:use-module (gnu packages zig)
>    #:use-module (guix licenses)
>    #:use-module (guix packages)
> +  #:use-module (guix utils)
>    #:use-module (guix download)
>    #:use-module (guix build-system gnu))
>  
> @@ -49,3 +52,32 @@ (define-public ncdu
>                (string-append "https://g.blicky.net/ncdu.git/plain/COPYING?id=v"
>                               version)))
>      (home-page "https://dev.yorhel.nl/ncdu")))
> +
> +(define-public ncdu-ng
> +  (package
> +    (inherit ncdu)
> +    (name "ncdu-ng")
> +    (version "2.0.1")
> +    (source (origin
> +              (method url-fetch)
> +              (uri (string-append "https://dev.yorhel.nl/download/ncdu-"
> +                                  version ".tar.gz"))
> +              (sha256
> +               (base32
> +                "0j3w8xixz1zkzcpk0xrh6y3r7sii3h3y31lbvs5iqc5q7q6day9g"))))
> +    (arguments
> +     `(#:tests? #f
> +       #:make-flags
> +       (list (string-append "PREFIX="
> +                            (assoc-ref %outputs "out"))
> +             ,(string-append "CC="
> +                             (cc-for-target)))
> +       #:phases
> +       (modify-phases %standard-phases
> +         (add-after 'unpack 'set-home-dir
> +           (lambda* _
> +             ;; Zig caches build
> +             (setenv "HOME" "/tmp")))
> +         (delete 'configure))))
> +    (native-inputs (list zig))
> +    (inputs (list ncurses))))
> -- 
> 2.34.0
> 


-- 
Efraim Flashner   <efraim@flashner.co.il>   רנשלפ םירפא
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

[-- Attachment #1.2: ncdu.scm --]
[-- Type: text/plain, Size: 2319 bytes --]

;;; Copyright © 2022 Efraim Flashner <efraim@flashner.co.il>
;;;
;;; This file is an addendum to GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

(define-module (dfsg main ncdu)
  #:use-module (guix packages)
  #:use-module (guix download)
  #:use-module (guix utils)
  #:use-module (guix gexp)
  #:use-module (gnu packages ncdu)
  #:use-module (gnu packages perl)
  #:use-module (gnu packages zig))

(define-public ncdu-2
  (package
    (inherit ncdu)
    (name "ncdu2")      ; only to prevent it from being installed by accident
    (version "2.0.1")
    (source (origin
              (method url-fetch)
              (uri (string-append "https://dev.yorhel.nl/download/ncdu-"
                                  version ".tar.gz"))
              (sha256
               (base32
                "0j3w8xixz1zkzcpk0xrh6y3r7sii3h3y31lbvs5iqc5q7q6day9g"))))
    (arguments
     (list
       #:make-flags
       #~(list (string-append "PREFIX=" #$output)
               (string-append "CC=" #$(cc-for-target)))
       #:phases
       #~(modify-phases %standard-phases
           (delete 'configure)      ; No configure script.
           (add-before 'build 'pre-build
             (lambda _
               (setenv "ZIG_GLOBAL_CACHE_DIR"
                       (mkdtemp "/tmp/zig-cache-XXXXXX"))))
           (add-after 'build 'build-manpage
             (lambda _
               (delete-file "ncdu.1")
               (invoke "make" "doc")))
           (replace 'check
             (lambda* (#:key tests? #:allow-other-keys)
               (when tests?
                 (invoke "zig" "test" "build.zig")))))))
    (native-inputs
     (list perl zig))))

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2022-02-01 11:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-27 14:22 [bug#53583] [PATCH] gnu: Add ncdu-ng phodina via Guix-patches via
2022-02-01 11:03 ` Efraim Flashner [this message]
2022-02-06  7:19   ` phodina via Guix-patches via
2022-03-06 12:16     ` bug#53583: " Efraim Flashner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YfkTjZs4XxhjVk98@3900XT \
    --to=efraim@flashner.co.il \
    --cc=53583@debbugs.gnu.org \
    --cc=phodina@protonmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).