about summary refs log tree commit diff
path: root/nixpkgs/pkgs/by-name/eb/ebtks/package.nix
blob: b2ffa4bdc20f8dd45d30581f9c7e3f8b37285767 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
{ lib, stdenv, fetchFromGitHub, cmake, libminc }:

stdenv.mkDerivation {
  pname = "ebtks";
  version  = "unstable-2017-09-23";

  src = fetchFromGitHub {
    owner  = "BIC-MNI";
    repo   = "EBTKS";
    rev    = "67e4e197d8a32d6462c9bdc7af44d64ebde4fb5c";
    sha256 = "1a1qw6i47fs1izx60l1ysabpmyx9j5sjnbdv8b47wi2xcc9i3hpq";
  };

  # error: use of undeclared identifier 'finite'; did you mean 'isfinite'?
  postPatch = ''
    substituteInPlace templates/EBTKS/SimpleArray.h \
      --replace "#define FINITE(x) finite(x)" "#define FINITE(x) isfinite(x)"
  ''
  # error: ISO C++17 does not allow 'register' storage class specifier
  + ''
    find . -type f -exec sed -i -e 's/register //g' {} +
  '';

  nativeBuildInputs = [ cmake ];
  buildInputs = [ libminc ];

  cmakeFlags = [ "-DLIBMINC_DIR=${libminc}/lib/cmake" ];

  meta = with lib; {
    homepage = "https://github.com/BIC-MNI/EBTKS";
    description = "Library for working with MINC files";
    maintainers = with maintainers; [ bcdarwin ];
    platforms = platforms.unix;
    license   = licenses.free;
  };
}