summaryrefslogtreecommitdiffstats
path: root/pkgs/tools/filesystems/f3
diff options
context:
space:
mode:
authorPeter Hoeg <peter@hoeg.com>2020-09-21 20:47:12 +0800
committerGitHub <noreply@github.com>2020-09-21 20:47:12 +0800
commit5f19b74d135449aebb43c8fe4ca2847b7ea37ef8 (patch)
tree2ce9ec0748ffb312a1dfca6ff28f270d57dffa5b /pkgs/tools/filesystems/f3
parent731fd9efe3114bc97a9e2a113a486721b77e07e9 (diff)
f3: clean-ups and compile on darwin (#98365)
* f3: clean-ups and compile on darwin * fixed from feedback
Diffstat (limited to 'pkgs/tools/filesystems/f3')
-rw-r--r--pkgs/tools/filesystems/f3/default.nix53
1 files changed, 36 insertions, 17 deletions
diff --git a/pkgs/tools/filesystems/f3/default.nix b/pkgs/tools/filesystems/f3/default.nix
index 3559579fe80f..e8d60f835bf0 100644
--- a/pkgs/tools/filesystems/f3/default.nix
+++ b/pkgs/tools/filesystems/f3/default.nix
@@ -1,13 +1,11 @@
-{ stdenv, fetchFromGitHub
-, parted, udev
+{ stdenv, lib, fetchFromGitHub
+, parted, systemd ? null
}:
stdenv.mkDerivation rec {
pname = "f3";
version = "7.2";
- enableParallelBuilding = true;
-
src = fetchFromGitHub {
owner = "AltraMayor";
repo = pname;
@@ -15,24 +13,45 @@ stdenv.mkDerivation rec {
sha256 = "1iwdg0r4wkgc8rynmw1qcqz62l0ldgc8lrazq33msxnk5a818jgy";
};
- buildInputs = [ parted udev ];
+ 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
- patchPhase = "sed -i 's/-oroot -groot//' Makefile";
+ installFlags = [
+ "PREFIX=${placeholder "out"}"
+ ];
- buildFlags = [ "all" # f3read, f3write
- "extra" # f3brew, f3fix, f3probe
- ];
+ installTargets = [
+ "install"
+ ]
+ ++ lib.optional stdenv.isLinux "install-extra";
- installFlags = [ "PREFIX=$(out)"
- "install"
- "install-extra"
- ];
+ postInstall = ''
+ install -Dm555 -t $out/bin f3write.h2w log-f3wr
+ install -Dm444 -t $out/share/doc/${pname} LICENSE README.rst
+ '';
- meta = {
+ meta = with lib; {
description = "Fight Flash Fraud";
homepage = "http://oss.digirati.com.br/f3/";
- license = stdenv.lib.licenses.gpl2;
- platforms = stdenv.lib.platforms.linux;
- maintainers = with stdenv.lib.maintainers; [ makefu ];
+ license = licenses.gpl3Plus;
+ maintainers = with maintainers; [ makefu ];
};
}