proj/gentoo: Initial commit
[gentoo.git] / dev-libs / go-fuse / go-fuse-0_p20140812-r1.ebuild
1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI=5
6
7 KEYWORDS="~amd64"
8 RESTRICT="strip"
9 DESCRIPTION="FUSE bindings for Go"
10 GO_PN=github.com/hanwen/${PN}
11 HOMEPAGE="https://${GO_PN}"
12 EGIT_COMMIT="8c85ded140ac1889372a0e22d8d21e3d10a303bd"
13 SRC_URI="https://${GO_PN}/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz"
14 LICENSE="BSD"
15 SLOT="0"
16 IUSE=""
17 DEPEND=">=dev-lang/go-1.3"
18 RDEPEND=""
19 S=${WORKDIR}
20
21 src_unpack() {
22         default_src_unpack
23         mkdir -p src/${GO_PN%/*} || die
24         mv ${PN}-${EGIT_COMMIT} src/${GO_PN} || die
25 }
26
27 src_prepare() {
28         sed -e "s:\(go \${target}\)\(.*\)$:\\1 -x \\2:" \
29                 -e 's:^for target in "clean" "install" ; do$:for target in "install" ; do:' \
30                 -e '17,26d' \
31                 src/${GO_PN}/all.bash > src/${GO_PN}/all.bash.patched || die
32 }
33
34 src_compile() {
35         # Create a filtered GOROOT tree out of symlinks,
36         # excluding go-fuse, for bug #503324.
37         cp -sR /usr/lib/go goroot || die
38         rm -rf goroot/src/${GO_PN} || die
39         rm -rf goroot/pkg/linux_${ARCH}/${GO_PN} || die
40         CGO_CFLAGS="${CFLAGS}" GOROOT="${WORKDIR}/goroot" GOPATH="${WORKDIR}" \
41                 bash src/${GO_PN}/all.bash.patched || die
42 }
43
44 src_install() {
45         insopts -m0644 -p # preserve timestamps for bug 551486
46         insinto /usr/lib/go
47         doins -r pkg
48         insinto /usr/lib/go/src
49         rm src/${GO_PN}/all.bash.patched || die
50         find src/${GO_PN} -name .gitignore -delete
51         doins -r src/*
52 }