2020-04-24 23:36:52 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, libndtypes
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
pname = "libxnd";
|
2020-09-25 04:45:31 +00:00
|
|
|
version = "unstable-2019-08-01";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2020-09-25 04:45:31 +00:00
|
|
|
owner = "xnd-project";
|
2020-04-24 23:36:52 +00:00
|
|
|
repo = "xnd";
|
2020-09-25 04:45:31 +00:00
|
|
|
rev = "6f305cd40d90b4f3fc2fe51ae144b433d186a6cc";
|
|
|
|
sha256 = "1n31d64qwlc7m3qkzbafhp0dgrvgvkdx89ykj63kll7r1n3yk59y";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ libndtypes ];
|
|
|
|
|
|
|
|
# Override linker with cc (symlink to either gcc or clang)
|
|
|
|
# Library expects to use cc for linking
|
|
|
|
configureFlags = [
|
|
|
|
# Override linker with cc (symlink to either gcc or clang)
|
|
|
|
# Library expects to use cc for linking
|
|
|
|
"LD=${stdenv.cc.targetPrefix}cc"
|
|
|
|
# needed for tests
|
|
|
|
"--with-includes=${libndtypes}/include"
|
|
|
|
"--with-libs=${libndtypes}/lib"
|
|
|
|
];
|
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
# other packages which depend on libxnd seem to expect overflow.h, but
|
|
|
|
# it doesn't seem to be included in the installed headers. for now this
|
|
|
|
# works, but the generic name of the header could produce problems
|
|
|
|
# with collisions down the line.
|
|
|
|
postInstall = ''
|
|
|
|
cp libxnd/overflow.h $out/include/overflow.h
|
|
|
|
'';
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
doCheck = true;
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "C library for managing typed memory blocks and Python container module";
|
|
|
|
homepage = "https://xnd.io/";
|
|
|
|
license = lib.licenses.bsdOriginal;
|
|
|
|
maintainers = with lib.maintainers; [ costrouc ];
|
|
|
|
};
|
|
|
|
}
|