Bug 282733 - [NEW PORT] textproc/dmenu-translate: Quick text translation with dmenu
Summary: [NEW PORT] textproc/dmenu-translate: Quick text translation with dmenu
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: Robert Clausecker
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-11-13 19:56 UTC by Yusuf Yaman
Modified: 2024-12-02 14:41 UTC (History)
2 users (show)

See Also:


Attachments
textproc/dmenu-translate.patch (3.16 KB, patch)
2024-11-13 19:58 UTC, Yusuf Yaman
no flags Details | Diff
textproc/dmenu-translate.patch (4.60 KB, patch)
2024-11-26 20:20 UTC, Yusuf Yaman
no flags Details | Diff
textproc/dmenu-translate.patch (4.70 KB, patch)
2024-11-27 13:28 UTC, Yusuf Yaman
no flags Details | Diff
textproc/dmenu-translate.patch (4.70 KB, patch)
2024-11-27 13:30 UTC, Yusuf Yaman
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yusuf Yaman 2024-11-13 19:56:19 UTC

    
Comment 1 Yusuf Yaman 2024-11-13 19:58:35 UTC
Created attachment 255145 [details]
textproc/dmenu-translate.patch

dmenu-translate is a simple and efficient tool that allows users to translate
text quickly using the dmenu or any other dmenu-like utility. It supports
multiple languages and translation services, making it easy
to get instant translations with minimal effort.

WWW:    https://github.com/nxjosephofficial/dmenu-translate

Thanks in advance.
Comment 2 Robert Clausecker freebsd_committer freebsd_triage 2024-11-26 15:13:22 UTC
MASTER_SITES doesn't need to be set if you use USE_GITHUB.

I see that you have forked upstream's repository to add portability patches.  We strongly prefer not to do this, as this makes it hard to go back to the real upstream if your fork stops being maintained.  Instead, use the real upstream and apply the portability patches locally using patch files.  See § 4.4 "Patching" Porter's Handbook for details.

Is it possible to adapt the sed usage to our sed instead of depending on GNU sed?  This would be preferable, but using GNU sed is fine.

PORTEXAMPLES doesn't work the way you use it.  Check § 5.17.4 "Install additional documentation" for how to use it.

The RUN_DEPENDS stuff depending on Wayland/X11 is a bit annoying; most users install binary packages, so this package won't be usable as precompiled for Wayland users.  Not sure what the best solution is.
Comment 3 Baptiste Daroussin freebsd_committer freebsd_triage 2024-11-26 15:19:44 UTC
all dependencies for wayland and x11 stuff are rather small I would activate both options by default.
Comment 4 Yusuf Yaman 2024-11-26 20:20:28 UTC
Created attachment 255475 [details]
textproc/dmenu-translate.patch

Ok, I fixed things after your feedback.

I don't know how to use FreeBSD sed so I think I can't do it.

I couldn't understand how can i properly install a config file for the program so I removed that instead.

I set both X11 and Wayland OPTIONS as default now.

Thanks for giving a look and feedback.
Comment 5 Robert Clausecker freebsd_committer freebsd_triage 2024-11-26 20:36:38 UTC
Thanks.  If you can't use base sed, using GNU sed should be fine.

As for your current patch, it looks better.  Some things that need to be fixed:

 - do not invent a version number when upstream doesn't have one, instead follow
   the example given in § 5.4.3 "USE_GITHUB" Example 17.
 - use the full git hash for GH_TAGNAME so it's unambiguous in any case
 - prefer DISTVERSION over PORTVERSION if possible
 - please check the grammar of your option descriptions; perhaps something like
   this would work?

    WAYLAND_DESC= depend on x11/wmenu and x11/wl-clipboard for use with Wayland
    X11_DESC= depend on x11/dmenu and x11/xclip for use with X11

 - our mktemp does not support --tempdir.  Please check the manual.  Perhaps you
   want "mktemp -d dmenu-translate.XXXXXX'

Please check and resubmit if possible.  I'm sorry for not catching these issues earlier.
Comment 6 Yusuf Yaman 2024-11-27 13:28:27 UTC
Created attachment 255487 [details]
textproc/dmenu-translate.patch

You are welcome and thanks for explaining things to fix with references and in a detailed way.

> do not invent a version number when upstream doesn't have one, instead follow
> the example given in § 5.4.3 "USE_GITHUB" Example 17.

Thanks, done.

> use the full git hash for GH_TAGNAME so it's unambiguous in any case

done.

> prefer DISTVERSION over PORTVERSION if possible

done.

> please check the grammar of your option descriptions; perhaps something like
> this would work?

i just used yours.

> our mktemp does not support --tempdir.  Please check the manual.  Perhaps you
> want "mktemp -d dmenu-translate.XXXXXX'

Hmm, it seem to work for me, man page of mktemp says:

     -p tmpdir, --tmpdir[=tmpdir]
             Use tmpdir for the -t flag if the TMPDIR environment variable is
             not set.  Additionally, any provided template arguments will be
             interpreted relative to the path specified as tmpdir.  If tmpdir
             is either empty or omitted, then the TMPDIR environment variable
             will be used.

> I'm sorry for not catching these issues earlier.

No problem.
Comment 7 Yusuf Yaman 2024-11-27 13:30:45 UTC
Created attachment 255488 [details]
textproc/dmenu-translate.patch

Changed WWW to upstream link in git commit message.
Comment 8 Robert Clausecker freebsd_committer freebsd_triage 2024-11-27 16:35:53 UTC
(In reply to Yusuf Yaman from comment #6)

Hi Yusuf,

> Hmm, it seem to work for me, man page of mktemp says:

Sorry, I missed that while reading the man page!
All good then.

Will commit this one with my next batch.
Comment 9 Yusuf Yaman 2024-11-27 16:48:46 UTC
(In reply to Robert Clausecker from comment #8)

> Hi Yusuf,

Hi.


> Sorry, I missed that while reading the man page!
> All good then.

No problem.

> Will commit this one with my next batch.

Okay, very thanks. Have a good one.
Comment 10 commit-hook freebsd_committer freebsd_triage 2024-12-02 14:28:47 UTC
A commit in branch main references this bug:

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

commit f604686b3abcbead9f8add1f3aa674f3ec979e14
Author:     Yusuf Yaman <nxjoseph@protonmail.com>
AuthorDate: 2024-11-13 19:55:30 +0000
Commit:     Robert Clausecker <fuz@FreeBSD.org>
CommitDate: 2024-12-02 14:27:27 +0000

    textproc/dmenu-translate: New port: Quick text translation with dmenu

    dmenu-translate is a simple and efficient tool that allows users to translate
    text quickly using the dmenu or any other dmenu-like utility. It supports
    multiple languages and translation services, making it easy
    to get instant translations with minimal effort.

    WWW: https://github.com/NikitaIvanovV/dmenu-translate

    PR:             282733

 textproc/Makefile                                  |  1 +
 textproc/dmenu-translate/Makefile (new)            | 40 +++++++++++++++++++
 textproc/dmenu-translate/distinfo (new)            |  3 ++
 .../files/patch-dmenu-translate (new)              | 45 ++++++++++++++++++++++
 textproc/dmenu-translate/pkg-descr (new)           |  4 ++
 5 files changed, 93 insertions(+)
Comment 11 Yusuf Yaman 2024-12-02 14:30:00 UTC
Very thanks.
Comment 12 Robert Clausecker freebsd_committer freebsd_triage 2024-12-02 14:40:33 UTC
Thank you for your contribution.
Comment 13 Yusuf Yaman 2024-12-02 14:41:30 UTC
(In reply to Robert Clausecker from comment #12)
You are welcome and thanks for doing more than giving a look.