diff options
Diffstat (limited to 'dev-lang/go')
-rw-r--r-- | dev-lang/go/Manifest | 4 | ||||
-rw-r--r-- | dev-lang/go/files/go-1.0.3-hardened.patch | 44 | ||||
-rw-r--r-- | dev-lang/go/go-1.0.3.ebuild | 139 | ||||
-rw-r--r-- | dev-lang/go/metadata.xml | 13 |
4 files changed, 200 insertions, 0 deletions
diff --git a/dev-lang/go/Manifest b/dev-lang/go/Manifest new file mode 100644 index 0000000..f4c134f --- /dev/null +++ b/dev-lang/go/Manifest @@ -0,0 +1,4 @@ +AUX go-1.0.3-hardened.patch 1306 SHA256 793f3b25c8fdcaa39415388ee534aabeceb48c2c08ce1f59d7fa16abaf1034d2 SHA512 d31a11157884e6ea03d21c8bfab03087264f458ef120250e4e919a7eb595f30fbde913bb970918b0cb3af86ea6aefa59ab254af84a9295ab933f045a60e31085 WHIRLPOOL dcafb608fc2e1a2e4d72dfca7d0a58543f8a05a6f99502f74e4558764be33536392bbc63ef1c7c7fe21b7cf8e26b3cea46feee3d2d376bf4458f3ce6d16691ee +DIST go1.0.3.src.tar.gz 7404849 SHA256 7fba3533d172f13629d3d8a79e57c620632b0bd075abe11d7698b338be0ae3df SHA512 8006b1c38b7d49f3ae040e405d1897218cbc941a81349f270e6f5fdfeb84ed9267cfcbadb414da4cef1135bb0e2377b295ade3f3d6411c6ae15149f7e1b717b1 WHIRLPOOL 15d8576a7210dcac0da45e3e43686e2b3135c01cc047f8881338fb437a54fd56c69b8eacbc1a395ebc0813e6940bbdfcde37518b214ba162851bc669a268b0f4 +EBUILD go-1.0.3.ebuild 3191 SHA256 7dede5ef3aff941a9d11154ccfb7db7c7091d98b3df6c900da80c5687c2926d6 SHA512 97c889c9b43302ca7fe2fd10999086e2248930ae0104e9dfbc77b36d1fcafb62076a517fb49df0ab65fc7dcd288e166ee220e2b694a67f688dcfe04131b4682d WHIRLPOOL 98d190be371d00a3514372efda7bc25335746681b66b751098b5c9232c412f4523ecdd17fd164e22abe3e3e7ff5069bf029eec4aa16e2beadd8766aec16e5af5 +MISC metadata.xml 448 SHA256 d53ad6b454d72353e0308a91a989a1a3345ae97c0199748dee1862576ad4476a SHA512 0c5fb551437353e87f87c91e576ef224b770f686700150c19e7f34e6903ba26910293bb74db9732a220006b873113662464646dd96e61503e4aa90cc84e14f75 WHIRLPOOL b3846a0fad8844ad7ec961b512cb12a9d588bfac28b2dc53798399ac8628ccbf6c06c5666b03eabef05b0acb0cea04d563252eaaa893341c5b3fe59475ffdab5 diff --git a/dev-lang/go/files/go-1.0.3-hardened.patch b/dev-lang/go/files/go-1.0.3-hardened.patch new file mode 100644 index 0000000..39e9ccb --- /dev/null +++ b/dev-lang/go/files/go-1.0.3-hardened.patch @@ -0,0 +1,44 @@ +Index: src/cmd/6l/asm.c +=================================================================== +--- a/src/cmd/6l/asm.c ++++ b/src/cmd/6l/asm.c +@@ -1082,6 +1082,11 @@ + ph->type = PT_GNU_STACK; + ph->flags = PF_W+PF_R; + ph->align = 8; ++ ++ ph = newElfPhdr(); ++ ph->type = PT_PAX_FLAGS; ++ ph->flags = 0x2a00; // mprotect, randexec, emutramp disabled ++ ph->align = 8; + + sh = newElfShstrtab(elfstr[ElfStrShstrtab]); + sh->type = SHT_STRTAB; +Index: src/cmd/8l/asm.c +=================================================================== +--- a/src/cmd/8l/asm.c ++++ b/src/cmd/8l/asm.c +@@ -1127,6 +1127,11 @@ + ph->flags = PF_W+PF_R; + ph->align = 4; + ++ ph = newElfPhdr(); ++ ph->type = PT_PAX_FLAGS; ++ ph->flags = 0x2a00; // mprotect, randexec, emutramp disabled ++ ph->align = 8; ++ + sh = newElfShstrtab(elfstr[ElfStrShstrtab]); + sh->type = SHT_STRTAB; + sh->addralign = 1; +Index: src/cmd/ld/elf.h +=================================================================== +--- a/src/cmd/ld/elf.h ++++ b/src/cmd/ld/elf.h +@@ -251,6 +251,7 @@ + #define PT_LOPROC 0x70000000 /* First processor-specific type. */ + #define PT_HIPROC 0x7fffffff /* Last processor-specific type. */ + #define PT_GNU_STACK 0x6474e551 ++#define PT_PAX_FLAGS 0x65041580 + + /* Values for p_flags. */ + #define PF_X 0x1 /* Executable. */ diff --git a/dev-lang/go/go-1.0.3.ebuild b/dev-lang/go/go-1.0.3.ebuild new file mode 100644 index 0000000..e830e9c --- /dev/null +++ b/dev-lang/go/go-1.0.3.ebuild @@ -0,0 +1,139 @@ +# 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.2.ebuild,v 1.4 2012/09/14 18:29:06 maekke Exp $ + +EAPI=4 + +export CTARGET=${CTARGET:-${CHOST}} + +if [[ ${PV} = 9999 ]]; then + EHG_REPO_URI="https://go.googlecode.com/hg" + inherit mercurial +fi +inherit 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="-* ~amd64 ~arm ~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" + +DEPEND="sys-apps/ed + ${COMMON_DEPEND}" +RDEPEND="bash-completion? ( app-shells/bash-completion ) + emacs? ( virtual/emacs ) + vim-syntax? ( || ( app-editors/vim app-editors/gvim ) ) + 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" + +if [[ ${PV} != 9999 ]]; then + S="${WORKDIR}"/go +fi + +src_prepare() +{ + if [[ ${PV} != 9999 ]]; then + epatch "${FILESDIR}"/${P}-hardened.patch + fi + epatch_user +} + +src_compile() +{ + export GOROOT_FINAL=/usr/lib/go + export GOROOT="$(pwd)" + export GOBIN="${GOROOT}/bin" + if [[ $CTARGET = armv5* ]] + then + export GOARM=5 + fi + + cd src + ./make.bash || die "build failed" + cd .. + + if use emacs; then + elisp-compile misc/emacs/*.el + fi +} + +src_test() +{ + cd src + PATH="${GOBIN}:${PATH}" \ + ./run.bash --no-rebuild --banner || die "tests failed" +} + +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 0000000..b8d8656 --- /dev/null +++ b/dev-lang/go/metadata.xml @@ -0,0 +1,13 @@ +<?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> + <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> |