File: fix_libcurl_pc

package info (click to toggle)
dar 2.8.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 12,068 kB
  • sloc: cpp: 86,310; sh: 6,996; ansic: 895; makefile: 502; python: 242; csh: 115; perl: 43; sed: 16
file content (24 lines) | stat: -rwxr-xr-x 816 bytes parent folder | download
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