Created attachment 160282 [details] v0 (unsorted) Proof of concept implementation based on bug 202608. It aggressively converts everything possible into helpers to avoid including bsd.port.mk 3x times. I didn't test yet. ;)
Created attachment 160283 [details] v0.1 CHOSEN_COMPILER_TYPE is defined too late, after bsd.options.mk is already parsed. I think we can replace it with COMPILER_TYPE since 8.x is EOL. FAVORITE_COMPILER=gcc doesn't convert USES=compiler:c++11-lib into USES=compiler:gcc-c++11-lib, anyway.
Created attachment 160291 [details] v1 (unsorted) Missed .include bsd.compiler.mk. Now tested.
Created attachment 160292 [details] QA: poudriere testport -j 93i386
Created attachment 160293 [details] QA: poudriere testport -j 102amd64
Created attachment 160294 [details] QA with TEST=on: poudriere testport -j 101i386 Unless I'm missing something the following error looks unrelated. According to components/storage_monitor.gypi 'storage_monitor_test_support' target has another set of of *_linux.cc 'sources' which aren't excluded for 'os_bsd == 1'. In file included from ../../components/storage_monitor/test_media_transfer_protocol_manager_linux.cc:5: In file included from ../../components/storage_monitor/test_media_transfer_protocol_manager_linux.h:8: ../../device/media_transfer_protocol/media_transfer_protocol_manager.h:16:2: error: "Only used on Linux and ChromeOS" #error "Only used on Linux and ChromeOS" ^ ../../components/storage_monitor/test_media_transfer_protocol_manager_linux.cc:7:10: fatal error: 'device/media_transfer_protocol/mtp_file_entry.pb.h' file not found #include "device/media_transfer_protocol/mtp_file_entry.pb.h" ^ 2 errors generated.
Created attachment 160304 [details] v1 against review D3410 (unsorted) Mostly mechanical conversion. Quoting is different, so TEST option has to preserve word splitting when copying TEST_TARGETS values used in .for loop in regression-test.
Created attachment 160306 [details] QA for D3410 flavor: poudriere testport -j 93amd64
Created attachment 160437 [details] v1 against r395468 review D3410 landed with slightly different syntax. Also, I was wrong about quoting difference with my version: ${opt}_VARS=SOME="foo bar ... qux" honors word-splitting fine.
Created attachment 183881 [details] v2 against r444567
Take a final look if you want :) Thank you, Jan
Created attachment 183931 [details] v2 against r444690 - Re-add missing "Makefile.tests"
Comment on attachment 183931 [details] v2 against r444690 > +DEBUG_MAKE_ENV= V=1 Does it have any effect nowadays? Verbose builds should be unconditional since ports r421635. > .include <bsd.port.pre.mk> Nothing later in the file relies on USES for flow control (.if/.for) or target names/prerequisites (foo: a b c), so you can either replace bsd.port.pre.mk with bsd.port.options.mk or drop it via bmake syntax e.g., -.include <bsd.port.pre.mk> [...] # Work around base r261801 -.if ${OPSYS} == FreeBSD && ${OSVERSION} < 1100508 -GN_ARGS+= extra_cxxflags="-D_LIBCPP_TRIVIAL_PAIR_COPY_CTOR=1" -.endif +GN_ARGS+= ${${OPSYS} == FreeBSD && ${OSVERSION} < 1100508:? \ + extra_cxxflags="-D_LIBCPP_TRIVIAL_PAIR_COPY_CTOR=1":} > +TEST_VARS= RUN_TESTS="${TEST_TARGETS}" [...] > test regression-test: build > -.for t in ${TEST_TARGETS} > +.for t in ${RUN_TESTS} IIRC, this disables tests if they haven't been built. After ports r398125 it can be simplified to -TEST_VARS= RUN_TESTS="${TEST_TARGETS}" [...] -test regression-test: build +do-test-TEST-on: .for t in ${TEST_TARGETS} > +CC= clang40 > +CXX= clang++40 > +EXTRA_PATCHES+= ${FILESDIR}/extra-patch-clang Can you move it higher in the file, just above the first GN_ARGS occurence? Also drop USES=compiler as CC/CXX are set manually while ${COMPILER_TYPE}, ${CHOSEN_COMPILER_TYPE}, ${COMPILER_VERSION} are unused. It would avoid pointless call to ${CC} --version which may not yet be installed.
Created attachment 183953 [details] v2 against r444769
(In reply to Jan Beich from comment #12) All the changes you have requested have been made. I have chosen to replace bsd.port.pre.mk with bsd.port.options.mk
Looks fine except for the following. $ portlint -C FATAL: Makefile: [79]: use a tab (not space) after a variable name FATAL: Makefile: [80]: use a tab (not space) after a variable name WARN: Makefile: [81]: use a tab (not space) after a variable name > -# TODO: move this big extra to small ones > -EXTRA_PATCHES+= ${FILESDIR}/extra-patch-clang TODO comment was lost. Intentional?
Created attachment 183954 [details] v2 against r444769 - Pet portlint FATAL: Makefile: [79]: use a tab (not space) after a variable name FATAL: Makefile: [80]: use a tab (not space) after a variable name WARN: Makefile: [81]: use a tab (not space) after a variable name
(In reply to Jan Beich from comment #15) Yes, I have intentionally deleted the comment. Thanks Jan
A commit references this bug: Author: cpm Date: Fri Jun 30 19:05:32 UTC 2017 New revision: 444774 URL: https://svnweb.freebsd.org/changeset/ports/444774 Log: www/chromium: convert to option helpers - Drop USES=compiler as CC/CXX are set manually - Switch to option helpers - Cleanup Makefile PR: 202609 Submitted by: jbeich (based on) Changes: head/www/chromium/Makefile
Committed, thanks!