Bug 258459 - [new port] www/adjuster: Web Adjuster, Annotator Generator and TermLayout
Summary: [new port] www/adjuster: Web Adjuster, Annotator Generator and TermLayout
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-09-12 13:39 UTC by Silas S. Brown
Modified: 2023-05-18 08:25 UTC (History)
1 user (show)

See Also:


Attachments
adjuster.mbox (2.58 KB, text/plain)
2021-09-12 13:39 UTC, Silas S. Brown
no flags Details
Updated for v3.23 (2.58 KB, text/plain)
2023-03-25 20:44 UTC, Silas S. Brown
no flags Details
Updated as per comments (2.43 KB, text/plain)
2023-05-13 21:05 UTC, Silas S. Brown
no flags Details
Fixed version (2.37 KB, text/plain)
2023-05-15 08:10 UTC, Silas S. Brown
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Silas S. Brown 2021-09-12 13:39:10 UTC
Created attachment 227856 [details]
adjuster.mbox

portlint is telling me '"RUN_DEPENDS" has to appear earlier' in the Makefile, but I'm not sure how to fix this without breaking the PYTHON_FLAVOR variable I've added, which seems to be needed to ensure an appropriate version of Tornado is installed and the correct Python interpreter is used, unless I've misunderstood something (which is highly likely as this is the first time I've tried to port Python programs to FreeBSD).

This port also lacks man pages, which I plan to add in a later version but I thought it might be good to run it past the community in its current state first (there's documentation on the website and there's --help text).
Comment 1 Silas S. Brown 2023-03-25 20:44:05 UTC
Created attachment 241112 [details]
Updated for v3.23

Updated version.  Is there any potential interest in having this as a port, or should I close?
Comment 2 Robert Clausecker freebsd_committer freebsd_triage 2023-04-29 18:07:15 UTC
Hi Silas, thank you for your submission.

There is interest in your port, but it kind of got lost on the bug tracker.  Please set "maintainer-approval" on your patch to ensure it gets looked at.  Will commence with a review shortly.
Comment 3 Robert Clausecker freebsd_committer freebsd_triage 2023-04-29 23:56:34 UTC
Here are some comments on your patch:

 - instead of manually fixing shebangs, check if you can use USES=shebangfix.
   It should automatically pick the right interpreter.
 - PYTHON_FLAVOR could be simplified to ${PYTHON_CMD:T} (though you won't need it
   with USES=shebangfix)
 - instead of ${SED} -I '' use ${REINPLACE_CMD} (though you won't need it with
   USES=shebangfix)
 - GH_PROJECT can be omitted if equal to PORTNAME
 - INSTALL_TARGET defaults to install and can be omitted.  If the port supports
   install-stripped, check if you can use that.
 - LICENSE_FILE should probably be ${WRKSRC}/LICENSE

Will commence with a build test once you fix these issues.
Comment 4 Silas S. Brown 2023-05-13 21:05:39 UTC
Created attachment 242150 [details]
Updated as per comments

Thanks, I've updated the patch
Comment 5 Robert Clausecker freebsd_committer freebsd_triage 2023-05-13 21:11:16 UTC
Your port doesn't build:

fuz@tau:/usr/home/main.ports/www/adjuster$ make
===>  License APACHE20 accepted by the user
===>   adjuster-3.23.21 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by adjuster-3.23.21 for building
===>  Extracting for adjuster-3.23.21
=> SHA256 Checksum OK for ssb22-adjuster-v3.23-21-g0d47f0d_GH0.tar.gz.
===>  Patching for adjuster-3.23.21
===>   adjuster-3.23.21 depends on file: /usr/local/bin/python3.9 - found
===>  Configuring for adjuster-3.23.21
===>  Building for adjuster-3.23.21
make[1]: "/usr/home/ports/main.ports/www/adjuster/work/adjuster-3.23-21-g0d47f0d/Makefile" line 8: Invalid line type
make[1]: Fatal errors encountered -- cannot continue
make[1]: stopped in /usr/home/ports/main.ports/www/adjuster/work/adjuster-3.23-21-g0d47f0d
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1

Stop.
make: stopped in /usr/home/ports/main.ports/www/adjuster


Please make sure you have build-tested your ports before submitting them.  Also make sure to run "make check-plist" and "make stage-qa" to ensure there are no errors.
Comment 6 Silas S. Brown 2023-05-14 08:14:40 UTC
Thanks, I always run portlint -A and thought that would pick up any problems but it didn't.  There's a trailing "1" in the main Makefile which I must have typed by accident after I tested it or something.  Will remove.
Comment 7 Robert Clausecker freebsd_committer freebsd_triage 2023-05-14 08:37:32 UTC
(In reply to Silas S. Brown from comment #6)

Just get rid of the whole PYTHON_FLAVOR variable.  We have PYTHON_SITELIBDIR for the thing you want:

    RUN_DEPENDS=	${PYTHON_SITELIBDIR}/tornado:www/py-tornado@${PY_FLAVOR}
Comment 8 Silas S. Brown 2023-05-15 08:10:22 UTC
Created attachment 242183 [details]
Fixed version

Thanks, the attached should fix it
Comment 9 Robert Clausecker freebsd_committer freebsd_triage 2023-05-15 10:00:50 UTC
Thanks.  That looks good.  Will commit with slight tweaks and formatting improvements.
Comment 10 commit-hook freebsd_committer freebsd_triage 2023-05-18 08:21:19 UTC
A commit in branch main references this bug:

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

commit b8e9c28744bb86cbbc76a046f39bbd80834ed4ce
Author:     Silas S. Brown <ssb22@cam.ac.uk>
AuthorDate: 2023-05-15 08:08:11 +0000
Commit:     Robert Clausecker <fuz@FreeBSD.org>
CommitDate: 2023-05-18 08:19:41 +0000

    www/adjuster: Apply custom processing to web pages

    Web Adjuster, Annotator Generator and TermLayout

    These are tools for applying custom processing to Web pages,
    particularly useful for mobile browsers that do not support
    browser extensions.

    * Web Adjuster is a domain-rewriting proxy that can inject
      Javascript and/or CSS into every page, as well as running
      the text through an arbitrary filter command;

    * Annotator Generator is an examples-driven generator of fast
      text annotators (that add language-learning hints to text):
      these can be used as filters in Web Adjuster;

    * TermLayout displays complex Web layouts on text terminals.

    WWW: http://ssb22.user.srcf.net/adjuster/

    PR:             258459

 www/Makefile                 |  1 +
 www/adjuster/Makefile (new)  | 27 +++++++++++++++++++++++++++
 www/adjuster/distinfo (new)  |  3 +++
 www/adjuster/pkg-descr (new) | 15 +++++++++++++++
 4 files changed, 46 insertions(+)
Comment 11 Robert Clausecker freebsd_committer freebsd_triage 2023-05-18 08:25:52 UTC
Thank you for your submission.