void-packages/srcpkgs/julia/template
2021-03-31 15:31:03 -04:00

110 lines
3.6 KiB
Bash

# Template file for 'julia'
pkgname=julia
version=1.6.0
revision=1
archs="i686* x86_64* armv7l* aarch64*"
build_style=gnu-makefile
make_build_args="prefix=/usr sysconfdir=/etc datarootdir=/usr/share
USE_BINARYBUILDER=0 USE_SYSTEM_LIBM=0 USE_SYSTEM_DSFMT=0 USE_SYSTEM_LIBUV=0
USE_SYSTEM_SUITESPARSE=0 USE_SYSTEM_BLAS=0 USE_SYSTEM_LAPACK=0 USE_SYSTEM_LLVM=1
USE_SYSTEM_LIBUNWIND=1 USE_SYSTEM_PCRE=1 USE_SYSTEM_GMP=1 USE_SYSTEM_PATCHELF=1
USE_SYSTEM_MPFR=1 USE_SYSTEM_MBEDTLS=1 USE_SYSTEM_LIBSSH2=1 USE_SYSTEM_NGHTTP2=1
USE_SYSTEM_CURL=1 USE_SYSTEM_ZLIB=1 USE_SYSTEM_P7ZIP=1 USE_SYSTEM_LIBGIT2=1
USE_SYSTEM_UTF8PROC=1
UTF8PROC_INC='${XBPS_CROSS_BASE}/usr/include/libutf8proc'"
make_install_args="$make_build_args"
make_check_args="$make_build_args"
make_check_target=testall
conf_files="/etc/julia/startup.jl"
hostmakedepends="pkg-config perl cmake python gcc-fortran patchelf which tar xz"
makedepends="p7zip pcre2-devel mpfr-devel libgit2-devel libcurl-devel nghttp2-devel
libssh2-devel mbedtls-devel libatomic-devel zlib-devel libunwind-devel
libutf8proc-devel llvm11"
# Julia provides vendored symlinks in /usr/lib/julia pointing to these libraries,
# but none of the julia executables link to them so these are not auto-detected
depends="libgit2 libcurl mpfr mbedtls libatomic libpcre2 libssh2 nghttp2 libquadmath libssp p7zip"
short_desc="High-level, high-performance dynamic programming language"
maintainer="Adam Beckmeyer <adam_git@thebeckmeyers.xyz>"
license="MIT"
homepage="https://julialang.org"
distfiles="https://github.com/JuliaLang/julia/releases/download/v${version}/julia-${version}-full.tar.gz"
checksum=1b05f42c9368bc2349c47363b7ddc175a2da3cd162d52b6e24c4f5d4d6e1232c
nocross="build system is a mess"
# Targets for the vendored symlinks mentioned above
shlib_requires="libgit2.so.1.0 libcurl.so.4 libmpfr.so.6 libgmp.so.10
libmbedcrypto.so.3 libmbedtls.so.12 libmbedx509.so.0 libpcre2-8.so.0
libssh2.so.1 libquadmath.so.0 libnghttp2.so.14 libatomic.so.1 libssp.so.0"
case "$XBPS_TARGET_MACHINE" in
i686*)
export M="pentium4"
export CFLAGS="-march=pentium4"
export CXXFLAGS="-march=pentium4"
export LDFLAGS="-Wl,--no-keep-memory"
make_build_args+=" MARCH=pentium4 OPENBLAS_USE_THREAD=0"
broken="https://build.voidlinux.org/builders/i686_builder/builds/31520/steps/shell_3/logs/stdio"
;;
x86_64*)
export M="x86-64"
export CFLAGS="-march=x86-64"
export CXXFLAGS="-march=x86-64"
make_build_args+=" MARCH=x86-64"
;;
armv7l*)
export M="armv7-a"
export CFLAGS="-march=armv7-a"
export CXXFLAGS="-march=armv7-a"
make_build_args+=" MARCH=armv7-a"
;;
aarch64*)
export M="armv8-a"
export CFLAGS="-march=armv8-a"
export CXXFLAGS="-march=armv8-a"
make_build_args+=" MARCH=armv8-a"
;;
esac
case "$XBPS_TARGET_MACHINE" in
i686-musl|ppc*-musl)
makedepends+=" libucontext-devel"
;;
esac
post_extract() {
vsed -i '/^install:/s| \$(BUILDROOT)/doc.*||' Makefile
case "$XBPS_TARGET_MACHINE" in
i686-musl|ppc*-musl)
# Make.inc does not use pkg-config libunwind.pc
vsed -i 's;-lunwind;& -lucontext;' Make.inc
esac
}
post_install() {
vlicense LICENSE.md
# julia needlessly copies system libraries into a vendor directory
local _lib
for _lib in libgcc_s.so.1 libgfortran.so.5 libquadmath.so.0 libatomic.so.1 libstdc++.so.6 libssp.so.0; do
rm "${DESTDIR}/usr/lib/julia/${_lib}"
ln -s "/usr/lib/${_lib}" "${DESTDIR}/usr/lib/julia"
done
}
julia-devel_package() {
depends="${sourcepkg}>=${version}_${revision}"
short_desc+=" - development files"
pkg_install() {
vmove usr/include
}
}
julia-doc_package() {
depends="${sourcepkg}>=${version}_${revision}"
short_desc+=" - documentation files"
pkg_install() {
vmove usr/share/doc
}
}