Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lang/julia/
Date: Sat, 25 Sep 2021 02:58:57
Message-Id: 1632538712.4d7d331f387dfcf804dc7d7915d57ec582af2312.sam@gentoo
1 commit: 4d7d331f387dfcf804dc7d7915d57ec582af2312
2 Author: Alessandro Barbieri <lssndrbarbieri <AT> gmail <DOT> com>
3 AuthorDate: Wed Apr 21 00:40:14 2021 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Sat Sep 25 02:58:32 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4d7d331f
7
8 dev-lang/julia: julia doesn't work if cjk is in utf8proc
9
10 Closes: https://bugs.gentoo.org/782919
11 Package-Manager: Portage-3.0.18, Repoman-3.0.3
12 Signed-off-by: Alessandro Barbieri <lssndrbarbieri <AT> gmail.com>
13 Closes: https://github.com/gentoo/gentoo/pull/20479
14 Signed-off-by: Sam James <sam <AT> gentoo.org>
15
16 dev-lang/julia/julia-1.6.0-r1.ebuild | 177 +++++++++++++++++++++++++++++++++++
17 1 file changed, 177 insertions(+)
18
19 diff --git a/dev-lang/julia/julia-1.6.0-r1.ebuild b/dev-lang/julia/julia-1.6.0-r1.ebuild
20 new file mode 100644
21 index 00000000000..15b9d0a0324
22 --- /dev/null
23 +++ b/dev-lang/julia/julia-1.6.0-r1.ebuild
24 @@ -0,0 +1,177 @@
25 +# Copyright 1999-2021 Gentoo Authors
26 +# Distributed under the terms of the GNU General Public License v2
27 +
28 +EAPI=7
29 +
30 +inherit llvm pax-utils toolchain-funcs
31 +
32 +# correct versions for stdlibs are in deps/checksums
33 +# for everything else, run with network-sandbox and wait for the crash
34 +
35 +MY_LIBUV_V="fb3e3364c33ae48c827f6b103e05c3f0e78b79a9"
36 +MY_LIBWHICH_V="81e9723c0273d78493dc8c8ed570f68d9ce7e89e"
37 +MY_LLVM_V="11.0.1"
38 +
39 +DESCRIPTION="High-performance programming language for technical computing"
40 +HOMEPAGE="https://julialang.org/"
41 +
42 +SRC_URI="
43 + https://github.com/JuliaLang/julia/releases/download/v${PV}/${P}.tar.gz
44 + https://api.github.com/repos/JuliaLang/libuv/tarball/${MY_LIBUV_V} -> ${PN}-libuv-${MY_LIBUV_V}.tar.gz
45 + https://api.github.com/repos/vtjnash/libwhich/tarball/${MY_LIBWHICH_V} -> ${PN}-libwhich-${MY_LIBWHICH_V}.tar.gz
46 + !system-llvm? ( https://github.com/llvm/llvm-project/releases/download/llvmorg-${MY_LLVM_V}/llvm-${MY_LLVM_V}.src.tar.xz )
47 +"
48 +
49 +LICENSE="MIT"
50 +SLOT="0"
51 +KEYWORDS="~amd64 ~x86"
52 +IUSE="+system-llvm"
53 +
54 +RDEPEND="
55 + system-llvm? ( sys-devel/llvm:11=[llvm_targets_NVPTX(-)] )
56 +"
57 +LLVM_MAX_SLOT=11
58 +
59 +RDEPEND+="
60 + app-arch/p7zip
61 + dev-libs/gmp:0=
62 + dev-libs/libgit2:0
63 + >=dev-libs/libpcre2-10.23:0=[jit,unicode]
64 + dev-libs/mpfr:0=
65 + dev-libs/libutf8proc:0=[-cjk]
66 + dev-util/patchelf
67 + >=net-libs/mbedtls-2.2
68 + net-misc/curl[http2,ssh]
69 + sci-libs/amd:0=
70 + sci-libs/arpack:0=
71 + sci-libs/camd:0=
72 + sci-libs/ccolamd:0=
73 + sci-libs/cholmod:0=
74 + sci-libs/colamd:0=
75 + sci-libs/fftw:3.0=[threads]
76 + sci-libs/openlibm:0=
77 + sci-libs/spqr:0=
78 + sci-libs/umfpack:0=
79 + >=sci-mathematics/dsfmt-2.2.4
80 + >=sys-libs/libunwind-1.1:0=
81 + sys-libs/zlib:0=
82 + >=virtual/blas-3.6
83 + virtual/lapack"
84 +
85 +DEPEND="${RDEPEND}
86 + dev-util/patchelf
87 + virtual/pkgconfig
88 + !system-llvm? ( dev-util/cmake )"
89 +
90 +PATCHES=(
91 + "${FILESDIR}/${PN}"-1.1.0-fix_llvm_install.patch
92 + "${FILESDIR}/${PN}"-1.4.0-no_symlink_llvm.patch
93 + "${FILESDIR}/${PN}"-1.6.0-fix-system-csl.patch
94 +)
95 +
96 +pkg_setup() {
97 + use system-llvm && llvm_pkg_setup
98 +}
99 +
100 +src_unpack() {
101 + local tounpack=(${A})
102 + # the main source tree, followed by deps
103 + unpack "${tounpack[0]}"
104 +
105 + mkdir -p "${S}/deps/srccache/"
106 + for i in "${tounpack[@]:1}"; do
107 + cp "${DISTDIR}/${i}" "${S}/deps/srccache/${i#julia-}" || die
108 + done
109 +}
110 +
111 +src_prepare() {
112 + default
113 +
114 + # Sledgehammer:
115 + # - prevent fetching of bundled stuff in compile and install phase
116 + # - respect CFLAGS
117 + # - respect EPREFIX and Gentoo specific paths
118 +
119 + sed -i \
120 + -e "\|SHIPFLAGS :=|c\\SHIPFLAGS := ${CFLAGS}" \
121 + Make.inc || die
122 +
123 + sed -i \
124 + -e "s|ar -rcs|$(tc-getAR) -rcs|g" \
125 + src/Makefile || die
126 +
127 + # disable doc install starting git fetching
128 + sed -i -e 's~install: $(build_depsbindir)/stringreplace $(BUILDROOT)/doc/_build/html/en/index.html~install: $(build_depsbindir)/stringreplace~' Makefile || die
129 +}
130 +
131 +src_configure() {
132 + use system-llvm && ewarn "You have enabled system-llvm. This is unsupported by upstream and may not work."
133 +
134 + # julia does not play well with the system versions of libuv
135 + # USE_SYSTEM_LIBM=0 implies using external openlibm
136 + cat <<-EOF > Make.user
137 + LOCALBASE:="${EPREFIX}/usr"
138 + override prefix:="${EPREFIX}/usr"
139 + override libdir:="\$(prefix)/$(get_libdir)"
140 + override CC:=$(tc-getCC)
141 + override CXX:=$(tc-getCXX)
142 + override AR:=$(tc-getAR)
143 +
144 + BUNDLE_DEBUG_LIBS:=0
145 + USE_BINARYBUILDER:=0
146 + USE_SYSTEM_CSL:=1
147 + USE_SYSTEM_LLVM:=$(usex system-llvm 1 0)
148 + USE_SYSTEM_LIBUNWIND:=1
149 + USE_SYSTEM_PCRE:=1
150 + USE_SYSTEM_LIBM:=0
151 + USE_SYSTEM_OPENLIBM:=1
152 + USE_SYSTEM_DSFMT:=1
153 + USE_SYSTEM_BLAS:=1
154 + USE_SYSTEM_LAPACK:=1
155 + USE_SYSTEM_GMP:=1
156 + USE_SYSTEM_MPFR:=1
157 + USE_SYSTEM_SUITESPARSE:=1
158 + USE_SYSTEM_LIBUV:=0
159 + USE_SYSTEM_UTF8PROC:=1
160 + USE_SYSTEM_MBEDTLS:=1
161 + USE_SYSTEM_LIBSSH2:=1
162 + USE_SYSTEM_NGHTTP2:=1
163 + USE_SYSTEM_CURL:=1
164 + USE_SYSTEM_LIBGIT2:=1
165 + USE_SYSTEM_PATCHELF:=1
166 + USE_SYSTEM_ZLIB:=1
167 + USE_SYSTEM_P7ZIP:=1
168 + VERBOSE:=1
169 + EOF
170 +}
171 +
172 +src_compile() {
173 + # Julia accesses /proc/self/mem on Linux
174 + addpredict /proc/self/mem
175 +
176 + default
177 + pax-mark m "$(file usr/bin/julia-* | awk -F : '/ELF/ {print $1}')"
178 +}
179 +
180 +src_install() {
181 + emake install DESTDIR="${D}"
182 +
183 + if ! use system-llvm ; then
184 + local llvmslot=$(ver_cut 1 ${MY_LLVM_V})
185 + cp "${S}/usr/lib/libLLVM-${llvmslot}jl.so" "${ED}/usr/$(get_libdir)/julia/" || die
186 + fi
187 +
188 + dodoc README.md
189 +
190 + mv "${ED}"/usr/etc/julia "${ED}"/etc || die
191 + rmdir "${ED}"/usr/etc || die
192 + mv "${ED}"/usr/share/doc/julia/html "${ED}"/usr/share/doc/"${PF}" || die
193 + rmdir "${ED}"/usr/share/doc/julia || die
194 +
195 + # The appdata directory is deprecated.
196 + mv "${ED}"/usr/share/{appdata,metainfo}/ || die
197 +}
198 +
199 +pkg_postinst() {
200 + elog "To use Plots, you will need to install sci-visualization/gr."
201 +}