Skip to content

Commit cdcc434

Browse files
author
Matthias Koeppe
committed
build/pkgs/{cmake,ninja_build}/spkg-configure.m4: Reject installs in inaccessible user scheme
1 parent 4ac7152 commit cdcc434

File tree

2 files changed

+31
-23
lines changed

2 files changed

+31
-23
lines changed

build/pkgs/cmake/spkg-configure.m4

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
1-
SAGE_SPKG_CONFIGURE(
2-
[cmake], [
3-
AC_CACHE_CHECK([for cmake >= 3.11], [ac_cv_path_CMAKE], [
4-
AC_PATH_PROGS_FEATURE_CHECK([CMAKE], [cmake], [
5-
cmake_version=`$ac_path_CMAKE --version 2>&1 \
6-
| $SED -n -e 's/cmake version *\([[0-9]]*\.[[0-9]]*\.[[0-9]]*\)/\1/p'`
7-
AS_IF([test -n "$cmake_version"], [
8-
AX_COMPARE_VERSION([$cmake_version], [ge], [3.11], [
9-
ac_cv_path_CMAKE="$ac_path_CMAKE"
10-
ac_path_CMAKE_found=:
1+
SAGE_SPKG_CONFIGURE([cmake], [dnl
2+
AC_CACHE_CHECK([for cmake >= 3.11], [ac_cv_path_CMAKE], [dnl
3+
dnl Do not accept cmake installed via https://pypi.org/project/cmake/
4+
dnl in the default user scheme; it will not work in our venv because
5+
dnl we set PYTHONUSERBASE in sage-env.
6+
WITH_SAGE_PYTHONUSERBASE([dnl
7+
AC_PATH_PROGS_FEATURE_CHECK([CMAKE], [cmake], [dnl
8+
cmake_version=`$ac_path_CMAKE --version 2>&1 \
9+
| $SED -n -e 's/cmake version *\([[0-9]]*\.[[0-9]]*\.[[0-9]]*\)/\1/p'`
10+
AS_IF([test -n "$cmake_version"], [dnl
11+
AX_COMPARE_VERSION([$cmake_version], [ge], [3.11], [dnl
12+
ac_cv_path_CMAKE="$ac_path_CMAKE"
13+
ac_path_CMAKE_found=:
14+
])
1115
])
1216
])
1317
])

build/pkgs/ninja_build/spkg-configure.m4

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
1-
SAGE_SPKG_CONFIGURE(
2-
[ninja_build], [
3-
dnl meson_python needs 1.8.2 or later
4-
AC_CACHE_CHECK([for ninja >= 1.8.2], [ac_cv_path_NINJA], [
5-
AC_PATH_PROGS_FEATURE_CHECK([NINJA], [ninja], [
6-
dnl support both two- and three-component version schemes
7-
dnl since samurai (a ninja alternative) uses two
8-
ninja_version=`$ac_path_NINJA --version 2>&1 \
9-
| $SED -n -e 's/\([[0-9]]*\(\.[[0-9]]*\)\{1,2\}\).*/\1/p'`
10-
AS_IF([test -n "$ninja_version"], [
11-
AX_COMPARE_VERSION([$ninja_version], [ge], [1.8.2], [
12-
ac_cv_path_NINJA="$ac_path_NINJA"
13-
ac_path_NINJA_found=:
1+
SAGE_SPKG_CONFIGURE([ninja_build], [dnl
2+
dnl meson_python needs 1.8.2 or later
3+
AC_CACHE_CHECK([for ninja >= 1.8.2], [ac_cv_path_NINJA], [dnl
4+
dnl Do not accept ninja installed from https://pypi.org/project/ninja/
5+
dnl in the default user scheme; it will not work in our venv because
6+
dnl we set PYTHONUSERBASE in sage-env.
7+
WITH_SAGE_PYTHONUSERBASE([dnl
8+
AC_PATH_PROGS_FEATURE_CHECK([NINJA], [ninja], [dnl
9+
dnl support both two- and three-component version schemes
10+
dnl since samurai (a ninja alternative) uses two
11+
ninja_version=`$ac_path_NINJA --version 2>&1 \
12+
| $SED -n -e 's/\([[0-9]]*\(\.[[0-9]]*\)\{1,2\}\).*/\1/p'`
13+
AS_IF([test -n "$ninja_version"], [dnl
14+
AX_COMPARE_VERSION([$ninja_version], [ge], [1.8.2], [
15+
ac_cv_path_NINJA="$ac_path_NINJA"
16+
ac_path_NINJA_found=:
17+
])
1418
])
1519
])
1620
])

0 commit comments

Comments
 (0)