nixpkgs/pkgs/tools/filesystems/f3/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

58 lines
1.2 KiB
Nix
Raw Normal View History

2022-10-22 06:44:59 +00:00
{ stdenv
, lib
, fetchFromGitHub
, parted
, systemd
, argp-standalone
}:
2018-03-11 18:05:41 +00:00
2016-09-28 11:31:27 +00:00
stdenv.mkDerivation rec {
2018-03-11 18:05:41 +00:00
pname = "f3";
2020-11-02 01:51:54 +00:00
version = "8.0";
2016-09-28 11:31:27 +00:00
src = fetchFromGitHub {
owner = "AltraMayor";
2018-03-11 18:05:41 +00:00
repo = pname;
rev = "v${version}";
2020-11-02 01:51:54 +00:00
sha256 = "17l5vspfcgfbkqg7bakp3gql29yb05gzawm8n3im30ilzdr53678";
2016-09-28 11:31:27 +00:00
};
postPatch = ''
2022-10-22 06:44:59 +00:00
sed -i 's/-oroot -groot//' Makefile
2022-10-22 06:44:59 +00:00
for f in f3write.h2w log-f3wr; do
substituteInPlace $f \
--replace '$(dirname $0)' $out/bin
done
'';
2022-10-22 06:44:59 +00:00
buildInputs = lib.optionals stdenv.isLinux [ systemd parted ]
++ lib.optionals stdenv.isDarwin [ argp-standalone ];
2022-10-22 06:44:59 +00:00
buildFlags = [
"all" # f3read, f3write
]
++ lib.optional stdenv.isLinux "extra"; # f3brew, f3fix, f3probe
installFlags = [
"PREFIX=${placeholder "out"}"
];
2016-09-28 11:31:27 +00:00
installTargets = [
"install"
]
++ lib.optional stdenv.isLinux "install-extra";
postInstall = ''
install -Dm555 -t $out/bin f3write.h2w log-f3wr
install -Dm444 -t $out/share/doc/${pname} LICENSE README.rst
'';
meta = with lib; {
2016-09-28 11:31:27 +00:00
description = "Fight Flash Fraud";
2022-10-22 06:44:59 +00:00
homepage = "https://fight-flash-fraud.readthedocs.io/en/stable/";
license = licenses.gpl3Plus;
2022-10-22 06:44:59 +00:00
maintainers = with maintainers; [ makefu evils ];
2016-09-28 11:31:27 +00:00
};
}