Skip to content

Commit

Permalink
systemd: symlink the internal libraries so they are found in rpath (s…
Browse files Browse the repository at this point in the history
  • Loading branch information
haampie authored Nov 19, 2024
1 parent 5333925 commit 5325cfe
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions var/spack/repos/builtin/packages/systemd/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)

import glob
import os

from spack.package import *
Expand Down Expand Up @@ -142,3 +143,13 @@ def install(self, spec, prefix):
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))

0 comments on commit 5325cfe

Please sign in to comment.