Created attachment 417332 [details] net-misc/unison-2.48.3 build.log $ emerge unison -pv [ebuild N ~] net-misc/unison-2.48.3 USE="ocamlopt threads -debug -doc -gtk -static {-test}" $ emerge unison ... /var/tmp/portage/net-misc/unison-2.48.3/work/unison-2.48.3/fsmonitor/linux/inotify_stubs.c:41:28: fatal error: inotify_compat.h: No such file or directory #include "inotify_compat.h" ^ compilation terminated. Makefile.OCaml:438: recipe for target 'fsmonitor/linux/inotify_stubs.o' failed make: *** [fsmonitor/linux/inotify_stubs.o] Error 2 * ERROR: net-misc/unison-2.48.3::gentoo failed (compile phase): * emake failed Bug originally noted here: http://lists.seas.upenn.edu/pipermail/unison-hackers/2013-October/001676.html inotify-nosys.h is in sys-fs/inotify-tools, so I patched: --- a/unison-2.48.3/work/unison-2.48.3/fsmonitor/linux/inotify_stubs.c 2015-11-19 04:47:22.981619219 +0000 +++ b/unison-2.48.3/work/unison-2.48.3/fsmonitor/linux/inotify_stubs.c 2015-11-19 04:47:36.966618842 +0000 @@ -38,7 +38,7 @@ #if GLIBC_SUPPORT_INOTIFY #include <sys/inotify.h> #else -#include "inotify_compat.h" +#include <inotifytools/inotify_nosys.h> #endif and: --- a/unison-2.48.3/Makefile.OCaml 2015-11-19 05:02:40.105594518 +0000 +++ b/unison-2.48.3/Makefile.OCaml 2015-11-19 05:03:21.845593394 +0000 @@ -315,7 +315,7 @@ -include fsmonitor/windows/Makefile src/fsmonitor/windows/Makefile endif -INCLFLAGS+=-I fsmonitor -I fsmonitor/linux -I fsmonitor/windows +INCLFLAGS+=-I fsmonitor -I fsmonitor/linux -I fsmonitor/windows -I inotifytools #################################################################### ### Static build setup but that's wrong because the error: /var/tmp/portage/net-misc/unison-2.48.3/work/unison-2.48.3/fsmonitor/linux/inotify_stubs.c:41:40: fatal error: inotifytools/inotify_nosys.h: No such file or directory still happens.
musl has <sys/inotify.h>. Can't that be used?
Created attachment 417432 [details] musl fix for unison-2.48.3.ebuild
Created attachment 417434 [details, diff] musl fix for unison-2.48.3.ebuild
Created attachment 417436 [details] c stub used by Makefile.OCaml to test for <sys/inotify.h>
Created attachment 417438 [details, diff] add <sys/inotify.h> test to Makefile.OCaml (ht to skarnet)
Created attachment 417440 [details, diff] generalize check for <sys/inotify.h> in fsmonitor/linux/inotify_stubs.c
Right, musl's <sys/inotify.h> works. I tried to make the fix as general and correct as possible, feedback appreciated. I prob don't need to set a var to run the shell commands in Makefile.OCaml, and I'm not sure if src_prepare() is proper, but it works. I also noticed it fails with >-j10 (every time), I'll file another bug for that.
(In reply to Justin Keogh from comment #7) > I also noticed it fails with >-j10 (every time), I'll file another bug for > that. Please do. I was lucky to read this comment as I had -j20 and unison never built. MAKEOPTS="-j4" emerge unison and it works.
Is this okay now? https://github.com/bcpierce00/unison/commit/4c0b7fb672e6c8e6e62f33d8a5b76fbd847ae97f