Gentoo Archives: gentoo-commits

From: "Anthony G. Basile" <blueness@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-util/plan9port/
Date: Wed, 02 Dec 2015 07:02:40
Message-Id: 1449040185.5e67c2bba2e8e68765f6602bcc71485297ad19a9.blueness@gentoo
1 commit: 5e67c2bba2e8e68765f6602bcc71485297ad19a9
2 Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
3 AuthorDate: Wed Dec 2 07:07:50 2015 +0000
4 Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
5 CommitDate: Wed Dec 2 07:09:45 2015 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5e67c2bb
7
8 dev-util/plan9port: add prefix support, bug #567260.
9
10 Package-Manager: portage-2.2.20.1
11
12 dev-util/plan9port/plan9port-20140306-r1.ebuild | 95 +++++++++++++++++++++++++
13 1 file changed, 95 insertions(+)
14
15 diff --git a/dev-util/plan9port/plan9port-20140306-r1.ebuild b/dev-util/plan9port/plan9port-20140306-r1.ebuild
16 new file mode 100644
17 index 0000000..d53a617
18 --- /dev/null
19 +++ b/dev-util/plan9port/plan9port-20140306-r1.ebuild
20 @@ -0,0 +1,95 @@
21 +# Copyright 1999-2015 Gentoo Foundation
22 +# Distributed under the terms of the GNU General Public License v2
23 +# $Id$
24 +
25 +EAPI="5"
26 +
27 +inherit eutils multiprocessing
28 +
29 +DESCRIPTION="Port of many Plan 9 programs and libraries"
30 +HOMEPAGE="http://swtch.com/plan9port/"
31 +SRC_URI="https://${PN}.googlecode.com/files/${P}.tgz"
32 +
33 +LICENSE="9base BSD-4 MIT LGPL-2.1 BigelowHolmes"
34 +SLOT="0"
35 +KEYWORDS="~amd64 ~x86"
36 +IUSE="X"
37 +
38 +DEPEND="X? ( x11-apps/xauth )"
39 +RDEPEND="${DEPEND}"
40 +
41 +S="${WORKDIR}/${PN}"
42 +
43 +PLAN9=/usr/lib/plan9
44 +EPLAN9="${EPREFIX}"${PLAN9}
45 +QA_MULTILIB_PATHS="${PLAN9}/.*/.*"
46 +
47 +src_prepare() {
48 + epatch "${FILESDIR}/${PN}-"{noexecstack,cflags,builderr}".patch"
49 +
50 + # don't hardcode /bin and /usr/bin in PATH
51 + sed -i '/PATH/s,/bin:/usr/bin:,,' INSTALL || die "sed on INSTALL failed"
52 +
53 + # don't hardcode /usr/{,local/}include and prefix /usr/include/*
54 + for f in src/cmd/fontsrv/freetyperules.sh INSTALL \
55 + $(find -name makefile); do
56 + sed -r -i -e 's,-I/usr(|/local)/include ,,g' \
57 + -e "s,-I/usr(|/local)/include,-I${EPREFIX}/usr\1/include,g" ${f} \
58 + || die "sed on ${f} failed"
59 + done
60 +
61 + # Fix paths, done in place of ./INSTALL -c
62 + einfo "Fixing hard-coded /usr/local/plan9 paths"
63 + grep --null -l -r '/usr/local/plan9' |
64 + xargs --null sed -i "s,/usr/local/plan9,${EPLAN9},g"
65 +}
66 +
67 +src_configure() {
68 + if use X; then
69 + echo "X11=${EPREFIX}/usr" >> LOCAL.config
70 + else
71 + echo "WSYSTYPE=nowsys" >> LOCAL.config
72 + fi
73 +}
74 +
75 +src_compile() {
76 + export NPROC=$(makeopts_jobs)
77 +
78 + # The INSTALL script builds mk then [re]builds everything using that
79 + einfo "Compiling Plan 9 from User Space can take a very long time"
80 + einfo "depending on the speed of your computer. Please be patient!"
81 + ./INSTALL -b || die "Please report bugs to bugs.gentoo.org, NOT Plan9Port."
82 +}
83 +
84 +src_install() {
85 + dodir "${PLAN9}"
86 +
87 + # P9P's man does not handle compression
88 + docompress -x $PLAN9/man
89 +
90 + # do* plays with the executable bit, and we should not modify them
91 + cp -a * "${ED}/${PLAN9}"
92 +
93 + # build the environment variables and install them in env.d
94 + cat > "${T}/30plan9" <<-EOF
95 + PLAN9="${EPLAN9}"
96 + PATH="${EPLAN9}/bin"
97 + ROOTPATH="${EPLAN9}/bin"
98 + MANPATH="${EPLAN9}/man"
99 + EOF
100 + doenvd "${T}/30plan9"
101 +}
102 +
103 +pkg_postinst() {
104 + elog "Plan 9 from User Space has been successfully installed into"
105 + elog "${PLAN9}. Your PLAN9 and PATH environment variables have"
106 + elog "also been appropriately set, please use env-update and"
107 + elog "source /etc/profile to bring that into immediate effect."
108 + elog
109 + elog "Please note that ${PLAN9}/bin has been appended to the"
110 + elog "*end* or your PATH to prevent conflicts. To use the Plan9"
111 + elog "versions of common UNIX tools, use the absolute path:"
112 + elog "${PLAN9}/bin or the 9 command (eg: 9 troff)"
113 + elog
114 + elog "Please report any bugs to bugs.gentoo.org, NOT Plan9Port."
115 +}