On 2025/02/05 21:50, Lucas Gabriel Vuotto wrote:
> Hi ports,
> 
> I've a WIP port for a Grafana plugin. Grafana expects the binaries in
> the plugin to be called whatever_plugin_openbsd_{amd64,arm64,...}. In
> my WIP port, I solved that by using _GOARCH and adding it to SUBST_VARS,
> but it might make sense to have the same facility for all the other
> consumers. Here's a patch that renames _GOARCH to MODGO_ARCH and adds
> it to SUBST_VARS.
> 
> Comments? ok?

I think it makes sense to expose this as MODGO_ARCH rather than a
variable named with an _ prefix i.e. intended to be internal only,
however I don't think it will be particularly widely used in PLISTs and
I'd be slightly worried about it matching strings which _shouldn't_ be
substituted, so I'd prefer to leave adding to SUBST_VARS to individual
ports which need it.

Also, watch out for sysutils/cloud-sql-proxy.

> diff refs/heads/master 595ce6e12cfc5770f183d30d4bdfda60cfd8a876
> commit - a4502989e54ac919a7b74beadb076c5f308e6d28
> commit + 595ce6e12cfc5770f183d30d4bdfda60cfd8a876
> blob - f99eabc4b636f368f66d0115f02df4db0fedb489
> blob + d3a32f294b2af5a920c0530b5a436c1e9d436214
> --- lang/go/go.port.mk
> +++ lang/go/go.port.mk
> @@ -24,23 +24,23 @@ BUILD_DEPENDS +=  ${MODGO_BUILD_DEPENDS}
>  .endif
>  
>  .if ${MACHINE_ARCH} == "aarch64"
> -_GOARCH =    arm64
> +MODGO_ARCH = arm64
>  .elif ${MACHINE_ARCH} == "amd64"
> -_GOARCH =    amd64
> +MODGO_ARCH = amd64
>  .elif ${MACHINE_ARCH} == "arm"
> -_GOARCH =    arm
> +MODGO_ARCH = arm
>  .elif ${MACHINE_ARCH} == "i386"
> -_GOARCH =    386
> +MODGO_ARCH = 386
>  .elif ${MACHINE_ARCH} == "riscv64"
> -_GOARCH =    riscv64
> +MODGO_ARCH = riscv64
>  .endif
>  
>  MODGO_PACKAGE_PATH = ${PREFIX}/go-pkg
> -MODGO_PACKAGES =     go-pkg/pkg/openbsd_${_GOARCH}
> +MODGO_PACKAGES =     go-pkg/pkg/openbsd_${MODGO_ARCH}
>  MODGO_SOURCES =              go-pkg/src
> -MODGO_TOOLS =                go-pkg/tool/openbsd_${_GOARCH}
> +MODGO_TOOLS =                go-pkg/tool/openbsd_${MODGO_ARCH}
>  
> -SUBST_VARS +=                MODGO_TOOLS MODGO_PACKAGES MODGO_SOURCES
> +SUBST_VARS +=                MODGO_TOOLS MODGO_PACKAGES MODGO_SOURCES 
> MODGO_ARCH
>  
>  MODGO_SUBDIR ?=              ${WRKDIST}
>  MODGO_TYPE ?=                bin
> 

Reply via email to