Bug 254261 - devel/notcurses: Update to 2.2.8
Summary: devel/notcurses: Update to 2.2.8
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Rainer Hurling
URL: https://github.com/dankamongmen/notcu...
Keywords:
Depends on:
Blocks:
 
Reported: 2021-03-13 21:04 UTC by nick black
Modified: 2021-05-02 08:31 UTC (History)
1 user (show)

See Also:


Attachments
git diff 2.2.2 -> 2.2.3 (1.83 KB, patch)
2021-03-13 21:04 UTC, nick black
nickblack: maintainer-approval+
Details | Diff
devel/notcurses git diff 2.2.2 -> 2.2.6 (1.97 KB, patch)
2021-04-13 23:07 UTC, nick black
nickblack: maintainer-approval+
Details | Diff
git diff 2.2.2 -> 2.2.8 (5.97 KB, patch)
2021-04-26 11:42 UTC, nick black
nickblack: maintainer-approval+
Details | Diff
patch with work fetch for both source files (5.97 KB, patch)
2021-04-26 20:25 UTC, Rainer Hurling
no flags Details | Diff
update 2.2.2 -> 2.2.8, use docs pack (6.45 KB, patch)
2021-05-02 00:37 UTC, nick black
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description nick black 2021-03-13 21:04:27 UTC
Created attachment 223236 [details]
git diff 2.2.2 -> 2.2.3

Nothing too new here, except I've added some PORTDOC-dependent files to the pkg-plist.
Comment 1 Rainer Hurling freebsd_committer freebsd_triage 2021-03-14 09:07:58 UTC
Hi Nick,

Poudriere still has problems with PORTDOCS= and gives the following error message:

====> Running Q/A tests (stage-qa)
====> Checking for pkg-plist issues (check-plist)
===> Parsing plist
===> Checking for items in STAGEDIR missing from pkg-plist
===> Checking for items in pkg-plist which are not in STAGEDIR
Error: Missing: %%DOCSDIR%%/NEWS.md
Error: Missing: %%DOCSDIR%%/README.md
Error: Missing: %%DOCSDIR%%/TERMINALS.md
Error: Missing: %%DOCSDIR%%/USAGE.md
===> Error: Plist issues found.


For these files a simple solution would be to use '\*.md' instead of '*.md'. However, the backslash is not a nice thing here.

Since there is still some work to be done anyway, one question: Are you interested in including documents that can be found under docs and docs/examples?
Comment 2 nick black 2021-04-13 23:07:09 UTC
(In reply to Rainer Hurling from comment #1)

I'd appreciate some advice on how to deal with this. Obviously, the files are only installed when the docs option has been enabled. Does Poudriere understand that they're conditional? When I have docs enabled, they do seem to get installed.

I've updated the patch for 2.2.6. Some new files are listed therein. Sorry to not have attended to this very promptly.

I'm not yet installing any other docs on any distributions. Examples will be installed when they're more useful =].
Comment 3 nick black 2021-04-13 23:07:37 UTC
Created attachment 224092 [details]
devel/notcurses git diff 2.2.2 -> 2.2.6
Comment 4 Rainer Hurling freebsd_committer freebsd_triage 2021-04-14 13:40:59 UTC
(In reply to Nick Black from comment #2)
Hi Nick,

Thanks for the update of notcurses and your FreeBSD port!

> I'd appreciate some advice on how to deal with this. Obviously,
> the files are only installed when the docs option has been enabled.
Unfortunately this is not true for your port in this constellation: Even if you deselect both options (DOCS and MANPAGES), the DOCS get installed as md files. Obviously this is somewhat hardcoded in your CMakeLists.txt?

I found a second issue with man pages. If option DOCS is disabled, no man pages are built. As far as I understand this is because man pages are build via Pandoc, as controlled by CMakeLists.txt? This is a bit unusual ;)

To get your port updated as far as possible, I would suggest two changes in the Makefile:
- Because DOCS are installed independent from the setting of the option, we could remove this option.
- The pandoc dependency and the CMAKE_BOOL should be moved into option helpers for MANPAGES.

What do you think?

> Does Poudriere understand that they're conditional? When I have
> docs enabled, they do seem to get installed.

> I've updated the patch for 2.2.6. Some new files are listed
> therein. Sorry to not have attended to this very promptly.
Absolutely no problem. It's your port :)

> I'm not yet installing any other docs on any distributions.
> Examples will be installed when they're more useful =].
Yupp, sounds reasonable.
Comment 5 nick black 2021-04-22 09:01:20 UTC
(In reply to Rainer Hurling from comment #4)

Thanks for the detailed feedback.

Yes, the man pages require pandoc, while the Markdown pages are installed as-is. I really only see a need for a single variable here -- MANPAGES, primarily because pandoc is a huge dependency stack.

So I agree with you, let's kill off DOCS as a variable, and the pandoc/CMAKE_BOOL ought be dependent on MANPAGES. I'm going to update the Makefile to the current 2.2.8 and try my hand at these changes (the first is obviously trivial). I appreciate the help!
Comment 6 Rainer Hurling freebsd_committer freebsd_triage 2021-04-22 09:14:22 UTC
(In reply to Nick Black from comment #5)
In principle, the MANPAGES OPTION could use the entries from DOCS for this, without DOCTEST.

What do you think about a 'special' MANPAGES_DESC like this:

MANPAGES_DESC=Install man pages (needs pandoc as build dependency)


And I think, because of the huge dependency, MANPAGES should be disabled by default?
Comment 7 nick black 2021-04-22 09:30:43 UTC
(In reply to Rainer Hurling from comment #6)

This seems to me a question of "local custom", regarding which I'm happy to look to the natives =]. Sounds good to me.
Comment 8 nick black 2021-04-22 09:39:23 UTC
Alternatively, I produce a prebuilt pack of documentation with each release, due to this exact problem. Would it be better to download that and always install man pages?
Comment 9 Rainer Hurling freebsd_committer freebsd_triage 2021-04-22 16:14:06 UTC
(In reply to Nick Black from comment #8)
On FreeBSD it is common for software to be installed with manpages if available. So if possible that should be done. However, it is up to the maintainer of a port to decide.

I'm not sure I understand the suggestion about pre-built packages for documentation, I don't have the experience. Does this package need to be downloaded additionally?

And one more thought: I am absolutely no expert for manpages. But aren't there much simpler tools that can be used to build them? Surely the very large pandoc is not necessary for this?
Comment 10 nick black 2021-04-24 06:54:26 UTC
(In reply to Rainer Hurling from comment #9)
> On FreeBSD it is common for software to be installed with manpages if available. So if possible that should be done. However, it is up to the maintainer of a port to decide.

I'd definitely like to install them so long as doing so doesn't put a great burden on general users. Building pandoc seems like such a burden, but grabbing the prebuilt manpage pack seems much less so.

> I'm not sure I understand the suggestion about pre-built packages for documentation, I don't have the experience. Does this package need to be downloaded additionally?

That's right. On each release, I make available a source tarball, and a prebuilt documentation tarball, for instance:

 https://github.com/dankamongmen/notcurses/archive/refs/tags/v2.2.8.tar.gz

has 

 https://github.com/dankamongmen/notcurses/releases/download/v2.2.8/notcurses-doc-2.2.8.tar.gz

which is significantly smaller, just 115K:

[schwarzgerat](0) $ wget -nv https://github.com/dankamongmen/notcurses/archive/refs/tags/v2.2.8.tar.gz https://github.com/dankamongmen/notcurses/releases/download/v2.2.8/notcurses-doc-2.2.8.tar.gz
[11255362/11255362] -> "v2.2.8.tar.gz" [1]
[115654/115654] -> "notcurses-doc-2.2.8.tar.gz" [1]
[schwarzgerat](0) $

I use this on e.g. Gentoo, a Linux derivative with (like FreeBSD) is geared towards building packages from source.

The Porter's Handbook section 4.9 seems to suggest that multiple distribution files are well-supported in the Ports System, even going so far as to support multiple upstream *sites*: https://www-legacy.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/makefile-distfiles.html
Comment 11 Rainer Hurling freebsd_committer freebsd_triage 2021-04-24 09:24:02 UTC
(In reply to Nick Black from comment #10)

> I'd definitely like to install them so long as doing so doesn't
> put a great burden on general users. Building pandoc seems like
> such a burden, but grabbing the prebuilt manpage pack seems much
> less so.
I feel the same way. We should find an elegant way to download the pre-built docs and optionally install them (default enabled).

> The Porter's Handbook section 4.9 ...
In fact, Section 5.4.9 is probably meant? For Github, section 5.4.3.1 also gives two examples, however I can't manage to apply them correctly to your files and file locations so far :(

BTW: If the problem with the docs is solved, shouldn't we commit the port to v2.2.8 as well?
Comment 12 nick black 2021-04-24 09:31:13 UTC
(In reply to Rainer Hurling from comment #11)

I did indeed mean 5.4.9; sorry for the stupid. I was just going to try listing two DISTFILES and avoiding the GH_ jibjab when I get around to it tomorrow.

I'm glad you approve of the strategy. It seems the best of all possible worlds. Migrating from pandoc isn't viable for me without finding something that has its features unrelated to man pages (I use it for a number of things). It is godawfully huge, though. Haskell amirite?

And yes, once the FreeBSD parts are done and approved, I will bump to 2.2.8 or whatever newer has been released in the meantime =]. This already moved up from the original 2.2.3 target =].

Thanks again for your patience and assistance.
Comment 13 nick black 2021-04-26 10:45:41 UTC
I just noticed that somehow along the way, my unit tests have been made conditional on DOCS (probably because i use "doctest" as my unit testing infrastructure). Since we're unconditionally defining CMAKE_OFF=BUILD_TESTING, disabling all of this, I've just dropped all mention of doctest for now. I'd like to put it back in in the future, but let's not worry about it for now.

I'm downloading the documentation tarball, and just need figure out a way to get the manpages from it installed. I've also updated to 2.2.8. New patch incoming soon.
Comment 14 nick black 2021-04-26 11:39:20 UTC
I have things working when I manually download the docs tarball and put it in /usr/ports/distfiles. When I clear them out, though, the USE_GITHUB stuff results in the wrong file being downloaded:

[qbsd](0) $ make
===>  License APACHE20 MIT accepted by the user
===>   notcurses-2.2.8 depends on file: /usr/local/sbin/pkg - found
=> dankamongmen-notcurses-v2.2.8_GH0.tar.gz doesn't seem to exist in /usr/ports/distfiles/.
=> Attempting to fetch https://codeload.github.com/dankamongmen/notcurses/tar.gz/v2.2.8?dummy=/dankamongmen-notcurses-v2.2.8_GH0.tar.gz
dankamongmen-notcurses-v2.2.8_GH0.tar.gz                10 MB   10 MBps    01s
=> notcurses-doc-2.2.8.tar.gz doesn't seem to exist in /usr/ports/distfiles/.
=> Attempting to fetch https://codeload.github.com/dankamongmen/notcurses/tar.gz/v2.2.8?dummy=/notcurses-doc-2.2.8.tar.gz
fetch: https://codeload.github.com/dankamongmen/notcurses/tar.gz/v2.2.8?dummy=/notcurses-doc-2.2.8.tar.gz: size mismatch: expected 115654, actual 11255362
=> Attempting to fetch http://distcache.FreeBSD.org/ports-distfiles/notcurses-doc-2.2.8.tar.gz
fetch: http://distcache.FreeBSD.org/ports-distfiles/notcurses-doc-2.2.8.tar.gz: Not Found
=> Couldn't fetch it - please try to retrieve this
=> port manually into /usr/ports/distfiles/ and try again.
*** Error code 1

This is clearly downloading the main source tarball (the size matches exactly) and naming it as the doc tarball. If I have a distinfo set up correctly, the hash check fails. If I run `make makesum`, I end up with:

[qbsd](0) $ sudo make makesum
===>  License APACHE20 MIT accepted by the user
===>  License APACHE20 MIT accepted by the user
===>   notcurses-2.2.8 depends on file: /usr/local/sbin/pkg - found
=> notcurses-doc-2.2.8.tar.gz doesn't seem to exist in /usr/ports/distfiles/.
=> Attempting to fetch https://codeload.github.com/dankamongmen/notcurses/tar.gz/v2.2.8?dummy=/notcurses-doc-2.2.8.tar.gz
fetch: https://codeload.github.com/dankamongmen/notcurses/tar.gz/v2.2.8?dummy=/notcurses-doc-2.2.8.tar.gz: size of remote file is not known
notcurses-doc-2.2.8.tar.gz                              10 MB   10 MBps    01s
===> Fetching all distfiles required by notcurses-2.2.8 for building
[qbsd](0) $ cat distinfo 
TIMESTAMP = 1619437066
SHA256 (dankamongmen-notcurses-v2.2.8_GH0.tar.gz) = dc744f6a11bf8ca81dc8a73f56c4d9021cf4d56ef89a9a658974dff7984df376
SIZE (dankamongmen-notcurses-v2.2.8_GH0.tar.gz) = 11255362
SHA256 (notcurses-doc-2.2.8.tar.gz) = dc744f6a11bf8ca81dc8a73f56c4d9021cf4d56ef89a9a658974dff7984df376
SIZE (notcurses-doc-2.2.8.tar.gz) = 11255362
SHA256 (dankamongmen-notcurses-v2.2.8_GH0.tar.gz) = dc744f6a11bf8ca81dc8a73f56c4d9021cf4d56ef89a9a658974dff7984df376
SIZE (dankamongmen-notcurses-v2.2.8_GH0.tar.gz) = 11255362
[qbsd](0) $ 

where the doc tarball has the same hash as the source tarball.

I tried changing to USE_GITHUB=nodefault, but got nowhere with it.

Again, if I have the actual doc tarball in /usr/ports/distfiles, and the correct distinfo checksums/lengths, everything is working. So something just seems broken with my fetch methodology.

I'm uploading a new diff now if you might have a minute to look at it. Sorry for the ineptitude =[.
Comment 15 nick black 2021-04-26 11:42:30 UTC
Created attachment 224439 [details]
git diff 2.2.2 -> 2.2.8
Comment 16 Rainer Hurling freebsd_committer freebsd_triage 2021-04-26 20:25:40 UTC
Created attachment 224455 [details]
patch with work fetch for both source files

(In reply to Nick Black from comment #14)

Hi Nick,

> I tried changing to USE_GITHUB=nodefault, but got nowhere with it.
Yeah, that is really tricky. I had to fiddle around almost two hours to get it working.

> Again, if I have the actual doc tarball in /usr/ports/distfiles,
> and the correct distinfo checksums/lengths, everything is working.
> So something just seems broken with my fetch methodology.
On has to use something like :alternative after the second distfile and path. I took ':docs' to group the second patch and distfile.

> I'm uploading a new diff now if you might have a minute to look
> at it. Sorry for the ineptitude =[.
No problem ;)

In my new example the patch downloads the two files 'dankamongmen-notcurses-v2.2.8_GH0.tar.gz' and 'notcurses-doc-2.2.8.tar.gz'.

The docs are extracted in ${WRKDIR} and should be copied from there. I let it to you to solve this next step and prepare the next patch :D
Comment 17 nick black 2021-05-02 00:34:19 UTC
(In reply to Rainer Hurling from comment #16)

Thanks a lot for the help! I completely missed the need for such grouping; the Handbook kinda implies it's only necessary when the distfiles originate in different places.

So with your latest, things seem to work fine, unless I'm missing something. You mention me adding the code to actually install the unpacked documentation, but I already had that, and I've tested afresh that it works:

[qbsd](0) $ ls /usr/local/man/man3/*notcur*  | wc -l
      29
[qbsd](0) $ 

before the "make install", there were no such files present.

I'm going to go ahead and make a unified, updated git patch, but this is ready to go unless I'm missing something...?
Comment 18 nick black 2021-05-02 00:37:45 UTC
Created attachment 224600 [details]
update 2.2.2 -> 2.2.8, use docs pack
Comment 19 nick black 2021-05-02 00:38:26 UTC
Comment on attachment 224455 [details]
patch with work fetch for both source files

ahhh, thanks a lot for the example of grouping, that's what i was missing for sure
Comment 20 commit-hook freebsd_committer freebsd_triage 2021-05-02 08:21:51 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=56966540bc3d87f3ff834ec0082ccf740cd9e9d2

commit 56966540bc3d87f3ff834ec0082ccf740cd9e9d2
Author:     Rainer Hurling <rhurlin@FreeBSD.org>
AuthorDate: 2021-05-02 08:18:49 +0000
Commit:     Rainer Hurling <rhurlin@FreeBSD.org>
CommitDate: 2021-05-02 08:18:49 +0000

    devel/notcurses: Update to 2.2.8

    Changelog: https://github.com/dankamongmen/notcurses/releases

    PR:             254261
    Submitted by:   Nick Black <nickblack@linux.com> (maintainer)

 devel/notcurses/Makefile  | 20 +++++++-----
 devel/notcurses/distinfo  |  8 +++--
 devel/notcurses/pkg-plist | 80 ++++++++++++++++++++++++++---------------------
 3 files changed, 62 insertions(+), 46 deletions(-)
Comment 21 Rainer Hurling freebsd_committer freebsd_triage 2021-05-02 08:31:11 UTC
Hi Nick,

Thanks for your latest update. While testing again on Poudriere, it turns out, that the man pages and docs even install, when options were disabled.

For man pages, using '.if !defined(NOPORTDOCS)' did not work. I changed it against a new 'post-install-MANPAGES-on:' target.

I found no knob to deactivate the installation of the docs in the cmake files, so I decided to turn off the docs installation "hard" ;)

In the pkg-plist was still missing an entry for %%MANPAGES%%man/man3/notcurses_tabbed.3.gz.


Committed now!

Many thanks for the good cooperation and have fun!