mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Workaround for sip version mismatch on Arch
This commit is contained in:
parent
d368c4f96e
commit
73a312dd64
@ -487,6 +487,10 @@ class Build(Command):
|
|||||||
os.rename(self.j(self.d(target), 'libheadless.dylib'), self.j(self.d(target), 'headless.so'))
|
os.rename(self.j(self.d(target), 'libheadless.dylib'), self.j(self.d(target), 'headless.so'))
|
||||||
|
|
||||||
def create_sip_build_skeleton(self, src_dir, ext):
|
def create_sip_build_skeleton(self, src_dir, ext):
|
||||||
|
from setup.build_environment import pyqt_sip_abi_version
|
||||||
|
abi_version = ''
|
||||||
|
if pyqt_sip_abi_version():
|
||||||
|
abi_version = f'abi-version = "{pyqt_sip_abi_version()}"'
|
||||||
sipf = ext.sip_files[0]
|
sipf = ext.sip_files[0]
|
||||||
needs_exceptions = 'true' if ext.needs_exceptions else 'false'
|
needs_exceptions = 'true' if ext.needs_exceptions else 'false'
|
||||||
with open(os.path.join(src_dir, 'pyproject.toml'), 'w') as f:
|
with open(os.path.join(src_dir, 'pyproject.toml'), 'w') as f:
|
||||||
@ -504,6 +508,7 @@ project-factory = "pyqtbuild:PyQtProject"
|
|||||||
|
|
||||||
[tool.sip.project]
|
[tool.sip.project]
|
||||||
sip-files-dir = "."
|
sip-files-dir = "."
|
||||||
|
{abi_version}
|
||||||
|
|
||||||
[tool.sip.bindings.pictureflow]
|
[tool.sip.bindings.pictureflow]
|
||||||
headers = {ext.headers}
|
headers = {ext.headers}
|
||||||
|
@ -7,12 +7,26 @@ __copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
|
|||||||
__docformat__ = 'restructuredtext en'
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|
||||||
import os, subprocess, re, shutil
|
import os, subprocess, re, shutil
|
||||||
|
from functools import lru_cache
|
||||||
|
|
||||||
from setup import ismacos, iswindows, is64bit, islinux, ishaiku
|
from setup import ismacos, iswindows, is64bit, islinux, ishaiku
|
||||||
|
|
||||||
NMAKE = RC = msvc = MT = win_inc = win_lib = win_cc = win_ld = None
|
NMAKE = RC = msvc = MT = win_inc = win_lib = win_cc = win_ld = None
|
||||||
|
|
||||||
|
|
||||||
|
@lru_cache(maxsize=2)
|
||||||
|
def pyqt_sip_abi_version():
|
||||||
|
import PyQt5
|
||||||
|
if getattr(PyQt5, '__file__', None):
|
||||||
|
bindings_path = os.path.join(os.path.dirname(PyQt5.__file__), 'bindings', 'QtCore', 'QtCore.toml')
|
||||||
|
if os.path.exists(bindings_path):
|
||||||
|
with open(bindings_path) as f:
|
||||||
|
raw = f.read()
|
||||||
|
m = re.search(r'^sip-abi-version\s*=\s*"(.+?)"', raw, flags=re.MULTILINE)
|
||||||
|
if m is not None:
|
||||||
|
return m.group(1)
|
||||||
|
|
||||||
|
|
||||||
def merge_paths(a, b):
|
def merge_paths(a, b):
|
||||||
a = [os.path.normcase(os.path.normpath(x)) for x in a.split(os.pathsep)]
|
a = [os.path.normcase(os.path.normpath(x)) for x in a.split(os.pathsep)]
|
||||||
for q in b.split(os.pathsep):
|
for q in b.split(os.pathsep):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user