mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Remove obsolete workarounds for buggy distro Qt packages
This commit is contained in:
parent
e2b730b3b2
commit
fc1803a800
@ -375,7 +375,7 @@ class Build(Command):
|
|||||||
from setup.parallel_build import cpu_count
|
from setup.parallel_build import cpu_count
|
||||||
if iswindows or ishaiku:
|
if iswindows or ishaiku:
|
||||||
return # Dont have headless operation on these platforms
|
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)
|
self.info('\n####### Building headless QPA plugin', '#'*7)
|
||||||
a = absolutize
|
a = absolutize
|
||||||
headers = a([
|
headers = a([
|
||||||
@ -396,13 +396,6 @@ class Build(Command):
|
|||||||
target = self.dest('headless')
|
target = self.dest('headless')
|
||||||
if not self.newer(target, headers + sources + others):
|
if not self.newer(target, headers + sources + others):
|
||||||
return
|
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(
|
pro = textwrap.dedent(
|
||||||
'''\
|
'''\
|
||||||
@ -410,24 +403,18 @@ class Build(Command):
|
|||||||
PLUGIN_TYPE = platforms
|
PLUGIN_TYPE = platforms
|
||||||
PLUGIN_CLASS_NAME = HeadlessIntegrationPlugin
|
PLUGIN_CLASS_NAME = HeadlessIntegrationPlugin
|
||||||
QT += core-private gui-private
|
QT += core-private gui-private
|
||||||
greaterThan(QT_MAJOR_VERSION, 5)|greaterThan(QT_MINOR_VERSION, 7): {{
|
|
||||||
TEMPLATE = lib
|
TEMPLATE = lib
|
||||||
CONFIG += plugin
|
CONFIG += plugin
|
||||||
QT += fontdatabase_support_private service_support_private eventdispatcher_support_private
|
QT += fontdatabase_support_private service_support_private eventdispatcher_support_private
|
||||||
}} else {{
|
|
||||||
load(qt_plugin)
|
|
||||||
QT += platformsupport-private
|
|
||||||
}}
|
|
||||||
HEADERS = {headers}
|
HEADERS = {headers}
|
||||||
SOURCES = {sources}
|
SOURCES = {sources}
|
||||||
OTHER_FILES = {others}
|
OTHER_FILES = {others}
|
||||||
INCLUDEPATH += {freetype}
|
INCLUDEPATH += {freetype}
|
||||||
DESTDIR = {destdir}
|
DESTDIR = {destdir}
|
||||||
CONFIG -= create_cmake # Prevent qmake from generating a cmake build file which it puts in the calibre src directory
|
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(
|
''').format(
|
||||||
headers=' '.join(headers), sources=' '.join(sources), others=' '.join(others), destdir=self.d(
|
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')
|
bdir = self.j(self.build_dir, 'headless')
|
||||||
if not os.path.exists(bdir):
|
if not os.path.exists(bdir):
|
||||||
os.makedirs(bdir)
|
os.makedirs(bdir)
|
||||||
|
@ -120,8 +120,6 @@ def get_sip_dir():
|
|||||||
pyqt['pyqt_sip_dir'] = get_sip_dir()
|
pyqt['pyqt_sip_dir'] = get_sip_dir()
|
||||||
pyqt['sip_inc_dir'] = os.environ.get('SIP_INC_DIR', sysconfig.get_path('include'))
|
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_inc = pyqt['inc']
|
||||||
qt_lib = pyqt['lib']
|
qt_lib = pyqt['lib']
|
||||||
ft_lib_dirs = []
|
ft_lib_dirs = []
|
||||||
|
Loading…
x
Reference in New Issue
Block a user