summaryrefslogtreecommitdiff
blob: 1dec9662d9f104ba0c4a1723a6ec435a3fb2fb7b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-lang/ekopath/ekopath-4.0.12.1_pre20120430.ebuild,v 1.1 2012/04/30 19:55:05 xarthisius Exp $

EAPI=4

inherit versionator

MY_PV=$(get_version_component_range 1-4)
DATE=$(get_version_component_range 5)
DATE=${DATE/pre}
DATE=${DATE:0:4}-${DATE:4:2}-${DATE:6}

DESCRIPTION="PathScale EKOPath Compiler Suite"
HOMEPAGE="http://www.pathscale.com/ekopath-compiler-suite"
SRC_URI="http://c591116.r16.cf2.rackcdn.com/${PN}/nightly/Linux/${PN}-${DATE}-installer.run
	-> ${P}.run"

LICENSE="GPL-3"
SLOT="0"
KEYWORDS="~amd64"
IUSE=""

RESTRICT="mirror"

S=${WORKDIR}

QA_PREBUILT="
	opt/${PN}/lib/${MY_PV}/x8664/*
	opt/${PN}/bin/path*
	opt/${PN}/bin/funclookup
	opt/${PN}/bin/doctool
	opt/${PN}/bin/subclient
	opt/${PN}/bin/subserver
	opt/${PN}/bin/assign"

pkg_pretend() {
	if has_version app-arch/rpm ; then
		ewarn "You have app-arch/rpm installed on your system. Therefore"
		ewarn "${PN} will fail to install due to sandbox violation."
		ewarn "As this cannot be fixed on distribution level, please use"
		ewarn "following workaround:"
		ewarn "  emerge -C rpm && emerge -1 ${PN} && emerge -1 rpm"
		die
	fi
	echo opt/${PN}/lib/${MY_PV}/x8664/64/libeh.so
}

src_unpack() {
	cp "${DISTDIR}"/${A} "${S}" || die
	chmod +x "${S}"/${P}.run
}

src_prepare() {
	cat > "99${PN}" <<-EOF
		PATH=/opt/${PN}/bin
		ROOTPATH=/opt/${PN}/bin
		LDPATH=/opt/${PN}/lib:/opt/${PN}/lib/${MY_PV}/x8664/64
	EOF
}

src_install() {
	# You must paxmark -m EI_PAX (not PT_PAX) to run the installer
	# on a pax enabled kernel.  Adding PT_PAX breaks the binary.
	/usr/bin/scanelf -Xxz m ${P}.run >> /dev/null

	./${P}.run \
		--prefix "${D}/opt/${PN}" \
		--disable-components subscriptionmanager \
		--mode unattended || die

	# This is a temporary/partial fix to remove a RWX GNU STACK header
	# from libstl.so.  It still leaves libstl.a in bad shape.
	# The correct fix is in the assembly atomic-cxx.S, which we don't get
	#   See http://www.gentoo.org/proj/en/hardened/gnu-stack.xml
	#   Section 6.  How to fix the stack (in practice)
	/usr/bin/scanelf -Xe "${D}/opt/ekopath/lib/4.0.11/x8664/64/libstl.so"

	rm -rf "${D}"/opt/${PN}/uninstall || die
	rm -rf "${D}"/opt/${PN}/bin/{pathdb,funclookup} || die #libtinfo
	rm -rf "${D}"/opt/${PN}/lib/${MY_PV}/x8664/coco || die #DT_PATH
	doenvd "99${PN}"
}