2020-04-24 23:36:52 +00:00
|
|
|
{ stdenv, fetchFromGitHub, cmake, makeWrapper, flex, bison, perl, TextFormat,
|
|
|
|
libminc, libjpeg, nifticlib, zlib }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "minc-tools";
|
|
|
|
version = "unstable-2019-12-04";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "BIC-MNI";
|
|
|
|
repo = pname;
|
|
|
|
rev = "d4dddfdb4e4fa0cea389b8fdce51cfc076565d94";
|
|
|
|
sha256 = "1wwdss59qq4hz1jp35qylfswzzv0d37if23al0srnxkkgc5f8zng";
|
|
|
|
};
|
|
|
|
|
|
|
|
patches = [ ./fix-netcdf-header.patch ];
|
|
|
|
|
2020-07-18 16:06:22 +00:00
|
|
|
# add missing CMake module to build NIFTI support
|
|
|
|
# (the maintainers normally build libminc and minc-tools in a meta-project)
|
|
|
|
postPatch = ''
|
|
|
|
cp ${libminc.src}/cmake-modules/FindNIFTI.cmake cmake-modules
|
|
|
|
'';
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
nativeBuildInputs = [ cmake flex bison makeWrapper ];
|
2020-07-18 16:06:22 +00:00
|
|
|
buildInputs = [ libminc libjpeg nifticlib zlib ];
|
2020-04-24 23:36:52 +00:00
|
|
|
propagatedBuildInputs = [ perl TextFormat ];
|
|
|
|
|
|
|
|
cmakeFlags = [ "-DLIBMINC_DIR=${libminc}/lib/"
|
2020-07-18 16:06:22 +00:00
|
|
|
"-DZNZ_INCLUDE_DIR=${nifticlib}/include/nifti"
|
|
|
|
"-DNIFTI_INCLUDE_DIR=${nifticlib}/include/nifti" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
postFixup = ''
|
|
|
|
for prog in minccomplete minchistory mincpik; do
|
|
|
|
wrapProgram $out/bin/$prog --prefix PERL5LIB : $PERL5LIB
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
homepage = "https://github.com/BIC-MNI/minc-tools";
|
|
|
|
description = "Command-line utilities for working with MINC files";
|
|
|
|
maintainers = with maintainers; [ bcdarwin ];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
license = licenses.free;
|
|
|
|
};
|
|
|
|
}
|