2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv
|
2019-03-13 02:41:37 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, makeWrapper
|
|
|
|
, python
|
|
|
|
, fuse
|
2021-01-17 09:17:16 +00:00
|
|
|
, pkg-config
|
2019-03-13 02:41:37 +00:00
|
|
|
, libpcap
|
2020-06-07 14:28:18 +01:00
|
|
|
, zlib
|
2019-03-13 02:41:37 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "moosefs";
|
2020-10-25 22:17:56 +00:00
|
|
|
version = "3.0.115";
|
2019-03-13 02:41:37 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = pname;
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2020-10-25 22:17:56 +00:00
|
|
|
sha256 = "0dap9dqwwx8adma6arxg015riqc86cmjv2m44hk0kz7s24h79ipq";
|
2019-03-13 02:41:37 +00:00
|
|
|
};
|
|
|
|
|
2021-01-17 09:17:16 +00:00
|
|
|
nativeBuildInputs = [ pkg-config makeWrapper ];
|
2019-03-13 02:41:37 +00:00
|
|
|
|
|
|
|
buildInputs =
|
2020-11-24 13:30:15 +00:00
|
|
|
[ fuse libpcap zlib python ];
|
2019-03-13 02:41:37 +00:00
|
|
|
|
2021-03-27 15:10:56 +00:00
|
|
|
buildFlags = lib.optionals stdenv.isDarwin [ "CPPFLAGS=-UHAVE_STRUCT_STAT_ST_BIRTHTIME" ];
|
|
|
|
|
|
|
|
# Fix the build on macOS with macFUSE installed
|
|
|
|
postPatch = lib.optionalString stdenv.isDarwin ''
|
|
|
|
substituteInPlace configure --replace \
|
|
|
|
"/usr/local/lib/pkgconfig" "/nonexistent"
|
|
|
|
'';
|
|
|
|
|
|
|
|
preBuild = lib.optional stdenv.isDarwin ''
|
|
|
|
substituteInPlace config.h --replace \
|
|
|
|
"#define HAVE_STRUCT_STAT_ST_BIRTHTIME 1" \
|
|
|
|
"#undef HAVE_STRUCT_STAT_ST_BIRTHTIME"
|
|
|
|
'';
|
|
|
|
|
2019-03-13 02:41:37 +00:00
|
|
|
postInstall = ''
|
2020-06-07 14:28:18 +01:00
|
|
|
substituteInPlace $out/sbin/mfscgiserv --replace "datapath=\"$out" "datapath=\""
|
2019-03-13 02:41:37 +00:00
|
|
|
'';
|
|
|
|
|
2021-03-27 15:10:56 +00:00
|
|
|
doCheck = true;
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-04-01 16:32:05 +01:00
|
|
|
homepage = "https://moosefs.com";
|
2019-03-13 02:41:37 +00:00
|
|
|
description = "Open Source, Petabyte, Fault-Tolerant, Highly Performing, Scalable Network Distributed File System";
|
2021-03-27 15:10:56 +00:00
|
|
|
platforms = platforms.unix;
|
2019-03-13 02:41:37 +00:00
|
|
|
license = licenses.gpl2;
|
|
|
|
maintainers = [ maintainers.mfossen ];
|
|
|
|
};
|
|
|
|
}
|