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.
This commit is contained in:
Dylan Araps 2020-07-28 02:58:11 +03:00
parent f59b725cdd
commit 6eb62bdd97
No known key found for this signature in database
GPG Key ID: 46D62DD9F1DE636E
1 changed files with 10 additions and 2 deletions

12
kiss
View File

@ -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"