Lines 1-71
Link Here
|
1 |
# $FreeBSD$ |
1 |
# $FreeBSD$ |
2 |
# |
2 |
# |
3 |
# Provide support for Meson based projects |
3 |
# Provide support for Meson based projects |
4 |
# |
4 |
# |
5 |
# Feature: meson |
5 |
# Feature: meson |
6 |
# Usage: USES=meson |
6 |
# Usage: USES=meson |
7 |
# |
7 |
# |
8 |
# The following files are bundled in source tar files. |
8 |
# The following files are bundled in source tar files. |
9 |
# meson.build - Instructions for meson like autoconf configure, |
9 |
# meson.build - Instructions for meson like autoconf configure, |
10 |
# there is no changeable parts in the file. |
10 |
# there is no changeable parts in the file. |
11 |
# meson_options.txt - All the options meson understands |
11 |
# meson_options.txt - All the options meson understands |
12 |
# |
12 |
# |
13 |
# Variables for ports: |
13 |
# Variables for ports: |
14 |
# MESON_ARGS - Arguments passed to meson |
14 |
# MESON_ARGS - Arguments passed to meson |
15 |
# format: -Denable_foo=true |
15 |
# format: -Denable_foo=true |
|
|
16 |
# MESON_SOURCE_PATH - Path to the source directory |
17 |
# Default: ${WRKSRC} |
16 |
# MESON_BUILD_DIR - Path to the build directory relative to ${WRKSRC} |
18 |
# MESON_BUILD_DIR - Path to the build directory relative to ${WRKSRC} |
17 |
# Default: _build |
19 |
# Default: _build |
18 |
# |
20 |
# |
19 |
# MAINTAINER: gnome@FreeBSD.org |
21 |
# MAINTAINER: gnome@FreeBSD.org |
20 |
|
22 |
|
21 |
.if !defined(_INCLUDE_USES_MESON_MK) |
23 |
.if !defined(_INCLUDE_USES_MESON_MK) |
22 |
_INCLUDE_USES_MESON_MK= yes |
24 |
_INCLUDE_USES_MESON_MK= yes |
23 |
|
25 |
|
24 |
# Sanity check |
26 |
# Sanity check |
25 |
.if !empty(meson_ARGS) |
27 |
.if !empty(meson_ARGS) |
26 |
IGNORE= Incorrect 'USES+= meson:${meson_ARGS}'. meson takes no arguments |
28 |
IGNORE= Incorrect 'USES+= meson:${meson_ARGS}'. meson takes no arguments |
27 |
.endif |
29 |
.endif |
28 |
|
30 |
|
29 |
BUILD_DEPENDS+= meson:devel/meson |
31 |
BUILD_DEPENDS+= meson:devel/meson |
30 |
|
32 |
|
31 |
# meson uses ninja |
33 |
# meson uses ninja |
32 |
.include "${USESDIR}/ninja.mk" |
34 |
.include "${USESDIR}/ninja.mk" |
33 |
|
35 |
|
34 |
# meson might have issues with non-unicode locales |
36 |
# meson might have issues with non-unicode locales |
35 |
USE_LOCALE?= en_US.UTF-8 |
37 |
USE_LOCALE?= en_US.UTF-8 |
36 |
|
38 |
|
37 |
CONFIGURE_ARGS+= --prefix ${PREFIX} \ |
39 |
CONFIGURE_ARGS+= --prefix ${PREFIX} \ |
38 |
--mandir man \ |
40 |
--mandir man \ |
39 |
--infodir ${INFO_PATH} |
41 |
--infodir ${INFO_PATH} |
40 |
|
42 |
|
41 |
# meson has it own strip mechanic |
43 |
# meson has it own strip mechanic |
42 |
INSTALL_TARGET= install |
44 |
INSTALL_TARGET= install |
43 |
|
45 |
|
44 |
# should we have strip separate from WITH_DEBUG? |
46 |
# should we have strip separate from WITH_DEBUG? |
45 |
.if defined(WITH_DEBUG) |
47 |
.if defined(WITH_DEBUG) |
46 |
CONFIGURE_ARGS+= --buildtype debug |
48 |
CONFIGURE_ARGS+= --buildtype debug |
47 |
.else |
49 |
.else |
48 |
CONFIGURE_ARGS+= --buildtype release \ |
50 |
CONFIGURE_ARGS+= --buildtype release \ |
49 |
--strip |
51 |
--strip |
50 |
.endif |
52 |
.endif |
51 |
|
53 |
|
52 |
HAS_CONFIGURE= yes |
54 |
HAS_CONFIGURE= yes |
53 |
CONFIGURE_CMD= meson |
55 |
CONFIGURE_CMD= meson |
54 |
# Pull in manual set settings and from options |
56 |
# Pull in manual set settings and from options |
55 |
CONFIGURE_ARGS+= ${MESON_ARGS} |
57 |
CONFIGURE_ARGS+= ${MESON_ARGS} |
56 |
|
58 |
|
57 |
BUILD_WRKSRC= ${WRKSRC}/${MESON_BUILD_DIR} |
59 |
BUILD_WRKSRC= ${WRKSRC}/${MESON_BUILD_DIR} |
58 |
|
60 |
|
59 |
INSTALL_WRKSRC= ${WRKSRC}/${MESON_BUILD_DIR} |
61 |
INSTALL_WRKSRC= ${WRKSRC}/${MESON_BUILD_DIR} |
60 |
|
62 |
|
61 |
TEST_WRKSRC= ${WRKSRC}/${MESON_BUILD_DIR} |
63 |
TEST_WRKSRC= ${WRKSRC}/${MESON_BUILD_DIR} |
62 |
TEST_TARGET= test |
64 |
TEST_TARGET= test |
63 |
|
65 |
|
|
|
66 |
MESON_SOURCE_PATH?= ${WRKSRC} |
64 |
MESON_BUILD_DIR?= _build |
67 |
MESON_BUILD_DIR?= _build |
65 |
|
68 |
|
66 |
CONFIGURE_LOG= ${MESON_BUILD_DIR}/meson-logs/meson-log.txt |
69 |
CONFIGURE_LOG= ${MESON_BUILD_DIR}/meson-logs/meson-log.txt |
67 |
|
70 |
|
68 |
# Add meson build dir at the end. |
71 |
# Add meson source path and build dir at the end. |
69 |
CONFIGURE_ARGS+= ${MESON_BUILD_DIR} |
72 |
CONFIGURE_ARGS+= ${MESON_SOURCE_PATH} ${MESON_BUILD_DIR} |
70 |
|
73 |
|
71 |
.endif #!defined(_INCLUDE_USES_MESON_MK) |
74 |
.endif #!defined(_INCLUDE_USES_MESON_MK) |