Page MenuHomeFreeBSD

devel/rubygem-docopt: Add new port
ClosedPublic

Authored by salvadore on Apr 22 2022, 6:50 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 14 2024, 4:48 AM
Unknown Object (File)
Mar 14 2024, 4:48 AM
Unknown Object (File)
Mar 14 2024, 4:48 AM
Unknown Object (File)
Mar 14 2024, 4:48 AM
Unknown Object (File)
Mar 14 2024, 4:48 AM
Unknown Object (File)
Mar 14 2024, 4:48 AM
Unknown Object (File)
Mar 14 2024, 4:35 AM
Unknown Object (File)
Jan 13 2024, 7:37 AM

Details

Summary

Rubygem implementation of docopt.

Docopt helps you:

  • define interface for your command-line app, and
  • automatically generate parser for it.

Docopt is based on conventions that have been used for decades in help messages
and man pages for describing a program's interface. An interface description in
docopt is such a help message, but formalized.

WWW: http://docopt.org/

Diff Detail

Repository
R11 FreeBSD ports repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Thanks for putting this together! Just some text suggestions/feedback.

devel/rubygem-docopt/Makefile
8

Maybe "based on nothing more"?

devel/rubygem-docopt/pkg-descr
5

"an interface"

6

"a parser" (or "parsers")

8

"in help messages for decades" (The English language is a bit special here)

11–12

Personally I omit the trailing slashes since they are fully redundant (and have been per the RFCs for more than two decades), but I understand opinions in FreeBSD differ.

This revision is now accepted and ready to land.Apr 24 2022, 6:01 PM
sunpoet requested changes to this revision.Apr 24 2022, 6:42 PM
sunpoet added a subscriber: sunpoet.
sunpoet added inline comments.
devel/rubygem-docopt/Makefile
13

"json >= 1.6.5, ~> 1.6" should be converted to rubygem-json>=1.6.5<2.

It helps to avoid breakage when updating rubygem-json.

devel/rubygem-docopt/pkg-descr
12

docopt description language != docopt gem

The above URL points to docopt description language.
The correct WWW should be http://github.com/docopt/docopt.rb

If you want to keep that link, the pkg-descr could be changed as follows:

Rubygem implementation of docopt description language [1].
...
[1] http://docopt.org/
...
This revision now requires changes to proceed.Apr 24 2022, 6:42 PM

I have applied all suggested and requested changes.

@sunpoet: Could you please explain better why json >= 1.6.5, ~> 1.6 should be converted to rubygem-json>=1.6.5<2? According to my understanding of the ~> symbol I would have thought it should be converted to rubygem-json>=1.6.5<1.7.

I have applied all suggested and requested changes.

@sunpoet: Could you please explain better why json >= 1.6.5, ~> 1.6 should be converted to rubygem-json>=1.6.5<2? According to my understanding of the ~> symbol I would have thought it should be converted to rubygem-json>=1.6.5<1.7.

">= 1.6.5" converts to ">= 1.6.5".
"~> 1.6" converts to ">=1.6<2".
Therefore, the intersection would be ">=1.6.5<2"

Reference: https://guides.rubygems.org/patterns/

I have applied all suggested and requested changes.

@sunpoet: Could you please explain better why json >= 1.6.5, ~> 1.6 should be converted to rubygem-json>=1.6.5<2? According to my understanding of the ~> symbol I would have thought it should be converted to rubygem-json>=1.6.5<1.7.

">= 1.6.5" converts to ">= 1.6.5".
"~> 1.6" converts to ">=1.6<2".
Therefore, the intersection would be ">=1.6.5<2"

Reference: https://guides.rubygems.org/patterns/

Ah, right, I understand now. Thanks.

As for the review, is it fine now? Does it have ruby approval or does it need some more fix?

salvadore retitled this revision from devel/rubygem-docopt: Add port to devel/rubygem-docopt: Parse command line arguments based on nothing more than a usage message.May 1 2022, 10:52 AM

Some cleanups. The rest are fine to me. Thanks!

devel/rubygem-docopt/Makefile
15–17

You could use USES=python:env instead.

21

SHEBANG_FILES is the list of files or glob pattern relative to ${WRKSRC}.
Use "SHEBANG_FILES=test/language_agnostic_tester.py" instead.

Ref: /usr/ports/Mk/Uses/shebangfix.mk

This revision is now accepted and ready to land.May 1 2022, 12:37 PM

@sunpoet: I am sorry, but before committing I tested the port again and the build now fails. This is due to the dependency on rubygem-json>=1.6.5<2: in ports we have rubygem-json version 2.5.1.

Then I removed "<2". I tested and I confirm that the other port that I am trying to create and depends on rubygem-docopt works as expected ( https://reviews.freebsd.org/D35032 ), so I think rubygem-docopt works well with rubygem-json version 2.5.1.
I also plan to suggest upstream to update their dependency.

Is the review still accepted? Should I solve the problem with a different strategy?

Thanks.

This revision now requires review to proceed.May 1 2022, 5:46 PM
salvadore retitled this revision from devel/rubygem-docopt: Parse command line arguments based on nothing more than a usage message to devel/rubygem-docopt: Add new port.May 1 2022, 5:46 PM

@sunpoet: I am sorry, but before committing I tested the port again and the build now fails. This is due to the dependency on rubygem-json>=1.6.5<2: in ports we have rubygem-json version 2.5.1.

Then I removed "<2". I tested and I confirm that the other port that I am trying to create and depends on rubygem-docopt works as expected ( https://reviews.freebsd.org/D35032 ), so I think rubygem-docopt works well with rubygem-json version 2.5.1.
I also plan to suggest upstream to update their dependency.

Is the review still accepted? Should I solve the problem with a different strategy?

Thanks.

I just noticed that it is a development dependency. Does it builds fine without rubygem-json (either 1.x or 2.x)? If so, please remove the BUILD_DEPENDS.

devel/rubygem-docopt/Makefile
16

Remove blank line.

I tested and it builds fine without BUILD_DEPENDS. I have also tested the port from https://reviews.freebsd.org/D35032 and this also works correctly after this change.

So I removed BUILD_DEPENDS. I also removed the blank line. Is the port finally ready to land?

Also, what is the general rule here? Should I avoid putting development dependencies in BUILD_DEPENDS in general? Should I avoid it only when something is wrong about them?

Thanks.

Also, what is the general rule here? Should I avoid putting development dependencies in BUILD_DEPENDS in general? Should I avoid it only when something is wrong about them?

Apologies if I misunderstand the question. I'd say if something is not required for the "end user" to build a port/package, it should not be in BUILD_DEPENDS. (Any specials useful for the maintainer can be under DEVELOPER=yes or something like MAINTAINER_MODE as I have used for lang/gcc*.)

Thank you for your reviewing this, @sunpoet . Looks okay to land from my side (as maintainer); are you fine as subject matter expert?

This revision is now accepted and ready to land.May 3 2022, 10:14 AM

Also, what is the general rule here? Should I avoid putting development dependencies in BUILD_DEPENDS in general? Should I avoid it only when something is wrong about them?

In most cases, we only need to add runtime dependencies as RUN_DEPENDS.
They are "RUNTIME DEPENDENCIES" on rubygems.org.

Apologies if I misunderstand the question. I'd say if something is not required for the "end user" to build a port/package, it should not be in BUILD_DEPENDS. (Any specials useful for the maintainer can be under DEVELOPER=yes or something like MAINTAINER_MODE as I have used for lang/gcc*.)

Thank you for your reviewing this, @sunpoet . Looks okay to land from my side (as maintainer); are you fine as subject matter expert?

LGTM. It's OK to commit. :)

This revision was automatically updated to reflect the committed changes.