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 000000000000..b19b9ffe8a62 --- /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 f60d5374648f..b12daff00387 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; }; }