On Thu, 17 Aug 2023 10:23 +0200, Omar Polo wrote:
> Some tweaks for the makefile:
> 
>  - the indentation of the value is off (you're not using tab multiples
>    of 8 columns?)

I guess I forgot to `:set tabstop=8 shiftwidth=8`. Usually I prefer
values of 4 and adjust those manually as needed. I'll fix my neovim
config to set those to 8 when I'm working with ports.

>  - homepage is already set by GH_*
> 
>  - to lower-case the package name you can just do PKGNAME=${DISTNAME:L}
> 
>  - typo on SEPARATE_BUILD (should be SEPARATED_BUILD)

I checked and SEPARATE_BUILD is right. I just rebuilt StyLua with
SEPARATE_BUILD to make sure that it works, so I think it should be
kept, right?

>  - missing WANTLIBs
> 
> not sure why CONFIGURE_STYLE is needed but the build fails otherwise
> and rust is out of my comfort zone.  It also seem to build stuff
> during fake, don't know if it's usual for rust ports.

I don't write Rust, but there's this in cargo-module(5).

"""
With CONFIGURE_STYLE set to 'cargo', cargo is configured to use
MODCARGO_VENDOR_DIR instead of the standard crates-io network source.
"""

> It's sad that there's not documentation other than the README.md (that
> isn't much legible with less(1)).  stylua -h | less seems like a
> manpage however, meh.

I agree, a man page would've been nicer.

Thank you for reviewing this, and apologies for the sloppy work.
Other than wanting to add SEPARATE_BUILD back in, your changes seem
good to me.

> Quickly tested the port, it doesn't like one file I wrote but
> otherwise seems to work fine.
> 
> I'm attaching a diff against your makefile and an updated tarball.
> Provided the two points above are fine, ok op@ to import.
> 
> --- Makefile.orig     Thu Aug 17 09:43:06 2023
> +++ Makefile  Thu Aug 17 10:18:31 2023
> @@ -1,22 +1,19 @@
> -COMMENT =                    opinionated Lua code formatter
> -V =                                  0.18.1
> -DISTNAME =                   stylua-${V}
> +COMMENT =            opinionated Lua code formatter
>  
>  GH_ACCOUNT =         JohnnyMorganz
>  GH_PROJECT =         StyLua
> -GH_TAGNAME =         v${V}
> +GH_TAGNAME =         v0.18.1
> +PKGNAME =            ${DISTNAME:L}
>  
>  CATEGORIES =         devel
>  
> -HOMEPAGE =                   https://github.com/JohnnyMorganz/StyLua
> -
>  # Mozilla Public License 2.0
>  PERMIT_PACKAGE =     Yes
>  
> -MODULES =                    devel/cargo
> -SEPARATE_BUILD =     Yes
> +WANTLIB = ${MODCARGO_WANTLIB}
> +
> +MODULES =            devel/cargo
>  CONFIGURE_STYLE =    cargo
>  
>  .include "crates.inc"
> -
>  .include <bsd.port.mk>

Reply via email to