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