571c71e6f7
We are migrating packages that meet below requirements: 1. using `callPackage` 2. called path is a directory 3. overriding set is empty (`{ }`) 4. not containing path expressions other than relative path (to makenixpkgs-vet happy) 5. not referenced by nix files outside of the directory, other than`pkgs/top-level/all-packages.nix` 6. not referencing nix files outside of the directory 7. not referencing `default.nix` (since it's changed to `package.nix`) 8. `outPath` doesn't change after migration The tool is here: https://github.com/Aleksanaa/by-name-migrate.
45 lines
1.3 KiB
Nix
45 lines
1.3 KiB
Nix
{ lib, stdenv, fetchurl, cmake, gfortran
|
|
# Whether to build with ILP64 interface
|
|
, blas64 ? false
|
|
}:
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "blas";
|
|
version = "3.12.0";
|
|
|
|
src = fetchurl {
|
|
url = "http://www.netlib.org/blas/${pname}-${version}.tgz";
|
|
sha256 = "sha256-zMQbXQiOUNsAMDF66bDJrzdXEME5KsrR/iCWAtpaWq0=";
|
|
};
|
|
|
|
passthru = { inherit blas64; };
|
|
|
|
nativeBuildInputs = [ cmake gfortran ];
|
|
|
|
cmakeFlags = [ "-DBUILD_SHARED_LIBS=ON" ]
|
|
++ lib.optional blas64 "-DBUILD_INDEX64=ON";
|
|
|
|
postInstall = let
|
|
canonicalExtension = if stdenv.hostPlatform.isLinux
|
|
then "${stdenv.hostPlatform.extensions.sharedLibrary}.${lib.versions.major version}"
|
|
else stdenv.hostPlatform.extensions.sharedLibrary;
|
|
in lib.optionalString blas64 ''
|
|
ln -s $out/lib/libblas64${canonicalExtension} $out/lib/libblas${canonicalExtension}
|
|
'';
|
|
|
|
preFixup = lib.optionalString stdenv.hostPlatform.isDarwin ''
|
|
for fn in $(find $out/lib -name "*.so*"); do
|
|
if [ -L "$fn" ]; then continue; fi
|
|
install_name_tool -id "$fn" "$fn"
|
|
done
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "Basic Linear Algebra Subprograms";
|
|
license = licenses.publicDomain;
|
|
maintainers = [ maintainers.markuskowa ];
|
|
homepage = "http://www.netlib.org/blas/";
|
|
platforms = platforms.unix;
|
|
};
|
|
}
|