all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Blake Shaw via Guix-patches via <guix-patches@gnu.org>
To: Nicolas Goaziou <mail@nicolasgoaziou.fr>
Cc: 52189@debbugs.gnu.org
Subject: [bug#52189] [PATCH] gnu: Add notcurses
Date: Fri, 03 Dec 2021 05:30:57 +0700	[thread overview]
Message-ID: <875ys6myfy.fsf@nonconstructivism.com> (raw)
In-Reply-To: <6a6031ead6f9f61bc8eed976374638089efdaf3f.1638231894.git.blake@nonconstructivism.com>


Hi, thanks for the feedback.

Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:

> I don't think we should create a new file just for this package. Also,
> new files need to be registered in "gnu/local.mk".

>
> Maybe this should go into... "ncurses.scm" (!). At a later time, we may
> rename ncurse.scm into tui.scm or some such.

I was originally packaging it with ncurses, but when I asked on the IRC
I was advised by <notmaximed> to create a new package [1]. Let me know
which is preferred and I will change things accordingly. 

[1] https://logs.guix.gnu.org/guix/2021-10-24.log#201648
>
>> +(define-public notcurses
>> +  (let ((commit "d15eb6003cbd65f11163916261cf6cd5600c77fa"))
>
> Upstream use tags. It might be more readable. You'll need a variable for
> the code name, tho. In any case, a comment is warranted explaining the
> situation.
>
>> +         (sha256
>> +          (base32
>> +           "10jf6iai1r0xafrgaz978y9bqlaw1gvd11gc0yynwwp6rcs97g17"))))
>
> Nitpick: string should go on the same line as base32.
>
noted.

>> +      (build-system cmake-build-system)
>> +      (arguments
>> +       `(#:tests? #f
>> +                  #:build-type "-DVAR=val"
>
> Indentation is off. You may want to use "etc/indent-code.el" script.
> The build-type value above is suspicious.

The build type is recommend in INSTALL.md[2]. I tried building without
it, and it seems to work fine, in case you'd like me to remove it. 

[2] https://github.com/dankamongmen/notcurses/blob/master/INSTALL.md
>
>> +                  #:make-flags
>> +                  (list
>> +                   (string-append "prefix="
>> +                                  (assoc-ref %outputs "out"))
>> +                   "CC=gcc")
>
> This is not cross-compilation friendly. The above should be:
>
>   (list ,(string-append "CC=" (cc-for-target))
>         (string-append "prefix=" ...))
Oh great, I did not know about this. I was trying to build for other targets
using QEMU and couldn't; this seems to be why. 
>
>> +                  #:configure-flags
>> +                  (map (lambda (s)
>> +                         (string-append "-D" s))
>> +                       '("USE_CPP=off"     "USE_COVERAGE=off"
>> +                         "USE_DOXYGEN=off" "USE_DOCTEST=off"
>> +                         "USE_GPM=off"     "USE_MULTIMEDIA=ffmpeg"
>> +                         "USE_PANDOC=off"  "FSG_BUILD=ON"))
>> +                  #:phases
>> +                  (modify-phases %standard-phases
>> +                    (add-before 'build 'patch-makefile-shell
>> +                      (lambda _
>> +                        (setenv "HOME" "/tmp")))
>
> Is the phase above required for tests? If so, could you add a comment
> about it?

The configure flags bring down the package size by about 80mb, and
FSG_BUILD=ON is to insure only FSF approved programs are used in the
build. I wasn't sure about comment etiquette, but I  will add and return.

>> +                    (add-before 'build 'set-prefix-in-makefile
>> +                      (lambda* (#:key outputs #:allow-other-keys)
>> +                        (let ((out (assoc-ref outputs "out")))
>> +                          (substitute* "Makefile"
>> +                            (("PREFIX =.*")
>> +                             (string-append "PREFIX = " out "\n")))
>> +                          #true))))))
>
> The trailing #true is not required anywore. You can drop it.

It seems it builds fine without either build phase, so I can remove them
in the future. I originally wrote this package back in October and it
had updated multiple times since then, so its difficult for me to recall the
purpose of these phases, although I do recall them solving some debugging issues early on.

>
>> +      (native-inputs
>> +       `(("ncurses" ,ncurses)
>> +         ("gcc-toolchain" ,gcc-10)
>
> Could you explain why gcc-10 must be used?

For some reason I had thought its important to pin a version for the sake of
reproducibility. If not, I will remove it.  

>
>> +         ("pkg-config" ,pkg-config)))
>> +      (inputs
>> +       `(("zlib" ,zlib)
>> +         ("ffmpeg" ,ffmpeg)
>> +         ("libunistring" ,libunistring)))
>
> Pleas order inputs alphabetically.
Got it
>
>> + (synopsis "Not-ncurses: A library facilitating complex TUIs on
>> modern terminals")
>
> I suggest:
>
>   "Library for building textual user interfaces on modern terminals"
>
>> + (description "Supporting vivid colors, multimedia, threads, &
>> Unicode to the max.")
>
> The description is not terribly useful, and sounds like an ad. Maybe:
>
>   Notcurses is a library for building complex, textual user interfaces
>   (TUIs) on modern terminal emulators. It does not use Ncurses, though
>   it does make use of libtinfo from that package.
>
> The second sentence above may even be dropped. Up to you.

Got it, I had just copied from their official release. 

>
> Could you send an updated patch?

I just found out that the newest version, which is a landmark version,
3.0, was released yesterday (I had thought it wasn't coming until
2022). so I'll write the new package with the above considerations,
after I hear back from you about the questions concerning putting it in
gnu/ncurses.scm.

Thanks!
Blake
>
> Regards,

-- 
“In girum imus nocte et consumimur igni”





  parent reply	other threads:[~2021-12-02 22:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-30  0:24 [bug#52189] [PATCH] gnu: Add notcurses Blake Shaw via Guix-patches via
2021-12-01 16:01 ` Nicolas Goaziou
2021-12-02 21:04   ` Blake Shaw via Guix-patches via
2021-12-03 20:47     ` Nicolas Goaziou
2021-12-02 22:20   ` Blake Shaw via Guix-patches via
2021-12-02 22:30 ` Blake Shaw via Guix-patches via [this message]
2023-09-01 21:43 ` bug#52189: " Vagrant Cascadian

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

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

  git send-email \
    --in-reply-to=875ys6myfy.fsf@nonconstructivism.com \
    --to=guix-patches@gnu.org \
    --cc=52189@debbugs.gnu.org \
    --cc=blake@nonconstructivism.com \
    --cc=mail@nicolasgoaziou.fr \
    /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 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.