Commit be7f1ecb authored by Simon McVittie's avatar Simon McVittie

debian: Build relocatable versions of libcapsule binary tools

When built on a system with the oldest glibc version that is to be
supported, these tools are suitable for bundling in projects that need
to run on an arbitrary host system and make use of libcapsule when
preparing a container.
Signed-off-by: Simon McVittie's avatarSimon McVittie <smcv@collabora.com>
parent 2a3bfae9
......@@ -10,6 +10,7 @@
/libcapsule-doc/
/libcapsule-gl-shims/
/libcapsule-tools/
/libcapsule-tools-relocatable/
/libcapsule-libgl1-shims/
/libcapsule-tests/
/libcapsule0/
......
......@@ -8,6 +8,7 @@ Build-Depends:
autoconf-archive <pkg.libcapsule.from-git>,
automake,
bubblewrap,
chrpath,
debhelper,
dh-autoreconf,
gtk-doc-tools,
......@@ -73,6 +74,26 @@ Description:
.
This package contains the files needed to generate libcapsule proxy libraries.
Package: libcapsule-tools-relocatable
Architecture: amd64 i386
Multi-Arch: same
Section: misc
Depends:
${shlibs:Depends},
Description:
libcapsule is a helper library used to implement segregated run-time
dynamic linking proxy libraries - used (for example) to load a library
that has dependencies incompatible with the regular libraries that are
part of the host OS, such as an incompatible libstdc++ version.
.
This package contains relocatable versions of the tools used to enumerate
library symbols and dependencies. After building this package on a system
with the oldest glibc that is to be supported, they can be bundled in
projects that need to run on an arbitrary host system and make use of
libcapsule to prepare a container. To do this, the relocatable tools
must be copied to PATH/bin/TUPLE-capsule-TOOL, and their required
non-glibc libraries (libelf and zlib) must be copied to PATH/lib/TUPLE.
Package: libcapsule-gl-shims
Architecture: amd64 i386
Multi-Arch: same
......
usr/lib/libcapsule/relocatable
......@@ -6,10 +6,13 @@
dh $@ --with autoreconf
binaries := $(shell dh_listpackages)
fake_rpath := /_ORIGIN_/__/lib/${DEB_HOST_MULTIARCH}
real_rpath := $${ORIGIN}/../lib/${DEB_HOST_MULTIARCH}
confflags = \
--disable-Werror \
--disable-silent-rules \
--enable-host-prefix=$(DEB_HOST_MULTIARCH)- \
--enable-tools-rpath='${fake_rpath}' \
--libexecdir=\$${exec_prefix}/lib/libcapsule \
$(NULL)
......@@ -72,6 +75,26 @@ override_dh_auto_install:
ln -s "$$bin" "$(DEB_HOST_GNU_TYPE)-$$tail"; \
done; \
fi
install -d debian/tmp/usr/lib/libcapsule/relocatable
cp -a \
debian/tmp/usr/bin/*-capsule-capture-libs \
debian/tmp/usr/bin/*-capsule-elf-dump \
debian/tmp/usr/bin/*-capsule-symbols \
debian/tmp/usr/bin/*-capsule-version \
debian/tmp/usr/lib/libcapsule/relocatable
set -e; for bin in debian/tmp/usr/bin/$(DEB_HOST_MULTIARCH)-*; do \
case "$$bin" in \
(*-capsule-mkstublib) \
;; \
(*) \
chrpath -d "$$bin"; \
chrpath -l "$$bin" || :; \
;; \
esac; \
done
chrpath -r '${real_rpath}' \
debian/tmp/usr/lib/libcapsule/relocatable/$(DEB_HOST_MULTIARCH)-*
chrpath -l debian/tmp/usr/lib/libcapsule/relocatable/*
$(MAKE) -C debian/libGL-proxy-build install V=1 $(proxy_vars) \
DESTDIR=$(CURDIR)/debian/libGL-proxy-build/shims
install -d debian/tmp/usr/lib/libcapsule/shims/lib/$(DEB_HOST_MULTIARCH)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment