-
Simon McVittie authored
git-subtree-dir: subprojects/libcapsule git-subtree-mainline: 596478d1 git-subtree-split: 4e9d404fcff97f8d337a48c7375e327100595f98
Simon McVittie authoredgit-subtree-dir: subprojects/libcapsule git-subtree-mainline: 596478d1 git-subtree-split: 4e9d404fcff97f8d337a48c7375e327100595f98
rules 4.03 KiB
#!/usr/bin/make -f
-include /usr/share/dpkg/default.mk
%:
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)
ifneq ($(filter libcapsule-doc,$(binaries)),)
confflags += --enable-gtk-doc
else
confflags += --disable-gtk-doc
endif
ifeq ($(DEB_HOST_ARCH),amd64)
confflags += --with-glib=auto
else
confflags += --without-glib
endif
override_dh_clean:
rm -fr html
dh_clean
override_dh_auto_configure:
dh_auto_configure -- $(confflags)
proxy_vars = \
CAPSULE_CFLAGS="-I$(CURDIR)" \
CAPSULE_LIBS="-L$(CURDIR)/.libs -lcapsule" \
CAPSULE_MKINC="$(CURDIR)/data" \
CAPSULE_MKSTUBLIB_TOOL="$(CURDIR)/data/capsule-mkstublib" \
CAPSULE_SYMBOLS_TOOL="$(CURDIR)/capsule-symbols" \
CAPSULE_VERSION_TOOL="$(CURDIR)/capsule-version" \
$(NULL)
override_dh_auto_build:
dh_auto_build
$(proxy_vars) ./data/capsule-init-project \
--capsule-pkgdatadir="$(CURDIR)/data" \
--destination="$(CURDIR)/debian/libGL-proxy" \
--no-autoreconf \
--package-name=libGL-proxy \
--search-tree=/nonexistent \
--symbols-from-dir="$(CURDIR)/examples/shim" \
libGL.so.1/1 \
libX11.so.6/6 \
libXext.so.6/6 \
libXi.so.6/6 \
libxcb-dri2.so.0/0 \
libxcb-glx.so.0/0 \
libxcb-present.so.0/0 \
libxcb-sync.so.1/1 \
libxcb.so.1/1 \
$(NULL)
# Copy it, so we can install the original source as an example
cp -a debian/libGL-proxy debian/libGL-proxy-build
cd debian/libGL-proxy-build && autoreconf -fi -I $(CURDIR)/m4
cd debian/libGL-proxy-build && ./configure --prefix=/usr $(proxy_vars)
$(MAKE) -C debian/libGL-proxy-build V=1 $(proxy_vars)
override_dh_auto_install:
dh_auto_install
if [ $(DEB_HOST_MULTIARCH) != $(DEB_HOST_GNU_TYPE) ]; then \
set -e; \
cd debian/tmp/usr/bin; \
for bin in $(DEB_HOST_MULTIARCH)-*; do \
tail="$${bin#$(DEB_HOST_MULTIARCH)-}"; \
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)
mv debian/libGL-proxy-build/shims/usr/lib/* \
debian/tmp/usr/lib/libcapsule/shims/lib/$(DEB_HOST_MULTIARCH)
override_dh_install:
rm -f debian/tmp/usr/lib/*/*.la
rm -f debian/tmp/usr/lib/libcapsule/shims/lib/*/*.la
find debian/tmp/usr/lib/libcapsule/installed-tests -name '*.la' -print -delete
# Only keep the architecture-qualified version, delete the unprefixed
# version, so we can be Multi-Arch: same
rm -f debian/tmp/usr/bin/capsule-capture-libs
rm -f debian/tmp/usr/bin/capsule-elf-dump
rm -f debian/tmp/usr/bin/capsule-symbols
rm -f debian/tmp/usr/bin/capsule-version
dh_install
# The debug symbols for libcapsule-tools-relocatable would be the same
# as for libcapsule-tools, making them non-co-installable.
# Use the environment variable instead of --no-automatic-dbgsym for
# compatibility with Steam Runtime 1 'scout'.
override_dh_strip:
DEB_BUILD_OPTIONS='$(DEB_BUILD_OPTIONS) noautodbgsym' dh_strip -plibcapsule-tools-relocatable
dh_strip --remaining-packages
override_dh_missing:
dh_missing --fail-missing
override_dh_autoreconf:
NOCONFIGURE=1 dh_autoreconf ./autogen.sh -- $(confflags)