From cd7cfcc9a22fe61d7ff08befece3894225f8d064 Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Tue, 22 Dec 2015 14:21:34 -0600 Subject: [PATCH] arpack: include OpenBLAS path in pkgconfig file --- .../libraries/science/math/arpack/default.nix | 8 +++++++- .../science/math/arpack/openblas-libdir.patch | 11 +++++++++++ pkgs/development/libraries/science/math/arpack/series | 1 + 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 pkgs/development/libraries/science/math/arpack/openblas-libdir.patch create mode 100644 pkgs/development/libraries/science/math/arpack/series diff --git a/pkgs/development/libraries/science/math/arpack/default.nix b/pkgs/development/libraries/science/math/arpack/default.nix index 58326a6fa503..13bf512b32d6 100644 --- a/pkgs/development/libraries/science/math/arpack/default.nix +++ b/pkgs/development/libraries/science/math/arpack/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, gfortran, openblas }: +{ stdenv, lib, copyPathsToStore, fetchurl, gfortran, openblas }: with stdenv.lib; @@ -7,11 +7,17 @@ let in stdenv.mkDerivation { name = "arpack-${version}"; + src = fetchurl { url = "https://github.com/opencollab/arpack-ng/archive/${version}.tar.gz"; sha256 = "1fwch6vipms1ispzg2djvbzv5wag36f1dmmr3xs3mbp6imfyhvff"; }; + patches = copyPathsToStore (lib.readPathsFromFile ./. ./series); + postPatch = '' + substituteInPlace arpack.pc.in --replace "@openblas@" "${openblas}/lib" + ''; + buildInputs = [ gfortran openblas ]; # Auto-detection fails because gfortran brings in BLAS by default diff --git a/pkgs/development/libraries/science/math/arpack/openblas-libdir.patch b/pkgs/development/libraries/science/math/arpack/openblas-libdir.patch new file mode 100644 index 000000000000..421f8e85f5fc --- /dev/null +++ b/pkgs/development/libraries/science/math/arpack/openblas-libdir.patch @@ -0,0 +1,11 @@ +Index: arpack-ng-3.2.0/arpack.pc.in +=================================================================== +--- arpack-ng-3.2.0.orig/arpack.pc.in ++++ arpack-ng-3.2.0/arpack.pc.in +@@ -5,5 +5,5 @@ libdir=@libdir@ + Name: arpack + Description: ARPACK-NG + Version: @PACKAGE_VERSION@ +-Libs: -L${libdir} -larpack @BLAS_LIBS@ @LAPACK_LIBS@ ++Libs: -L@openblas@ -L${libdir} -larpack @BLAS_LIBS@ @LAPACK_LIBS@ + Cflags: diff --git a/pkgs/development/libraries/science/math/arpack/series b/pkgs/development/libraries/science/math/arpack/series new file mode 100644 index 000000000000..6ac0b3286ef4 --- /dev/null +++ b/pkgs/development/libraries/science/math/arpack/series @@ -0,0 +1 @@ +openblas-libdir.patch