1 |
commit: 8ca155177cde6bd796fb6db7aeed3e75799acfc8 |
2 |
Author: neeshy <neeshy <AT> tfwno <DOT> gf> |
3 |
AuthorDate: Tue Jun 2 11:11:16 2020 +0000 |
4 |
Commit: Joonas Niilola <juippis <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Jun 2 11:13:44 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8ca15517 |
7 |
|
8 |
dev-util/plan9port: add 9999 version |
9 |
|
10 |
Closes: https://github.com/gentoo/gentoo/pull/15073 |
11 |
Signed-off-by: Nima Sadeghi <neeshy <AT> tfwno.gf> |
12 |
Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org> |
13 |
|
14 |
dev-util/plan9port/plan9port-9999.ebuild | 126 +++++++++++++++++++++++++++++++ |
15 |
1 file changed, 126 insertions(+) |
16 |
|
17 |
diff --git a/dev-util/plan9port/plan9port-9999.ebuild b/dev-util/plan9port/plan9port-9999.ebuild |
18 |
new file mode 100644 |
19 |
index 00000000000..4c1e286476b |
20 |
--- /dev/null |
21 |
+++ b/dev-util/plan9port/plan9port-9999.ebuild |
22 |
@@ -0,0 +1,126 @@ |
23 |
+# Copyright 1999-2020 Gentoo Authors |
24 |
+# Distributed under the terms of the GNU General Public License v2 |
25 |
+ |
26 |
+EAPI=7 |
27 |
+ |
28 |
+inherit multiprocessing toolchain-funcs git-r3 readme.gentoo-r1 |
29 |
+ |
30 |
+DESCRIPTION="Port of many Plan 9 programs and libraries" |
31 |
+HOMEPAGE="https://9fans.github.io/plan9port/ |
32 |
+ https://github.com/9fans/plan9port" |
33 |
+EGIT_REPO_URI="https://github.com/9fans/${PN}.git" |
34 |
+ |
35 |
+LICENSE="9base BSD-4 MIT LGPL-2.1 BigelowHolmes" |
36 |
+SLOT="0" |
37 |
+IUSE="X aqua truetype" |
38 |
+REQUIRED_USE="?? ( X aqua )" |
39 |
+ |
40 |
+DEPEND=" |
41 |
+ X? ( x11-apps/xauth ) |
42 |
+ truetype? ( |
43 |
+ media-libs/freetype |
44 |
+ media-libs/fontconfig |
45 |
+ ) |
46 |
+" |
47 |
+RDEPEND="${DEPEND}" |
48 |
+ |
49 |
+PATCHES=( |
50 |
+ "${FILESDIR}/${PN}-noexecstack.patch" |
51 |
+ "${FILESDIR}/${PN}-cflags.patch" |
52 |
+ "${FILESDIR}/${PN}-builderr.patch" |
53 |
+) |
54 |
+ |
55 |
+PLAN9="/opt/plan9" |
56 |
+EPLAN9="${EPREFIX}${PLAN9}" |
57 |
+QA_MULTILIB_PATHS="${PLAN9}/.*/.*" |
58 |
+ |
59 |
+DOC_CONTENTS="Plan 9 from User Space has been successfully installed into |
60 |
+${PLAN9}. Your PLAN9 and PATH environment variables have |
61 |
+also been appropriately set, please use env-update and |
62 |
+source /etc/profile to bring that into immediate effect. |
63 |
+ |
64 |
+Please note that ${PLAN9}/bin has been appended to the |
65 |
+*end* or your PATH to prevent conflicts. To use the Plan9 |
66 |
+versions of common UNIX tools, use the absolute path: |
67 |
+${PLAN9}/bin or the 9 command (eg: 9 troff) |
68 |
+ |
69 |
+Please report any bugs to bugs.gentoo.org, NOT Plan9Port." |
70 |
+DISABLE_AUTOFORMATTING="yes" |
71 |
+ |
72 |
+src_prepare() { |
73 |
+ default |
74 |
+ |
75 |
+ case "${CHOST}" in |
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 |
+ sed -Ei -e 's,-I/usr(|/local)/include ,,g' \ |
86 |
+ -e "s,-I/usr(|/local)/include,-I${EPREFIX}/usr\1/include,g" \ |
87 |
+ src/cmd/fontsrv/freetyperules.sh INSTALL $(find -name makefile) || |
88 |
+ die "sed failed" |
89 |
+ |
90 |
+ # Fix paths, done in place of ./INSTALL -c |
91 |
+ einfo "Fixing hard-coded /usr/local/plan9 paths" |
92 |
+ sed -i "s,/usr/local/plan9,${EPLAN9},g" $(grep -lr /usr/local/plan9) || |
93 |
+ die "sed failed" |
94 |
+} |
95 |
+ |
96 |
+src_configure() { |
97 |
+ local -a myconf=( |
98 |
+ CC9="$(tc-getCC)" |
99 |
+ CC9FLAGS="'${CFLAGS} ${LDFLAGS}'" |
100 |
+ ) |
101 |
+ |
102 |
+ if use X; then |
103 |
+ myconf+=( WSYSTYPE=x11 ) |
104 |
+ elif use aqua; then |
105 |
+ local wsystype="$(awk '{if ($1 > 10.5) print "osx-cocoa"; else print "osx"}' \ |
106 |
+ <<< "${MACOSX_DEPLOYMENT_TARGET}")" |
107 |
+ myconf+=( WSYSTYPE="${wsystype}" ) |
108 |
+ else |
109 |
+ myconf+=( WSYSTYPE=nowsys ) |
110 |
+ fi |
111 |
+ |
112 |
+ if use truetype; then |
113 |
+ myconf+=( FONTSRV=fontsrv ) |
114 |
+ else |
115 |
+ myconf+=( FONTSRV= ) |
116 |
+ fi |
117 |
+ |
118 |
+ printf '%s\n' "${myconf[@]}" >> LOCAL.config || |
119 |
+ die "cannot create configuration" |
120 |
+} |
121 |
+ |
122 |
+src_compile() { |
123 |
+ # The INSTALL script builds mk then [re]builds everything using that |
124 |
+ einfo "Compiling Plan 9 from User Space can take a very long time" |
125 |
+ einfo "depending on the speed of your computer. Please be patient!" |
126 |
+ NPROC="$(makeopts_jobs)" ./INSTALL -b || |
127 |
+ die "Please report bugs to bugs.gentoo.org, NOT Plan9Port." |
128 |
+} |
129 |
+ |
130 |
+src_install() { |
131 |
+ readme.gentoo_create_doc |
132 |
+ |
133 |
+ # do* plays with the executable bit, and we should not modify them |
134 |
+ dodir "${PLAN9}" |
135 |
+ cp -a * "${ED}${PLAN9}" || die "cp failed" |
136 |
+ |
137 |
+ # build the environment variables and install them in env.d |
138 |
+ newenvd - 60plan9 <<-EOF |
139 |
+ PLAN9="${EPLAN9}" |
140 |
+ PATH="${EPLAN9}/bin" |
141 |
+ ROOTPATH="${EPLAN9}/bin" |
142 |
+ MANPATH="${EPLAN9}/man" |
143 |
+ EOF |
144 |
+} |
145 |
+ |
146 |
+pkg_postinst() { |
147 |
+ readme.gentoo_print_elog |
148 |
+} |