Merge pull request #156906 from Sciencentistguy/darwin-thc-hydra

thc-hydra: fix build on darwin
This commit is contained in:
Jaka Hudoklin 2022-02-01 09:07:10 +01:00 committed by GitHub
commit 282b130514
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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=";
};
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;
};
}