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
This commit is contained in:
Jamie Quigley 2022-01-26 20:45:06 +00:00
parent 7eb3c0f557
commit 65b18a28c0
No known key found for this signature in database
GPG key ID: 8E8FF66E2AE8D970
2 changed files with 18 additions and 1 deletions

View file

@ -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 ?=

View file

@ -12,6 +12,10 @@ stdenv.mkDerivation rec {
sha256 = "sha256-V9rr5fbJWm0pa+Kp8g95XvLPo/uWcDwyU2goImnIq58="; sha256 = "sha256-V9rr5fbJWm0pa+Kp8g95XvLPo/uWcDwyU2goImnIq58=";
}; };
patches = lib.optionals stdenv.isDarwin [
./darwin-remove-ldflag.patch
];
postPatch = let postPatch = let
makeDirs = output: subDir: lib.concatStringsSep " " (map (path: lib.getOutput output path + "/" + subDir) buildInputs); makeDirs = output: subDir: lib.concatStringsSep " " (map (path: lib.getOutput output path + "/" + subDir) buildInputs);
in '' in ''
@ -43,6 +47,6 @@ stdenv.mkDerivation rec {
homepage = "https://www.thc.org/thc-hydra/"; homepage = "https://www.thc.org/thc-hydra/";
license = licenses.agpl3; license = licenses.agpl3;
maintainers = with maintainers; [ offline ]; maintainers = with maintainers; [ offline ];
platforms = platforms.linux; platforms = platforms.unix;
}; };
} }