summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarmen Stoppels <me@harmenstoppels.nl>2024-11-19 15:28:49 +0100
committerGitHub <noreply@github.com>2024-11-19 15:28:49 +0100
commit5325cfe8654ef6e7f02a7ed1e892a4f2870d07f0 (patch)
tree1982bc794a21443e8dfb17ffb02df71b9b231cb2
parent5333925dd7a4245b761c73e557e30b7eb62b88c1 (diff)
downloadspack-5325cfe8654ef6e7f02a7ed1e892a4f2870d07f0.tar.gz
spack-5325cfe8654ef6e7f02a7ed1e892a4f2870d07f0.tar.bz2
spack-5325cfe8654ef6e7f02a7ed1e892a4f2870d07f0.tar.xz
spack-5325cfe8654ef6e7f02a7ed1e892a4f2870d07f0.zip
systemd: symlink the internal libraries so they are found in rpath (#47667)
-rw-r--r--var/spack/repos/builtin/packages/systemd/package.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/systemd/package.py b/var/spack/repos/builtin/packages/systemd/package.py
index 16f07dca83..cbd6596c1c 100644
--- a/var/spack/repos/builtin/packages/systemd/package.py
+++ b/var/spack/repos/builtin/packages/systemd/package.py
@@ -3,6 +3,7 @@
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
+import glob
import os
from spack.package import *
@@ -142,3 +143,13 @@ class Systemd(MesonPackage):
os.environ["DESTDIR"] = prefix
with working_dir(self.build_directory):
ninja("install")
+
+ @run_after("install")
+ def symlink_internal_libs(self):
+ with working_dir(self.prefix):
+ # Create symlinks lib/lib*.so* -> lib/systemd/lib*.so* so that executables and
+ # libraries from systemd can find its own libraries in rpaths.
+ for lib_path in glob.glob("lib*/systemd/lib*.so*"):
+ lib_name = os.path.basename(lib_path)
+ lib_dir = os.path.dirname(os.path.dirname(lib_path))
+ os.symlink(os.path.relpath(lib_path, lib_dir), os.path.join(lib_dir, lib_name))