about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/qt-5/hooks/fix-qmake-libtool.sh
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/qt-5/hooks/fix-qmake-libtool.sh')
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/hooks/fix-qmake-libtool.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/hooks/fix-qmake-libtool.sh b/nixpkgs/pkgs/development/libraries/qt-5/hooks/fix-qmake-libtool.sh
new file mode 100644
index 000000000000..5acaeb824466
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/hooks/fix-qmake-libtool.sh
@@ -0,0 +1,14 @@
+# Fix libtool libraries generated by qmake.
+# qmake started inserting filenames of shared objects instead of the appropriate
+# linker flags. fixQmakeLibtool searches for broken libtool libraries and
+# replaces the filenames with the linker flags that should have been there.
+fixQmakeLibtool() {
+    if [ -d "$1" ]; then
+        find "$1" -name '*.la' | while read la; do
+            sed -i "$la" \
+                -e '/^dependency_libs/ s,\(/[^ ]\+\)/lib\([^/ ]\+\)\.so,-L\1 -l\2,g'
+        done
+    fi
+}
+
+fixupOutputHooks+=('fixQmakeLibtool $prefix')