kiss: Make ldd, readelf and strip optional

This commit is contained in:
Dylan Araps 2020-05-09 12:11:40 +03:00
parent 4dd4af5ac0
commit 08eae0366a
No known key found for this signature in database
GPG Key ID: 46D62DD9F1DE636E
1 changed files with 19 additions and 4 deletions

23
kiss
View File

@ -44,12 +44,12 @@
# - curl (needed by git)
#
# Compiler/libc utilities (depends cc & libc)
# - readelf (Part of compiler toolchain) (GNU, LLVM or elfutils)
# - strip (Part of compiler toolchain) (GNU, LLVM or elfutils)
# - ldd (Part of libc)
# - readelf (optional) (Part of compiler toolchain) (GNU, LLVM or elfutils)
# - strip (optional) (Part of compiler toolchain) (GNU, LLVM or elfutils)
# - ldd (optional) (Part of libc)
#
# Tarball compression
# - tar (as portable as can be) (cf, tf, xf)
# - tar (as portable as can be) (merely: cf, tf, xf)
# - bzip2 (widely used) -d, -z
# - xz (widely used) -d, -z, -c, -T
# - gzip (widely used) -d, -6
@ -506,6 +506,16 @@ pkg_strip() {
log "$1" "Stripping binaries and libraries"
command -v strip >/dev/null 2>&1 || {
war "strip not found, skipping binary stripping"
return 0
}
command -v readelf >/dev/null 2>&1 || {
war "readelf not found, skipping binary stripping"
return 0
}
# Strip only files matching the below ELF types.
# NOTE: 'readelf' is used in place of 'file' as
# it allows us to remove 'file' from the
@ -529,6 +539,11 @@ pkg_fixdeps() {
# build suite.
log "$1" "Checking for missing dependencies"
command -v ldd >/dev/null 2>&1 || {
war "ldd not found, skipping dependency fixer"
return 0
}
# Go to the directory containing the built package to
# simplify path building.
cd "$pkg_dir/$1/$pkg_db/$1"