2020-09-25 04:45:31 +00:00
|
|
|
{ stdenv, lib, fetchFromGitHub
|
|
|
|
, parted, systemd ? null
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "f3";
|
|
|
|
version = "7.2";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "AltraMayor";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "1iwdg0r4wkgc8rynmw1qcqz62l0ldgc8lrazq33msxnk5a818jgy";
|
|
|
|
};
|
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
postPatch = ''
|
|
|
|
sed -i 's/-oroot -groot//' Makefile
|
|
|
|
|
|
|
|
for f in f3write.h2w log-f3wr; do
|
|
|
|
substituteInPlace $f \
|
|
|
|
--replace '$(dirname $0)' $out/bin
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
parted
|
|
|
|
]
|
|
|
|
++ lib.optional stdenv.isLinux systemd;
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
buildFlags = [
|
|
|
|
"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";
|
|
|
|
homepage = "http://oss.digirati.com.br/f3/";
|
2020-09-25 04:45:31 +00:00
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
maintainers = with maintainers; [ makefu ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|