Gentoo Archives: gentoo-commits

From: Matthias Maier <tamiko@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lang/julia/
Date: Tue, 04 Sep 2018 01:20:20
Message-Id: 1536023994.996ebaf4e9cd229aca6d46af7f2ea8a01322e3d9.tamiko@gentoo
1 commit: 996ebaf4e9cd229aca6d46af7f2ea8a01322e3d9
2 Author: Matthias Maier <tamiko <AT> gentoo <DOT> org>
3 AuthorDate: Tue Sep 4 01:03:45 2018 +0000
4 Commit: Matthias Maier <tamiko <AT> gentoo <DOT> org>
5 CommitDate: Tue Sep 4 01:19:54 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=996ebaf4
7
8 dev-lang/julia: add version 0.7
9
10 Package-Manager: Portage-2.3.48, Repoman-2.3.10
11
12 dev-lang/julia/Manifest | 1 +
13 dev-lang/julia/julia-0.7.0.ebuild | 201 ++++++++++++++++++++++++++++++++++++++
14 2 files changed, 202 insertions(+)
15
16 diff --git a/dev-lang/julia/Manifest b/dev-lang/julia/Manifest
17 index 04afe500355..7b1c97da219 100644
18 --- a/dev-lang/julia/Manifest
19 +++ b/dev-lang/julia/Manifest
20 @@ -1,5 +1,6 @@
21 DIST julia-0.6.3-bundled.tar.gz 2099258 BLAKE2B dea1f5d37477e0a612e3901d7d568e8c4b350496f9d2b344cd7e2c2043ae30b4dd26b567803a2cb96d1ec4dbe2ba514fb08b925c695589746691887334330dd2 SHA512 d04cd55ba0dde08f253db3a388cf5ebe87cec8ae321a5af4c1c92f2680aa6e6ef2ebfa771ec74f8f1ff96409e2c0645476acf577859e8718eac4a581f097639d
22 DIST julia-0.6.3.tar.gz 5542642 BLAKE2B cccd1ee2eb4d9f59382a0d1f6466e77c84b0542456c405c05b718bc8a39ff537a09760a523ee572fc9eee6797158aa00010fc4c931a80deac645fb1e45061c87 SHA512 f529bb30a17989234061cf4c3d87aecc6da720eb494efaca7be4ec1ed5eda60d440896fb76a45b6cb30205030256e7de765e8944f873b31d96f7c9ecac542db8
23 +DIST julia-0.7.0.tar.gz 7547849 BLAKE2B 6721e980a5fd84f1a28838a91acdd95e8562dd971903e30776dfb90a6cc0ac1ffbedd22c2bfee45bd2fa616adead82680ebe30f9b86a1d968db2353233b32bc2 SHA512 296dbc71fe5238b0cbdc5c67f7002fbf05abea85dc4298784d74fbfef1c96890ab9cc1bbe874337c01f39ca08a6022f6abcde3a5e2ff1cdc25f2f7493ead1804
24 DIST julia-1.0.0.tar.gz 7378753 BLAKE2B 1fcf3a63b00b6a49a86ca69b6ee809a28c828287c739405ae180e96645d565de0941b049d319f82f60e1ee63ee89629be213ecb22ab1ea901b306d1e149fa861 SHA512 5a53b16a1ab57cdffa5dadf11e78c413ed9f18af23ae90b64dee8323c2fc9bd6e6918b341f48accbcb7a6eab559811c80d72ac3ac0576c7cf6c9c9057356f6ba
25 DIST julia-dsfmt-2.2.3.tar.gz 291773 BLAKE2B 6ffae90494d72527920c80fc0fb005da1c7b84f8a03a7ecb0789434c0fff97359e5098e85431896dffccc7d5148c414e847aaba5feef648b8788421a466ff65e SHA512 6d8ddcd01aab3f9039f4f0288a8af53e290cc2f293ed8c4a8c9f3b3f12398e7eedfce8016117b425766ba89c61c86c13b3e420035b5f9bf91315b8b814c03662
26 DIST julia-libuv-ed3700c849289ed01fe04273a7bf865340b2bd7e.tar.gz 1492695 BLAKE2B ad03512dd1db2c7066b46b5a3a314645b925481d8ace09ac0a0ae23cf5b8a64338ad457f8df229aa82f1d45605b5366883f563f2e22756ce28bb6fb7607d7124 SHA512 1305035b1372bdf234e3c5e673ee4c8ab5bda83ff06bc27704786def52667c3143fe587fca8f6e0855ba0c8b6d4dd90b2faefd33736224173f459d751885683e
27
28 diff --git a/dev-lang/julia/julia-0.7.0.ebuild b/dev-lang/julia/julia-0.7.0.ebuild
29 new file mode 100644
30 index 00000000000..f7b451ce750
31 --- /dev/null
32 +++ b/dev-lang/julia/julia-0.7.0.ebuild
33 @@ -0,0 +1,201 @@
34 +# Copyright 1999-2018 Gentoo Foundation
35 +# Distributed under the terms of the GNU General Public License v2
36 +
37 +EAPI=6
38 +
39 +RESTRICT="test"
40 +
41 +inherit llvm pax-utils toolchain-funcs
42 +
43 +MY_LIBUV_V="ed3700c849289ed01fe04273a7bf865340b2bd7e"
44 +MY_UTF8PROC_V="97ef668b312b96382714dbb8eaac4affce0816e6"
45 +MY_LIBWHICH_V="81e9723c0273d78493dc8c8ed570f68d9ce7e89e"
46 +MY_DSFMT_V="2.2.3"
47 +
48 +DESCRIPTION="High-performance programming language for technical computing"
49 +HOMEPAGE="https://julialang.org/"
50 +SRC_URI="
51 + https://github.com/JuliaLang/${PN}/releases/download/v${PV}/${P}.tar.gz
52 + https://api.github.com/repos/JuliaLang/libuv/tarball/${MY_LIBUV_V} -> ${PN}-libuv-${MY_LIBUV_V}.tar.gz
53 + https://api.github.com/repos/JuliaLang/utf8proc/tarball/${MY_UTF8PROC_V} -> ${PN}-utf8proc-${MY_UTF8PROC_V}.tar.gz
54 + https://api.github.com/repos/vtjnash/libwhich/tarball/${MY_LIBWHICH_V} -> ${PN}-libwhich-${MY_LIBWHICH_V}.tar.gz
55 + http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/dSFMT-src-${MY_DSFMT_V}.tar.gz -> ${PN}-dsfmt-${MY_DSFMT_V}.tar.gz
56 +"
57 +
58 +S="${WORKDIR}/${PN}"
59 +
60 +LICENSE="MIT"
61 +SLOT="0"
62 +KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
63 +IUSE=""
64 +
65 +# julia 0.7* needs a patched llvm-6
66 +RDEPEND="
67 + =sys-devel/llvm-6*:=
68 + =sys-devel/clang-6*:="
69 +LLVM_MAX_SLOT=6
70 +
71 +RDEPEND+="
72 + dev-libs/double-conversion:0=
73 + dev-libs/gmp:0=
74 + dev-libs/libgit2:0=
75 + >=dev-libs/libpcre2-10.23:0=[jit]
76 + dev-libs/mpfr:0=
77 + dev-libs/openspecfun
78 + sci-libs/amd:0=
79 + sci-libs/arpack:0=
80 + sci-libs/camd:0=
81 + sci-libs/ccolamd:0=
82 + sci-libs/cholmod:0=
83 + sci-libs/colamd:0=
84 + sci-libs/fftw:3.0=[threads]
85 + sci-libs/openlibm:0=
86 + sci-libs/spqr:0=
87 + sci-libs/umfpack:0=
88 + sci-mathematics/glpk:0=
89 + >=sys-libs/libunwind-1.1:7=
90 + sys-libs/readline:0=
91 + sys-libs/zlib:0=
92 + >=virtual/blas-3.6
93 + virtual/lapack"
94 +
95 +DEPEND="${RDEPEND}
96 + dev-vcs/git
97 + dev-util/patchelf
98 + virtual/pkgconfig"
99 +
100 +PATCHES=(
101 + "${FILESDIR}"/${PN}-1.0.0-fix_build_system.patch
102 +)
103 +
104 +src_unpack() {
105 + tounpack=(${A})
106 + # the main source tree, followed by deps
107 + unpack "${A/%\ */}"
108 +
109 + mkdir -p "${S}/deps/srccache/"
110 + for i in "${tounpack[@]:1}"; do
111 + cp "${DISTDIR}/${i}" "${S}/deps/srccache/${i#julia-}" || die
112 + done
113 +}
114 +
115 +src_prepare() {
116 + default
117 +
118 + # Sledgehammer:
119 + # - prevent fetching of bundled stuff in compile and install phase
120 + # - respect CFLAGS
121 + # - respect EPREFIX and Gentoo specific paths
122 + # - fix BLAS and LAPACK link interface
123 +
124 + sed -i \
125 + -e 's|git submodule|${EPREFIX}/bin/true|g' \
126 + -e "s|GENTOOCFLAGS|${CFLAGS}|g" \
127 + -e "s|/usr/include|${EPREFIX%/}/usr/include|g" \
128 + deps/Makefile || die
129 +
130 + local libblas="$($(tc-getPKG_CONFIG) --libs-only-l blas)"
131 + libblas="${libblas%% *}"
132 + libblas="lib${libblas#-l}"
133 + local liblapack="$($(tc-getPKG_CONFIG) --libs-only-l lapack)"
134 + liblapack="${liblapack%% *}"
135 + liblapack="lib${liblapack#-l}"
136 +
137 + sed -i \
138 + -e "s|GENTOOCFLAGS|${CFLAGS}|g" \
139 + -e "s|GENTOOLIBDIR|$(get_libdir)|" \
140 + -e "s|^JULIA_COMMIT = .*|JULIA_COMMIT = v${PV}|" \
141 + -e "s|-lblas|$($(tc-getPKG_CONFIG) --libs blas)|" \
142 + -e "s|= libblas|= ${libblas}|" \
143 + -e "s|-llapack|$($(tc-getPKG_CONFIG) --libs lapack)|" \
144 + -e "s|= liblapack|= ${liblapack}|" \
145 + Make.inc || die
146 +
147 + sed -i \
148 + -e "s|,lib)|,$(get_libdir))|g" \
149 + -e "s|\$(BUILD)/lib|\$(BUILD)/$(get_libdir)|g" \
150 + Makefile || die
151 +
152 + sed -i \
153 + -e "s|ar -rcs|$(tc-getAR) -rcs|g" \
154 + src/Makefile || die
155 +
156 + # disable doc install starting git fetching
157 + sed -i -e 's~install: $(build_depsbindir)/stringreplace $(BUILDROOT)/doc/_build/html/en/index.html~install: $(build_depsbindir)/stringreplace~' Makefile || die
158 +}
159 +
160 +src_configure() {
161 + # julia does not play well with the system versions of dsfmt, libuv,
162 + # and utf8proc
163 +
164 + # USE_SYSTEM_LIBM=0 implies using external openlibm
165 + cat <<-EOF > Make.user
166 + USE_SYSTEM_ARPACK:=1
167 + USE_SYSTEM_BLAS:=1
168 + USE_SYSTEM_DSFMT:=0
169 + USE_SYSTEM_GMP:=1
170 + USE_SYSTEM_GRISU:=1
171 + USE_SYSTEM_LAPACK:=1
172 + USE_SYSTEM_LIBGIT2:=1
173 + USE_SYSTEM_LIBM:=0
174 + USE_SYSTEM_LIBUNWIND:=1
175 + USE_SYSTEM_LIBUV:=0
176 + USE_SYSTEM_LLVM:=1
177 + USE_LLVM_SHLIB:=1
178 + USE_SYSTEM_MPFR:=1
179 + USE_SYSTEM_OPENLIBM:=1
180 + USE_SYSTEM_OPENSPECFUN:=1
181 + USE_SYSTEM_PATCHELF:=1
182 + USE_SYSTEM_PCRE:=1
183 + USE_SYSTEM_READLINE:=1
184 + USE_SYSTEM_RMATH:=0
185 + USE_SYSTEM_SUITESPARSE:=1
186 + USE_SYSTEM_UTF8PROC:=0
187 + USE_SYSTEM_ZLIB=1
188 + VERBOSE=1
189 + libdir="${EROOT}/usr/$(get_libdir)"
190 + EOF
191 +
192 +}
193 +
194 +src_compile() {
195 +
196 + # Julia accesses /proc/self/mem on Linux
197 + addpredict /proc/self/mem
198 +
199 + emake cleanall
200 + emake julia-release \
201 + prefix="${EPREFIX}/usr" DESTDIR="${D}" \
202 + CC="$(tc-getCC)" CXX="$(tc-getCXX)"
203 + pax-mark m $(file usr/bin/julia-* | awk -F : '/ELF/ {print $1}')
204 + emake
205 +}
206 +
207 +src_test() {
208 + emake test
209 +}
210 +
211 +src_install() {
212 + # Julia is special. It tries to find a valid git repository (that would
213 + # normally be cloned during compilation/installation). Just make it
214 + # happy...
215 + git init && \
216 + git config --local user.email "whatyoudoing@×××××××.com" && \
217 + git config --local user.name "Whyyyyyy" && \
218 + git commit -a --allow-empty -m "initial" || die "git failed"
219 +
220 + emake install \
221 + prefix="${EPREFIX}/usr" DESTDIR="${D}" \
222 + CC="$(tc-getCC)" CXX="$(tc-getCXX)"
223 + cat > 99julia <<-EOF
224 + LDPATH=${EROOT%/}/usr/$(get_libdir)/julia
225 + EOF
226 + doenvd 99julia
227 +
228 + dodoc README.md
229 +
230 + mv "${ED}"/usr/etc/julia "${ED}"/etc || die
231 + rmdir "${ED}"/usr/etc || die
232 + mv "${ED}"/usr/share/doc/julia/html "${ED}"/usr/share/doc/${PF} || die
233 + rmdir "${ED}"/usr/share/doc/julia || die
234 +}