python3Packages.orjson: Disable failing tests on 32 bit
[NixPkgs.git] / pkgs / development / libraries / qt-6 / hooks / fix-qmake-libtool.sh
blob44bf10a0db068523213e1a94a684e324934c42a7
1 # Fix libtool libraries generated by qmake.
2 # qmake started inserting filenames of shared objects instead of the appropriate
3 # linker flags. fixQmakeLibtool searches for broken libtool libraries and
4 # replaces the filenames with the linker flags that should have been there.
5 fixQmakeLibtool() {
6 if [ -d "$1" ]; then
7 find "$1" -name '*.la' | while read la; do
8 set +e
9 framework_libs=$(grep '^dependency_libs' "$la" | grep -Eo -- '-framework +\w+' | tr '\n' ' ')
10 set -e
11 sed -i "$la" \
12 -e '/^dependency_libs/ s,\(/[^ ]\+\)/lib\([^/ ]\+\)\.so,-L\1 -l\2,g' \
13 -e '/^dependency_libs/ s,-framework \+\w\+,,g'
14 if [ ! -z "$framework_libs" ]; then
15 if grep '^inherited_linker_flags=' $la >/dev/null; then
16 sed -i "$la" -e "s/^\(inherited_linker_flags='[^']*\)/\1 $framework_libs/"
17 else
18 echo "inherited_linker_flags='$framework_libs'" >>"$la"
21 done
25 fixupOutputHooks+=('fixQmakeLibtool $prefix')