From fc1803a800feb2c4dd0236a7f1a1ee99666abf6f Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 4 Feb 2020 08:45:03 +0530 Subject: [PATCH] Remove obsolete workarounds for buggy distro Qt packages --- setup/build.py | 23 +++++------------------ setup/build_environment.py | 2 -- 2 files changed, 5 insertions(+), 20 deletions(-) diff --git a/setup/build.py b/setup/build.py index 5dd400793a..8daa96b3fa 100644 --- a/setup/build.py +++ b/setup/build.py @@ -375,7 +375,7 @@ class Build(Command): from setup.parallel_build import cpu_count if iswindows or ishaiku: return # Dont have headless operation on these platforms - from setup.build_environment import glib_flags, fontconfig_flags, ft_inc_dirs, QMAKE + from setup.build_environment import ft_inc_dirs, QMAKE self.info('\n####### Building headless QPA plugin', '#'*7) a = absolutize headers = a([ @@ -396,13 +396,6 @@ class Build(Command): target = self.dest('headless') if not self.newer(target, headers + sources + others): return - # Arch and possibly other distros (fedora?) monkey patches qmake as a - # result of which it fails to add glib-2.0 and freetype2 to the list of - # library dependencies. Compiling QPA plugins uses the static - # libQt5PlatformSupport.a which needs glib to be specified after it for - # linking to succeed, so we add it to QMAKE_LIBS_PRIVATE (we cannot use - # LIBS as that would put -lglib-2.0 before libQt5PlatformSupport. See - # https://bugs.archlinux.org/task/38819 pro = textwrap.dedent( '''\ @@ -410,24 +403,18 @@ class Build(Command): PLUGIN_TYPE = platforms PLUGIN_CLASS_NAME = HeadlessIntegrationPlugin QT += core-private gui-private - greaterThan(QT_MAJOR_VERSION, 5)|greaterThan(QT_MINOR_VERSION, 7): {{ - TEMPLATE = lib - CONFIG += plugin - QT += fontdatabase_support_private service_support_private eventdispatcher_support_private - }} else {{ - load(qt_plugin) - QT += platformsupport-private - }} + TEMPLATE = lib + CONFIG += plugin + QT += fontdatabase_support_private service_support_private eventdispatcher_support_private HEADERS = {headers} SOURCES = {sources} OTHER_FILES = {others} INCLUDEPATH += {freetype} DESTDIR = {destdir} CONFIG -= create_cmake # Prevent qmake from generating a cmake build file which it puts in the calibre src directory - QMAKE_LIBS_PRIVATE += {glib} {fontconfig} ''').format( headers=' '.join(headers), sources=' '.join(sources), others=' '.join(others), destdir=self.d( - target), glib=glib_flags, fontconfig=fontconfig_flags, freetype=' '.join(ft_inc_dirs)) + target), freetype=' '.join(ft_inc_dirs)) bdir = self.j(self.build_dir, 'headless') if not os.path.exists(bdir): os.makedirs(bdir) diff --git a/setup/build_environment.py b/setup/build_environment.py index bf97458b3b..fce7ff40bb 100644 --- a/setup/build_environment.py +++ b/setup/build_environment.py @@ -120,8 +120,6 @@ def get_sip_dir(): pyqt['pyqt_sip_dir'] = get_sip_dir() pyqt['sip_inc_dir'] = os.environ.get('SIP_INC_DIR', sysconfig.get_path('include')) -glib_flags = subprocess.check_output([PKGCONFIG, '--libs', 'glib-2.0']).decode('utf-8').strip() if islinux or ishaiku else '' -fontconfig_flags = subprocess.check_output([PKGCONFIG, '--libs', 'fontconfig']).decode('utf-8').strip() if islinux or ishaiku else '' qt_inc = pyqt['inc'] qt_lib = pyqt['lib'] ft_lib_dirs = []