From 8e71a4574f2121200a6aa5294bf3b54277630931 Mon Sep 17 00:00:00 2001 From: midchildan Date: Sun, 28 Mar 2021 00:10:56 +0900 Subject: [PATCH] moosefs: add darwin build --- pkgs/tools/filesystems/moosefs/default.nix | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/pkgs/tools/filesystems/moosefs/default.nix b/pkgs/tools/filesystems/moosefs/default.nix index e38b040ec0d..ee0d5eedc92 100644 --- a/pkgs/tools/filesystems/moosefs/default.nix +++ b/pkgs/tools/filesystems/moosefs/default.nix @@ -24,14 +24,30 @@ stdenv.mkDerivation rec { buildInputs = [ fuse libpcap zlib python ]; + 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" + ''; + postInstall = '' substituteInPlace $out/sbin/mfscgiserv --replace "datapath=\"$out" "datapath=\"" ''; + doCheck = true; + meta = with lib; { homepage = "https://moosefs.com"; description = "Open Source, Petabyte, Fault-Tolerant, Highly Performing, Scalable Network Distributed File System"; - platforms = platforms.linux; + platforms = platforms.unix; license = licenses.gpl2; maintainers = [ maintainers.mfossen ]; };