From 00baa26ab41dfa7b6eb304467e94fcc2d9d5e592 Mon Sep 17 00:00:00 2001 From: Reno Dakota Date: Fri, 27 Dec 2024 21:43:56 -0800 Subject: [PATCH] arpack: minor cleanups use ninja, cmakeBool and remove unneeded install_name_tool usage in postFixup as the library name is already properly set by the build --- pkgs/by-name/ar/arpack/package.nix | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/pkgs/by-name/ar/arpack/package.nix b/pkgs/by-name/ar/arpack/package.nix index f4c45e7de2f8..28c4c77c5dd3 100644 --- a/pkgs/by-name/ar/arpack/package.nix +++ b/pkgs/by-name/ar/arpack/package.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchFromGitHub, cmake +{ lib, stdenv, fetchFromGitHub, cmake, ninja , gfortran, blas, lapack, eigen , useMpi ? false , mpi @@ -21,7 +21,7 @@ stdenv.mkDerivation rec { sha256 = "sha256-HCvapLba8oLqx9I5+KDAU0s/dTmdWOEilS75i4gyfC0="; }; - nativeBuildInputs = [ cmake gfortran ]; + nativeBuildInputs = [ cmake gfortran ninja ]; buildInputs = assert (blas.isILP64 == lapack.isILP64); [ blas lapack @@ -33,10 +33,10 @@ stdenv.mkDerivation rec { doCheck = true; cmakeFlags = [ - "-DBUILD_SHARED_LIBS=ON" - "-DINTERFACE64=${if blas.isILP64 then "1" else "0"}" - "-DMPI=${if useMpi then "ON" else "OFF"}" - "-DICB=ON" + (lib.cmakeBool "BUILD_SHARED_LIBS" stdenv.hostPlatform.hasSharedLibraries) + (lib.cmakeBool "ICB" true) + (lib.cmakeBool "INTERFACE64" blas.isILP64) + (lib.cmakeBool "MPI" useMpi) ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ # prevent cmake from using Accelerate, which causes single precision tests # to segfault @@ -48,10 +48,6 @@ stdenv.mkDerivation rec { export OMP_NUM_THREADS=2 ''; - postFixup = lib.optionalString stdenv.hostPlatform.isDarwin '' - install_name_tool -change libblas.dylib ${blas}/lib/libblas.dylib $out/lib/libarpack.dylib - ''; - passthru = { inherit (blas) isILP64; tests = {