2020-02-07 16:57:12 +00:00
|
|
|
{ stdenv, fetchFromGitHub, cmake, makeWrapper, flex, bison, perl, TextFormat,
|
|
|
|
libminc, libjpeg, nifticlib, zlib }:
|
2015-11-12 00:31:45 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-12-20 17:11:24 +00:00
|
|
|
pname = "minc-tools";
|
|
|
|
version = "unstable-2019-12-04";
|
2015-11-12 00:31:45 +00:00
|
|
|
|
2017-12-01 00:36:15 +00:00
|
|
|
src = fetchFromGitHub {
|
2017-09-24 23:06:00 +01:00
|
|
|
owner = "BIC-MNI";
|
|
|
|
repo = pname;
|
2019-12-20 17:11:24 +00:00
|
|
|
rev = "d4dddfdb4e4fa0cea389b8fdce51cfc076565d94";
|
|
|
|
sha256 = "1wwdss59qq4hz1jp35qylfswzzv0d37if23al0srnxkkgc5f8zng";
|
2015-11-12 00:31:45 +00:00
|
|
|
};
|
|
|
|
|
2019-12-20 17:11:24 +00:00
|
|
|
patches = [ ./fix-netcdf-header.patch ];
|
|
|
|
|
2017-09-24 23:06:00 +01:00
|
|
|
nativeBuildInputs = [ cmake flex bison makeWrapper ];
|
|
|
|
buildInputs = [ libminc libjpeg zlib ];
|
2020-02-07 16:57:12 +00:00
|
|
|
propagatedBuildInputs = [ perl TextFormat ];
|
2015-11-12 00:31:45 +00:00
|
|
|
|
2020-02-07 16:57:12 +00:00
|
|
|
cmakeFlags = [ "-DLIBMINC_DIR=${libminc}/lib/"
|
|
|
|
"-DZNZ_INCLUDE_DIR=${nifticlib}/include/"
|
|
|
|
"-DZNZ_LIBRARY=${nifticlib}/lib/libznz.a"
|
|
|
|
"-DNIFTI_INCLUDE_DIR=${nifticlib}/include/nifti/"
|
|
|
|
"-DNIFTI_LIBRARY=${nifticlib}/lib/libniftiio.a" ];
|
2015-11-12 00:31:45 +00:00
|
|
|
|
2017-09-24 23:06:00 +01:00
|
|
|
postFixup = ''
|
|
|
|
for prog in minccomplete minchistory mincpik; do
|
|
|
|
wrapProgram $out/bin/$prog --prefix PERL5LIB : $PERL5LIB
|
|
|
|
done
|
|
|
|
'';
|
2015-11-12 00:31:45 +00:00
|
|
|
|
2017-12-01 00:36:15 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2015-11-12 00:31:45 +00:00
|
|
|
meta = with stdenv.lib; {
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://github.com/BIC-MNI/minc-tools";
|
2015-11-12 00:31:45 +00:00
|
|
|
description = "Command-line utilities for working with MINC files";
|
|
|
|
maintainers = with maintainers; [ bcdarwin ];
|
|
|
|
platforms = platforms.unix;
|
2017-09-26 18:22:46 +01:00
|
|
|
license = licenses.free;
|
2015-11-12 00:31:45 +00:00
|
|
|
};
|
|
|
|
}
|