While looking at building multiple flavors of nginx together, I found something interesting.
for nginx, both naxsi and lua set a pre-patch target. When I build each one individually, everything works (as expected). BUT, when I try to combine both flavors, only one of the pre-patch targets is ran, and the other is not. So, the build fails because the necessary pre-patch targets are not being ran. This problem is not specific to nginx. Pretty much any port that has pre/post patch/configure/package/build/etc targets in more than one flavor will be affected. Instructions for reproducing it in a -current tree, and output shown below. $ cd /usr/ports/www/nginx && env FLAVOR="naxsi lua" make configure ===> nginx-1.9.10p1-lua-naxsi depends on: lua->=5.1,<5.2 -> lua-5.1.5p5 ===> nginx-1.9.10p1-lua-naxsi depends on: pcre-* -> pcre-8.38 ===> Verifying specs: c crypto pcre ssl z lua5.1 m ===> found c.84.2 crypto.37.0 pcre.3.0 ssl.38.0 z.5.0 lua5.1.5.1 m.9.0 ===> Checking files for nginx-1.9.10p1-lua-naxsi `/usr/ports/distfiles/naxsi-0.53-1.tar.gz' is up to date. `/usr/ports/distfiles/nginx-1.9.10.tar.gz' is up to date. `/usr/ports/distfiles/ngx_devel_kit-0.2.19.tar.gz' is up to date. `/usr/ports/distfiles/lua-nginx-module-0.9.12.tar.gz' is up to date. `/usr/ports/distfiles/nginx_chroot-20151002.patch' is up to date. >> (SHA256) naxsi-0.53-1.tar.gz: OK >> (SHA256) nginx-1.9.10.tar.gz: OK >> (SHA256) ngx_devel_kit-0.2.19.tar.gz: OK >> (SHA256) lua-nginx-module-0.9.12.tar.gz: OK >> (SHA256) nginx_chroot-20151002.patch: OK ===> Extracting for nginx-1.9.10p1-lua-naxsi ===> Patching for nginx-1.9.10p1-lua-naxsi cd /usr/ports/pobj/nginx-1.9.10-lua-naxsi/nginx-1.9.10 && mv ../naxsi-* naxsi `/usr/ports/pobj/nginx-1.9.10-lua-naxsi/.prepatch_done' is up to date. ===> Applying distribution patches for nginx-1.9.10p1-lua-naxsi File to patch: No file found--skip this patch? [n] y 2 out of 2 hunks ignored--saving rejects to Oops.rej ***> lua-lua-nginx-module_src_ngx_http_lua_socket_tcp_c did not apply cleanly *** Error 1 in . (/usr/ports/infrastructure/mk/bsd.port.mk:2695 '/usr/ports/pobj/nginx-1.9.10-lua-naxsi/.patch_done': @if cd /usr/ports/www/...) *** Error 1 in /usr/ports/www/nginx (/usr/ports/infrastructure/mk/bsd.port.mk:2495 'configure') -- If you eat a live frog in the morning, nothing worse will happen to either of you for the rest of the day.