diff options
author | William Hubbs <williamh@gentoo.org> | 2012-05-15 18:11:26 +0000 |
---|---|---|
committer | William Hubbs <williamh@gentoo.org> | 2012-05-15 18:11:26 +0000 |
commit | 8ebbe819cbe27dc8e6cc1eab5f3147f3fe503a4d (patch) | |
tree | 9592f55b91c570c5f192b8b9020930b727f52340 /dev-lang | |
parent | Depend only once on ICU. (diff) | |
download | gentoo-2-8ebbe819cbe27dc8e6cc1eab5f3147f3fe503a4d.tar.gz gentoo-2-8ebbe819cbe27dc8e6cc1eab5f3147f3fe503a4d.tar.bz2 gentoo-2-8ebbe819cbe27dc8e6cc1eab5f3147f3fe503a4d.zip |
Initial commit for bug #342505.
I would like to thank johnny@9souldier.org for the initial report and
ebuild. Also, I would like to thank powerman-asdf@yandex.ru for the
original hardened patch and everyone else who worked with me on the bug
so we could get this into the tree.
(Portage version: 2.2.0_alpha104/cvs/Linux i686)
Diffstat (limited to 'dev-lang')
-rw-r--r-- | dev-lang/go/ChangeLog | 15 | ||||
-rw-r--r-- | dev-lang/go/files/go-1.0.1-hardened.patch | 55 | ||||
-rw-r--r-- | dev-lang/go/go-1.0.1.ebuild | 144 | ||||
-rw-r--r-- | dev-lang/go/go-9999.ebuild | 144 | ||||
-rw-r--r-- | dev-lang/go/metadata.xml | 16 |
5 files changed, 374 insertions, 0 deletions
diff --git a/dev-lang/go/ChangeLog b/dev-lang/go/ChangeLog new file mode 100644 index 000000000000..f148488fe1b2 --- /dev/null +++ b/dev-lang/go/ChangeLog @@ -0,0 +1,15 @@ +# ChangeLog for dev-lang/go +# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/dev-lang/go/ChangeLog,v 1.1 2012/05/15 18:11:26 williamh Exp $ + +*go-9999 (15 May 2012) +*go-1.0.1 (15 May 2012) + + 15 May 2012; William Hubbs <williamh@gentoo.org> +go-1.0.1.ebuild, + +files/go-1.0.1-hardened.patch, +go-9999.ebuild, +metadata.xml: + Initial commit for bug #342505. + I would like to thank johnny@9souldier.org for the initial report and + ebuild. Also, I would like to thank powerman-asdf@yandex.ru for the + original hardened patch and everyone else who worked with me on the bug + so we could get this into the tree. + diff --git a/dev-lang/go/files/go-1.0.1-hardened.patch b/dev-lang/go/files/go-1.0.1-hardened.patch new file mode 100644 index 000000000000..220bc1b6e4c5 --- /dev/null +++ b/dev-lang/go/files/go-1.0.1-hardened.patch @@ -0,0 +1,55 @@ +diff -r 95d6aec944d4 src/all.bash +--- a/src/all.bash Tue May 15 12:00:13 2012 +1000 ++++ b/src/all.bash Tue May 15 08:46:50 2012 -0500 +@@ -8,6 +8,6 @@ + echo 'all.bash must be run from $GOROOT/src' 1>&2 + exit 1 + fi +-. ./make.bash --no-banner ++. ./make.bash $@ --no-banner + bash run.bash --no-rebuild --banner + $GOTOOLDIR/dist banner # print build info +diff -r 95d6aec944d4 src/make.bash +--- a/src/make.bash Tue May 15 12:00:13 2012 +1000 ++++ b/src/make.bash Tue May 15 08:46:50 2012 -0500 +@@ -116,6 +116,40 @@ + ./cmd/dist/dist bootstrap $buildall -v # builds go_bootstrap + # Delay move of dist tool to now, because bootstrap may clear tool directory. + mv cmd/dist/dist "$GOTOOLDIR"/dist ++if [ "$1" = "--pax-kernel" ]; then ++ shift ++ if [ -f "$GOTOOLDIR"/8l ]; then ++ mv "$GOTOOLDIR"/8l{,.orig} ++ cat <<'EOF' >"$GOTOOLDIR"/8l ++#!/bin/bash ++BIN="8.out" ++for (( i = 1 ; i <= $# ; i++ )); do ++ if [ "x${!i}" = "x-o" ]; then ++ i=$(( i + 1 )) ++ BIN="${!i}" ++ fi ++done ++$(dirname $0)/8l.orig "$@" && paxctl -cm "$BIN" &>/dev/null ++EOF ++ chmod +x "$GOTOOLDIR"/8l ++ fi ++ if [ -f "$GOTOOLDIR"/6l ]; then ++ mv "$GOTOOLDIR"/6l{,.orig} ++ cat <<'EOF' >"$GOTOOLDIR"/6l ++#!/bin/bash ++BIN="6.out" ++for (( i = 1 ; i <= $# ; i++ )); do ++ if [ "x${!i}" = "x-o" ]; then ++ i=$(( i + 1 )) ++ BIN="${!i}" ++ fi ++done ++$(dirname $0)/6l.orig "$@" && paxctl -cm "$BIN" &>/dev/null ++EOF ++ chmod +x "$GOTOOLDIR"/6l ++ fi ++ paxctl -cm "$GOTOOLDIR"/go_bootstrap &>/dev/null ++fi + "$GOTOOLDIR"/go_bootstrap clean -i std + echo + diff --git a/dev-lang/go/go-1.0.1.ebuild b/dev-lang/go/go-1.0.1.ebuild new file mode 100644 index 000000000000..3c3de64960a2 --- /dev/null +++ b/dev-lang/go/go-1.0.1.ebuild @@ -0,0 +1,144 @@ +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-lang/go/go-1.0.1.ebuild,v 1.1 2012/05/15 18:11:26 williamh Exp $ + +EAPI=4 + +EHG_REPO_URI="https://go.googlecode.com/hg" + +[[ ${PV} == 9999 ]] && vcs=mercurial + +inherit $vcs bash-completion-r1 elisp-common eutils + +if [[ ${PV} != 9999 ]]; then + SRC_URI="http://go.googlecode.com/files/go${PV}.src.tar.gz" + # Upstream only supports go on amd64, arm and x86 architectures. + KEYWORDS="-* ~x86" +fi + +DESCRIPTION="A concurrent garbage collected and typesafe programming language" +HOMEPAGE="http://www.golang.org" + +LICENSE="BSD" +SLOT="0" +IUSE="bash-completion emacs vim-syntax zsh-completion" + +if [[ ${PV} != 9999 ]]; then + IUSE="${IUSE} pax_kernel" + COMMON_DEPEND="pax_kernel? ( sys-apps/paxctl )" +fi + +DEPEND="sys-apps/ed + ${COMMON_DEPEND}" +RDEPEND="bash-completion? ( app-shells/bash-completion ) + emacs? ( virtual/emacs ) + vim-syntax? ( app-editors/vim ) + zsh-completion? ( app-shells/zsh-completion ) + ${COMMON_DEPEND}" + + # The go language stores binary data for packages in *.a files. + # These are _NOT_ libraries, and should not be stripped. +STRIP_MASK="/usr/lib/go/pkg/linux*/*.a" + +[[ ${PV} == 9999 ]] || S="${WORKDIR}"/go + +export_settings() +{ + export HOST_EXTRA_CFLAGS="${CFLAGS}" + export HOST_EXTRA_LDFLAGS="${LDFLAGS}" + export GOROOT_FINAL=/usr/lib/go + export GOROOT="$(pwd)" + export GOBIN="${GOROOT}/bin" +} + +src_prepare() +{ + if [[ ${PV} != 9999 ]]; then + epatch "${FILESDIR}"/${P}-hardened.patch + fi +} + +src_compile() +{ + export_settings + if [[ ${PV} != 9999 ]]; then + use pax_kernel && opts="--pax-kernel" + fi + cd src + ./make.bash $opts + cd .. + + if use emacs; then + elisp-compile misc/emacs/*.el + fi +} + +src_test() +{ + export_settings + cd src + ./run.bash --no-rebuild --banner +} + +src_install() +{ + dobin bin/* + dodoc AUTHORS CONTRIBUTORS PATENTS README + + dodir /usr/lib/go + insinto /usr/lib/go + + # There is a known issue which requires the source tree to be installed [1]. + # Once this is fixed, we can consider using the doc use flag to control + # installing the doc and src directories. + # [1] http://code.google.com/p/go/issues/detail?id=2775 + doins -r doc lib pkg src + + if use bash-completion; then + dobashcomp misc/bash/go + fi + + if use emacs; then + elisp-install ${PN} misc/emacs/*.el misc/emacs/*.elc + fi + + if use vim-syntax; then + insinto /usr/share/vim/vimfiles + doins -r misc/vim/ftdetect + doins -r misc/vim/ftplugin + doins -r misc/vim/syntax + doins -r misc/vim/plugin + doins -r misc/vim/indent + fi + + if use zsh-completion; then + insinto /usr/share/zsh/site-functions + doins misc/zsh/go + fi + + fperms -R +x /usr/lib/go/pkg/tool +} + +pkg_postinst() +{ + if use emacs; then + elisp-site-regen + fi + + # If the go tool sees a package file timestamped older than a dependancy it + # will rebuild that file. So, in order to stop go from rebuilding lots of + # packages for every build we need to fix the timestamps. The compiler and + # linker are also checked - so we need to fix them too. + ebegin "fixing timestamps to avoid unnecessary rebuilds" + tref="usr/lib/go/pkg/*/runtime.a" + find "${ROOT}"usr/lib/go/pkg -type f \ + -exec touch -r "${ROOT}"${tref} {} \; + eend $? +} + +pkg_postrm() +{ + if use emacs; then + elisp-site-regen + fi +} diff --git a/dev-lang/go/go-9999.ebuild b/dev-lang/go/go-9999.ebuild new file mode 100644 index 000000000000..476286345290 --- /dev/null +++ b/dev-lang/go/go-9999.ebuild @@ -0,0 +1,144 @@ +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-lang/go/go-9999.ebuild,v 1.1 2012/05/15 18:11:26 williamh Exp $ + +EAPI=4 + +EHG_REPO_URI="https://go.googlecode.com/hg" + +[[ ${PV} == 9999 ]] && vcs=mercurial + +inherit $vcs bash-completion-r1 elisp-common eutils + +if [[ ${PV} != 9999 ]]; then + SRC_URI="http://go.googlecode.com/files/go${PV}.src.tar.gz" + # Upstream only supports go on amd64, arm and x86 architectures. + KEYWORDS="-* ~x86" +fi + +DESCRIPTION="A concurrent garbage collected and typesafe programming language" +HOMEPAGE="http://www.golang.org" + +LICENSE="BSD" +SLOT="0" +IUSE="bash-completion emacs vim-syntax zsh-completion" + +if [[ ${PV} != 9999 ]]; then + IUSE="${IUSE} pax_kernel" + COMMON_DEPEND="pax_kernel? ( sys-apps/paxctl )" +fi + +DEPEND="sys-apps/ed + ${COMMON_DEPEND}" +RDEPEND="bash-completion? ( app-shells/bash-completion ) + emacs? ( virtual/emacs ) + vim-syntax? ( app-editors/vim ) + zsh-completion? ( app-shells/zsh-completion ) + ${COMMON_DEPEND}" + + # The go language stores binary data for packages in *.a files. + # These are _NOT_ libraries, and should not be stripped. +STRIP_MASK="/usr/lib/go/pkg/linux*/*.a" + +[[ ${PV} == 9999 ]] || S="${WORKDIR}"/go + +export_settings() +{ + export HOST_EXTRA_CFLAGS="${CFLAGS}" + export HOST_EXTRA_LDFLAGS="${LDFLAGS}" + export GOROOT_FINAL=/usr/lib/go + export GOROOT="$(pwd)" + export GOBIN="${GOROOT}/bin" +} + +src_prepare() +{ + if [[ ${PV} != 9999 ]]; then + epatch "${FILESDIR}"/${P}-hardened.patch + fi +} + +src_compile() +{ + export_settings + if [[ ${PV} != 9999 ]]; then + use pax_kernel && opts="--pax-kernel" + fi + cd src + ./make.bash $opts + cd .. + + if use emacs; then + elisp-compile misc/emacs/*.el + fi +} + +src_test() +{ + export_settings + cd src + ./run.bash --no-rebuild --banner +} + +src_install() +{ + dobin bin/* + dodoc AUTHORS CONTRIBUTORS PATENTS README + + dodir /usr/lib/go + insinto /usr/lib/go + + # There is a known issue which requires the source tree to be installed [1]. + # Once this is fixed, we can consider using the doc use flag to control + # installing the doc and src directories. + # [1] http://code.google.com/p/go/issues/detail?id=2775 + doins -r doc lib pkg src + + if use bash-completion; then + dobashcomp misc/bash/go + fi + + if use emacs; then + elisp-install ${PN} misc/emacs/*.el misc/emacs/*.elc + fi + + if use vim-syntax; then + insinto /usr/share/vim/vimfiles + doins -r misc/vim/ftdetect + doins -r misc/vim/ftplugin + doins -r misc/vim/syntax + doins -r misc/vim/plugin + doins -r misc/vim/indent + fi + + if use zsh-completion; then + insinto /usr/share/zsh/site-functions + doins misc/zsh/go + fi + + fperms -R +x /usr/lib/go/pkg/tool +} + +pkg_postinst() +{ + if use emacs; then + elisp-site-regen + fi + + # If the go tool sees a package file timestamped older than a dependancy it + # will rebuild that file. So, in order to stop go from rebuilding lots of + # packages for every build we need to fix the timestamps. The compiler and + # linker are also checked - so we need to fix them too. + ebegin "fixing timestamps to avoid unnecessary rebuilds" + tref="usr/lib/go/pkg/*/runtime.a" + find "${ROOT}"usr/lib/go/pkg -type f \ + -exec touch -r "${ROOT}"${tref} {} \; + eend $? +} + +pkg_postrm() +{ + if use emacs; then + elisp-site-regen + fi +} diff --git a/dev-lang/go/metadata.xml b/dev-lang/go/metadata.xml new file mode 100644 index 000000000000..b1ab5c0f9546 --- /dev/null +++ b/dev-lang/go/metadata.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer> + <email>williamh@gentoo.org</email> + <name>William Hubbs</name> + </maintainer> + <use> + <flag name="pax_kernel">enable running under a kernel with PaX enabled</flag> + </use> + <longdescription lang="en"> + Go is a new systems programming language developped at google by + Rob Pike. It has garbage collection, coroutines, communication + channels and a clean syntax. + </longdescription> +</pkgmetadata> |