[PATCH cygport 0/2] Use meson auto-features option

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH cygport 0/2] Use meson auto-features option

Jon TURNEY
Jon Turney (2):
  meson: use auto-features option
  Fixup __version_at_least a bit

 cygclass/meson.cygclass | 9 ++++++++-
 lib/check_funcs.cygpart | 6 +++---
 2 files changed, 11 insertions(+), 4 deletions(-)

--
2.17.0

Reply | Threaded
Open this post in threaded view
|

[PATCH cygport 1/2] meson: use auto-features option

Jon TURNEY
This option added in 0.47 [1], is intended to be used by distribution
packaging to ensure that features for a package are explicitly
configured. (e.g see discussion at [2])

(Note that features are a relatively recent meson feature and thus
aren't used by some packages)

[1] http://mesonbuild.com/Release-notes-for-0-47-0.html#new-type-of-build-option-for-features
[2] https://lists.fedoraproject.org/archives/list/devel@.../thread/SVURE6JRDBTFKHJAPFBYRZ62JQ56OLEG/
---
 cygclass/meson.cygclass | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/cygclass/meson.cygclass b/cygclass/meson.cygclass
index 1d2694c..2490cd6 100644
--- a/cygclass/meson.cygclass
+++ b/cygclass/meson.cygclass
@@ -53,7 +53,7 @@ inherit ninja
 #  cygmeson should be run in the directory containing the top-level meson.build.
 #****
 cygmeson() {
- local crossargs mdir
+ local crossargs mdir meson_version
 
  if [ ! -e meson.build ]
  then
@@ -75,6 +75,12 @@ cygmeson() {
 
  check_prog_req meson
 
+ meson_version=$(meson --version)
+ if ! __version_at_least 0.47 ${meson_version}
+ then
+    error "meson.cygclass: minimum supported meson version is 0.47"
+ fi
+
 #****v* cygmeson/CYGMESON_ARGS
 #  DESCRIPTION
 #  Additional flags to pass to meson, as a string.
@@ -86,6 +92,7 @@ cygmeson() {
  --localstatedir=$(__host_localstatedir) \
  --sysconfdir=$(__host_sysconfdir) \
  --buildtype=plain --wrap-mode=nodownload \
+ --auto-features=enabled \
  ${crossargs} ${CYGMESON_ARGS} "${@}" ${CHOST} \
  || error "meson failed"
 }
--
2.17.0

Reply | Threaded
Open this post in threaded view
|

[PATCH cygport 2/2] Fixup __version_at_least a bit

Jon TURNEY
In reply to this post by Jon TURNEY
Use the variables we've made containing the separated version
components, rather than an undefined one
---
 lib/check_funcs.cygpart | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/check_funcs.cygpart b/lib/check_funcs.cygpart
index 07516be..bb35812 100644
--- a/lib/check_funcs.cygpart
+++ b/lib/check_funcs.cygpart
@@ -699,12 +699,12 @@ __version_at_least() {
  local -a have_va=(${have_v//[-\._]/ });
  local -i n=0;
 
- while defined want_ver[${n}]
+ while defined want_va[${n}]
  do
- if (( want_ver[n] < ${have_ver[${n}]:-0} ))
+ if (( want_va[n] < ${have_va[${n}]:-0} ))
  then
  return 0;
- elif (( want_ver[n] > ${have_ver[${n}]:-0} ))
+ elif (( want_va[n] > ${have_va[${n}]:-0} ))
  then
  return 1;
  else
--
2.17.0

Reply | Threaded
Open this post in threaded view
|

Re: [PATCH cygport 0/2] Use meson auto-features option

Yaakov Selkowitz
In reply to this post by Jon TURNEY
On Tue, 2019-04-02 at 18:21 +0100, Jon Turney wrote:
> Jon Turney (2):
>   meson: use auto-features option
>   Fixup __version_at_least a bit
>
>  cygclass/meson.cygclass | 9 ++++++++-
>  lib/check_funcs.cygpart | 6 +++---
>  2 files changed, 11 insertions(+), 4 deletions(-)

Pushed to master, please test.

--
Yaakov