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