Skip to content

Commit

Permalink
sagemathgh-36955: build/pkgs/ninja_build: support samurai version scheme
Browse files Browse the repository at this point in the history
Samurai is a C99 ninja implementation with an almost-compatible version
scheme, except that it has only two version components instead of the
three that ninja has. We update the "sed" call used to parse the version
number out of `ninja --version` so that it can parse a samurai version
too.

This should only matter on systems where (for example) /usr/bin/ninja
points to samurai. That's not typical, but it recently became possible
to do on Gentoo in an "official" way.

URL: sagemath#36955
Reported by: Michael Orlitzky
Reviewer(s): Matthias Köppe
  • Loading branch information
Release Manager committed Dec 24, 2023
2 parents bcc4640 + 5413732 commit f72e4df
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
6 changes: 3 additions & 3 deletions build/pkgs/configure/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
tarball=configure-VERSION.tar.gz
sha1=2389d2b093493c568deda190ffc326ff2b835169
md5=545e80b50deb4efa46f14d0a543ba98f
cksum=169905223
sha1=9efe8fb5bde503598ca8fa9c88c8264142a629e0
md5=7cb1bc053cc00a1f91a0d46b90ab487a
cksum=3260934064
2 changes: 1 addition & 1 deletion build/pkgs/configure/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
73e52a419812253c3c3ce72bab7f1a5ddf4c0461
706e0de188dd8706317e5bc5175db4ea19ebc22f
4 changes: 3 additions & 1 deletion build/pkgs/ninja_build/spkg-configure.m4
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ SAGE_SPKG_CONFIGURE(
dnl meson_python needs 1.8.2 or later
AC_CACHE_CHECK([for ninja >= 1.8.2], [ac_cv_path_NINJA], [
AC_PATH_PROGS_FEATURE_CHECK([NINJA], [ninja], [
dnl support both two- and three-component version schemes
dnl since samurai (a ninja alternative) uses two
ninja_version=`$ac_path_NINJA --version 2>&1 \
| $SED -n -e 's/\([[0-9]]*\.[[0-9]]*\.[[0-9]]*\).*/\1/p'`
| $SED -n -e 's/\([[0-9]]*\(\.[[0-9]]*\)\{1,2\}\).*/\1/p'`
AS_IF([test -n "$ninja_version"], [
AX_COMPARE_VERSION([$ninja_version], [ge], [1.8.2], [
ac_cv_path_NINJA="$ac_path_NINJA"
Expand Down

0 comments on commit f72e4df

Please sign in to comment.