19 |
meson_disable() |
meson_disable() |
20 |
{ |
{ |
21 |
local feature="$1" |
local feature="$1" |
22 |
echo "-Denable_${feature}=false" |
echo "-Denable-${feature}=false" |
23 |
} |
} |
24 |
|
|
25 |
# enables features like --with-blah with make |
# enables features like --with-blah with make |
55 |
meson_configure() |
meson_configure() |
56 |
{ |
{ |
57 |
local configure_opts="$@" |
local configure_opts="$@" |
58 |
|
local default_opts |
59 |
|
|
60 |
meson setup \ |
default_opts+=" --buildtype=release" |
61 |
--buildtype=release \ |
default_opts+=" --prefix=/usr" |
62 |
--prefix=/usr \ |
default_opts+=" --sysconfdir=/etc" |
63 |
--sysconfdir=/etc \ |
default_opts+=" --localstatedir=/var/lib" |
64 |
--localstatedir=/var/lib \ |
default_opts+=" --libdir=/usr/$(mlibdir)" |
65 |
--libdir=/usr/$(mlibdir) \ |
default_opts+=" --libexecdir=/usr/$(mlibdir)/${PNAME}" |
66 |
--libexecdir=/usr/$(mlibdir)/${PNAME} \ |
|
67 |
${configure_opts} \ |
if [[ ${MULTILIB_BUILD} = true ]] |
68 |
${SRCDIR}/${SRCSUBDIR} \ |
then |
69 |
|| die |
ABI_DO_NOT_ENTER_SRCDIR=false all-abis meson setup ${default_opts} ${configure_opts} ${SRCDIR}-$(mabi)/${SRCSUBDIR} || die |
70 |
|
else |
71 |
|
meson setup ${default_opts} ${configure_opts} ${SRCDIR}/${SRCSUBDIR} || die |
72 |
|
fi |
73 |
} |
} |
74 |
|
|
75 |
mninja() |
mninja() |
76 |
{ |
{ |
77 |
ninja -v ${MAKEOPTS} "$@" |
if [[ ${MULTILIB_BUILD} = true ]] |
78 |
|
then |
79 |
|
all-abis ninja -C ${SRCDIR}-$(mabi)/${SRCSUBDIR} -v ${MAKEOPTS} "$@" |
80 |
|
else |
81 |
|
ninja -C ${SRCDIR}/${SRCSUBDIR} -v ${MAKEOPTS} "$@" |
82 |
|
fi |
83 |
|
} |
84 |
|
|
85 |
|
meson_setup_builddir() |
86 |
|
{ |
87 |
|
if [[ ${MULTILIB_BUILD} = true ]] |
88 |
|
then |
89 |
|
all-abis install -d ${BUILDDIR}/build-$(mabi) || die |
90 |
|
else |
91 |
|
install -d ${BUILDDIR}/build || die |
92 |
|
fi |
93 |
} |
} |
94 |
|
|
95 |
meson_src_compile() |
meson_src_compile() |
96 |
{ |
{ |
97 |
cd ${SRCDIR} |
if [[ ${MULTILIB_BUILD} != true ]] |
98 |
|
then |
99 |
# remove build dir if exist |
cd ${SRCDIR} |
100 |
[[ -d ${BUILDDIR}/build ]] && rm -rf ${BUILDDIR}/build |
fi |
101 |
|
|
102 |
# build outside of the source dir |
meson_setup_builddir || die |
103 |
install -d ${BUILDDIR}/build || die |
meson_configure "$@" || die |
|
cd ${BUILDDIR}/build |
|
|
|
|
|
meson_configure || die |
|
104 |
mninja || die |
mninja || die |
105 |
} |
} |
106 |
|
|
110 |
meson test || die |
meson test || die |
111 |
} |
} |
112 |
|
|
113 |
|
meson_multilib_src_check() |
114 |
|
{ |
115 |
|
local abi |
116 |
|
local abis_to_run="${MULTILIB_ABIS}" |
117 |
|
|
118 |
|
# respect MULTILIB_ONLY_ABI variable |
119 |
|
[[ ! -z ${MULTILIB_ONLY_ABI} ]] && abis_to_run="${MULTILIB_ONLY_ABI}" |
120 |
|
for abi in ${abis_to_run} |
121 |
|
do |
122 |
|
cd ${BUILDDIR}/build-${abi} |
123 |
|
meson test || die |
124 |
|
done |
125 |
|
} |
126 |
|
|
127 |
meson_src_install() |
meson_src_install() |
128 |
{ |
{ |
129 |
cd ${BUILDDIR}/build |
cd ${BUILDDIR}/build |
141 |
done |
done |
142 |
} |
} |
143 |
|
|
144 |
export_inherits meson src_prepare src_compile src_check src_install |
meson_multilib_src_install() |
145 |
|
{ |
146 |
|
local abi |
147 |
|
local abis_to_run="${MULTILIB_ABIS}" |
148 |
|
|
149 |
|
# respect MULTILIB_ONLY_ABI variable |
150 |
|
[[ ! -z ${MULTILIB_ONLY_ABI} ]] && abis_to_run="${MULTILIB_ONLY_ABI}" |
151 |
|
for abi in ${abis_to_run} |
152 |
|
do |
153 |
|
cd ${BUILDDIR}/build-${abi} |
154 |
|
DESTDIR=${BINDIR} ninja install || die |
155 |
|
|
156 |
|
cd ${SRCDIR}-${abi} |
157 |
|
local i |
158 |
|
for i in ABOUT-NLS AUTHORS BUGS CHANGES ChangeLog COPYING \ |
159 |
|
FAQ LICENSE NEWS README TODO |
160 |
|
do |
161 |
|
if [ -f ${SRCDIR}-${abi}/${i} ] |
162 |
|
then |
163 |
|
minstalldocs ${i} || die |
164 |
|
fi |
165 |
|
done |
166 |
|
done |
167 |
|
} |
168 |
|
|
169 |
|
export_inherits meson src_prepare src_compile |
170 |
|
if [[ ${MULTILIB_BUILD} = true ]] |
171 |
|
then |
172 |
|
export_inherits meson_multilib src_check src_install |
173 |
|
else |
174 |
|
export_inherits meson src_check src_install |
175 |
|
fi |