From 6eb62bdd976a66614a535341da732a5907bab5b0 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Tue, 28 Jul 2020 02:58:11 +0300 Subject: [PATCH] kiss: Remove .la files from all packages. These files are unneeded and become a source of errors when an autotools build references a non-existing .la file. This was the case with a recent update to freetype-harfbuzz. The files are required by libtool to do libtool things, however libtool works just fine without them. These files are safe to remove according to upstream and other distributions have already been doing this for a while. > https://www.gnu.org/software/automake/faq/autotools-faq.html > > 3.1 What are these .la files for and can I safely remove them? > > portable encoding of static and shared library names and dependencies. > > removing usually only works OK if done in directories which the > runtime linker searches by default anyway (otherwise you might need > to set LD_LIBRARY_PATH or an equivalent variable) and only on systems > where the runtime linker loads indirect library dependencies > automatically (includes GNU/Linux, GNU, Solaris). It is recommended that you remove all .la files from your system if manually updating the package manager to the latest version. Running 'kiss update' will automatically handle this for you. The following script will be run on post-install to clean up the .la files. This can also be run manually. Executing this script will do nothing if the system is already clean. #!/bin/sh find "$KISS_ROOT/usr/lib" \ ! -type d \ -name \*.la \ -exec rm -f -- {} + find "$KISS_ROOT/var/db/kiss/installed" \ ! -type d \ -name manifest \ -exec sed -i '/.*\.la$/d' {} + This commit also brings back the removal of charset.alias which was a part of the default KISS_HOOK prior. It makes much more sense for it to live alongside this change. --- kiss | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/kiss b/kiss index 622527c..70d098a 100755 --- a/kiss +++ b/kiss @@ -81,8 +81,7 @@ run_hook() { [ "${KISS_HOOK:-}" ] || { case $1 in post-build) rm -rf "$3/usr/share/gettext" "$3/usr/share/polkit-1" \ - "$3/usr/share/locale" "$3/usr/share/info" \ - "$3/usr/lib/charset.alias" + "$3/usr/share/locale" "$3/usr/share/info" esac return 0 @@ -636,6 +635,15 @@ pkg_build() { log "$pkg" "Successfully built package" run_hook post-build "$pkg" "$pkg_dir/$pkg" + # Remove all .la files from the packages. They're unneeded and cause + # issues when a package stops providing one. This recently caused an + # issue with harfbuzz (See: 05096e5a4dc6db5d202342f538d067d87ae7135e). + find "$pkg_dir/$pkg/usr/lib" -name \*.la -exec rm -f {} + 2>/dev/null ||: + + # Remove this unneeded file from all packages as it is an endless + # source of conflicts. This is used with info pages we we do not support. + rm -f "$pkg_dir/$pkg/usr/lib/charset.alias" + # Create the manifest file early and make it empty. This ensures that # the manifest is added to the manifest. : > "$pkg_dir/$pkg/$pkg_db/$pkg/manifest"