Issue installing dependencies for a golang application

Hello,

I am having an issue building my golang application.
The issue is around go get-ing dependencies in my %build part of the spec file.

I’ve followed the guidelines in the this guide https://en.opensuse.org/openSUSE:Packaging_Go
but the build fails when trying to go get the dependencies.

Here is the build log: https://pb.viktorbarzin.me/?1e1297c6b74e4239#44Qa5AVGC4tMmqtBYpjBg3KuGQuv4qEXhVdtBHPfaoqE

I know that the build vm does not have internet access but I am not sure how to go about making it go get the dependencies for my project.

Any help would be appreciated!
Thanks

Hi and welcome to the Forum :slight_smile:
Build against the golang development repository and is your dependencies exist it should build, else AFAIK you would need to build the dependencies in you project for it to have access…

If you building locally and using osc, then can just use --alternative-project to build…

Hi again :wink:
Looks like you need GitHub - gotk3/gotk3: Go bindings for GTK3

Sidenote, just share a link to your package, no need to post a log it can all be seen if you just share the link :wink:

Thanks for your reply!

I’m quite new to OBS and I’m not quite sure what you mean by building against the golang repo.
Can you please elaborate lol!

Hi
After a look at the code it should only need that one dependency (gotk3) built first in your home repository and added as a build requires for the goclip package.

I would suggest following the format as the rest of the golang packages are built for naming etc for example;

Hi
I built gotk3 without any major issues and have submitted it to your home repository for acceptance;

https://build.opensuse.org/request/show/789562

You need to add a BuildRequires on golang-github-gotk3-gotk3-devel.

Hi thanks for the help!
My project also needs to build https://github.com/mattn/go-gtk
I tried to follow exactly what you did for building gotk3 but I’m still struggling.
I tried uploading the tar-red source of the library and build it but the go library is split in 2 sublibraries that use each other and I’ve had limited success at building them both :confused:

I feel like this should be much easier :confused:

Hi
Looking at the build log it’s missing a few development packages, add the following and see how it goes;


BuildRequires:  pkgconfig(glib-2.0)
BuildRequires:  pkgconfig(gobject-2.0)
BuildRequires:  pkgconfig(pango)

This made some progress.
Now I’m stuck building pkgconfig(gtkgl-2.0)
Tried a lot of combinations but it’s either unresolvable or it’s throwing the same error. Perhaps I’m solving the wrong issue, but that’s what I made out of the build error.

Hi
You need to create a link to this package in your project and let it build;

Go to your main project page Welcome - openSUSE Build Service

Under the package list on the web interface hit the button called ‘Branch Existing Package’, in the ‘Original Project name’ start type Education this is the project, now in ‘Original Package name’ start typing gtkglarea2, you only need those two fields complete and hit the accept button. In your project you will see tha package name along with a ‘link’ icon. All you then need to do is in the package enable the build targets, wait for it to build and finish. Then add the build requires for the gtkgl-2 in your package and should be good to go.

If I was using the command line tool osc on my local machine it would be;


osc linkpac Education gtkglarea2 home:edinpriqtel