summary refs log tree commit diff
path: root/pkgs/tools/security/thc-hydra
diff options
context:
space:
mode:
authorJamie Quigley <jamie@quigley.xyz>2022-01-26 20:45:06 +0000
committerJamie Quigley <jamie@quigley.xyz>2022-01-26 20:45:06 +0000
commit65b18a28c00c286c4417e0bfbecea6db96d35074 (patch)
treed7e082fb6b4b7c2566911d13943f78d417b3cd18 /pkgs/tools/security/thc-hydra
parent7eb3c0f557f2bcceac69cac5127ac22fd5cd06d9 (diff)
downloadnixpkgs-65b18a28c00c286c4417e0bfbecea6db96d35074.tar
nixpkgs-65b18a28c00c286c4417e0bfbecea6db96d35074.tar.gz
nixpkgs-65b18a28c00c286c4417e0bfbecea6db96d35074.tar.bz2
nixpkgs-65b18a28c00c286c4417e0bfbecea6db96d35074.tar.lz
nixpkgs-65b18a28c00c286c4417e0bfbecea6db96d35074.tar.xz
nixpkgs-65b18a28c00c286c4417e0bfbecea6db96d35074.tar.zst
nixpkgs-65b18a28c00c286c4417e0bfbecea6db96d35074.zip
thc-hydra: fix build on darwin
stdenv-darwin's `ld` doesn;t support --allow-multiple-definition, so it
has to be patched out to build
Diffstat (limited to 'pkgs/tools/security/thc-hydra')
-rw-r--r--pkgs/tools/security/thc-hydra/darwin-remove-ldflag.patch13
-rw-r--r--pkgs/tools/security/thc-hydra/default.nix6
2 files changed, 18 insertions, 1 deletions
diff --git a/pkgs/tools/security/thc-hydra/darwin-remove-ldflag.patch b/pkgs/tools/security/thc-hydra/darwin-remove-ldflag.patch
new file mode 100644
index 00000000000..b19b9ffe8a6
--- /dev/null
+++ b/pkgs/tools/security/thc-hydra/darwin-remove-ldflag.patch
@@ -0,0 +1,13 @@
+diff --git a/Makefile.am b/Makefile.am
+index 1c915f1..83a8e41 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -4,7 +4,7 @@
+ WARN_CLANG=-Wformat-nonliteral -Wstrncat-size -Wformat-security -Wsign-conversion -Wconversion -Wfloat-conversion -Wshorten-64-to-32 -Wuninitialized -Wmissing-variable-declarations  -Wmissing-declarations
+ WARN_GCC=-Wformat=2 -Wformat-overflow=2 -Wformat-nonliteral -Wformat-truncation=2 -Wnull-dereference -Wstrict-overflow=2 -Wstringop-overflow=4 -Walloca-larger-than=4096 -Wtype-limits -Wconversion -Wtrampolines -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -fno-common -Wcast-align
+ CFLAGS ?= -g
+-OPTS=-I. -O3 $(CFLAGS) -fcommon -Wl,--allow-multiple-definition
++OPTS=-I. -O3 $(CFLAGS) -fcommon
+ # -Wall -g -pedantic
+ LIBS=-lm
+ DESTDIR ?=
diff --git a/pkgs/tools/security/thc-hydra/default.nix b/pkgs/tools/security/thc-hydra/default.nix
index f60d5374648..b12daff0038 100644
--- a/pkgs/tools/security/thc-hydra/default.nix
+++ b/pkgs/tools/security/thc-hydra/default.nix
@@ -12,6 +12,10 @@ stdenv.mkDerivation rec {
     sha256 = "sha256-V9rr5fbJWm0pa+Kp8g95XvLPo/uWcDwyU2goImnIq58=";
   };
 
+  patches = lib.optionals stdenv.isDarwin [
+    ./darwin-remove-ldflag.patch
+  ];
+
   postPatch = let
     makeDirs = output: subDir: lib.concatStringsSep " " (map (path: lib.getOutput output path + "/" + subDir) buildInputs);
   in ''
@@ -43,6 +47,6 @@ stdenv.mkDerivation rec {
     homepage = "https://www.thc.org/thc-hydra/";
     license = licenses.agpl3;
     maintainers = with maintainers; [ offline ];
-    platforms = platforms.linux;
+    platforms = platforms.unix;
   };
 }