2014-08-06 09:24:22 +02:00
#
# spec file for package julia
#
2022-07-05 14:30:51 +02:00
# Copyright (c) 2021 SUSE LLC
2014-08-06 09:24:22 +02:00
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
2022-07-05 14:30:51 +02:00
# Please submit bugfixes or comments via https://bugs.opensuse.org/
2014-08-06 09:24:22 +02:00
#
2022-07-05 14:30:51 +02:00
# We must not strip binaries in julia, since it can lead to many problems.
# For example, see:
#
# https://github.com/JuliaLang/julia/issues/17941
%undefine _build_create_debug
%define __arch_install_post export NO_BRP_STRIP_DEBUG=true
%global __provides_exclude_from ^%{_libdir} /%{name} /.*\\.so$
# List all bundled libraries.
%global _privatelibs lib(LLVM-.*|ccalltest|dSFMT|git2|llvmcalltest|openlibm|suitesparse_wrapper|mbedcrypto|mbedtls|mbedx509|uv)\\.so.*
%global __provides_exclude ^(%{_privatelibs})$
%global __requires_exclude ^(%{_privatelibs})$
%define libjulia_sover_major 1
%define libjulia_sover_minor 6
%if "@BUILD_FLAVOR@%{nil}" == "compat"
%define compat_mode 1
%else
%define compat_mode 0
%endif
Version : 1.6.3
2014-08-06 09:24:22 +02:00
Release : 0
2022-07-05 14:30:51 +02:00
URL : http://julialang.org/
Source0 : https://github.com/JuliaLang/julia/releases/download/v%{version} /julia-%{version} -full.tar.gz
Source1 : julia-rpmlintrc
Source99 : juliabuildopts
# PATCH-FIX-OPENSUSE julia-env-script-interpreter.patch ronisbr@gmail.com -- Change script interpreted to avoid errors in rpmlint.
Patch0 : julia-env-script-interpreter.patch
# PATCH-FIX-OPENSUSE julia-fix_doc_build.patch ronisbr@gmail.com -- Makefile is building the docs with `USE_SYSTEM_CSL=1` even if they are already available in the tarball.
Patch1 : julia-fix_doc_build.patch
# PATCH-FIX-UPSTREAM julia-fix-mbedtls-build-failure-gcc-11.patch ronisbr@gmail.com - Fix MBEDTLS building using GCC 11.
Patch2 : julia-fix-mbedtls-build-failure-gcc-11.patch
# PATCH-FIX-UPSTREAM julia-fix-task-build-failure-gcc-11.patch pandom79@gmail.com - Fix task.c building using GCC 11.
Patch3 : julia-fix-task-build-failure-gcc-11.patch
BuildRequires : arpack-ng-devel >= 3.3.0
2014-08-06 09:24:22 +02:00
BuildRequires : blas-devel
2022-07-05 14:30:51 +02:00
BuildRequires : cmake
2014-08-06 09:24:22 +02:00
BuildRequires : double-conversion-devel
BuildRequires : fdupes
2022-07-05 14:30:51 +02:00
BuildRequires : fftw3-threads-devel >= 3.3.4
2014-08-06 09:24:22 +02:00
BuildRequires : gcc-c++
BuildRequires : gcc-fortran
2022-07-05 14:30:51 +02:00
BuildRequires : gmp-devel >= 6.1.2
BuildRequires : hicolor-icon-theme
BuildRequires : lapack-devel >= 3.5.0
BuildRequires : libcurl-devel
BuildRequires : libnghttp2-devel
BuildRequires : libopenblas_openmp-devel >= 0.3.5
BuildRequires : libssh2-devel >= 1.9.0
BuildRequires : libunwind-devel >= 1.3.1
2014-08-06 09:24:22 +02:00
BuildRequires : m4
2022-07-05 14:30:51 +02:00
BuildRequires : mpfr-devel >= 4.0.2
2014-08-06 09:24:22 +02:00
BuildRequires : ncurses-devel
BuildRequires : openspecfun-devel
2022-07-05 14:30:51 +02:00
BuildRequires : openssl
BuildRequires : patchelf >= 0.9
BuildRequires : pcre2-devel >= 10.31
2014-08-06 09:24:22 +02:00
BuildRequires : perl
2022-07-05 14:30:51 +02:00
BuildRequires : python >= 2.5
2014-08-06 09:24:22 +02:00
BuildRequires : readline-devel
2022-07-05 14:30:51 +02:00
BuildRequires : suitesparse-devel >= 5.4.0
BuildRequires : update-desktop-files
BuildRequires : zlib-devel >= 1.2.11
Requires : libamd2
Requires : libarpack2
Requires : libcamd2
Requires : libccolamd2
Requires : libcholmod3
Requires : libcolamd2
Requires : libfftw3_threads3
Requires : libgmp10
Requires : libmpfr6
Requires : libopenblas_openmp0 >= 0.3.5
Requires : libpcre2-8-0
Requires : libspqr2
Requires : libsuitesparseconfig5
Requires : libumfpack5
2014-08-06 09:24:22 +02:00
Requires : ncurses
2022-07-05 14:30:51 +02:00
Requires : p7zip >= 16
2014-08-06 09:24:22 +02:00
Requires : readline
2022-07-05 14:30:51 +02:00
Recommends: arpack-ng-devel
2014-08-06 09:24:22 +02:00
Recommends: git
Recommends: gmp-devel
Recommends: mpfr-devel
Recommends: openspecfun-devel
2022-07-05 14:30:51 +02:00
Recommends: pcre2-devel
2014-08-06 09:24:22 +02:00
Recommends: suitesparse-devel
2022-07-05 14:30:51 +02:00
%if 0%{?compat_mode} == 0
Name : julia
%else
Name : julia-compat
%endif
%if 0%{?compat_mode} == 0
Summary : High-level, high-performance dynamic programming language
License : BSD-3-Clause AND GPL-2.0-or-later AND MIT AND Zlib
Group : Development/Languages/Other
%else
Summary : High-level, high-performance dynamic programming language (without CPU optim.)
License : BSD-3-Clause AND GPL-2.0-or-later AND MIT AND Zlib
Group : Development/Languages/Other
%endif
%if 0%{?compat_mode}
Conflicts : julia
Provides : julia = %{version}
%endif
# Since the 32-bit julia package is already being built using MARCH=pentium4,
# which is the most generic flag supported, then the julia-compat mode only
# makes sense for 64-bit architectures.
%if 0%{?compat_mode}
ExclusiveArch : x86_64
%else
ExclusiveArch : %{ix86} x86_64 %{arm} aarch64 ppc64le
%endif
2014-08-06 09:24:22 +02:00
%description
Julia is a high-level, high-performance dynamic programming language for
technical computing, with syntax that is familiar to users of other technical
computing environments. It provides a sophisticated compiler, distributed
parallel execution, numerical accuracy, and an extensive mathematical function
library. The library, largely written in Julia itself, also integrates mature,
best-of-breed C and Fortran libraries for linear algebra, random number
generation, signal processing, and string processing.
%package devel
Summary : Julia development, debugging and testing files
Group : Development/Languages/Other
Requires : %{name} = %{version}
2022-07-05 14:30:51 +02:00
%if 0%{?compat_mode}
Conflicts : julia-devel
%endif
2014-08-06 09:24:22 +02:00
%description devel
Contains library symbolic links and header files for developing applications
linking to the Julia library, in particular embedding it, as well as tests and a
debugging version of Julia. This package is normally not needed when programming
in the Julia language, but rather for embedding Julia into external programs or
debugging Julia itself.
2022-07-05 14:30:51 +02:00
%package debug
Summary : Julia debugging
Group : Development/Languages/Other
Requires : %{name} = %{version}
%if 0%{?compat_mode}
Conflicts : julia-debug
%endif
%description debug
Contains a debugging version of Julia system image and Julia library.
%if 0%{?compat_mode} == 0
2014-08-06 09:24:22 +02:00
%package doc
Summary : Julia documentation and code examples
Group : Documentation/Other
BuildArch : noarch
%description doc
Contains the Julia manual, the reference documentation of the standard library.
2022-07-05 14:30:51 +02:00
%endif
2014-08-06 09:24:22 +02:00
2022-07-05 14:30:51 +02:00
%{expand:%global juliabuildopts %(cat %{SOURCE99} )}
2014-08-06 09:24:22 +02:00
%prep
2014-08-21 07:42:58 +02:00
%setup -q -n julia-%{version}
2022-07-05 14:30:51 +02:00
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%ifarch aarch64 %{arm}
# https://github.com/JuliaLang/julia/issues/41613#issuecomment-976535193
sed -i 's#$(eval $(call symlink_system_library,CSL,libquadmath,0))##' base/Makefile
%endif
2014-08-06 09:24:22 +02:00
# remove .gitignore
find . -name " . g i t * " -exec rm {} \;
%build
2022-07-05 14:30:51 +02:00
%if 0%{?compat_mode} == 0
%ifarch x86_64
%define julia_march core2
%endif
%ifarch %{ix86}
%define julia_march pentium4
%endif
%ifarch aarch64
%define julia_march armv8-a
%endif
%ifarch armv7l armv7hl
%define julia_march armv7-a
%endif
%ifarch armv6l armv6hl
%define julia_march armv6
%endif
%ifarch ppc64le
%define julia_march ppc64le
%endif
%else
# compat_mode is only defined for 64-bit architecture.
%define julia_march x86-64
%endif
%ifarch armv6l armv6hl
export LDFLAGS=" $ L D F L A G S - l a t o m i c "
%endif
# We need these compilation flags to avoid error when building MBEDTLS with
# GCC-11.
# Ref.: https://build.opensuse.org/package/show/security:tls/mbedtls
export CFLAGS=" %{optflags} - W n o - s t r i n g o p - o v e r f l o w - W n o - m a y b e - u n i n i t i a l i z e d "
export CXXLAGS=" %{optflags} - W n o - s t r i n g o p - o v e r f l o w - W n o - m a y b e - u n i n i t i a l i z e d "
%define julia_builddir %{_builddir}/%{name}/
make %{?_smp_mflags} \
MARCH=%{julia_march} \
%ifarch aarch64
JULIA_CPU_TARGET=" g e n e r i c " \
%endif
prefix=%{_prefix} \
bindir=%{_bindir} \
libdir=%{_libdir} \
libexecdir=%{_libexecdir} \
datarootdir=%{_datarootdir} \
includedir=%{_includedir} \
sysconfdir=%{_sysconfdir} \
%{juliabuildopts} \
release debug
%check
# The tests will only pass if openblas is being used.
# make %{?_smp_mflags} test
2014-08-06 09:24:22 +02:00
%install
make install DESTDIR=%{buildroot} \
2022-07-05 14:30:51 +02:00
MARCH=%{julia_march} \
%ifarch aarch64
JULIA_CPU_TARGET=" g e n e r i c " \
%endif
2014-08-06 09:24:22 +02:00
prefix=%{_prefix} \
2022-07-05 14:30:51 +02:00
bindir=%{_bindir} \
2014-08-06 09:24:22 +02:00
libdir=%{_libdir} \
2022-07-05 14:30:51 +02:00
libexecdir=%{_libexecdir} \
datarootdir=%{_datarootdir} \
includedir=%{_includedir} \
2014-08-06 09:24:22 +02:00
sysconfdir=%{_sysconfdir} \
%{juliabuildopts}
# GZip man page.
gzip %{buildroot} /%{_mandir} /man1/julia.1
# Copy the man page for every executable.
cd %{buildroot} /%{_mandir} /man1/
ln -sf julia.1.gz julia-debug.1.gz
2014-08-25 16:21:44 +02:00
rm -f %{buildroot} %{_libdir} /julia/libuv.a
rm -f %{buildroot} %{_datadir} /julia/base/build.h
rm -f %{buildroot} %{_datadir} /julia/base/Makefile
2022-07-05 14:30:51 +02:00
# Fix documentation directories.
mkdir -p %{buildroot} %{_docdir} /julia
mv -f %{buildroot} %{_datadir} /doc/julia/* %{buildroot} %{_docdir} /julia/
rm -r %{buildroot} %{_datadir} /doc/julia
# Remove execution permission on documentation files.
chmod -x+X -R %{buildroot} %{_docdir} /julia/*
# Remove hidden files from stdlib.
pushd %{buildroot} %{_datadir} /julia/stdlib/
find . -name " . c o d e c o v . y m l " -exec rm -rf {} \;
find . -name " . g i t i g n o r e " -exec rm -rf {} \;
find . -name " . t r a v i s . y m l " -exec rm -rf {} \;
popd
%if 0%{?compat_mode}
rm -rf %{buildroot} %{_docdir} /julia/
# The 'application' object must be only provided by one package
# Alternatively, we could rename the .appdata and .desktop file to have
# both applications show up in a valid way, but that would require the
# -compat appdata to be modified to make the difference clear
rm %{buildroot} %{_datadir} /appdata/julia.appdata.xml
%endif
# Remove duplicated files.
%fdupes %{buildroot} %{_datadir} /
2014-08-06 09:24:22 +02:00
2022-07-05 14:30:51 +02:00
%suse_update_desktop_file -r julia Science Math
2014-08-06 09:24:22 +02:00
2022-07-05 14:30:51 +02:00
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%post devel -p /sbin/ldconfig
2014-08-06 09:24:22 +02:00
%postun devel -p /sbin/ldconfig
2022-07-05 14:30:51 +02:00
%post debug -p /sbin/ldconfig
%postun debug -p /sbin/ldconfig
2014-08-06 09:24:22 +02:00
%files
2022-07-05 14:30:51 +02:00
%doc CONTRIBUTING.md NEWS.md README.md
%license LICENSE.md
2014-08-06 09:24:22 +02:00
%{_bindir} /julia
%dir %{_datadir} /julia
%{_datadir} /julia/base
2022-07-05 14:30:51 +02:00
%{_datadir} /julia/base.cache
%{_datadir} /julia/stdlib
%{_datadir} /julia/cert.pem
%if !%{?compat_mode}
%dir %{_datadir} /appdata/
%{_datadir} /appdata/julia.appdata.xml
%endif
%{_datadir} /applications/julia.desktop
%{_libdir} /julia/
%{_libdir} /libjulia.so.%{libjulia_sover_major} .%{libjulia_sover_minor}
%{_mandir} /man1/julia.1%{?ext_man}
2014-08-06 09:24:22 +02:00
%dir %{_sysconfdir} /julia/
2022-07-05 14:30:51 +02:00
%config (noreplace) %{_sysconfdir} /julia/startup.jl
# Exclude debugging files.
%exclude %{_libdir} /julia/libccalltest.so.debug
%exclude %{_libdir} /julia/sys-debug.so
# Exclude documentation.
%exclude %{_docdir} /julia/html
2014-08-06 09:24:22 +02:00
%files devel
%{_datadir} /julia/test/
2022-07-05 14:30:51 +02:00
%{_datadir} /julia/julia-config.jl
2014-08-06 09:24:22 +02:00
%{_includedir} /julia/
2022-07-05 14:30:51 +02:00
%{_libdir} /libjulia.so.%{libjulia_sover_major}
2014-08-06 09:24:22 +02:00
%{_libdir} /libjulia.so
2022-07-05 14:30:51 +02:00
%files debug
%{_bindir} /julia-debug
%{_libdir} /libjulia-debug.so.%{libjulia_sover_major} .%{libjulia_sover_minor}
%{_libdir} /libjulia-debug.so.%{libjulia_sover_major}
%{_libdir} /libjulia-debug.so
%{_libdir} /julia/libccalltest.so.debug
%{_libdir} /julia/sys-debug.so
%{_mandir} /man1/julia-debug.1%{?ext_man}
%if 0%{?compat_mode} == 0
2014-08-06 09:24:22 +02:00
%files doc
2022-07-05 14:30:51 +02:00
%{_docdir} /julia
%exclude %{_docdir} /julia/CONTRIBUTING.md
%exclude %{_docdir} /julia/NEWS.md
%exclude %{_docdir} /julia/README.md
%endif
2014-08-06 09:24:22 +02:00
%changelog