meson: Support CONFIGURE_DIRS et al.diff -r1.1 -r1.2 pkgsrc/devel/meson/build.mk
(nia)
@@ -1,27 +1,39 @@ | @@ -1,27 +1,39 @@ | |||
1 | # $NetBSD: build.mk,v 1.1 2019/10/04 14:06:18 prlw1 Exp $ | 1 | # $NetBSD: build.mk,v 1.2 2019/10/05 20:09:52 nia Exp $ | |
2 | 2 | |||
3 | BUILD_DEPENDS+= meson-[0-9]*:../../devel/meson | 3 | BUILD_DEPENDS+= meson-[0-9]*:../../devel/meson | |
4 | 4 | |||
5 | CONFIGURE_DIRS?= . | |||
6 | BUILD_DIRS?= ${CONFIGURE_DIRS} | |||
7 | INSTALL_DIRS?= ${CONFIGURE_DIRS} | |||
8 | ||||
5 | .PHONY: meson-configure meson-build meson-install | 9 | .PHONY: meson-configure meson-build meson-install | |
6 | 10 | |||
7 | # pkgsrc contains multiple llvm-config executables at multiple locations. | 11 | # pkgsrc contains multiple llvm-config executables at multiple locations. | |
8 | .if !empty(LLVM_CONFIG_PATH) | 12 | .if !empty(LLVM_CONFIG_PATH) | |
9 | MAKE_ENV+= LLVM_CONFIG_PATH=${LLVM_CONFIG_PATH:Q} | 13 | MAKE_ENV+= LLVM_CONFIG_PATH=${LLVM_CONFIG_PATH:Q} | |
10 | .endif | 14 | .endif | |
11 | 15 | |||
12 | do-configure: meson-configure | 16 | do-configure: meson-configure | |
13 | meson-configure: | 17 | meson-configure: | |
14 | cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} meson --prefix ${PREFIX} --libdir lib --mandir ${PKGMANDIR} --sysconfdir ${PKG_SYSCONFDIR} --buildtype=plain ${MESON_ARGS} . output | 18 | .for d in ${CONFIGURE_DIRS} | |
19 | cd ${WRKSRC} && cd ${d} && ${SETENV} ${MAKE_ENV} meson \ | |||
20 | --prefix ${PREFIX} --libdir lib --mandir ${PKGMANDIR} \ | |||
21 | --sysconfdir ${PKG_SYSCONFDIR} --buildtype=plain ${MESON_ARGS} . output | |||
22 | .endfor | |||
15 | 23 | |||
16 | do-build: meson-build | 24 | do-build: meson-build | |
17 | meson-build: | 25 | meson-build: | |
18 | cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ninja -j ${MAKE_JOBS:U1} -C output | 26 | .for d in ${BUILD_DIRS} | |
27 | cd ${WRKSRC} && cd ${d} && ${SETENV} ${MAKE_ENV} ninja -j ${MAKE_JOBS:U1} -C output | |||
28 | .endfor | |||
19 | 29 | |||
20 | do-install: meson-install | 30 | do-install: meson-install | |
21 | meson-install: | 31 | meson-install: | |
32 | .for d in ${INSTALL_DIRS} | |||
22 | if [ -f ${WRKSRC}/meson_post_install.py ]; then \ | 33 | if [ -f ${WRKSRC}/meson_post_install.py ]; then \ | |
23 | ${CHMOD} +x ${WRKSRC}/meson_post_install.py; \ | 34 | ${CHMOD} +x ${WRKSRC}/meson_post_install.py; \ | |
24 | fi | 35 | fi | |
25 | cd ${WRKSRC} && ${SETENV} ${INSTALL_ENV} ${MAKE_ENV} ninja -C output install | 36 | cd ${WRKSRC} && cd ${d} && ${SETENV} ${INSTALL_ENV} ${MAKE_ENV} ninja -C output install | |
37 | .endfor | |||
26 | 38 | |||
27 | .include "../../lang/python/application.mk" | 39 | .include "../../lang/python/application.mk" |
@@ -1,27 +1,39 @@ | @@ -1,27 +1,39 @@ | |||
1 | # $NetBSD: build.mk,v 1.13 2019/09/30 11:37:04 prlw1 Exp $ | 1 | # $NetBSD: build.mk,v 1.14 2019/10/05 20:09:52 nia Exp $ | |
2 | 2 | |||
3 | BUILD_DEPENDS+= py37-meson-[0-9]*:../../devel/py-meson | 3 | BUILD_DEPENDS+= py37-meson-[0-9]*:../../devel/py-meson | |
4 | 4 | |||
5 | CONFIGURE_DIRS?= . | |||
6 | BUILD_DIRS?= ${CONFIGURE_DIRS} | |||
7 | INSTALL_DIRS?= ${CONFIGURE_DIRS} | |||
8 | ||||
5 | .PHONY: meson-configure meson-build meson-install | 9 | .PHONY: meson-configure meson-build meson-install | |
6 | 10 | |||
7 | # pkgsrc contains multiple llvm-config executables at multiple locations. | 11 | # pkgsrc contains multiple llvm-config executables at multiple locations. | |
8 | .if !empty(LLVM_CONFIG_PATH) | 12 | .if !empty(LLVM_CONFIG_PATH) | |
9 | MAKE_ENV+= LLVM_CONFIG_PATH=${LLVM_CONFIG_PATH:Q} | 13 | MAKE_ENV+= LLVM_CONFIG_PATH=${LLVM_CONFIG_PATH:Q} | |
10 | .endif | 14 | .endif | |
11 | 15 | |||
12 | do-configure: meson-configure | 16 | do-configure: meson-configure | |
13 | meson-configure: | 17 | meson-configure: | |
14 | cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} meson --prefix ${PREFIX} --libdir lib --mandir ${PKGMANDIR} --sysconfdir ${PKG_SYSCONFDIR} --buildtype=plain ${MESON_ARGS} . output | 18 | .for d in ${CONFIGURE_DIRS} | |
19 | cd ${WRKSRC} && cd ${d} && ${SETENV} ${MAKE_ENV} meson \ | |||
20 | --prefix ${PREFIX} --libdir lib --mandir ${PKGMANDIR} \ | |||
21 | --sysconfdir ${PKG_SYSCONFDIR} --buildtype=plain ${MESON_ARGS} . output | |||
22 | .endfor | |||
15 | 23 | |||
16 | do-build: meson-build | 24 | do-build: meson-build | |
17 | meson-build: | 25 | meson-build: | |
18 | cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ninja -j ${MAKE_JOBS:U1} -C output | 26 | .for d in ${BUILD_DIRS} | |
27 | cd ${WRKSRC} && cd ${d} && ${SETENV} ${MAKE_ENV} ninja -j ${MAKE_JOBS:U1} -C output | |||
28 | .endfor | |||
19 | 29 | |||
20 | do-install: meson-install | 30 | do-install: meson-install | |
21 | meson-install: | 31 | meson-install: | |
32 | .for d in ${INSTALL_DIRS} | |||
22 | if [ -f ${WRKSRC}/meson_post_install.py ]; then \ | 33 | if [ -f ${WRKSRC}/meson_post_install.py ]; then \ | |
23 | ${CHMOD} +x ${WRKSRC}/meson_post_install.py; \ | 34 | ${CHMOD} +x ${WRKSRC}/meson_post_install.py; \ | |
24 | fi | 35 | fi | |
25 | cd ${WRKSRC} && ${SETENV} ${INSTALL_ENV} ${MAKE_ENV} ninja -C output install | 36 | cd ${WRKSRC} && cd ${d} && ${SETENV} ${INSTALL_ENV} ${MAKE_ENV} ninja -C output install | |
37 | .endfor | |||
26 | 38 | |||
27 | .include "../../lang/python/application.mk" | 39 | .include "../../lang/python/application.mk" |