about summary refs log tree commit diff
path: root/pkgs/development/compilers
diff options
context:
space:
mode:
authorChristoph Stich <christoph.n.stich@gmail.com>2020-02-03 18:17:22 +0000
committerChristoph Stich <christoph.n.stich@gmail.com>2020-02-13 11:49:38 +0000
commite4f65629dbab46933f8d872b32ddfa41df366bc6 (patch)
tree952e395c7bf8d79b60a3426542a83ac6e9a69e74 /pkgs/development/compilers
parent1144ee553852f5e91cf85a639ee2e30438a5136a (diff)
downloadnixlib-e4f65629dbab46933f8d872b32ddfa41df366bc6.tar
nixlib-e4f65629dbab46933f8d872b32ddfa41df366bc6.tar.gz
nixlib-e4f65629dbab46933f8d872b32ddfa41df366bc6.tar.bz2
nixlib-e4f65629dbab46933f8d872b32ddfa41df366bc6.tar.lz
nixlib-e4f65629dbab46933f8d872b32ddfa41df366bc6.tar.xz
nixlib-e4f65629dbab46933f8d872b32ddfa41df366bc6.tar.zst
nixlib-e4f65629dbab46933f8d872b32ddfa41df366bc6.zip
julia_13: julia-1.3.1 version bump
Added all-packages.nix
Diffstat (limited to 'pkgs/development/compilers')
-rw-r--r--pkgs/development/compilers/julia/1.3.nix168
-rw-r--r--pkgs/development/compilers/julia/use-system-utf8proc-julia-1.3.patch24
2 files changed, 192 insertions, 0 deletions
diff --git a/pkgs/development/compilers/julia/1.3.nix b/pkgs/development/compilers/julia/1.3.nix
new file mode 100644
index 000000000000..efb9ce391987
--- /dev/null
+++ b/pkgs/development/compilers/julia/1.3.nix
@@ -0,0 +1,168 @@
+{ stdenv, fetchurl, fetchzip, fetchFromGitHub
+# build tools
+, gfortran, m4, makeWrapper, patchelf, perl, which, python2
+, cmake
+# libjulia dependencies
+, libunwind, readline, utf8proc, zlib
+# standard library dependencies
+, curl, fftwSinglePrec, fftw, gmp, libgit2, mpfr, openlibm, openspecfun, pcre2
+# linear algebra
+, openblas, arpack
+# llvm
+, llvm
+}:
+
+with stdenv.lib;
+
+# All dependencies must use the same OpenBLAS.
+let
+  arpack_ = arpack;
+in
+let
+  arpack = arpack_.override { inherit openblas; };
+in
+
+let 
+  majorVersion = "1";
+  minorVersion = "3";
+  maintenanceVersion = "1";
+  src_sha256 = "0q9a7yc3b235psrwl5ghyxgwly25lf8n818l8h6bkf2ymdbsv5p6";
+  version = "${majorVersion}.${minorVersion}.${maintenanceVersion}";
+in 
+
+stdenv.mkDerivation rec {
+  pname = "julia";
+  inherit version;
+
+   src = fetchzip {
+     url = "https://github.com/JuliaLang/julia/releases/download/v${majorVersion}.${minorVersion}.${maintenanceVersion}/julia-${majorVersion}.${minorVersion}.${maintenanceVersion}-full.tar.gz";
+     sha256 = src_sha256;
+   };
+
+  prePatch = ''
+    export PATH=$PATH:${cmake}/bin
+    '';
+
+  patches = [
+    ./use-system-utf8proc-julia-1.3.patch
+
+    # Julia recompiles a precompiled file if the mtime stored *in* the
+    # .ji file differs from the mtime of the .ji file.  This
+    # doesn't work in Nix because Nix changes the mtime of files in
+    # the Nix store to 1. So patch Julia to accept mtimes of 1.
+    ./allow_nix_mtime.patch
+  ];
+
+  postPatch = ''
+    patchShebangs . contrib
+    for i in backtrace cmdlineargs; do
+      mv test/$i.jl{,.off}
+      touch test/$i.jl
+    done
+    rm stdlib/Sockets/test/runtests.jl && touch stdlib/Sockets/test/runtests.jl
+    rm stdlib/Distributed/test/runtests.jl && touch stdlib/Distributed/test/runtests.jl
+    sed -e 's/Invalid Content-Type:/invalid Content-Type:/g' -i ./stdlib/LibGit2/test/libgit2.jl
+    sed -e 's/Failed to resolve /failed to resolve /g' -i ./stdlib/LibGit2/test/libgit2.jl
+  '';
+
+  buildInputs = [
+    arpack fftw fftwSinglePrec gmp libgit2 libunwind mpfr
+    pcre2.dev openblas openlibm openspecfun readline utf8proc
+    zlib
+  ]
+  ++ stdenv.lib.optionals stdenv.isDarwin [CoreServices ApplicationServices]
+  ;
+
+  nativeBuildInputs = [ curl gfortran m4 makeWrapper patchelf perl python2 which ];
+
+  makeFlags =
+    let
+      arch = head (splitString "-" stdenv.system);
+      march = { x86_64 = stdenv.hostPlatform.platform.gcc.arch or "x86-64"; i686 = "pentium4"; }.${arch}
+              or (throw "unsupported architecture: ${arch}");
+      # Julia requires Pentium 4 (SSE2) or better
+      cpuTarget = { x86_64 = "x86-64"; i686 = "pentium4"; }.${arch}
+                  or (throw "unsupported architecture: ${arch}");
+    in [
+      "ARCH=${arch}"
+      "MARCH=${march}"
+      "JULIA_CPU_TARGET=${cpuTarget}"
+      "PREFIX=$(out)"
+      "prefix=$(out)"
+      "SHELL=${stdenv.shell}"
+
+      "USE_SYSTEM_BLAS=1"
+      "USE_BLAS64=${if openblas.blas64 then "1" else "0"}"
+      "LIBBLAS=-lopenblas"
+      "LIBBLASNAME=libopenblas"
+
+      "USE_SYSTEM_LAPACK=1"
+      "LIBLAPACK=-lopenblas"
+      "LIBLAPACKNAME=libopenblas"
+
+      "USE_SYSTEM_ARPACK=1"
+      "USE_SYSTEM_FFTW=1"
+      "USE_SYSTEM_GMP=1"
+      "USE_SYSTEM_LIBGIT2=1"
+      "USE_SYSTEM_LIBUNWIND=1"
+
+      "USE_SYSTEM_MPFR=1"
+      "USE_SYSTEM_OPENLIBM=1"
+      "USE_SYSTEM_OPENSPECFUN=1"
+      "USE_SYSTEM_PATCHELF=1"
+      "USE_SYSTEM_PCRE=1"
+      "PCRE_CONFIG=${pcre2.dev}/bin/pcre2-config"
+      "PCRE_INCL_PATH=${pcre2.dev}/include/pcre2.h"
+      "USE_SYSTEM_READLINE=1"
+      "USE_SYSTEM_UTF8PROC=1"
+      "USE_SYSTEM_ZLIB=1"
+
+      "USE_BINARYBUILDER=0"
+    ];
+
+  LD_LIBRARY_PATH = makeLibraryPath [
+    arpack fftw fftwSinglePrec gmp libgit2 mpfr openblas openlibm
+    openspecfun pcre2
+  ];
+
+  enableParallelBuilding = true;
+
+  doCheck = !stdenv.isDarwin;
+  checkTarget = "testall";
+  # Julia's tests require read/write access to $HOME
+  preCheck = ''
+    export HOME="$NIX_BUILD_TOP"
+  '';
+
+  preBuild = ''
+    sed -e '/^install:/s@[^ ]*/doc/[^ ]*@@' -i Makefile
+    sed -e '/[$](DESTDIR)[$](docdir)/d' -i Makefile
+    export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}
+  '';
+
+  postInstall = ''
+    # Symlink shared libraries from LD_LIBRARY_PATH into lib/julia,
+    # as using a wrapper with LD_LIBRARY_PATH causes segmentation
+    # faults when program returns an error:
+    #   $ julia -e 'throw(Error())'
+    find $(echo $LD_LIBRARY_PATH | sed 's|:| |g') -maxdepth 1 -name '*.${if stdenv.isDarwin then "dylib" else "so"}*' | while read lib; do
+      if [[ ! -e $out/lib/julia/$(basename $lib) ]]; then
+        ln -sv $lib $out/lib/julia/$(basename $lib)
+      fi
+    done
+  '';
+
+  passthru = {
+    inherit majorVersion minorVersion maintenanceVersion;
+    site = "share/julia/site/v${majorVersion}.${minorVersion}";
+  };
+
+  meta = {
+    description = "High-level performance-oriented dynamical language for technical computing";
+    homepage = https://julialang.org/;
+    license = stdenv.lib.licenses.mit;
+    maintainers = with stdenv.lib.maintainers; [ raskin rob garrison ];
+    platforms = [ "i686-linux" "x86_64-linux" "x86_64-darwin" ];
+    broken = stdenv.isi686;
+  };
+}
diff --git a/pkgs/development/compilers/julia/use-system-utf8proc-julia-1.3.patch b/pkgs/development/compilers/julia/use-system-utf8proc-julia-1.3.patch
new file mode 100644
index 000000000000..63e0ba9ab057
--- /dev/null
+++ b/pkgs/development/compilers/julia/use-system-utf8proc-julia-1.3.patch
@@ -0,0 +1,24 @@
+---
+ src/flisp/Makefile | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+
+diff --git a/src/flisp/Makefile b/src/flisp/Makefile
+index d97075e..6bebca7 100644
+--- a/src/flisp/Makefile
++++ b/src/flisp/Makefile
+@@ -32,9 +32,9 @@ OBJS := $(SRCS:%.c=$(BUILDDIR)/%.o)
+ DOBJS := $(SRCS:%.c=$(BUILDDIR)/%.dbg.obj)
+ LLT_release := $(LLT_BUILDDIR)/libsupport.a
+ LLT_debug := $(LLT_BUILDDIR)/libsupport-debug.a
+-LIBFILES_release := $(LLT_release) $(LIBUV) $(LIBUTF8PROC)
+-LIBFILES_debug := $(LLT_debug) $(LIBUV) $(LIBUTF8PROC)
+-LIBS :=
++LIBFILES_release := $(LLT_release) $(LIBUV)
++LIBFILES_debug := $(LLT_debug) $(LIBUV)
++LIBS := $(LIBUTF8PROC)
+ ifneq ($(OS),WINNT)
+ LIBS += -lpthread
+ endif
+
+--