Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-02-23 12:31:34 +0100
committerErich Eckner <git@eckner.net>2018-02-23 12:31:34 +0100
commit9e612bcdf9fd521cde2873ea8c5368e05c1dbb46 (patch)
treebf3aaa0223b2c82068ee3b215279fc0992a7b5b9 /bin
parentfa16cc10d6ad6e6a43f9bd185fd17f1a18ae076e (diff)
bin/build-packages: save list of required libraries
Diffstat (limited to 'bin')
-rwxr-xr-xbin/build-packages18
1 files changed, 17 insertions, 1 deletions
diff --git a/bin/build-packages b/bin/build-packages
index f15c99e..70a0c3a 100755
--- a/bin/build-packages
+++ b/bin/build-packages
@@ -426,7 +426,21 @@ while [ "${count}" -ne 0 ]; do
' > \
"${pkgfile}.so.provides"
done
- # TODO: search for required libraries, too
+ >&2 printf 'searching for required libraries\n'
+ package_content_dir=$(mktemp -d "${tmp_dir}/package-content.XXXXXX")
+ find "${tar_content_dir}" -maxdepth 1 \
+ -name '*.pkg.tar.xz' | \
+ while read -r pkgfile; do
+ mkdir "${package_content_dir}/${pkgfile##*/}"
+ tar -C "${package_content_dir}/${pkgfile##*/}" -xJf "${pkgfile}" 2>/dev/null
+ find "${package_content_dir}/${pkgfile##*/}" -type f \
+ -exec objdump -x '{}' \; 2>/dev/null | \
+ grep -w 'NEEDED' | \
+ awk '{print $2}' | \
+ sort -u > \
+ "${pkgfile}.so.needs"
+ rm -rf --one-file-system "${package_content_dir:?}/${pkgfile##*/}"
+ done
>&2 printf 'running namcap ...'
if [ "${repository}" = 'multilib' ]; then
x86_64_build_command='multilib-build'
@@ -467,6 +481,7 @@ while [ "${count}" -ne 0 ]; do
find "${tar_content_dir}/" -maxdepth 1 \
\( \
-name '*.pkg.tar.xz-namcap.log' -o \
+ -name '*.pkg.tar.xz.so.needs' -o \
-name '*.pkg.tar.xz.so.provides' \
\) \
-execdir gzip '{}' \;
@@ -482,6 +497,7 @@ while [ "${count}" -ne 0 ]; do
-name '*.pkg.tar.xz' -o \
-name '*.pkg.tar.xz.sig' -o \
-name '*.pkg.tar.xz-namcap.log.gz' -o \
+ -name '*.pkg.tar.xz.so.needs.gz' -o \
-name '*.pkg.tar.xz.so.provides.gz' \
\) \
-printf '%f\n'