2018-08-11 21:01:45 +01:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, libndtypes
|
|
|
|
}:
|
|
|
|
|
2019-08-13 22:52:01 +01:00
|
|
|
stdenv.mkDerivation {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "libxnd";
|
2020-09-12 01:20:46 +01:00
|
|
|
version = "unstable-2019-08-01";
|
2018-08-11 21:01:45 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2020-09-12 01:20:46 +01:00
|
|
|
owner = "xnd-project";
|
2018-08-11 21:01:45 +01:00
|
|
|
repo = "xnd";
|
2020-09-12 01:20:46 +01:00
|
|
|
rev = "6f305cd40d90b4f3fc2fe51ae144b433d186a6cc";
|
|
|
|
sha256 = "1n31d64qwlc7m3qkzbafhp0dgrvgvkdx89ykj63kll7r1n3yk59y";
|
2018-08-11 21:01:45 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ libndtypes ];
|
|
|
|
|
2018-09-12 20:03:02 +01:00
|
|
|
# Override linker with cc (symlink to either gcc or clang)
|
|
|
|
# Library expects to use cc for linking
|
2018-11-27 21:53:46 +00:00
|
|
|
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-12 01:20:46 +01: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
|
|
|
|
'';
|
|
|
|
|
2018-11-27 21:53:46 +00:00
|
|
|
doCheck = true;
|
2018-08-11 21:01:45 +01:00
|
|
|
|
|
|
|
meta = {
|
2018-11-27 21:53:46 +00:00
|
|
|
description = "C library for managing typed memory blocks and Python container module";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://xnd.io/";
|
2018-08-11 21:01:45 +01:00
|
|
|
license = lib.licenses.bsdOriginal;
|
|
|
|
maintainers = with lib.maintainers; [ costrouc ];
|
|
|
|
};
|
|
|
|
}
|