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

Add Go SDK extension #213

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions org.freedesktop.Sdk.Extension.golang.appdata.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="runtime">
<id>org.freedesktop.Sdk.Extension.golang</id>
<metadata_license>CC0-1.0</metadata_license>
<name>Go programming language Sdk extension</name>
<summary>Go compiler and tools</summary>
</component>
87 changes: 87 additions & 0 deletions org.freedesktop.Sdk.Extension.golang.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
{
"id": "org.freedesktop.Sdk.Extension.golang",
"branch": "1.6",
"runtime": "org.freedesktop.Sdk",
"build-extension": true,
"sdk": "org.freedesktop.Sdk",
"runtime-version": "1.6",
"sdk-extensions": [],
"separate-locales": false,
"appstream-compose": false,
"modules": [
{
"name": "golang",
"buildsystem": "simple",
"sources": [
{
"type": "archive",
"only-arches": [
"i386"
],
"url": "https://dl.google.com/go/go1.9.2.linux-386.tar.gz",
"sha256": "574b2c4b1a248e58ef7d1f825beda15429610a2316d9cbd3096d8d3fa8c0bc1a"
},
{
"type": "archive",
"only-arches": [
"arm"
],
"url": "https://dl.google.com/go/go1.9.2.linux-armv6l.tar.gz",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm pretty sure this is the wrong arm architecture for our definition of ARM. We should test, but we may have to ban arm from this extension

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, right, we're targetting armv7? I could probably make some workaround to build it from source, I'll take a look at it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we can just build it from source that would be nice in general.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After another look, seems to be potential time sink. Last release that doesn't require working Go compiler is 1.4 and it doesn't seem to build on my Odroid C2 (aarch64).

One option would be another extension to build this one (that would also cut some time for building), but use binary release just for aarch64.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah - I'd rather have go, and the bootstrap is super messy.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ramcq which exact arm do we use again? you were the last person who touched that as I remember ;-)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at how gcc is built, it's armv7-a. Fix will come in a minute…

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad, there are no binaries optimized for armv7. I will test armv6 one on my Odroid XU4 and merge it as is if it works properly.

"sha256": "8a6758c8d390e28ef2bcea511f62dcb43056f38c1addc06a8bc996741987e7bb"
},
{
"type": "archive",
"only-arches": [
"aarch64"
],
"url": "https://dl.google.com/go/go1.9.2.linux-arm64.tar.gz",
"sha256": "0016ac65ad8340c84f51bc11dbb24ee8265b0a4597dbfdf8d91776fc187456fa"
},
{
"type": "archive",
"only-arches": [
"x86_64"
],
"url": "https://dl.google.com/go/go1.9.2.linux-amd64.tar.gz",
"sha256": "de874549d9a8d8d8062be05808509c09a88a248e77ec14eb77453530829ac02b"
}
],
"build-commands": [
"install -d /usr/lib/sdk/golang",
"cp -rpv * /usr/lib/sdk/golang/"
]
},
{
"name": "scripts",
"sources": [
{
"type": "script",
"commands": [
"export GOROOT=/usr/lib/sdk/golang",
"export PATH=$PATH:$GOROOT/bin"
],
"dest-filename": "enable.sh"
}
],
"buildsystem": "simple",
"build-commands": [
"cp enable.sh /usr/lib/sdk/golang/"
]
},
{
"name": "appdata",
"buildsystem": "simple",
"build-commands": [
"mkdir -p ${FLATPAK_DEST}/share/appdata",
"cp org.freedesktop.Sdk.Extension.golang.appdata.xml ${FLATPAK_DEST}/share/appdata",
"appstream-compose --basename=org.freedesktop.Sdk.Extension.golang --prefix=${FLATPAK_DEST} --origin=flatpak org.freedesktop.Sdk.Extension.golang"
],
"sources": [
{
"type": "file",
"path": "org.freedesktop.Sdk.Extension.golang.appdata.xml"
}
]
}
]
}