1 |
commit: 043c2bbc72cfd2f22cbd3cf58786dd3262d54ae3 |
2 |
Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Feb 26 21:45:51 2020 +0000 |
4 |
Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Feb 26 21:46:03 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=043c2bbc |
7 |
|
8 |
dev-lang/erlang: fix USE=doc dirs, bug #684376 |
9 |
|
10 |
Reported-by: Ciprian Ciubotariu |
11 |
Closes: https://bugs.gentoo.org/684376 |
12 |
Package-Manager: Portage-2.3.89, Repoman-2.3.20 |
13 |
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org> |
14 |
|
15 |
dev-lang/erlang/erlang-22.2.7-r1.ebuild | 161 ++++++++++++++++++++++++++++++++ |
16 |
1 file changed, 161 insertions(+) |
17 |
|
18 |
diff --git a/dev-lang/erlang/erlang-22.2.7-r1.ebuild b/dev-lang/erlang/erlang-22.2.7-r1.ebuild |
19 |
new file mode 100644 |
20 |
index 00000000000..b3c069a442b |
21 |
--- /dev/null |
22 |
+++ b/dev-lang/erlang/erlang-22.2.7-r1.ebuild |
23 |
@@ -0,0 +1,161 @@ |
24 |
+# Copyright 1999-2020 Gentoo Authors |
25 |
+# Distributed under the terms of the GNU General Public License v2 |
26 |
+ |
27 |
+EAPI=7 |
28 |
+WX_GTK_VER="3.0" |
29 |
+ |
30 |
+inherit elisp-common java-pkg-opt-2 systemd wxwidgets |
31 |
+ |
32 |
+# NOTE: If you need symlinks for binaries please tell maintainers or |
33 |
+# open up a bug to let it be created. |
34 |
+ |
35 |
+UPSTREAM_V="$(ver_cut 1-2)" |
36 |
+ |
37 |
+DESCRIPTION="Erlang programming language, runtime environment and libraries (OTP)" |
38 |
+HOMEPAGE="https://www.erlang.org/" |
39 |
+SRC_URI="https://github.com/erlang/otp/archive/OTP-${PV}.tar.gz -> ${P}.tar.gz |
40 |
+ http://erlang.org/download/otp_doc_man_${UPSTREAM_V}.tar.gz -> ${PN}_doc_man_${UPSTREAM_V}.tar.gz |
41 |
+ doc? ( http://erlang.org/download/otp_doc_html_${UPSTREAM_V}.tar.gz -> ${PN}_doc_html_${UPSTREAM_V}.tar.gz )" |
42 |
+ |
43 |
+LICENSE="Apache-2.0" |
44 |
+# We use this subslot because Compiled HiPE Code can be loaded on the exact |
45 |
+# same build of ERTS that was used when compiling the code. See |
46 |
+# http://erlang.org/doc/system_principles/misc.html for more information. |
47 |
+SLOT="0/${PV}" |
48 |
+KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x64-solaris" |
49 |
+IUSE="doc emacs +hipe java +kpoll libressl odbc sctp ssl systemd tk wxwidgets" |
50 |
+ |
51 |
+RDEPEND=" |
52 |
+ acct-group/epmd |
53 |
+ acct-user/epmd |
54 |
+ sys-libs/ncurses:0 |
55 |
+ sys-libs/zlib |
56 |
+ emacs? ( >=app-editors/emacs-23.1:* ) |
57 |
+ java? ( >=virtual/jdk-1.8:* ) |
58 |
+ odbc? ( dev-db/unixODBC ) |
59 |
+ sctp? ( net-misc/lksctp-tools ) |
60 |
+ ssl? ( |
61 |
+ !libressl? ( >=dev-libs/openssl-0.9.7d:0= ) |
62 |
+ libressl? ( dev-libs/libressl:0= ) |
63 |
+ ) |
64 |
+ systemd? ( sys-apps/systemd ) |
65 |
+ tk? ( dev-lang/tk:0 ) |
66 |
+ wxwidgets? ( x11-libs/wxGTK:${WX_GTK_VER}[X,opengl] ) |
67 |
+" |
68 |
+DEPEND="${RDEPEND} |
69 |
+ dev-lang/perl |
70 |
+" |
71 |
+ |
72 |
+S="${WORKDIR}/otp-OTP-${PV}" |
73 |
+ |
74 |
+PATCHES=( |
75 |
+ "${FILESDIR}/18.2.1-wx3.0.patch" |
76 |
+ "${FILESDIR}/${PN}-22.0-dont-ignore-LDFLAGS.patch" |
77 |
+ "${FILESDIR}/${PN}-22.2.2-gcc-10.patch" |
78 |
+ "${FILESDIR}/${PN}-22.1.4-asn1-dep.patch" |
79 |
+) |
80 |
+ |
81 |
+SITEFILE=50"${PN}"-gentoo.el |
82 |
+ |
83 |
+src_prepare() { |
84 |
+ default |
85 |
+ |
86 |
+ ./otp_build autoconf || die |
87 |
+} |
88 |
+ |
89 |
+src_configure() { |
90 |
+ use wxwidgets && setup-wxwidgets |
91 |
+ |
92 |
+ local myconf=( |
93 |
+ --disable-builtin-zlib |
94 |
+ $(use_enable hipe) |
95 |
+ $(use_enable kpoll kernel-poll) |
96 |
+ $(use_with java javac) |
97 |
+ $(use_enable sctp) |
98 |
+ $(use_with ssl ssl "${EPREFIX}"/usr) |
99 |
+ $(use_enable ssl dynamic-ssl-lib) |
100 |
+ $(use_enable systemd) |
101 |
+ $(usex wxwidgets "--with-wx-config=${WX_CONFIG}" "--with-wxdir=/dev/null") |
102 |
+ ) |
103 |
+ econf "${myconf[@]}" |
104 |
+} |
105 |
+ |
106 |
+src_compile() { |
107 |
+ emake |
108 |
+ |
109 |
+ if use emacs ; then |
110 |
+ pushd lib/tools/emacs &>/dev/null || die |
111 |
+ elisp-compile *.el |
112 |
+ popd &>/dev/null || die |
113 |
+ fi |
114 |
+} |
115 |
+ |
116 |
+extract_version() { |
117 |
+ local path="$1" |
118 |
+ local var_name="$2" |
119 |
+ sed -n -e "/^${var_name} = \(.*\)$/s::\1:p" "${S}/${path}/vsn.mk" || die "extract_version() failed" |
120 |
+} |
121 |
+ |
122 |
+src_install() { |
123 |
+ local erl_libdir_rel="$(get_libdir)/erlang" |
124 |
+ local erl_libdir="/usr/${erl_libdir_rel}" |
125 |
+ local erl_interface_ver="$(extract_version lib/erl_interface EI_VSN)" |
126 |
+ local erl_erts_ver="$(extract_version erts VSN)" |
127 |
+ local my_manpath="/usr/share/${PN}/man" |
128 |
+ |
129 |
+ [[ -z "${erl_erts_ver}" ]] && die "Couldn't determine erts version" |
130 |
+ [[ -z "${erl_interface_ver}" ]] && die "Couldn't determine interface version" |
131 |
+ |
132 |
+ emake INSTALL_PREFIX="${D}" install |
133 |
+ |
134 |
+ if use doc ; then |
135 |
+ # Note: we explicitly install docs into: |
136 |
+ # /usr/share/doc/${PF}/{doc,lib,erts-*} |
137 |
+ # To maintain that layout we gather everything in 'html-docs'. |
138 |
+ # See bug #684376. |
139 |
+ mkdir html-docs || die |
140 |
+ mv "${WORKDIR}"/doc "${WORKDIR}"/lib "${WORKDIR}"/erts-* html-docs/ || die |
141 |
+ local DOCS=( "AUTHORS" "HOWTO"/* "README.md" "CONTRIBUTING.md" html-docs/. ) |
142 |
+ docompress -x /usr/share/doc/${PF} |
143 |
+ else |
144 |
+ local DOCS=("README.md") |
145 |
+ fi |
146 |
+ |
147 |
+ einstalldocs |
148 |
+ |
149 |
+ dosym "../${erl_libdir_rel}/bin/erl" /usr/bin/erl |
150 |
+ dosym "../${erl_libdir_rel}/bin/erlc" /usr/bin/erlc |
151 |
+ dosym "../${erl_libdir_rel}/bin/escript" /usr/bin/escript |
152 |
+ dosym "../${erl_libdir_rel}/lib/erl_interface-${erl_interface_ver}/bin/erl_call" /usr/bin/erl_call |
153 |
+ dosym "../${erl_libdir_rel}/erts-${erl_erts_ver}/bin/beam.smp" /usr/bin/beam.smp |
154 |
+ |
155 |
+ ## Clean up the no longer needed files |
156 |
+ rm "${ED}/${erl_libdir}/Install" || die |
157 |
+ |
158 |
+ insinto "${my_manpath}" |
159 |
+ doins -r "${WORKDIR}"/man/* |
160 |
+ # extend MANPATH, so the normal man command can find it |
161 |
+ # see bug 189639 |
162 |
+ newenvd - "90erlang" <<-_EOF_ |
163 |
+ MANPATH="${my_manpath}" |
164 |
+ _EOF_ |
165 |
+ |
166 |
+ if use emacs ; then |
167 |
+ elisp-install erlang lib/tools/emacs/*.{el,elc} |
168 |
+ sed -e "s:/usr/share:${EPREFIX}/usr/share:g" \ |
169 |
+ "${FILESDIR}/${SITEFILE}" > "${T}/${SITEFILE}" || die |
170 |
+ elisp-site-file-install "${T}/${SITEFILE}" |
171 |
+ fi |
172 |
+ |
173 |
+ newinitd "${FILESDIR}"/epmd.init-r2 epmd |
174 |
+ newconfd "${FILESDIR}"/epmd.confd-r2 epmd |
175 |
+ use systemd && systemd_newunit "${FILESDIR}"/epmd.service-r1 epmd.service |
176 |
+} |
177 |
+ |
178 |
+pkg_postinst() { |
179 |
+ use emacs && elisp-site-regen |
180 |
+} |
181 |
+ |
182 |
+pkg_postrm() { |
183 |
+ use emacs && elisp-site-regen |
184 |
+} |