Accepting request 1132207 from home:uncomfyhalomacro:branches:science

- Remove debug package. It's not created. Still we won't strip
  debug symbols from julia as it will cause issues.
- Declare that it conflicts with juliaup.
- Update tagged release banner message that says it is an unofficial experimental build
- Add mbedtls-hardcoded-libs.patch
- Update description
- Add llvm-link-shared.patch
- Add openlibm.patch
- Add libblastrampoline-hardcoded-libs.patch 
- Add use-system-libuv-correctly.patch
- Use sed to replace julia-hardcoded-libs.patch
- Add patch julia-suitesparse-7.patch
- Update julia-env-script-interpreter.patch
- Add new patches
  * 21d4c2f1.patch
  * 959902f1.patch
  * e08e1444.patch
  * f11bfc6c.patch
  * julia-hardcoded-libs.patch
  * julia-libgit2-1.7.patch
  * julia-libunwind-1.9.patch
- Update to julia version 1.9.4
  ** CHANGELOG TOO HUGE SINCE 1.6.3 **
  See https://github.com/JuliaLang/julia/compare/v1.6.3...v1.9.4
- Remove a lot of old patches
  * julia-fix_doc_build.patch
  * julia-fix-mbedtls-build-failure-gcc-11.patch
  * julia-fix-task-build-failure-gcc-11.patch

OBS-URL: https://build.opensuse.org/request/show/1132207
OBS-URL: https://build.opensuse.org/package/show/science/julia?expand=0&rev=114
This commit is contained in:
Soc Virnyl Estela
2023-12-09 08:02:57 +00:00
committed by Git OBS Bridge
parent bd3f4624e7
commit e15cadffe0
23 changed files with 1522 additions and 528 deletions

View File

@@ -1,4 +1,4 @@
#
# spec file for package julia
#
# Copyright (c) 2021 SUSE LLC
@@ -23,47 +23,64 @@
%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
%define libjulia_sover_minor 9
%if "@BUILD_FLAVOR@%{nil}" == "compat"
%define compat_mode 1
%else
%define compat_mode 0
%endif
Version: 1.6.3
# LTO currently makes building blastrampoline and Julia itself fail
# It is not enabled upstream anyway
%global _lto_cflags %nil
Version: 1.9.4
Release: 0
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
Patch1: julia-env-script-interpreter.patch
Patch2: https://gitlab.archlinux.org/archlinux/packaging/packages/julia/-/raw/main/e08e1444.patch?ref_type=heads#/e08e1444.patch
Patch3: https://gitlab.archlinux.org/archlinux/packaging/packages/julia/-/raw/main/959902f1.patch?ref_type=heads#/959902f1.patch
Patch4: https://gitlab.archlinux.org/archlinux/packaging/packages/julia/-/raw/main/f11bfc6c.patch?ref_type=heads#/f11bfc6c.patch
Patch5: https://gitlab.archlinux.org/archlinux/packaging/packages/julia/-/raw/main/21d4c2f1.patch?ref_type=heads#/21d4c2f1.patch
Patch6: https://gitlab.archlinux.org/archlinux/packaging/packages/julia/-/raw/main/julia-libunwind-1.6.patch?ref_type=heads#/julia-libunwind-1.9.patch
Patch8: https://gitlab.archlinux.org/archlinux/packaging/packages/julia/-/raw/main/julia-libgit2-1.7.patch?ref_type=heads#/julia-libgit2-1.7.patch
Patch9: https://gitlab.archlinux.org/archlinux/packaging/packages/julia/-/raw/main/julia-suitesparse-7.patch?ref_type=heads#/julia-suitesparse-7.patch
Patch10: use-system-libuv-correctly.patch
Patch11: openlibm.patch
Patch12: llvm-link-shared.patch
Patch13: https://gitlab.archlinux.org/archlinux/packaging/packages/julia/-/raw/main/julia-hardcoded-libs.patch?ref_type=heads#/julia-hardcoded-libs.patch
Patch14: mbedtls-hardcoded-libs.patch
Patch15: libblastrampoline-hardcoded-libs.patch
BuildRequires: arpack-ng-devel >= 3.3.0
BuildRequires: llvm15-devel
BuildRequires: libblastrampoline-devel
BuildRequires: lld15
BuildRequires: libwhich
BuildRequires: libgit2-devel
BuildRequires: zlib-devel
BuildRequires: p7zip >= 16
BuildRequires: dSFMT-devel
BuildRequires: libuv-devel
BuildRequires: mbedtls-devel
BuildRequires: openlibm-devel
BuildRequires: utf8proc-devel
BuildRequires: blas-devel
BuildRequires: cmake
BuildRequires: double-conversion-devel
BuildRequires: fdupes
BuildRequires: fftw3-threads-devel >= 3.3.4
BuildRequires: gcc-c++
BuildRequires: gcc
BuildRequires: gcc-fortran
BuildRequires: gmp-devel >= 6.1.2
BuildRequires: hicolor-icon-theme
BuildRequires: lapack-devel >= 3.5.0
BuildRequires: libcurl-devel
BuildRequires: libnghttp2-devel
BuildRequires: openblas-common-devel
BuildRequires: libopenblas_openmp-devel >= 0.3.5
BuildRequires: libssh2-devel >= 1.9.0
BuildRequires: libunwind-devel >= 1.3.1
@@ -79,24 +96,12 @@ BuildRequires: python >= 2.5
BuildRequires: readline-devel
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
Requires: ncurses
BuildRequires: ca-certificates
Conflicts: juliaup
Requires: p7zip >= 16
Requires: readline
Requires: ca-certificates
Requires: julia-devel = %{version}
Recommends: arpack-ng-devel
Recommends: git
Recommends: gmp-devel
@@ -140,6 +145,9 @@ 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.
This package is experimental and by no means supported by upstream. If you want
to use julia, please install juliaup instead
%package devel
Summary: Julia development, debugging and testing files
Group: Development/Languages/Other
@@ -155,45 +163,50 @@ 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
BuildArch: noarch
%description doc
Contains the Julia manual, the reference documentation of the standard library.
%endif
%{expand:%global juliabuildopts %(cat %{SOURCE99})}
%prep
%setup -q -n julia-%{version}
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
patch -p1 -i %{PATCH1}
patch -p1 -i %{PATCH2}
patch -p1 -i %{PATCH3}
patch -p1 -i %{PATCH4}
patch -p1 -i %{PATCH5}
# libunwind 1.6 compatibility
patch -p1 -i %{PATCH6}
# Fix tests with libgit2 1.7
patch -p1 -i %{PATCH8}
# Make.inc puts it in the wrong libpath
# patch -p1 -i %{PATCH10}
patch -p1 -i %{PATCH11}
patch -p1 -i %{PATCH12}
patch -p1 -i %{PATCH13}
patch -p1 -i %{PATCH14}
patch -p1 -i %{PATCH15}
%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 {} \;
pushd stdlib/srccache
tar -xzf SparseArrays-37e6e58706a54c5a1b96a17cda7d3e8be8bcb190.tar.gz
patch -d JuliaSparse-SparseArrays.jl-37e6e58 -p1 -i %{PATCH9}
rm SparseArrays-37e6e58706a54c5a1b96a17cda7d3e8be8bcb190.tar.gz
tar -czf SparseArrays-37e6e58706a54c5a1b96a17cda7d3e8be8bcb190.tar.gz JuliaSparse-SparseArrays.jl-37e6e58
md5sum SparseArrays-37e6e58706a54c5a1b96a17cda7d3e8be8bcb190.tar.gz | cut -d ' ' -f 1 > ../../deps/checksums/SparseArrays-37e6e58706a54c5a1b96a17cda7d3e8be8bcb190.tar.gz/md5
sha512sum SparseArrays-37e6e58706a54c5a1b96a17cda7d3e8be8bcb190.tar.gz | cut -d ' ' -f 1 > ../../deps/checksums/SparseArrays-37e6e58706a54c5a1b96a17cda7d3e8be8bcb190.tar.gz/sha512
popd
# Work around bug that prompts zlib to be downloaded even when not used
# https://github.com/JuliaLang/julia/pull/42524/files#r734972945
sed "s/ \$(build_prefix)\\/manifest\\/zlib//" -i deps/llvm.mk
%build
# Workaround for https://github.com/JuliaLang/julia/issues/27118
%global build_cxxflags %(echo %{build_cxxflags} | sed 's/-Wp,-D_GLIBCXX_ASSERTIONS //')
# Workaround for https://github.com/JuliaLang/julia/issues/39822
# and https://bugzilla.redhat.com/show_bug.cgi?id=1928696
%global build_cflags %(echo %{build_cflags} | sed 's/-Wp,-D_GNU_SOURCE //')
%if 0%{?compat_mode} == 0
%ifarch x86_64
@@ -225,7 +238,7 @@ find . -name ".git*" -exec rm {} \;
%define julia_march x86-64
%endif
%ifarch armv6l armv6hl
%ifarch armv6l armv6hl aarch64
export LDFLAGS="$LDFLAGS -latomic"
%endif
@@ -233,14 +246,18 @@ export LDFLAGS="$LDFLAGS -latomic"
# 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"
export CXXFLAGS="%{optflags} -Wno-stringop-overflow -Wno-maybe-uninitialized"
%define julia_builddir %{_builddir}/%{name}/
make %{?_smp_mflags} \
MARCH=%{julia_march} \
%ifarch aarch64
JULIA_CPU_TARGET="generic" \
JULIA_CPU_TARGET="generic;cortex-a57;thunderx2t99;armv8.2-a,crypto,fullfp16,lse,rdm" \
%endif
%ifarch x86_64
JULIA_CPU_TARGET="generic;sandybridge,-xsaveopt,clone_all;haswell,-rdrnd,base(1)" \
%endif
build_prefix=%{_builddir}/%{buildsubdir}/build%{_prefix} \
build_libdir=%{_builddir}/%{buildsubdir}/build%{_libdir} \
prefix=%{_prefix} \
bindir=%{_bindir} \
libdir=%{_libdir} \
@@ -248,7 +265,42 @@ make %{?_smp_mflags} \
datarootdir=%{_datarootdir} \
includedir=%{_includedir} \
sysconfdir=%{_sysconfdir} \
%{juliabuildopts} \
USE_BINARYBUILDER=0 \
USE_SYSTEM_CSL=1 \
USE_SYSTEM_LLVM=1 \
USE_SYSTEM_LLD=1 \
USE_SYSTEM_LIBUNWIND=1 \
USE_SYSTEM_PCRE=1 \
USE_SYSTEM_BLAS=1 \
OPENBLAS_LIBNAMESUFFIX= \
USE_SYSTEM_LAPACK=1 \
USE_SYSTEM_LIBBLASTRAMPOLINE=1 \
USE_SYSTEM_GMP=1 \
USE_SYSTEM_MPFR=1 \
USE_SYSTEM_LIBSUITESPARSE=1 \
USE_SYSTEM_SUITESPARSE=1 \
USE_INTEL_JITEVENTS=0 \
USE_SYSTEM_LIBWHICH=1 \
USE_SYSTEM_DSFMT=1 \
USE_SYSTEM_LIBUV=0 \
USE_SYSTEM_UTF8PROC=1 \
USE_SYSTEM_LIBGIT2=1 \
USE_SYSTEM_LIBSSH2=1 \
USE_SYSTEM_MBEDTLS=1 \
USE_SYSTEM_CURL=1 \
USE_SYSTEM_PATCHELF=1 \
USE_SYSTEM_ZLIB=1 \
USE_SYSTEM_P7ZIP=1 \
USE_SYSTEM_OPENLIBM=1 \
USE_BLAS64=0 \
LIBBLAS=-lblas \
LIBBLASNAME=libblas \
LIBLAPACK=-llapack \
LIBLAPACKNAME=liblapack \
JLDFLAGS="$LDFLAGS" \
VERBOSE=1 \
LLVM_CONFIG=llvm-config \
TAGGED_RELEASE_BANNER="openSUSE %{suse_version} experimental build (unofficial)" \
release debug
%check
@@ -256,11 +308,22 @@ make %{?_smp_mflags} \
# make %{?_smp_mflags} test
%install
# 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 CXXFLAGS="%{optflags} -Wno-stringop-overflow -Wno-maybe-uninitialized"
make install DESTDIR=%{buildroot} \
MARCH=%{julia_march} \
%ifarch aarch64
JULIA_CPU_TARGET="generic" \
JULIA_CPU_TARGET="generic;cortex-a57;thunderx2t99;armv8.2-a,crypto,fullfp16,lse,rdm" \
%endif
%ifarch x86_64
JULIA_CPU_TARGET="generic;sandybridge,-xsaveopt,clone_all;haswell,-rdrnd,base(1)" \
%endif
build_prefix=%{_builddir}/%{buildsubdir}/build%{_prefix} \
build_libdir=%{_builddir}/%{buildsubdir}/build%{_libdir} \
prefix=%{_prefix} \
bindir=%{_bindir} \
libdir=%{_libdir} \
@@ -268,14 +331,48 @@ make install DESTDIR=%{buildroot} \
datarootdir=%{_datarootdir} \
includedir=%{_includedir} \
sysconfdir=%{_sysconfdir} \
%{juliabuildopts}
USE_BINARYBUILDER=0 \
USE_SYSTEM_CSL=1 \
USE_SYSTEM_LLVM=1 \
USE_SYSTEM_LLD=1 \
USE_SYSTEM_LIBUNWIND=1 \
USE_SYSTEM_PCRE=1 \
USE_SYSTEM_BLAS=1 \
OPENBLAS_LIBNAMESUFFIX= \
USE_SYSTEM_LAPACK=1 \
USE_SYSTEM_LIBBLASTRAMPOLINE=1 \
USE_SYSTEM_GMP=1 \
USE_SYSTEM_MPFR=1 \
USE_SYSTEM_LIBSUITESPARSE=1 \
USE_SYSTEM_SUITESPARSE=1 \
USE_INTEL_JITEVENTS=0 \
USE_SYSTEM_LIBWHICH=1 \
USE_SYSTEM_DSFMT=1 \
USE_SYSTEM_LIBUV=0 \
USE_SYSTEM_UTF8PROC=1 \
USE_SYSTEM_LIBGIT2=1 \
USE_SYSTEM_LIBSSH2=1 \
USE_SYSTEM_MBEDTLS=1 \
USE_SYSTEM_CURL=1 \
USE_SYSTEM_PATCHELF=1 \
USE_SYSTEM_ZLIB=1 \
USE_SYSTEM_P7ZIP=1 \
USE_SYSTEM_OPENLIBM=1 \
USE_BLAS64=0 \
LIBBLAS=-lblas \
LIBBLASNAME=libblas \
LIBLAPACK=-llapack \
LIBLAPACKNAME=liblapack \
JLDFLAGS="$LDFLAGS" \
VERBOSE=1 \
LLVM_CONFIG=llvm-config \
TAGGED_RELEASE_BANNER="openSUSE %{suse_version} experimental build (unofficial)"
# 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
rm -f %{buildroot}%{_libdir}/julia/libuv.a
rm -f %{buildroot}%{_datadir}/julia/base/build.h
@@ -286,14 +383,21 @@ mkdir -p %{buildroot}%{_docdir}/julia
mv -f %{buildroot}%{_datadir}/doc/julia/* %{buildroot}%{_docdir}/julia/
rm -r %{buildroot}%{_datadir}/doc/julia
ln -sfv /var/lib/ca-certificates/ca-bundle.pem %{buildroot}%{_datadir}/julia/cert.pem # Needed by some julia packages
# 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 {} \;
# Remove hidden files and zero-length files and directories from stdlib.
pushd %{buildroot}
find . -name ".codecov.yml" -prune -execdir rm -rf {} \;
find . -name ".git*" -prune -execdir rm -rf {} \;
find . -name ".ci" -prune -execdir rm -rf {} \;
find . -name ".devcontainer" -prune -execdir rm -rf {} \;
find . -name ".travis.yml" -prune -execdir rm -rf {} \;
find . -empty -type d -prune -execdir rm -rf {} \;
find . -empty -type f -prune -execdir rm -rf {} \;
find . -name "*.orig" -prune -execdir rm -rf {} \;
popd
%if 0%{?compat_mode}
@@ -315,8 +419,6 @@ rm %{buildroot}%{_datadir}/appdata/julia.appdata.xml
%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
%doc CONTRIBUTING.md NEWS.md README.md
@@ -326,10 +428,16 @@ rm %{buildroot}%{_datadir}/appdata/julia.appdata.xml
%{_datadir}/julia/base
%{_datadir}/julia/base.cache
%{_datadir}/julia/stdlib
%{_datadir}/julia/compiled*
%{_datadir}/julia/cert.pem
%dir %{_libexecdir}/julia
%{_libexecdir}/julia/*
%if !%{?compat_mode}
%dir %{_datadir}/appdata/
%{_datadir}/appdata/julia.appdata.xml
%dir %{_docdir}/julia
%{_docdir}/julia/*
%endif
%{_datadir}/applications/julia.desktop
%{_libdir}/julia/
@@ -337,11 +445,6 @@ rm %{buildroot}%{_datadir}/appdata/julia.appdata.xml
%{_mandir}/man1/julia.1%{?ext_man}
%dir %{_sysconfdir}/julia/
%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
%{_datadir}/julia/test/
@@ -350,21 +453,4 @@ rm %{buildroot}%{_datadir}/appdata/julia.appdata.xml
%{_libdir}/libjulia.so.%{libjulia_sover_major}
%{_libdir}/libjulia.so
%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
%{_docdir}/julia
%exclude %{_docdir}/julia/CONTRIBUTING.md
%exclude %{_docdir}/julia/NEWS.md
%exclude %{_docdir}/julia/README.md
%endif
%changelog