Changeset View
Standalone View
Mk/bsd.options.mk
Show First 20 Lines • Show All 185 Lines • ▼ Show 20 Lines | _OPTIONS_FLAGS= ALL_TARGET BROKEN CATEGORIES CFLAGS CONFIGURE_ENV CONFLICTS \ | ||||
CONFLICTS_BUILD CONFLICTS_INSTALL CPPFLAGS CXXFLAGS \ | CONFLICTS_BUILD CONFLICTS_INSTALL CPPFLAGS CXXFLAGS \ | ||||
DESKTOP_ENTRIES DISTFILES EXTRA_PATCHES EXTRACT_ONLY \ | DESKTOP_ENTRIES DISTFILES EXTRA_PATCHES EXTRACT_ONLY \ | ||||
GH_ACCOUNT GH_PROJECT GH_SUBDIR GH_TAGNAME GH_TUPLE \ | GH_ACCOUNT GH_PROJECT GH_SUBDIR GH_TAGNAME GH_TUPLE \ | ||||
GL_ACCOUNT GL_COMMIT GL_PROJECT GL_SITE GL_SUBDIR GL_TUPLE \ | GL_ACCOUNT GL_COMMIT GL_PROJECT GL_SITE GL_SUBDIR GL_TUPLE \ | ||||
IGNORE INFO INSTALL_TARGET LDFLAGS LIBS MAKE_ARGS MAKE_ENV \ | IGNORE INFO INSTALL_TARGET LDFLAGS LIBS MAKE_ARGS MAKE_ENV \ | ||||
MASTER_SITES PATCHFILES PATCH_SITES PLIST_DIRS PLIST_FILES \ | MASTER_SITES PATCHFILES PATCH_SITES PLIST_DIRS PLIST_FILES \ | ||||
PLIST_SUB PORTDOCS PORTEXAMPLES SUB_FILES SUB_LIST \ | PLIST_SUB PORTDOCS PORTEXAMPLES SUB_FILES SUB_LIST \ | ||||
TEST_TARGET USES BINARY_ALIAS | TEST_TARGET USES BINARY_ALIAS | ||||
_OPTIONS_DEPENDS= PKG FETCH EXTRACT PATCH BUILD LIB RUN TEST | _OPTIONS_DEPENDS= PKG FETCH EXTRACT PATCH BUILD LIB RUN TEST | ||||
mat: Remove `EXECUTABLES` here. | |||||
# The format here is target_family:priority:target-type | # The format here is target_family:priority:target-type | ||||
_OPTIONS_TARGETS= fetch:300:pre fetch:500:do fetch:700:post \ | _OPTIONS_TARGETS= fetch:300:pre fetch:500:do fetch:700:post \ | ||||
Done Inline ActionsRemove USE_CABAL here. mat: Remove `USE_CABAL` here. | |||||
extract:300:pre extract:500:do extract:700:post \ | extract:300:pre extract:500:do extract:700:post \ | ||||
patch:300:pre patch:500:do patch:700:post \ | patch:300:pre patch:500:do patch:700:post \ | ||||
configure:300:pre configure:500:do configure:700:post \ | configure:300:pre configure:500:do configure:700:post \ | ||||
build:300:pre build:500:do build:700:post \ | build:300:pre build:500:do build:700:post \ | ||||
install:300:pre install:500:do install:700:post \ | install:300:pre install:500:do install:700:post \ | ||||
test:300:pre test:500:do test:700:post \ | test:300:pre test:500:do test:700:post \ | ||||
package:300:pre package:500:do package:700:post \ | package:300:pre package:500:do package:700:post \ | ||||
stage:800:post | stage:800:post | ||||
▲ Show 20 Lines • Show All 305 Lines • ▼ Show 20 Lines | |||||
MESON_ARGS+= ${${opt}_MESON_NO:C/.*/-D&=no/} | MESON_ARGS+= ${${opt}_MESON_NO:C/.*/-D&=no/} | ||||
. endif | . endif | ||||
. if defined(${opt}_MESON_ENABLED) | . if defined(${opt}_MESON_ENABLED) | ||||
MESON_ARGS+= ${${opt}_MESON_ENABLED:C/.*/-D&=enabled/} | MESON_ARGS+= ${${opt}_MESON_ENABLED:C/.*/-D&=enabled/} | ||||
. endif | . endif | ||||
. if defined(${opt}_MESON_DISABLED) | . if defined(${opt}_MESON_DISABLED) | ||||
MESON_ARGS+= ${${opt}_MESON_DISABLED:C/.*/-D&=disabled/} | MESON_ARGS+= ${${opt}_MESON_DISABLED:C/.*/-D&=disabled/} | ||||
. endif | . endif | ||||
. if defined(${opt}_CABAL_FLAGS) | |||||
CABAL_FLAGS+= ${${opt}_CABAL_FLAGS} | |||||
. endif | |||||
. if defined(${opt}_USE_CABAL) | |||||
USE_CABAL+= ${${opt}_USE_CABAL} | |||||
. endif | |||||
Not Done Inline ActionsIs this really needed when we already have the opt_USE helper? tobik: Is this really needed when we already have the `opt_USE` helper? | |||||
Done Inline ActionsIt is not, but I'm hesistant to change that now. Moreover, I find opt_USE to look untidy when there are many items and you have to list them separated by , instead of . arrowd: It is not, but I'm hesistant to change that now.
Moreover, I find `opt_USE` to look untidy… | |||||
Not Done Inline ActionsNote that this is not needed, you already have <opt>_USE= cabal=foo. mat: Note that this is not needed, you already have `<opt>_USE= cabal=foo`. | |||||
Done Inline ActionsPlease, let's leave these 3 lines as they are. While opt_USE= xorg:xft,xwhatever looks nice, because there aren't many arguments for USE_XORG exists, the opt_USE= cabal:foo-1.2.3_4,bar-5.6.7_8,baz-9.10.11_12,... is awful, IMO. And these lines can be pretty large, in case some option pulls a bunch of Haskell packages. arrowd: Please, let's leave these 3 lines as they are. While `opt_USE= xorg:xft,xwhatever` looks nice… | |||||
. if defined(${opt}_EXECUTABLES) | |||||
EXECUTABLES+= ${${opt}_EXECUTABLES} | |||||
. endif | |||||
Done Inline ActionsIf all you are doing is: .if defined(<opt>_FOO) FOO+= <opt>_FOO .endif all you need to do is add FOO to _OPTIONS_FLAGS. mat: If all you are doing is:
```
.if defined(<opt>_FOO)
FOO+= <opt>_FOO
.endif
```
all you need… | |||||
. for configure in CONFIGURE CMAKE MESON QMAKE | . for configure in CONFIGURE CMAKE MESON QMAKE | ||||
. if defined(${opt}_${configure}_ON) | . if defined(${opt}_${configure}_ON) | ||||
${configure}_ARGS+= ${${opt}_${configure}_ON} | ${configure}_ARGS+= ${${opt}_${configure}_ON} | ||||
. endif | . endif | ||||
. endfor | . endfor | ||||
. for flags in ${_OPTIONS_FLAGS} | . for flags in ${_OPTIONS_FLAGS} | ||||
. if defined(${opt}_${flags}) | . if defined(${opt}_${flags}) | ||||
${flags}+= ${${opt}_${flags}} | ${flags}+= ${${opt}_${flags}} | ||||
. endif | . endif | ||||
. endfor | . endfor | ||||
. for deptype in ${_OPTIONS_DEPENDS} | . for deptype in ${_OPTIONS_DEPENDS} | ||||
. if defined(${opt}_${deptype}_DEPENDS) | . if defined(${opt}_${deptype}_DEPENDS) | ||||
${deptype}_DEPENDS+= ${${opt}_${deptype}_DEPENDS} | ${deptype}_DEPENDS+= ${${opt}_${deptype}_DEPENDS} | ||||
. endif | . endif | ||||
. endfor | . endfor | ||||
. for target in ${_OPTIONS_TARGETS} | . for target in ${_OPTIONS_TARGETS} | ||||
_target= ${target:C/:.*//} | _target= ${target:C/:.*//} | ||||
_prio= ${target:C/.*:(.*):.*/\1/} | _prio= ${target:C/.*:(.*):.*/\1/} | ||||
_type= ${target:C/.*://} | _type= ${target:C/.*://} | ||||
_OPTIONS_${_target}:= ${_OPTIONS_${_target}} ${_prio}:${_type}-${_target}-${opt}-on | _OPTIONS_${_target}:= ${_OPTIONS_${_target}} ${_prio}:${_type}-${_target}-${opt}-on | ||||
. endfor | . endfor | ||||
. else | . else | ||||
. if defined(${opt}_USE_OFF) | . if defined(${opt}_USE_OFF) | ||||
. for option in ${${opt}_USE_OFF:C/=.*//:O:u} | . for option in ${${opt}_USE_OFF:C/=.*//:O:u} | ||||
_u= ${option} | _u= ${option} | ||||
USE_${_u:tu}+= ${${opt}_USE_OFF:M${option}=*:C/.*=//g:C/,/ /g} | USE_${_u:tu}+= ${${opt}_USE_OFF:M${option}=*:C/.*=//g:C/,/ /g} | ||||
. endfor | . endfor | ||||
. endif | . endif | ||||
. if defined(${opt}_VARS_OFF) | . if defined(${opt}_VARS_OFF) | ||||
. for var in ${${opt}_VARS_OFF:C/=.*//:O:u} | . for var in ${${opt}_VARS_OFF:C/=.*//:O:u} | ||||
_u= ${var} | _u= ${var} | ||||
. if ${_u:M*+} | . if ${_u:M*+} | ||||
${_u:C/.$//:tu}+= ${${opt}_VARS_OFF:M${var}=*:C/[^+]*\+=//:C/^"(.*)"$$/\1/} | ${_u:C/.$//:tu}+= ${${opt}_VARS_OFF:M${var}=*:C/[^+]*\+=//:C/^"(.*)"$$/\1/} | ||||
. else | . else | ||||
${_u:tu}= ${${opt}_VARS_OFF:M${var}=*:C/[^=]*=//:C/^"(.*)"$$/\1/} | ${_u:tu}= ${${opt}_VARS_OFF:M${var}=*:C/[^=]*=//:C/^"(.*)"$$/\1/} | ||||
. endif | . endif | ||||
. endfor | . endfor | ||||
. endif | . endif | ||||
. if defined(${opt}_CONFIGURE_ENABLE) | . if defined(${opt}_CONFIGURE_ENABLE) | ||||
CONFIGURE_ARGS+= ${${opt}_CONFIGURE_ENABLE:S/^/--disable-/:C/=.*//} | CONFIGURE_ARGS+= ${${opt}_CONFIGURE_ENABLE:S/^/--disable-/:C/=.*//} | ||||
. endif | . endif | ||||
. if defined(${opt}_CONFIGURE_WITH) | . if defined(${opt}_CONFIGURE_WITH) | ||||
CONFIGURE_ARGS+= ${${opt}_CONFIGURE_WITH:S/^/--without-/:C/=.*//} | CONFIGURE_ARGS+= ${${opt}_CONFIGURE_WITH:S/^/--without-/:C/=.*//} | ||||
. endif | . endif | ||||
. if defined(${opt}_CMAKE_BOOL) | . if defined(${opt}_CMAKE_BOOL) | ||||
CMAKE_ARGS+= ${${opt}_CMAKE_BOOL:C/.*/-D&:BOOL=false/} | CMAKE_ARGS+= ${${opt}_CMAKE_BOOL:C/.*/-D&:BOOL=false/} | ||||
. endif | . endif | ||||
. if defined(${opt}_CMAKE_BOOL_OFF) | . if defined(${opt}_CMAKE_BOOL_OFF) | ||||
CMAKE_ARGS+= ${${opt}_CMAKE_BOOL_OFF:C/.*/-D&:BOOL=true/} | CMAKE_ARGS+= ${${opt}_CMAKE_BOOL_OFF:C/.*/-D&:BOOL=true/} | ||||
. endif | . endif | ||||
. if defined(${opt}_MESON_TRUE) | . if defined(${opt}_MESON_TRUE) | ||||
MESON_ARGS+= ${${opt}_MESON_TRUE:C/.*/-D&=false/} | MESON_ARGS+= ${${opt}_MESON_TRUE:C/.*/-D&=false/} | ||||
. endif | . endif | ||||
. if defined(${opt}_MESON_FALSE) | . if defined(${opt}_MESON_FALSE) | ||||
MESON_ARGS+= ${${opt}_MESON_FALSE:C/.*/-D&=true/} | MESON_ARGS+= ${${opt}_MESON_FALSE:C/.*/-D&=true/} | ||||
. endif | . endif | ||||
. if defined(${opt}_MESON_YES) | . if defined(${opt}_MESON_YES) | ||||
MESON_ARGS+= ${${opt}_MESON_YES:C/.*/-D&=no/} | MESON_ARGS+= ${${opt}_MESON_YES:C/.*/-D&=no/} | ||||
. endif | . endif | ||||
. if defined(${opt}_MESON_NO) | . if defined(${opt}_MESON_NO) | ||||
MESON_ARGS+= ${${opt}_MESON_NO:C/.*/-D&=yes/} | MESON_ARGS+= ${${opt}_MESON_NO:C/.*/-D&=yes/} | ||||
. endif | . endif | ||||
. if defined(${opt}_MESON_ENABLED) | . if defined(${opt}_MESON_ENABLED) | ||||
MESON_ARGS+= ${${opt}_MESON_ENABLED:C/.*/-D&=disabled/} | MESON_ARGS+= ${${opt}_MESON_ENABLED:C/.*/-D&=disabled/} | ||||
. endif | . endif | ||||
. if defined(${opt}_MESON_DISABLED) | . if defined(${opt}_MESON_DISABLED) | ||||
MESON_ARGS+= ${${opt}_MESON_DISABLED:C/.*/-D&=enabled/} | MESON_ARGS+= ${${opt}_MESON_DISABLED:C/.*/-D&=enabled/} | ||||
. endif | |||||
. if defined(${opt}_CABAL_FLAGS) | |||||
CABAL_FLAGS+= -${${opt}_CABAL_FLAGS} | |||||
Done Inline ActionsThe new options helpers need to be documented in the header and added to _OPTIONS_FLAGS/_ALL_OPTIONS_HELPERS too. tobik: The new options helpers need to be documented in the header and added to… | |||||
Done Inline ActionsNot sure about last part. ${opt}_CABAL_FLAGS works differently from other opt helpers - it appends some value in any case, so it actually handles _OFF case too. As for ${opt}_USE_CABAL and ${opt}_EXECUTABLES - they don't need any handling for _OFF case. arrowd: Not sure about last part. `${opt}_CABAL_FLAGS` works differently from other opt helpers - it… | |||||
Done Inline ActionsAdding them to just _ALL_OPTIONS_HELPERS directly should be fine then. tobik: Adding them to just _ALL_OPTIONS_HELPERS directly should be fine then. | |||||
Done Inline Actionsgrep -r _ALL_OPTIONS_HELPERS Mk yields nothing. What's _ALL_OPTIONS_HELPERS and where is it located? arrowd: `grep -r _ALL_OPTIONS_HELPERS Mk` yields nothing. What's `_ALL_OPTIONS_HELPERS` and where is it… | |||||
Done Inline ActionsIn bsd.options.mk. Update your ports tree to after rP499267. tobik: In bsd.options.mk. Update your ports tree to after rP499267. | |||||
. endif | . endif | ||||
. for configure in CONFIGURE CMAKE MESON QMAKE | . for configure in CONFIGURE CMAKE MESON QMAKE | ||||
. if defined(${opt}_${configure}_OFF) | . if defined(${opt}_${configure}_OFF) | ||||
${configure}_ARGS+= ${${opt}_${configure}_OFF} | ${configure}_ARGS+= ${${opt}_${configure}_OFF} | ||||
. endif | . endif | ||||
. endfor | . endfor | ||||
. for flags in ${_OPTIONS_FLAGS} | . for flags in ${_OPTIONS_FLAGS} | ||||
. if defined(${opt}_${flags}_OFF) | . if defined(${opt}_${flags}_OFF) | ||||
Show All 34 Lines |
Remove EXECUTABLES here.