nixpkgs/pkgs/development/libraries/librsb/default.nix
Artturin e0464e4788 treewide: replace stdenv.is with stdenv.hostPlatform.is
In preparation for the deprecation of `stdenv.isX`.

These shorthands are not conducive to cross-compilation because they
hide the platforms.

Darwin might get cross-compilation for which the continued usage of `stdenv.isDarwin` will get in the way

One example of why this is bad and especially affects compiler packages
https://www.github.com/NixOS/nixpkgs/pull/343059

There are too many files to go through manually but a treewide should
get users thinking when they see a `hostPlatform.isX` in a place where it
doesn't make sense.

```
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv.is" "stdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv'.is" "stdenv'.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "clangStdenv.is" "clangStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "gccStdenv.is" "gccStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenvNoCC.is" "stdenvNoCC.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "inherit (stdenv) is" "inherit (stdenv.hostPlatform) is"
fd --type f "\.nix" | xargs sd --fixed-strings "buildStdenv.is" "buildStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "effectiveStdenv.is" "effectiveStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "originalStdenv.is" "originalStdenv.hostPlatform.is"
```
2024-09-25 00:04:37 +03:00

89 lines
2.4 KiB
Nix

{ lib, stdenv, fetchurl
, gfortran
, pkg-config, libtool
, m4, gnum4
, file
# Memory Hierarchy (End-user can provide this.)
, memHierarchy ? ""
# Headers/Libraries
, blas, zlib
# RPC headers (rpc/xdr.h)
, openmpi
, help2man
, doxygen
, octave
}:
stdenv.mkDerivation rec {
pname = "librsb";
version = "1.2.0.10";
src = fetchurl {
url = "mirror://sourceforge/${pname}/${pname}-${version}.tar.gz";
sha256 = "sha256-7Enz94p8Q/yeEJdlk9EAqkmxhjMJ7Y+jzLt6rVLS97g=";
};
# The default configure flags are still present when building
# --disable-static --disable-dependency-tracking
# Along with the --prefix=... flag (but we want that one).
configureFlags = [
"--enable-static"
"--enable-doc-build"
"--enable-octave-testing"
"--enable-sparse-blas-interface"
"--enable-fortran-module-install"
"--enable-pkg-config-install"
"--enable-matrix-types=all"
"--with-zlib=${zlib}/lib/libz.so"
"--with-memhinfo=${memHierarchy}"
];
# Ensure C/Fortran code is position-independent.
env.NIX_CFLAGS_COMPILE = toString [ "-fPIC" "-Ofast" ];
FCFLAGS = [ "-fPIC" "-Ofast" ];
enableParallelBuilding = true;
nativeBuildInputs = [
gfortran
pkg-config libtool
m4 gnum4
file
blas zlib
openmpi
octave
help2man # Turn "--help" into a man-page
doxygen # Build documentation
];
# Need to run cleanall target to remove any previously-generated files.
preBuild = ''
make cleanall
'';
nativeCheckInputs = [
octave
];
checkTarget = "tests";
meta = with lib; {
homepage = "https://librsb.sourceforge.net/";
description = "Shared memory parallel sparse matrix and sparse BLAS library";
longDescription = ''
Library for sparse matrix computations featuring the Recursive Sparse
Blocks (RSB) matrix format. This format allows cache efficient and
multi-threaded (that is, shared memory parallel) operations on large
sparse matrices.
librsb implements the Sparse BLAS standard, as specified in the BLAS
Forum documents.
Contains libraries and header files for developing applications that
want to make use of librsb.
'';
license = with licenses; [ lgpl3Plus ];
maintainers = with maintainers; [ KarlJoad ];
platforms = platforms.all;
# ./rsb_common.h:56:10: fatal error: 'omp.h' file not found
broken = stdenv.hostPlatform.isDarwin;
};
}