2022-07-05 12:30:51 +00:00
committed by Git OBS Bridge
parent 9c1cb783f2
commit bd3f4624e7
15 changed files with 1269 additions and 124 deletions

View File

@@ -1,7 +1,7 @@
#
# spec file for package julia
#
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2021 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -12,65 +12,124 @@
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
Name: julia
Version: 0.3.0
%define rmath_ver 226598f
%define libuv_ver a12eb33
# 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
Release: 0
Summary: High-level, high-performance dynamic programming language
License: MIT and GPL-2.0+
Group: Development/Languages/Other
Url: http://julialang.org/
Source0: https://github.com/JuliaLang/julia/archive/v%{version}.tar.gz#/julia-%{version}.tar.gz
Source1: juliabuildopts
# external sources
Source10: libuv-%{libuv_ver}.tar.gz
Source11: Rmath-%{rmath_ver}.tar.gz
BuildRequires: arpack-ng-devel
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
BuildRequires: blas-devel
BuildRequires: dSFMT-devel
BuildRequires: cmake
BuildRequires: double-conversion-devel
BuildRequires: fdupes
BuildRequires: fftw3-threads-devel
BuildRequires: fftw3-threads-devel >= 3.3.4
BuildRequires: gcc-c++
BuildRequires: gcc-fortran
BuildRequires: gmp-devel
BuildRequires: lapack-devel
BuildRequires: libunwind-devel
BuildRequires: llvm-clang >= 3.3
BuildRequires: llvm-devel
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
BuildRequires: m4
BuildRequires: mpfr-devel
BuildRequires: mpfr-devel >= 4.0.2
BuildRequires: ncurses-devel
BuildRequires: openlibm-devel
BuildRequires: openspecfun-devel
BuildRequires: patchelf
BuildRequires: pcre-devel >= 8.31
BuildRequires: openssl
BuildRequires: patchelf >= 0.9
BuildRequires: pcre2-devel >= 10.31
BuildRequires: perl
BuildRequires: python >= 2.5
BuildRequires: readline-devel
BuildRequires: suitesparse-devel
BuildRequires: utf8proc-devel
BuildRequires: zlib-devel
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Requires: ncurses
Requires: readline
# Julia uses dlopen
Requires: libblas3
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: liblapack3
Requires: libgmp10
Requires: libmpfr6
Requires: libopenblas_openmp0 >= 0.3.5
Requires: libpcre2-8-0
Requires: libspqr2
Requires: libsuitesparseconfig5
Requires: libumfpack5
Requires: ncurses
Requires: p7zip >= 16
Requires: readline
Recommends: arpack-ng-devel
Recommends: git
# Julia uses unversioned .so files
# https://github.com/JuliaLang/julia/issues/6742
Recommends: gmp-devel
Recommends: mpfr-devel
Recommends: openlibm-devel
Recommends: openspecfun-devel
Recommends: pcre-devel
Recommends: pcre2-devel
Recommends: suitesparse-devel
%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
%description
Julia is a high-level, high-performance dynamic programming language for
@@ -85,6 +144,9 @@ generation, signal processing, and string processing.
Summary: Julia development, debugging and testing files
Group: Development/Languages/Other
Requires: %{name} = %{version}
%if 0%{?compat_mode}
Conflicts: julia-devel
%endif
%description devel
Contains library symbolic links and header files for developing applications
@@ -93,6 +155,18 @@ 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.
%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
%package doc
Summary: Julia documentation and code examples
Group: Documentation/Other
@@ -101,35 +175,98 @@ BuildArch: noarch
%description doc
Contains the Julia manual, the reference documentation of the standard library.
%package examples
Summary: Julia code examples
Group: Documentation/Other
BuildArch: noarch
%endif
%description examples
Contains the Julia code examples.
%{expand:%global juliabuildopts %(cat %{SOURCE1})}
%{expand:%global juliabuildopts %(cat %{SOURCE99})}
%prep
%setup -q -n julia-%{version}
%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
# remove .gitignore
find . -name ".git*" -exec rm {} \;
cd deps
tar xzf %{SOURCE10}
tar xzf %{SOURCE11}
mv -T Rmath-%{rmath_ver} Rmath
mv -T libuv-%{libuv_ver} libuv
%build
make %{?_smp_mflags} %{juliabuildopts}
%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="$LDFLAGS -latomic"
%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} -Wno-stringop-overflow -Wno-maybe-uninitialized"
export CXXLAGS="%{optflags} -Wno-stringop-overflow -Wno-maybe-uninitialized"
%define julia_builddir %{_builddir}/%{name}/
make %{?_smp_mflags} \
MARCH=%{julia_march} \
%ifarch aarch64
JULIA_CPU_TARGET="generic" \
%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
%install
make install DESTDIR=%{buildroot} \
MARCH=%{julia_march} \
%ifarch aarch64
JULIA_CPU_TARGET="generic" \
%endif
prefix=%{_prefix} \
bindir=%{_bindir} \
libdir=%{_libdir} \
libexecdir=%{_libexecdir} \
datarootdir=%{_datarootdir} \
includedir=%{_includedir} \
sysconfdir=%{_sysconfdir} \
%{juliabuildopts}
@@ -140,53 +277,94 @@ gzip %{buildroot}/%{_mandir}/man1/julia.1
cd %{buildroot}/%{_mandir}/man1/
ln -sf julia.1.gz julia-debug.1.gz
# Symbolic link of the library libjulia.so for the julia-devel package.
cd %{buildroot}/%{_libdir}
ln -s julia/libjulia.so libjulia.so
rm -f %{buildroot}%{_libdir}/julia/libuv.a
rm -f %{buildroot}%{_datadir}/julia/base/build.h
rm -f %{buildroot}%{_datadir}/julia/base/Makefile
%check
# cd test && make all
# Fix documentation directories.
mkdir -p %{buildroot}%{_docdir}/julia
mv -f %{buildroot}%{_datadir}/doc/julia/* %{buildroot}%{_docdir}/julia/
rm -r %{buildroot}%{_datadir}/doc/julia
%post devel -p /sbin/ldconfig
# 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 ".codecov.yml" -exec rm -rf {} \;
find . -name ".gitignore" -exec rm -rf {} \;
find . -name ".travis.yml" -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}/
%suse_update_desktop_file -r julia Science Math
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%post devel -p /sbin/ldconfig
%postun devel -p /sbin/ldconfig
%post debug -p /sbin/ldconfig
%postun debug -p /sbin/ldconfig
%files
%defattr(-,root,root)
%doc CONTRIBUTING.md LICENSE.md NEWS.md README.md
%doc CONTRIBUTING.md NEWS.md README.md
%license LICENSE.md
%{_bindir}/julia
%{_libdir}/julia/
%dir %{_datadir}/julia
%{_datadir}/julia/base
%{_datadir}/julia/helpdb.jl
%{_mandir}/man1/julia.1.*
%{_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}
%dir %{_sysconfdir}/julia/
%config(noreplace) %{_sysconfdir}/julia/juliarc.jl
# Exclude development files.
%exclude %{_libdir}/julia/libjulia-debug.so
%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
%files devel
%defattr(-,root,root)
%{_bindir}/julia-debug
%{_datadir}/julia/test/
%{_datadir}/julia/julia-config.jl
%{_includedir}/julia/
%{_libdir}/libjulia.so.%{libjulia_sover_major}
%{_libdir}/libjulia.so
%{_libdir}/julia/libjulia-debug.so
%{_mandir}/man1/julia-debug.1.*
%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
%files doc
%defattr(-,root,root)
%docdir %{_datadir}/julia/doc
%{_datadir}/julia/doc
%exclude %{_datadir}/julia/doc/Makefile
%exclude %{_datadir}/julia/doc/README.md
%files examples
%defattr(-,root,root)
%{_datadir}/julia/examples
%{_docdir}/julia
%exclude %{_docdir}/julia/CONTRIBUTING.md
%exclude %{_docdir}/julia/NEWS.md
%exclude %{_docdir}/julia/README.md
%endif
%changelog