1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
#!/bin/bash
####
## THIS SIMPLE SCRIPT IS CALLED FROM dar_static_builder_with_musl_voidlinux.bash
## TO FIX BUG IN LIBCURL PROVIDED PKG-CONFIG CONFIGURATION FILE
## WHICH IS BROKEN FOR STATICAL LINKING (MISSING DEPENDENT LIBRARY TO ADD FOR
## THE LINKING TO SUCCEED).
## This scripts expects the libcurl library to be installed in /usr/local and
## built with the minimal options set from the dar_static_builder_with_musl_voidlinux.bash
## script
curlpkg=/usr/local/lib/pkgconfig/libcurl.pc
# -lpsl -lidn2 -lunistring
libs_line=$(grep -E '^Libs:' /usr/local/lib/pkgconfig/libcurl.pc)
is_fixed=$(echo "$libs_lline" | grep -- '-lidn2' | wc -l)
if [ $is_fixed -eq 0 ] ; then
cp "$curlpkg" "${curlpkg}.old"
sed -r -e 's/(^Libs:.*)/\1 -lunistring/' < "${curlpkg}.old" > "${curlpkg}"
rm "${curlpkg}.old"
fi
|