2021-01-19 06:50:56 +00:00
|
|
|
{ lib, stdenv, cmake, rocksdb, rapidjson, pkg-config, fetchFromGitHub, fetchpatch, zlib }:
|
2019-07-12 14:35:03 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "sortmerna";
|
2020-07-18 14:14:20 +01:00
|
|
|
version = "4.2.0";
|
2019-07-12 14:35:03 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
repo = pname;
|
|
|
|
owner = "biocore";
|
|
|
|
rev = "v${version}";
|
2020-07-18 14:14:20 +01:00
|
|
|
sha256 = "0r91viylzr069jm7kpcgb45kagvf8sqcj5zc1af4arl9sgfs1f3j";
|
2019-07-12 14:35:03 +01:00
|
|
|
};
|
|
|
|
|
2021-01-19 06:50:56 +00:00
|
|
|
nativeBuildInputs = [ cmake pkg-config ];
|
2019-07-12 14:35:03 +01:00
|
|
|
buildInputs = [ zlib rocksdb rapidjson ];
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DCMAKE_BUILD_TYPE=Release"
|
2020-07-18 14:14:20 +01:00
|
|
|
"-DPORTABLE=off"
|
2019-07-12 14:35:03 +01:00
|
|
|
"-DRAPIDJSON_HOME=${rapidjson}"
|
2020-07-18 14:14:20 +01:00
|
|
|
"-DROCKSDB_HOME=${rocksdb}"
|
|
|
|
"-DROCKSDB_STATIC=off"
|
|
|
|
"-DZLIB_STATIC=off"
|
2019-07-12 14:35:03 +01:00
|
|
|
];
|
|
|
|
|
2020-07-18 14:14:20 +01:00
|
|
|
postPatch = ''
|
|
|
|
# Fix formatting string error:
|
|
|
|
# https://github.com/biocore/sortmerna/issues/255
|
|
|
|
substituteInPlace src/sortmerna/indexdb.cpp \
|
|
|
|
--replace 'is_verbose, ss' 'is_verbose, "%s", ss'
|
|
|
|
|
|
|
|
# Fix missing pthread dependency for the main binary.
|
|
|
|
substituteInPlace src/sortmerna/CMakeLists.txt \
|
|
|
|
--replace "target_link_libraries(sortmerna" \
|
|
|
|
"target_link_libraries(sortmerna Threads::Threads"
|
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2019-07-12 14:35:03 +01:00
|
|
|
description = "Tools for filtering, mapping, and OTU-picking from shotgun genomics data";
|
|
|
|
license = licenses.lgpl3;
|
|
|
|
platforms = platforms.x86_64;
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://bioinfo.lifl.fr/RNA/sortmerna/";
|
2019-07-12 14:35:03 +01:00
|
|
|
maintainers = with maintainers; [ luispedro ];
|
2021-01-26 17:55:33 +00:00
|
|
|
broken = stdenv.isDarwin;
|
2019-07-12 14:35:03 +01:00
|
|
|
};
|
|
|
|
}
|