diff --git a/debian/control b/debian/control index 393211d944657e865e288d51c3c5cd2c9cb775bf..69eec0dc620498ca0c350079b8f0c1945a0bf201 100644 --- a/debian/control +++ b/debian/control @@ -23,7 +23,8 @@ Build-Depends: Build-Depends-Indep: libglib2.0-dev, Build-Conflicts: - libsteam-runtime-tools-0-helpers, + libsteam-runtime-tools-0-helpers (<< 0.20191204.0~), + libsteam-runtime-tools-0-relocatable-libs, Vcs-Git: https://gitlab.steamos.cloud/steam/steam-runtime-tools.git Vcs-Browser: https://gitlab.steamos.cloud/steam/steam-runtime-tools @@ -89,6 +90,23 @@ Description: This package contains helper tools used to examine the library stack available for each architecture. +Package: libsteam-runtime-tools-0-relocatable-libs +Architecture: amd64 i386 +Multi-Arch: same +Section: misc +Depends: + ${misc:Depends}, + ${relocatable:Depends}, +Description: + The Steam Runtime is the library stack used to run the Steam client + on Linux. The Steam Runtime Tools utility library contains open-source + supporting code used by the Steam client to discover system information. + . + This package contains symbolic links to libraries depended on by the + steam-runtime-system-info and libsteam-runtime-tools-0-helpers packages, + which make it possible to run those tools from an LD_LIBRARY_PATH-style + Steam Runtime even if the LD_LIBRARY_PATH is not correctly set. + Package: libsteam-runtime-tools-0-tests Architecture: any Section: misc diff --git a/debian/libsteam-runtime-tools-0-helpers.install b/debian/libsteam-runtime-tools-0-helpers.install index 4f58c509f4b15622ce24b6c0b13e02fa2b63f0b7..4d24bb6e601f5ae39446eb84d572b5f5947a1614 100644 --- a/debian/libsteam-runtime-tools-0-helpers.install +++ b/debian/libsteam-runtime-tools-0-helpers.install @@ -1,2 +1 @@ -usr/lib/*/steam-runtime-tools-0/* usr/libexec/steam-runtime-tools-0/* diff --git a/debian/rules b/debian/rules index e8200469bc50201641ac386f46de5c2910c85f42..f786e23868d6528f1b5b210644474481beec4c54 100755 --- a/debian/rules +++ b/debian/rules @@ -45,6 +45,7 @@ pkglibexecdir := $(libexecdir)/steam-runtime-tools-0 libdir := lib/$(DEB_HOST_MULTIARCH) pkglibdir := $(libdir)/steam-runtime-tools-0 DESTDIR := $(CURDIR)/debian/tmp +relocatable_pkglibdir := $(CURDIR)/debian/libsteam-runtime-tools-0-relocatable-libs/usr/$(pkglibdir) override_dh_auto_configure: meson builddir \ @@ -81,25 +82,37 @@ override_dh_auto_install: ln -fnsv ../../steam-runtime-tools-0/$(DEB_HOST_MULTIARCH)-true "$$x"; \ fi; \ done - install -d $(DESTDIR)/usr/$(pkglibdir) - ln -fnsv ../libsteam-runtime-tools-0.so.0 $(DESTDIR)/usr/$(pkglibdir)/ + +override_dh_shlibdeps: + dh_shlibdeps \ + -plibsteam-runtime-tools-0-relocatable-libs \ + -- \ + -prelocatable \ + -e$(DESTDIR)/usr/bin/steam-runtime-system-info \ + -e$(DESTDIR)/usr/$(pkglibexecdir)/$(DEB_HOST_MULTIARCH)-check-locale \ + $(NULL) + dh_shlibdeps + +override_dh_link: + dh_link + : + install -d $(relocatable_pkglibdir) + ln -fnsv ../libsteam-runtime-tools-0.so.0 $(relocatable_pkglibdir) LD_LIBRARY_PATH='$(DESTDIR)/usr/$(libdir)' \ $(DEB_HOST_MULTIARCH)-capsule-capture-libs \ --container / \ - --dest $(DESTDIR)/usr/$(pkglibdir) \ + --dest $(relocatable_pkglibdir) \ --link-target / \ --no-glibc \ --provider / \ only-dependencies:path:$(DESTDIR)/usr/bin/steam-runtime-system-info \ only-dependencies:path:$(DESTDIR)/usr/$(pkglibexecdir)/$(DEB_HOST_MULTIARCH)-check-locale \ $(NULL) - -override_dh_link: - dh_link + : # Make the links in $(pkglibdir) relative. This is contrary # to Debian policy, but is what we need for the LD_LIBRARY_PATH # Steam Runtime, where GLib is in /lib. - set -e; for link in debian/libsteam-runtime-tools-0-helpers/usr/$(pkglibdir)/lib*; do \ + set -e; for link in $(relocatable_pkglibdir)/lib*; do \ target="$$(readlink -v "$$link")"; \ echo "before: $$link -> $$target"; \ case "$$target" in \