[PATCH] build: Don't use non-posix arguments for build without GNU coreutils

Zach DeCook zachdecook at librem.one
Thu Jun 6 15:01:03 CEST 2024


date will output a date like
2024-06-05T17:06:30EDT

(time zone is different than currently specified)

ln won't create a relative link
(not a big deal because the command gets reran each time)
---
specifically tested in Alpine Linux, using busybox utils
 src/py/libcamera/meson.build | 4 ++--
 utils/gen-version.sh         | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/py/libcamera/meson.build b/src/py/libcamera/meson.build
index 4807ca7d..524d010c 100644
--- a/src/py/libcamera/meson.build
+++ b/src/py/libcamera/meson.build
@@ -98,11 +98,11 @@ pycamera = shared_module('_libcamera',
 # Create symlinks from the build dir to the source dir so that we can use the
 # Python module directly from the build dir.
 
-run_command('ln', '-fsrT', files('__init__.py'),
+run_command('ln', '-fs', files('__init__.py'),
             meson.current_build_dir() / '__init__.py',
             check : true)
 
-run_command('ln', '-fsrT', meson.current_source_dir() / 'utils',
+run_command('ln', '-fs', meson.current_source_dir() / 'utils',
             meson.current_build_dir() / 'utils',
             check : true)
 
diff --git a/utils/gen-version.sh b/utils/gen-version.sh
index e1f7ca7b..1b818e9e 100755
--- a/utils/gen-version.sh
+++ b/utils/gen-version.sh
@@ -42,7 +42,7 @@ if [ -z "$build_dir" ] || (echo "$build_dir" | grep -q "$src_dir")
 then
 	git update-index --refresh > /dev/null 2>&1
 fi
-git diff-index --quiet HEAD || version="$version-dirty ($(date --iso-8601=seconds))"
+git diff-index --quiet HEAD || version="$version-dirty ($(date +%Y-%m-%dT%H:%M:%S%Z))"
 
 # If a project version is provided, use it to replace the version number.
 if [ -n "$project_version" ]
-- 
2.45.1



More information about the libcamera-devel mailing list