2020-09-21 14:47:12 +02:00
|
|
|
{ stdenv, lib, fetchFromGitHub
|
|
|
|
, parted, systemd ? null
|
2016-11-26 04:28:20 +01:00
|
|
|
}:
|
2018-03-11 19:05:41 +01:00
|
|
|
|
2016-09-28 13:31:27 +02:00
|
|
|
stdenv.mkDerivation rec {
|
2018-03-11 19:05:41 +01:00
|
|
|
pname = "f3";
|
2020-11-02 02:51:54 +01:00
|
|
|
version = "8.0";
|
2016-09-28 13:31:27 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "AltraMayor";
|
2018-03-11 19:05:41 +01:00
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2020-11-02 02:51:54 +01:00
|
|
|
sha256 = "17l5vspfcgfbkqg7bakp3gql29yb05gzawm8n3im30ilzdr53678";
|
2016-09-28 13:31:27 +02:00
|
|
|
};
|
|
|
|
|
2020-09-21 14:47:12 +02: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
|
2016-11-26 04:28:20 +01:00
|
|
|
|
2020-09-21 14:47:12 +02:00
|
|
|
installFlags = [
|
|
|
|
"PREFIX=${placeholder "out"}"
|
|
|
|
];
|
2016-09-28 13:31:27 +02:00
|
|
|
|
2020-09-21 14:47:12 +02:00
|
|
|
installTargets = [
|
|
|
|
"install"
|
|
|
|
]
|
|
|
|
++ lib.optional stdenv.isLinux "install-extra";
|
2016-11-26 04:28:20 +01:00
|
|
|
|
2020-09-21 14:47:12 +02:00
|
|
|
postInstall = ''
|
|
|
|
install -Dm555 -t $out/bin f3write.h2w log-f3wr
|
|
|
|
install -Dm444 -t $out/share/doc/${pname} LICENSE README.rst
|
|
|
|
'';
|
2016-11-26 04:28:20 +01:00
|
|
|
|
2020-09-21 14:47:12 +02:00
|
|
|
meta = with lib; {
|
2016-09-28 13:31:27 +02:00
|
|
|
description = "Fight Flash Fraud";
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "http://oss.digirati.com.br/f3/";
|
2020-09-21 14:47:12 +02:00
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
maintainers = with maintainers; [ makefu ];
|
2016-09-28 13:31:27 +02:00
|
|
|
};
|
|
|
|
}
|