lol

rhash: fix darwin build

Fixes cmake update to 3.8.2, d74d871f52512a1f827d2dc165db685f499ce5f0

+41 -1
+38
pkgs/tools/security/rhash/darwin.patch
··· 1 + diff --git a/Makefile b/Makefile 2 + index e40dbc3..e198b93 100644 3 + --- a/Makefile 4 + +++ b/Makefile 5 + @@ -17,7 +17,7 @@ ALLCFLAGS = -pipe $(CFLAGS) $(ADDCFLAGS) \ 6 + -Wbad-function-cast -Wmissing-prototypes -Wmissing-declarations 7 + LDLIBRHASH = -Llibrhash -lrhash 8 + ALLLDFLAGS = $(LDLIBRHASH) $(LDFLAGS) $(ADDLDFLAGS) 9 + -SHAREDLIB = librhash/librhash.so.0 10 + +SHAREDLIB = librhash/librhash.0.dylib 11 + SHRDLFLAGS = $(LDFLAGS) $(ADDLDFLAGS) 12 + HEADERS = calc_sums.h hash_print.h common_func.h hash_update.h file_mask.h file_set.h find_file.h hash_check.h output.h parse_cmdline.h rhash_main.h win_utils.h version.h 13 + SOURCES = calc_sums.c hash_print.c common_func.c hash_update.c file_mask.c file_set.c find_file.c hash_check.c output.c parse_cmdline.c rhash_main.c win_utils.c 14 + diff --git a/librhash/Makefile b/librhash/Makefile 15 + index 2f9bcc9..0c5aaad 100644 16 + --- a/librhash/Makefile 17 + +++ b/librhash/Makefile 18 + @@ -28,8 +28,8 @@ PREFIX = /usr/local 19 + INCDIR = $(PREFIX)/include 20 + LIBDIR = $(PREFIX)/lib 21 + LIBRARY = librhash.a 22 + -SONAME = librhash.so.0 23 + -SOLINK = librhash.so 24 + +SONAME = librhash.0.dylib 25 + +SOLINK = librhash.dylib 26 + TEST_TARGET = test_hashes 27 + TEST_SHARED = test_shared 28 + # Set variables according to GNU coding standard 29 + @@ -182,8 +182,7 @@ test-dll: $(DLLNAME) test_hashes.o 30 + 31 + # shared and static libraries 32 + $(SONAME): $(SOURCES) 33 + - sed -n '1s/.*/{ global:/p; s/^RHASH_API.* \([a-z0-9_]\+\)(.*/ \1;/p; $$s/.*/local: *; };/p' $(SO_HEADERS) > exports.sym 34 + - $(CC) -fpic $(ALLCFLAGS) -shared $(SOURCES) -Wl,--version-script,exports.sym,-soname,$(SONAME) $(LIBLDFLAGS) -o $@ 35 + + $(CC) -fpic $(ALLCFLAGS) -dynamiclib $(SOURCES) $(LIBLDFLAGS) -Wl,-install_name,$(PREFIX)/lib/$@ -o $@ 36 + ln -s $(SONAME) $(SOLINK) 37 + # use 'nm -Cg --defined-only $@' to view exported symbols 38 +
+3 -1
pkgs/tools/security/rhash/default.nix
··· 10 10 sha256 = "0nii6p4m2x8rkaf8r6smgfwb1q4hpf117kkg64yr6gyqgdchnljv"; 11 11 }; 12 12 13 + patches = stdenv.lib.optional stdenv.isDarwin ./darwin.patch; 14 + 13 15 installFlags = [ "DESTDIR=$(out)" "PREFIX=/" ]; 14 16 15 17 # we build the static library because of two makefile bugs 16 18 # * .h files installed for static library target only 17 19 # * .so.0 -> .so link only created in the static library install target 18 20 buildPhase = '' 19 - make lib-shared lib-static build-shared 21 + make lib-shared lib-static build-shared CC=cc PREFIX=$out 20 22 ''; 21 23 22 24 # we don't actually want the static library, so we remove it after it