Skip to content

Commit

Permalink
ports: Backports from Gloire of soname fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mintsuki committed Jan 8, 2024
1 parent 87ad9de commit 9a70ef6
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 1 deletion.
14 changes: 14 additions & 0 deletions build-support/checksoname.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#! /bin/sh

TMPDIR="$(mktemp -d)"
./jinx install "$TMPDIR" '*'
rm -rf "$TMPDIR/bin" "$TMPDIR/sbin" "$TMPDIR/lib" "$TMPDIR/lib64" "$TMPDIR/usr/sbin" "$TMPDIR/usr/lib64"
for f in $(find "$TMPDIR" -name '*.so*' -type f); do
if ! readelf --dynamic "$f" >/dev/null 2>&1; then
continue
fi
if ! readelf --dynamic "$f" | grep -q 'SONAME'; then
echo "$f has no soname"
fi
done
rm -rf "$TMPDIR"
14 changes: 14 additions & 0 deletions build-support/checksysroot.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#! /bin/sh

TMPDIR="$(mktemp -d)"
./jinx install "$TMPDIR" '*'
rm -rf "$TMPDIR/bin" "$TMPDIR/sbin" "$TMPDIR/lib" "$TMPDIR/lib64" "$TMPDIR/usr/sbin" "$TMPDIR/usr/lib64"
for f in $(find "$TMPDIR" -type f); do
stuff="$(strings "$f" | grep '/sysroot' | grep -v Assertion | grep -v '\--enable-languages')"
if [ -z "$stuff" ]; then
continue
fi
echo "in $f"
echo "$stuff"
done
rm -rf "$TMPDIR"
4 changes: 3 additions & 1 deletion recipes/ncurses
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ revision=1
tarball_url="https://github.com/ThomasDickey/ncurses-snapshots/archive/refs/tags/v6_4_20231111.tar.gz"
tarball_blake2b="0d7b490b50e58281250cc4ebdac8f35cbb3fbf0e13578524003ae4c26c10507d59fb8dd2a4d67102067df77d857c41e6c37c509d9a7cee8661dd3bb80f7cbfef"
source_hostdeps="autoconf automake libtool pkg-config"
imagedeps="gcc ncurses"
imagedeps="gcc ncurses patchelf"
hostdeps="gcc automake autoconf libtool pkg-config"
deps="core-libs"

Expand Down Expand Up @@ -37,6 +37,8 @@ package() {
rm -vf "${dest_dir}${prefix}"/lib/lib${lib}.so
echo "INPUT(-l${lib}w)" > "${dest_dir}${prefix}"/lib/lib${lib}.so
ln -sfv ${lib}w.pc "${dest_dir}${prefix}"/lib/pkgconfig/${lib}.pc
# Set library soname
patchelf --set-soname lib${lib}w.so "${dest_dir}${prefix}"/lib/lib${lib}w.so
done
rm -vf "${dest_dir}${prefix}"/lib/libcursesw.so
echo "INPUT(-lncursesw)" > "${dest_dir}${prefix}"/lib/libcursesw.so
Expand Down
6 changes: 6 additions & 0 deletions recipes/readline
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ revision=1
tarball_url="https://ftp.gnu.org/gnu/readline/readline-${version}.tar.gz"
tarball_blake2b="7974322b9c092a756a79e537df08e8532f8e0fcb598f77732e28287c33ebec9e9837ed88b43334c310892d56a871b423903f0f564def2fbe700a1004f2ae7b18"
source_hostdeps="automake autoconf libtool pkg-config"
imagedeps="patchelf"
hostdeps="gcc autoconf automake libtool pkg-config"
deps="core-libs ncurses"

Expand All @@ -22,5 +23,10 @@ build() {
package() {
make SHLIB_LIBS="-lncursesw" install DESTDIR="${dest_dir}"

# libraries are created without soname... fix that
for lib in libhistory.so.8 libreadline.so.8; do
patchelf --set-soname $lib "${dest_dir}${prefix}/lib/$lib"
done

post_package_strip
}
4 changes: 4 additions & 0 deletions recipes/zlib
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ version=1.3
revision=1
tarball_url="https://github.com/madler/zlib/archive/refs/tags/v${version}.tar.gz"
tarball_blake2b="e663d8041a613b544d76313e61b6340adacb53322422d4b6392455627c80cbac430b9fd0fb4a69e59b0fa110f120d29a1e9513bb37888442cc1b9d5075f47ea6"
imagedeps="patchelf"
hostdeps="gcc pkg-config"
deps="core-libs"

Expand All @@ -19,5 +20,8 @@ package() {
# Remove static libraries
rm -rf "${dest_dir}${prefix}"/lib/*.a

# libz.so.${version} is created without soname... fix that
patchelf --set-soname libz.so.${version} "${dest_dir}${prefix}/lib/libz.so.${version}"

post_package_strip
}

0 comments on commit 9a70ef6

Please sign in to comment.