2023-08-04 22:07:22 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, autoreconfHook, libuuid, libselinux
|
2021-12-06 16:07:01 +00:00
|
|
|
, e2fsprogs }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "nilfs-utils";
|
2022-08-12 12:06:08 +00:00
|
|
|
version = "2.2.9";
|
2021-12-06 16:07:01 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "nilfs-dev";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2022-08-12 12:06:08 +00:00
|
|
|
sha256 = "sha256-XqViUvPj2BHO3bGs9xBO3VpRq9XqnwBptHvMwBOntqo=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
nativeBuildInputs = [ autoreconfHook ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
buildInputs = [ libuuid libselinux ];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
# Fix up hardcoded paths.
|
|
|
|
substituteInPlace lib/cleaner_exec.c --replace /sbin/ $out/bin/
|
|
|
|
substituteInPlace sbin/mkfs/mkfs.c --replace /sbin/ ${lib.getBin e2fsprogs}/bin/
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
# According to upstream, libmount should be detected automatically but the
|
|
|
|
# build system fails to do this. This is likely a bug with their build system
|
|
|
|
# hence it is explicitly enabled here.
|
|
|
|
configureFlags = [ "--with-libmount" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
installFlags = [
|
|
|
|
"sysconfdir=${placeholder "out"}/etc"
|
|
|
|
"root_sbindir=${placeholder "out"}/sbin"
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
# FIXME: https://github.com/NixOS/patchelf/pull/98 is in, but stdenv
|
|
|
|
# still doesn't use it
|
|
|
|
#
|
|
|
|
# To make sure patchelf doesn't mistakenly keep the reference via
|
|
|
|
# build directory
|
|
|
|
postInstall = ''
|
2021-12-06 16:07:01 +00:00
|
|
|
find . -name .libs -exec rm -rf -- {} +
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "NILFS utilities";
|
|
|
|
maintainers = [ maintainers.raskin ];
|
|
|
|
platforms = platforms.linux;
|
|
|
|
license = with licenses; [ gpl2 lgpl21 ];
|
|
|
|
downloadPage = "http://nilfs.sourceforge.net/en/download.html";
|
|
|
|
};
|
|
|
|
}
|