From 9a60a65249e5d507ecfcd5f0d1825b7ac1376d58 Mon Sep 17 00:00:00 2001 From: Markus Kowalewski Date: Tue, 5 Mar 2019 17:17:03 +0100 Subject: [PATCH 1/2] arpack: 3.6.3 -> 3.7.0 * switch to FetchFromGitHub * switch from autotools to cmake * add eigen to input (is now required) --- .../libraries/science/math/arpack/default.nix | 35 +++++++++++++------ 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/pkgs/development/libraries/science/math/arpack/default.nix b/pkgs/development/libraries/science/math/arpack/default.nix index 2a6c4af43fc3..8541384e8313 100644 --- a/pkgs/development/libraries/science/math/arpack/default.nix +++ b/pkgs/development/libraries/science/math/arpack/default.nix @@ -1,32 +1,45 @@ -{ stdenv, fetchurl, autoconf, automake, gettext, libtool -, gfortran, openblas }: +{ stdenv, fetchFromGitHub, cmake +, gfortran, openblas, eigen }: with stdenv.lib; let - version = "3.6.3"; + version = "3.7.0"; in stdenv.mkDerivation { name = "arpack-${version}"; - src = fetchurl { - url = "https://github.com/opencollab/arpack-ng/archive/${version}.tar.gz"; - sha256 = "0lzlcsrjsi36pv5bnipwjnyg2fx3nrv31bw2klwrg11gb8g5bwv4"; + src = fetchFromGitHub { + owner = "opencollab"; + repo = "arpack-ng"; + rev = version; + sha256 = "1x7a1dj3dg43nlpvjlh8jzzbadjyr3mbias6f0256qkmgdyk4izr"; }; - nativeBuildInputs = [ autoconf automake gettext libtool ]; - buildInputs = [ gfortran openblas ]; + nativeBuildInputs = [ cmake ]; + buildInputs = [ gfortran openblas eigen ]; doCheck = true; BLAS_LIBS = "-L${openblas}/lib -lopenblas"; - INTERFACE64 = optional openblas.blas64 "1"; + cmakeFlags = [ + "-DBUILD_SHARED_LIBS=ON" + "-DINTERFACE64=${optionalString openblas.blas64 "1"}" + ]; - preConfigure = '' - ./bootstrap + preCheck = '' + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:`pwd`/lib + # Prevent tests from using all cores + export OMP_NUM_THREADS=2 ''; + postInstall = '' + mkdir -p $out/lib/pkgconfig + cp arpack.pc $out/lib/pkgconfig/ + ''; + + meta = { homepage = https://github.com/opencollab/arpack-ng; description = '' From 70867a92f6d8a43f03b03eee93c7eff885a76368 Mon Sep 17 00:00:00 2001 From: Markus Kowalewski Date: Tue, 2 Apr 2019 17:13:18 +0200 Subject: [PATCH 2/2] arpack: fix tests on darwin --- pkgs/development/libraries/science/math/arpack/default.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgs/development/libraries/science/math/arpack/default.nix b/pkgs/development/libraries/science/math/arpack/default.nix index 8541384e8313..05373cd1cbda 100644 --- a/pkgs/development/libraries/science/math/arpack/default.nix +++ b/pkgs/development/libraries/science/math/arpack/default.nix @@ -28,8 +28,11 @@ stdenv.mkDerivation { "-DINTERFACE64=${optionalString openblas.blas64 "1"}" ]; - preCheck = '' + preCheck = if stdenv.isDarwin then '' + export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:`pwd`/lib + '' else '' export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:`pwd`/lib + '' + '' # Prevent tests from using all cores export OMP_NUM_THREADS=2 '';