Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Go packages installations #1466

Open
pelacables opened this issue Jul 25, 2018 · 0 comments
Open

Go packages installations #1466

pelacables opened this issue Jul 25, 2018 · 0 comments
Milestone

Comments

@pelacables
Copy link

I needèd to install a go package and did not find any easyblock that support duch installation so I asked the mailing list for help and Alan O'Cais did provide a sample easyconfig (using the Binary easyblock) that installed the go package:

I leave it here for the record, in case someone else needs to install go package with EB and while the go easyblock is not available.

https://gist.github.com/ocaisa/1057ca936273db6715768fcb9b4b9191

easyblock = 'Binary'

name = 'Go-Example'
version = '20180724'
commit_id = '46695d8'

homepage = 'https://github.com/golang/example'
description = """This repository contains a collection of Go programs and libraries that demonstrate the language, standard libraries, and tools."""

toolchain = {'name': 'GCCcore', 'version': '7.3.0'}

source_urls = ['https://github.com/golang/example/archive/']
sources = ['%s.tar.gz' % commit_id]

buildininstalldir = True
extract_sources = True

builddependencies = [
    ('binutils', '2.30'),
]

dependencies = [
    ('Go', '1.10.3', '', True),
]

# The sources are expected in a very particular place
unpack_options = '&& mkdir -p %(installdir)s/src/github.com/golang&& mv example-* %(installdir)s/src/github.com/golang/example'


# Update GOPATH so install location is correct
install_cmd = "export GOPATH=%(installdir)s:$GOPATH &&"
# Update PATH to include new bin directory (in case it is needed)
install_cmd += "export PATH=%(installdir)s/bin:$PATH &&"

# Do the stringutils installation
install_cmd += "cd %(installdir)s/src/github.com/golang/example/stringutil &&"
install_cmd += "go build && go install &&"

# Do the hello installation
install_cmd += "cd %(installdir)s/src/github.com/golang/example/hello &&"
install_cmd += "go build && go install"

modextrapaths = {
    'GOPATH': ['.'],
}

sanity_check_paths = {
    'files': ['bin/hello'],
    'dirs': ['bin', 'src', 'pkg'],
}
``
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants