From e1e7c55a760cc82baf4acbb102736f15656514ea Mon Sep 17 00:00:00 2001 From: awwpotato Date: Sat, 29 Mar 2025 17:20:53 -0700 Subject: [PATCH] redfang: unbreak on GCC 14, modernize --- pkgs/by-name/re/redfang/include-pthread.patch | 12 ++++++++++++ pkgs/by-name/re/redfang/package.nix | 14 ++++++++------ 2 files changed, 20 insertions(+), 6 deletions(-) create mode 100644 pkgs/by-name/re/redfang/include-pthread.patch diff --git a/pkgs/by-name/re/redfang/include-pthread.patch b/pkgs/by-name/re/redfang/include-pthread.patch new file mode 100644 index 000000000000..6e895df84ac4 --- /dev/null +++ b/pkgs/by-name/re/redfang/include-pthread.patch @@ -0,0 +1,12 @@ +diff --git a/fang.c b/fang.c +index cda61bf..52f9659 100755 +--- a/fang.c ++++ b/fang.c +@@ -45,6 +45,7 @@ + #include + #include + #include ++#include + + #include + #include diff --git a/pkgs/by-name/re/redfang/package.nix b/pkgs/by-name/re/redfang/package.nix index 014e62ac328f..5bb42b53b109 100644 --- a/pkgs/by-name/re/redfang/package.nix +++ b/pkgs/by-name/re/redfang/package.nix @@ -6,7 +6,7 @@ bluez, }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "redfang"; version = "2.5"; @@ -14,7 +14,7 @@ stdenv.mkDerivation rec { group = "kalilinux"; owner = "packages"; repo = "redfang"; - rev = "upstream/${version}"; + rev = "upstream/${finalAttrs.version}"; hash = "sha256-dF9QmBckyHAZ+JbLr0jTmp0eMu947unJqjrTMsJAfIE="; }; @@ -24,6 +24,8 @@ stdenv.mkDerivation rec { url = "https://gitlab.com/kalilinux/packages/redfang/-/merge_requests/1.diff"; sha256 = "sha256-oxIrUAucxsBL4+u9zNNe2XXoAd088AEAHcRB/AN7B1M="; }) + # error: implicit declaration of function 'pthread_create' [] + ./include-pthread.patch ]; installFlags = [ "DESTDIR=$(out)" ]; @@ -32,11 +34,11 @@ stdenv.mkDerivation rec { buildInputs = [ bluez ]; - meta = with lib; { + meta = { description = "Small proof-of-concept application to find non discoverable bluetooth devices"; homepage = "https://gitlab.com/kalilinux/packages/redfang"; - license = licenses.gpl2Only; - maintainers = with maintainers; [ moni ]; + license = lib.licenses.gpl2Only; + maintainers = with lib.maintainers; [ moni ]; mainProgram = "fang"; }; -} +})