File fix-python-lib.patch of Package pgadmin4

From: Antonio Larrosa <alarrosa@suse.com>
Subject: Fix a linking to the python library

Python 3.8's python3-config doesn't seem to include the python3.8 library anymore, so
we have to add it ourselves. Use an environment variable (just as in the Windows case)
to find out the library version to link to.

Index: pgadmin4-4.22/runtime/pgAdmin4.pro
===================================================================
--- pgadmin4-4.22/runtime/pgAdmin4.pro.orig	2020-06-15 09:57:31.503298807 +0200
+++ pgadmin4-4.22/runtime/pgAdmin4.pro	2020-06-15 10:02:06.335072806 +0200
@@ -78,6 +78,12 @@
     } else {
         error(No suitable python-config could be found in $${PYTHON_DIR}/bin.)
     }
+
+    PYTHON_VERSION = $$(PYTHON_VERSION)
+    isEmpty(PYTHON_VERSION) {
+        error(Please set the PYTHON_VERSION environment variable to the version of python to link to.)
+    }
+
     message(Python config: $$PYTHON_CONFIG)
 
     PYTHON_EMBED = $$system($$PYTHON_CONFIG --help 2>&1 | grep -o \'\\-\\-embed\')
@@ -88,7 +94,7 @@
     QMAKE_LFLAGS += $$system($$PYTHON_CONFIG --ldflags)
     message(LDFLAGS: $$QMAKE_LFLAGS)
 
-    LIBS += $$system($$PYTHON_CONFIG --libs $$PYTHON_EMBED)
+    LIBS += $$system($$PYTHON_CONFIG --libs $$PYTHON_EMBED) -lpython$$PYTHON_VERSION
     message(LIBS: $$LIBS)
 }
 
openSUSE Build Service is sponsored by