2022-10-22 06:44:59 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, parted
|
|
|
|
, systemd
|
|
|
|
, argp-standalone
|
2016-11-26 03:28:20 +00:00
|
|
|
}:
|
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
|
|
|
};
|
|
|
|
|
2020-09-21 12:47:12 +00:00
|
|
|
postPatch = ''
|
2022-10-22 06:44:59 +00:00
|
|
|
sed -i 's/-oroot -groot//' Makefile
|
2020-09-21 12:47:12 +00:00
|
|
|
|
2022-10-22 06:44:59 +00:00
|
|
|
for f in f3write.h2w log-f3wr; do
|
|
|
|
substituteInPlace $f \
|
|
|
|
--replace '$(dirname $0)' $out/bin
|
|
|
|
done
|
2020-09-21 12:47:12 +00:00
|
|
|
'';
|
|
|
|
|
2022-10-22 06:44:59 +00:00
|
|
|
buildInputs = lib.optionals stdenv.isLinux [ systemd parted ]
|
|
|
|
++ lib.optionals stdenv.isDarwin [ argp-standalone ];
|
2020-09-21 12:47:12 +00:00
|
|
|
|
2022-10-22 06:44:59 +00:00
|
|
|
buildFlags = [
|
2020-09-21 12:47:12 +00:00
|
|
|
"all" # f3read, f3write
|
|
|
|
]
|
|
|
|
++ lib.optional stdenv.isLinux "extra"; # f3brew, f3fix, f3probe
|
2016-11-26 03:28:20 +00:00
|
|
|
|
2020-09-21 12:47:12 +00:00
|
|
|
installFlags = [
|
|
|
|
"PREFIX=${placeholder "out"}"
|
|
|
|
];
|
2016-09-28 11:31:27 +00:00
|
|
|
|
2020-09-21 12:47:12 +00:00
|
|
|
installTargets = [
|
|
|
|
"install"
|
|
|
|
]
|
|
|
|
++ lib.optional stdenv.isLinux "install-extra";
|
2016-11-26 03:28:20 +00:00
|
|
|
|
2020-09-21 12:47:12 +00:00
|
|
|
postInstall = ''
|
|
|
|
install -Dm555 -t $out/bin f3write.h2w log-f3wr
|
|
|
|
install -Dm444 -t $out/share/doc/${pname} LICENSE README.rst
|
|
|
|
'';
|
2016-11-26 03:28:20 +00:00
|
|
|
|
2020-09-21 12:47:12 +00:00
|
|
|
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/";
|
2020-09-21 12:47:12 +00:00
|
|
|
license = licenses.gpl3Plus;
|
2022-10-22 06:44:59 +00:00
|
|
|
maintainers = with maintainers; [ makefu evils ];
|
2016-09-28 11:31:27 +00:00
|
|
|
};
|
|
|
|
}
|