From 69d21fe15d60722cdb3e413b8c089da1cb5b6a9e Mon Sep 17 00:00:00 2001 From: Lukas Rusak Date: Mon, 4 Apr 2016 14:20:04 -0700 Subject: [PATCH] go: initial package --- packages/addons/addon-depends/go/package.mk | 60 +++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 packages/addons/addon-depends/go/package.mk diff --git a/packages/addons/addon-depends/go/package.mk b/packages/addons/addon-depends/go/package.mk new file mode 100644 index 0000000000..742a38cc05 --- /dev/null +++ b/packages/addons/addon-depends/go/package.mk @@ -0,0 +1,60 @@ +################################################################################ +# This file is part of LibreELEC - http://www.libreelec.tv +# Copyright (C) 2009-2016 Lukas Rusak (lrusak@libreelec.tv) +# +# LibreELEC is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# LibreELEC is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with LibreELEC. If not, see . +################################################################################ + +PKG_NAME="go" +PKG_VERSION="1.6" +PKG_REV="1" +PKG_ARCH="any" +PKG_LICENSE="BSD" +PKG_SITE="https://golang.org" +PKG_URL="https://github.com/golang/go/archive/${PKG_NAME}${PKG_VERSION}.tar.gz" +PKG_SOURCE_DIR="${PKG_NAME}-${PKG_NAME}${PKG_VERSION}" +PKG_DEPENDS_HOST="toolchain" +PKG_PRIORITY="optional" +PKG_SECTION="system" +PKG_SHORTDESC="Go is an open source programming language that makes it easy to build simple, reliable, and efficient software." +PKG_LONGDESC="Go is an open source programming language that makes it easy to build simple, reliable, and efficient software." + +PKG_IS_ADDON="no" +PKG_AUTORECONF="no" + +#################################################################### +# On Fedora `dnf install golang` will install go to /usr/lib/golang +# +# On Ubuntu you need to install golang manually, similar to: +# $ wget https://storage.googleapis.com/golang/go1.6.linux-amd64.tar.gz +# $ tar xf go1.6.linux-amd64.tar.gz -C /opt/ +# $ ln -s /opt/go /usr/lib/golang +#################################################################### + +configure_host() { + export GOOS=linux + export GOROOT_FINAL=$ROOT/$TOOLCHAIN/lib/golang + export GOROOT_BOOTSTRAP=/usr/lib/golang + export GOARCH=amd64 +} + +make_host() { + cd $ROOT/$PKG_BUILD/src + bash make.bash --no-banner +} + +makeinstall_host() { + mkdir -p $ROOT/$TOOLCHAIN/lib/golang + cp -av $ROOT/$PKG_BUILD/* $ROOT/$TOOLCHAIN/lib/golang/ +}