1 |
commit: 367d47d9414005bea0e6a7fc749fa19032fd89d6 |
2 |
Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Dec 27 22:57:30 2015 +0000 |
4 |
Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Dec 27 22:58:01 2015 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=367d47d9 |
7 |
|
8 |
dev-util/plan9port: add prefix support, bug #567260 |
9 |
|
10 |
Thanks Jeremi Piotrowski <jeremi.piotrowski <AT> gmail.com> |
11 |
|
12 |
Package-Manager: portage-2.2.24 |
13 |
|
14 |
.../plan9port/files/plan9port-freebsd-10.patch | 11 ++ |
15 |
dev-util/plan9port/plan9port-20140306-r2.ebuild | 118 +++++++++++++++++++++ |
16 |
2 files changed, 129 insertions(+) |
17 |
|
18 |
diff --git a/dev-util/plan9port/files/plan9port-freebsd-10.patch b/dev-util/plan9port/files/plan9port-freebsd-10.patch |
19 |
new file mode 100644 |
20 |
index 0000000..cc46dc6 |
21 |
--- /dev/null |
22 |
+++ b/dev-util/plan9port/files/plan9port-freebsd-10.patch |
23 |
@@ -0,0 +1,11 @@ |
24 |
+--- a/bin/9l 2015-12-09 19:12:50.000000000 +0000 |
25 |
++++ b/bin/9l 2015-12-09 19:13:00.000000000 +0000 |
26 |
+@@ -19,7 +19,7 @@ case "$tag" in |
27 |
+ 5.2.*) |
28 |
+ extralibs="$extralibs -lkse" |
29 |
+ ;; |
30 |
+- [5-9].*) |
31 |
++ [5-9].*|10.*) |
32 |
+ extralibs="$extralibs -lpthread" |
33 |
+ ;; |
34 |
+ esac |
35 |
|
36 |
diff --git a/dev-util/plan9port/plan9port-20140306-r2.ebuild b/dev-util/plan9port/plan9port-20140306-r2.ebuild |
37 |
new file mode 100644 |
38 |
index 0000000..05fdf5f |
39 |
--- /dev/null |
40 |
+++ b/dev-util/plan9port/plan9port-20140306-r2.ebuild |
41 |
@@ -0,0 +1,118 @@ |
42 |
+# Copyright 1999-2015 Gentoo Foundation |
43 |
+# Distributed under the terms of the GNU General Public License v2 |
44 |
+# $Id$ |
45 |
+ |
46 |
+EAPI="5" |
47 |
+ |
48 |
+inherit eutils multiprocessing toolchain-funcs |
49 |
+ |
50 |
+DESCRIPTION="Port of many Plan 9 programs and libraries" |
51 |
+HOMEPAGE="http://swtch.com/plan9port/" |
52 |
+SRC_URI="https://${PN}.googlecode.com/files/${P}.tgz" |
53 |
+ |
54 |
+LICENSE="9base BSD-4 MIT LGPL-2.1 BigelowHolmes" |
55 |
+SLOT="0" |
56 |
+KEYWORDS="~amd64 ~x86" |
57 |
+IUSE="X aqua truetype" |
58 |
+REQUIRED_USE="?? ( X aqua )" |
59 |
+ |
60 |
+DEPEND="X? ( x11-apps/xauth ) |
61 |
+ truetype? ( media-libs/freetype |
62 |
+ media-libs/fontconfig )" |
63 |
+RDEPEND="${DEPEND}" |
64 |
+ |
65 |
+S="${WORKDIR}/${PN}" |
66 |
+ |
67 |
+PLAN9=/usr/lib/plan9 |
68 |
+EPLAN9="${EPREFIX}"${PLAN9} |
69 |
+QA_MULTILIB_PATHS="${PLAN9}/.*/.*" |
70 |
+ |
71 |
+src_prepare() { |
72 |
+ epatch "${FILESDIR}/${PN}-"{noexecstack,cflags,builderr}".patch" |
73 |
+ case ${CHOST} in |
74 |
+ *freebsd10.*) # patch 9l to use -pthread also on FreeBSD-10 |
75 |
+ epatch "${FILESDIR}/${PN}-freebsd-10.patch" ;; |
76 |
+ *apple*) |
77 |
+ sed -i 's/--noexecstack/-noexecstack/' src/mkhdr || |
78 |
+ die "Failed to sed AFLAGS" ;; |
79 |
+ esac |
80 |
+ |
81 |
+ # don't hardcode /bin and /usr/bin in PATH |
82 |
+ sed -i '/PATH/s,/bin:/usr/bin:,,' INSTALL || die "sed on INSTALL failed" |
83 |
+ |
84 |
+ # don't hardcode /usr/{,local/}include and prefix /usr/include/* |
85 |
+ for f in src/cmd/fontsrv/freetyperules.sh INSTALL \ |
86 |
+ $(find -name makefile); do |
87 |
+ sed -r -i -e 's,-I/usr(|/local)/include ,,g' \ |
88 |
+ -e "s,-I/usr(|/local)/include,-I${EPREFIX}/usr\1/include,g" ${f} \ |
89 |
+ || die "sed on ${f} failed" |
90 |
+ done |
91 |
+ |
92 |
+ # Fix paths, done in place of ./INSTALL -c |
93 |
+ einfo "Fixing hard-coded /usr/local/plan9 paths" |
94 |
+ grep --null -l -r '/usr/local/plan9' | |
95 |
+ xargs --null sed -i "s,/usr/local/plan9,${EPLAN9},g" |
96 |
+} |
97 |
+ |
98 |
+src_configure() { |
99 |
+ local myconf=() |
100 |
+ if use X; then |
101 |
+ myconf+=("X11=${EPREFIX}/usr" WSYSTYPE=x11) |
102 |
+ elif use aqua; then |
103 |
+ local wsystype=$(echo ${MACOSX_DEPLOYMENT_TARGET} | |
104 |
+ awk '{if ($1 > 10.5) print "osx-cocoa"; else print "osx"}') |
105 |
+ myconf+=("WSYSTYPE=${wsystype}") |
106 |
+ else |
107 |
+ myconf+=(WSYSTYPE=nowsys) |
108 |
+ fi |
109 |
+ |
110 |
+ if use truetype; then |
111 |
+ myconf+=(FONTSRV=fontsrv) |
112 |
+ else |
113 |
+ myconf+=(FONTSRV=) |
114 |
+ fi |
115 |
+ printf '%s\n' "${myconf[@]}" >> LOCAL.config |
116 |
+} |
117 |
+ |
118 |
+src_compile() { |
119 |
+ export NPROC=$(makeopts_jobs) |
120 |
+ export CC9=$(tc-getCC) |
121 |
+ |
122 |
+ # The INSTALL script builds mk then [re]builds everything using that |
123 |
+ einfo "Compiling Plan 9 from User Space can take a very long time" |
124 |
+ einfo "depending on the speed of your computer. Please be patient!" |
125 |
+ ./INSTALL -b || die "Please report bugs to bugs.gentoo.org, NOT Plan9Port." |
126 |
+} |
127 |
+ |
128 |
+src_install() { |
129 |
+ dodir "${PLAN9}" |
130 |
+ |
131 |
+ # P9P's man does not handle compression |
132 |
+ docompress -x $PLAN9/man |
133 |
+ |
134 |
+ # do* plays with the executable bit, and we should not modify them |
135 |
+ cp -a * "${ED}/${PLAN9}" |
136 |
+ |
137 |
+ # build the environment variables and install them in env.d |
138 |
+ cat > "${T}/30plan9" <<-EOF |
139 |
+ PLAN9="${EPLAN9}" |
140 |
+ PATH="${EPLAN9}/bin" |
141 |
+ ROOTPATH="${EPLAN9}/bin" |
142 |
+ MANPATH="${EPLAN9}/man" |
143 |
+ EOF |
144 |
+ doenvd "${T}/30plan9" |
145 |
+} |
146 |
+ |
147 |
+pkg_postinst() { |
148 |
+ elog "Plan 9 from User Space has been successfully installed into" |
149 |
+ elog "${PLAN9}. Your PLAN9 and PATH environment variables have" |
150 |
+ elog "also been appropriately set, please use env-update and" |
151 |
+ elog "source /etc/profile to bring that into immediate effect." |
152 |
+ elog |
153 |
+ elog "Please note that ${PLAN9}/bin has been appended to the" |
154 |
+ elog "*end* or your PATH to prevent conflicts. To use the Plan9" |
155 |
+ elog "versions of common UNIX tools, use the absolute path:" |
156 |
+ elog "${PLAN9}/bin or the 9 command (eg: 9 troff)" |
157 |
+ elog |
158 |
+ elog "Please report any bugs to bugs.gentoo.org, NOT Plan9Port." |
159 |
+} |