build: path improvements

Use correct paths in date.py

Fix some build warnings
This commit is contained in:
Dirk-Jan C. Binnema 2023-10-14 16:46:05 +03:00
parent 51ecf46d81
commit 48cb83b427
3 changed files with 17 additions and 11 deletions

View File

@ -11,16 +11,16 @@ BUILDDIR=build
command -v meson 2> /dev/null command -v meson 2> /dev/null
if [ $? != 0 ]; then if [ $? != 0 ]; then
echo "*** No meson found, please install it ***" echo "*** 'meson' not found, please install it ***"
exit 1 exit 1
fi fi
# we could remove build/ but let's avoid rm -rf risks... # we could remove build/ but let's avoid rm -rf risks...
if test -d ${BUILDDIR}; then if test -d ${BUILDDIR}; then
meson --reconfigure ${BUILDDIR} $@ meson setup --reconfigure ${BUILDDIR} $@ || exit 1
else else
meson ${BUILDDIR} $@ meson setup ${BUILDDIR} $@ || exit 1
fi fi
echo "*** Now run 'ninja -C ${BUILDDIR}' to build mu" echo "*** Now run either 'ninja -C ${BUILDDIR}' or 'make' to build mu"
echo "*** Or check the Makefile for some useful targets" echo "*** Check the Makefile for other useful targets"

View File

@ -1,9 +1,15 @@
#!/bin/env python #!/usr/bin/env python3
#The MacOS 'date' is not quite up to GNU standards
"""
Script to get date strings, since the MacOS 'date' is not quite up to GNU
standards
E.g..
date.py 2023-10-14 "The year-month is %y %m"
"""
import sys import sys
from datetime import datetime from datetime import datetime
date=datetime.strptime(sys.argv[1],'%Y-%m-%d') date=datetime.strptime(sys.argv[1],'%Y-%m-%d')
print(date.strftime(sys.argv[2])) print(date.strftime(sys.argv[2]))
#
# ./date.py 2023-10-14 "The year-month is %y %m"
#

View File

@ -103,7 +103,7 @@ build_aux = join_paths(meson.current_source_dir(), 'build-aux')
################################################################################ ################################################################################
# derived date values (based on 'mu-date'); used in docs # derived date values (based on 'mu-date'); used in docs
# we can't use the 'date' because MacOS 'date' is incompatible with GNU's. # we can't use the 'date' because MacOS 'date' is incompatible with GNU's.
pdate=join_paths(build_aux, 'date.py') pdate=find_program(join_paths(build_aux, 'date.py'))
env = environment() env = environment()
env.set('LANG', 'C') env.set('LANG', 'C')
mu_day_month_year = run_command(pdate, mu_date, '%d %B %Y', mu_day_month_year = run_command(pdate, mu_date, '%d %B %Y',