2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv
|
2020-04-24 23:36:52 +00:00
|
|
|
, fetchFromGitHub
|
2021-08-05 21:33:18 +00:00
|
|
|
, python3
|
2020-04-24 23:36:52 +00:00
|
|
|
, fuse
|
2021-02-05 17:12:51 +00:00
|
|
|
, pkg-config
|
2020-04-24 23:36:52 +00:00
|
|
|
, libpcap
|
2020-06-18 07:06:33 +00:00
|
|
|
, zlib
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "moosefs";
|
2023-02-09 11:40:11 +00:00
|
|
|
version = "3.0.117";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = pname;
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2023-02-09 11:40:11 +00:00
|
|
|
sha256 = "sha256-6zBMAi9ruPPlcnpdgqwl35QZ5u4MyFPUa70yvGTkHpo=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-08-05 21:33:18 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
pkg-config
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildInputs =
|
2021-08-05 21:33:18 +00:00
|
|
|
[ fuse libpcap zlib python3 ];
|
|
|
|
|
|
|
|
strictDeps = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-04-22 02:08:21 +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"
|
|
|
|
'';
|
|
|
|
|
2021-08-22 07:53:02 +00:00
|
|
|
preBuild = lib.optionalString stdenv.isDarwin ''
|
2021-04-22 02:08:21 +00:00
|
|
|
substituteInPlace config.h --replace \
|
|
|
|
"#define HAVE_STRUCT_STAT_ST_BIRTHTIME 1" \
|
|
|
|
"#undef HAVE_STRUCT_STAT_ST_BIRTHTIME"
|
|
|
|
'';
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
postInstall = ''
|
2020-06-18 07:06:33 +00:00
|
|
|
substituteInPlace $out/sbin/mfscgiserv --replace "datapath=\"$out" "datapath=\""
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-04-22 02:08:21 +00:00
|
|
|
doCheck = true;
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://moosefs.com";
|
|
|
|
description = "Open Source, Petabyte, Fault-Tolerant, Highly Performing, Scalable Network Distributed File System";
|
2021-04-22 02:08:21 +00:00
|
|
|
platforms = platforms.unix;
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.gpl2;
|
|
|
|
maintainers = [ maintainers.mfossen ];
|
|
|
|
};
|
|
|
|
}
|