How to package Golang application?

I am trying to package this Go application https://github.com/arduino/arduino-cli and failing super-miserably.

I know nothing about Go, so after having read this guide https://en.opensuse.org/openSUSE:Packaging_Go I searched for a couple of packages to use as examples, and I found these:

Armed with that, and taking a guess at this packages’ other Golang dependencies from a manual compilation attempt, I put together a spec file which, as you can see, fails to build claiming that “nothing provides golang(…])”. :cry:

I have tried locally and OBS with the same result.

Any ideas how to go about building this package?

Did you actually check that these dependencies are provided by any package?

fails to build claiming that "nothing provides golang(…])

I am not really surprised, on vanilla TW I see very small number of golang packages and not all of them even have “goloang(xxx)” provides.

Any ideas how to go about building this package?

Either you add additional repositories where necessary packages are provided to your project, so missing provides can be resolved, or you build needed packages locally as part of your project.

The first step is to actually verify that necessary packages exist, not guess what they may be.

Since the project hasn’t yet gotten around to creating build instructions,
I’d suggest using their posted Dockerfile as a likely recipe for building, which of course would list dependencies

https://github.com/arduino/arduino-cli/blob/master/Dockerfiles/CI/Dockerfile

TSU

Thanks for the answer. I guess a better question is: what does “BuildRequires: golang([something])” do?

Clearly, those are not normal dependencies as can be deduced from the links I posted earlier. So what is that expression supposed to do?

Hi
First off you will not get anything from the internet in the buildroot, the only way is before build with a _service. In saying that if you remove all of those build requires and do a test build, what is the error? If those requirements are not present in the distribution then you will need to build…

It declares that at the time package is being built another package that Provides string “golang([something])” must be present. If such package is not present (i.e. nothing provides “golang([something])”) rpmbuild fails.

Sometimes such Provides are autogenerated during package build. I am not familiar with golang (or its packaging) so I cannot comment here. After cursory look at Wiki page it sounds like these Provides are added manually.

Thank you once again. Mostly for my own reference, I leave here a URL documenting the _service feature: https://en.opensuse.org/openSUSE:Build_Service_Concept_SourceService