kumquat-buildroot/package/systemd/0002-install-don-t-use-ln-relative.patch
Adam Duskett db860d7837 systemd: bump to 236, convert to meson
systemd is no longer an autotools package, as such, it has now been converted
over to meson.

Even though systemd234 has meson support, it is broken with gcc7, as such
the revision bump and conversion to meson must be in a single patch.

Changes include:
  - Change systemd from an autotools package to a generic package
  - Changing all the options from --enable/disable to -Doption=true/false
  - Remove --without-python (no longer an option)
  - Remove all of the ac_cv_path_ variables, and move them into CONF_OPTS
    with the prefix -Doption-path=/path.
  - Add sha256sum's for the license files.
  - Remove 0002-build-check-for-ln-relative.patch and add
    0002-install-dont-use-ln-relative.patch in its place, the old patch relied on autotools and is no longer relevant.
  - Add 0004-add-false-option-for-tests.patch. With the conversion to meson,
    systemd no longer has the option to disable unit tests from being built.
    This patch re-adds the functionality. This prevents 381 files from being
    built, and prevents gcrypt from becoming a dependency.

Signed-off-by: Adam Duskett <Adamduskett@outlook.com>
Tested-by: Jérémy Rosen <jeremy.rosen@smile.fr>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Tested-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Tested-by: gitlab-ci https://gitlab.com/ymorin/buildroot-ci/pipelines/15857672/builds
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2018-01-17 00:00:54 +01:00

77 lines
2.4 KiB
Diff

From ecf3b9baaebda1d9182c22dc504e32ed275d4abb Mon Sep 17 00:00:00 2001
From: Adam Duskett <Adamduskett@outlook.com>
Date: Sun, 31 Dec 2017 12:46:04 -0500
Subject: [PATCH] install: don't use ln --relative
Oldish enterprise-class distributions have too old versions of
coreutils, with ln not supporting --relative.
So we fake it.
ln --relative would create minimalist relative paths, but they are not
trivial to generate. Instead, we always create paths relative to the
root, i.e.:
ln -s --relative /usr/bin/foo /usr/sbin/foo
would create: /usr/sbin/foo -> ../bin/foo
while we do : /usr/sbin/foo -> ../../usr/bin/foo
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
[aduskett@gmail.com: Added meson.build section and dirname wrapper in add-wants]
Signed-off-by: Adam Duskett <Adamduskett@outlook.com>
---
meson.build | 2 +-
tools/meson-make-symlink.sh | 3 ++-
units/meson-add-wants.sh | 5 +++--
3 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/meson.build b/meson.build
index ddc061c..614201a 100644
--- a/meson.build
+++ b/meson.build
@@ -531,7 +531,7 @@ foreach prog : progs
endforeach
if run_command('ln', '--relative', '--help').returncode() != 0
- error('ln does not support --relative')
+ message('ln does not support --relative')
endif
############################################################
diff --git a/tools/meson-make-symlink.sh b/tools/meson-make-symlink.sh
index 47a5e70..e9002ad 100755
--- a/tools/meson-make-symlink.sh
+++ b/tools/meson-make-symlink.sh
@@ -7,5 +7,6 @@ mkdir -vp "$(dirname "${DESTDIR:-}$2")"
if [ "$(dirname $1)" = . ]; then
ln -vfs -T "$1" "${DESTDIR:-}$2"
else
- ln -vfs -T --relative "${DESTDIR:-}$1" "${DESTDIR:-}$2"
+ dds="$( dirname "$2" |sed -r -e 's:/+[^/]+:../:g; s:/$::' )"
+ ln -vfs -T "${dds}$1" "${DESTDIR:-}$2"
fi
diff --git a/units/meson-add-wants.sh b/units/meson-add-wants.sh
index dfd287e..8c08283 100755
--- a/units/meson-add-wants.sh
+++ b/units/meson-add-wants.sh
@@ -13,7 +13,7 @@ case "$target" in
;;
esac
-unitpath="${DESTDIR:-}${unitdir}/${unit}"
+unitpath="${unitdir}/${unit}"
case "$target" in
*/)
@@ -24,4 +24,5 @@ case "$target" in
;;
esac
-ln -vfs --relative "$unitpath" "$dir"
+dds="$( dirname `printf "%s" "${dir#${DESTDIR:-}}" |sed -r -e 's:/+[^/]+:../:g; s:/$::'` )"
+ln -vfs "$dds$unitpath" "$dir"
--
2.14.3