Page 1 of 1

Correct way of building with go?

Posted: Sat Jan 11, 2025 11:49 pm
by libertas

Hi,

I'm building a package for syncthing.
It needs go to build it.
From gslapt, I've installed go package.
The go binary was installed in /opt/go-1.22.4/bin/go.

In the recipe, I've included this:

Code: Select all

pkg_build() { 
	cd /tmp/syncthing*
	export PATH=/opt/go-1.22.4/bin:$PATH
	go run build.go && cp ./bin/* /usr/local/bin/ && pkg_build_slackdesc
}

It works, builds and install the binaries fine, but the go installation path is hard coded.
Now, it's version 1.22.4, tomorrow can be different.
How can I do this in a better way?


Re: Correct way of building with go?

Posted: Mon Jan 13, 2025 9:31 pm
by Keef

Symlink to /opt/go ? That's the way go is normally installed I think.


Re: Correct way of building with go?

Posted: Mon Jan 13, 2025 10:29 pm
by libertas

That's it.
Thank you @Keef.
I hadn't noticed the symlink.