nyxexprs/pkgs/applications/misc/rat/default.nix

48 lines
1.1 KiB
Nix
Raw Normal View History

2023-11-03 07:25:58 +00:00
{
2023-11-03 09:27:04 +00:00
pins,
2024-02-13 03:44:04 +00:00
lib,
disableHardening ? true,
fetchFromGitHub,
stdenv,
unixtools,
2023-11-03 07:25:58 +00:00
}:
2024-02-13 03:44:04 +00:00
assert disableHardening -> lib.warn "nyxpkgs/rat disables hardening to avoid segfaults. You may want to consider overriding the package if this is undesirable" true; let
pin = pins.rat;
2023-11-03 07:25:58 +00:00
2024-02-13 03:44:04 +00:00
pname = "rat";
version = "2.0.1";
in
stdenv.mkDerivation {
inherit pname version;
src = fetchFromGitHub {
inherit (pin.repository) owner repo;
sha256 = pin.hash;
rev = pin.revision;
};
# the code is so unsafe, it doesn't work with even one of hardening flags
# lol
hardeningDisable = lib.optionals disableHardening ["all"];
buildInputs = [unixtools.xxd];
buildPhase = ''
runHook preBuild
make linux_audio
runHook postBuild
'';
installPhase = ''
runHook preInstall
mkdir -p $out/bin
install -Dm755 ./bin/rat -t "$out/bin/"
runHook postInstall
'';
meta = {
description = "rat";
homepage = "https://github.com/thinkingsand/rat";
maintainers = with lib.maintainers; [NotAShelf];
};
}