All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] package/pkg-golang: default to rawname to install binaries
@ 2022-03-08 16:53 yann.morin
  2022-03-08 20:13 ` Peter Korsgaard
  0 siblings, 1 reply; 2+ messages in thread
From: yann.morin @ 2022-03-08 16:53 UTC (permalink / raw)
  To: buildroot; +Cc: Yann E. MORIN

From: "Yann E. MORIN" <yann.morin@orange.com>

The default currently is to rely on the package name to decide what to
build and install if not specified by tje caller. This works nice for
target packages, where a 'foo' package will by default build and
install a 'foo' executable.

However, for host packages, that will build and install a 'host-foo'
exzcutable, which is not really, even really not, what would be
expected.

We fix that by using the package raw name, i.e. the package name with
the host- prefix yanked away.

It is very improbable that there already have many host-golang packages
in the wild (in br2-external trees), but if there are, they would
forcibly define those variables to a sane value. This change is not
incompatible, as the values provided by packages take precendence; it's
just that those packages now carry superfluous, if innocuous, variable
assignments.

Signed-off-by: Yann E. MORIN <yann.morin@orange.com>
---
 package/pkg-golang.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/package/pkg-golang.mk b/package/pkg-golang.mk
index 0cb2ed73cc..0b3dc3d32f 100644
--- a/package/pkg-golang.mk
+++ b/package/pkg-golang.mk
@@ -59,10 +59,10 @@ $(2)_BUILD_TARGETS ?= .
 # been specified, we assume that the binaries to be produced are named
 # after each build target building them (below in <pkg>_BUILD_CMDS).
 ifeq ($$($(2)_BUILD_TARGETS),.)
-$(2)_BIN_NAME ?= $(1)
+$(2)_BIN_NAME ?= $$($(2)_RAWNAME)
 endif
 
-$(2)_INSTALL_BINS ?= $(1)
+$(2)_INSTALL_BINS ?= $$($(2)_RAWNAME)
 
 # Source files in Go usually use an import path resolved around
 # domain/vendor/software. We infer domain/vendor/software from the upstream URL
-- 
2.25.1


_________________________________________________________________________________________________________________________

Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc
pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par erreur, veuillez le signaler
a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant susceptibles d'alteration,
Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci.

This message and its attachments may contain confidential or privileged information that may be protected by law;
they should not be distributed, used or copied without authorisation.
If you have received this email in error, please notify the sender and delete this message and its attachments.
As emails may be altered, Orange is not liable for messages that have been modified, changed or falsified.
Thank you.

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Buildroot] [PATCH] package/pkg-golang: default to rawname to install binaries
  2022-03-08 16:53 [Buildroot] [PATCH] package/pkg-golang: default to rawname to install binaries yann.morin
@ 2022-03-08 20:13 ` Peter Korsgaard
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Korsgaard @ 2022-03-08 20:13 UTC (permalink / raw)
  To: yann.morin; +Cc: buildroot

>>>>>   <yann.morin@orange.com> writes:

 > From: "Yann E. MORIN" <yann.morin@orange.com>
 > The default currently is to rely on the package name to decide what to
 > build and install if not specified by tje caller. This works nice for
 > target packages, where a 'foo' package will by default build and
 > install a 'foo' executable.

 > However, for host packages, that will build and install a 'host-foo'
 > exzcutable, which is not really, even really not, what would be
 > expected.

 > We fix that by using the package raw name, i.e. the package name with
 > the host- prefix yanked away.

 > It is very improbable that there already have many host-golang packages
 > in the wild (in br2-external trees), but if there are, they would
 > forcibly define those variables to a sane value. This change is not
 > incompatible, as the values provided by packages take precendence; it's
 > just that those packages now carry superfluous, if innocuous, variable
 > assignments.

 > Signed-off-by: Yann E. MORIN <yann.morin@orange.com>

Committed, thanks.

-- 
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-03-08 20:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-08 16:53 [Buildroot] [PATCH] package/pkg-golang: default to rawname to install binaries yann.morin
2022-03-08 20:13 ` Peter Korsgaard

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.