pyqt-builder: Fix and minimize patch

This commit is contained in:
مهدي شينون (Mehdi Chinoune) 2024-12-06 08:29:40 +01:00
parent eafe1a8cec
commit f2cfebdad9
2 changed files with 10 additions and 27 deletions

View File

@ -1,6 +1,6 @@
--- a/pyqtbuild/builder.py
+++ b/pyqtbuild/builder.py
@@ -59,7 +59,7 @@
@@ -39,7 +39,7 @@
exe_dir, exe_name = os.path.split(sys.argv[0])
if exe_name.startswith('sip-'):
@ -9,7 +9,7 @@
self._sip_distinfo)
# Check we have a qmake.
@@ -240,8 +240,12 @@
@@ -233,8 +233,12 @@
['install_' + installable.name
for installable in project.installables])))
pro_lines.append('distinfo.extra = {}'.format(' '.join(args)))
@ -23,16 +23,7 @@
pro_lines.append('INSTALLS += distinfo')
pro_name = os.path.join(project.build_dir, project.name + '.pro')
@@ -336,7 +340,7 @@
def _find_make(self):
""" Return the name of a valid make program. """
- if self.project.py_platform == 'win32':
+ if self.project.py_platform == 'win32' and not "MSYSTEM" in os.environ:
if 'g++' in self.spec:
make = 'make'
else:
@@ -468,8 +473,8 @@
@@ -461,8 +465,8 @@
# TODO: is this still necessary for Python v3.8?
if not buildable.static:
pro_lines.extend(['win32 {',
@ -43,16 +34,16 @@
'}'])
# Add any installables from the buildable.
@@ -500,6 +504,8 @@
@@ -493,6 +497,8 @@
"Unexpected output from qmake: '{0}'".format(line))
name, value = tokens
+ if sysconfig._POSIX_BUILD and "MSYSTEM" in os.environ and value != "":
+ if "MSYSTEM" in os.environ and value != "":
+ value = os.popen(' '.join(['cygpath', '--unix', value])).readline().strip()
else:
name = tokens
value = None
@@ -630,7 +634,7 @@
@@ -627,7 +633,7 @@
if install:
args.append('install')
@ -63,20 +54,12 @@
--- a/pyqtbuild/project.py
+++ b/pyqtbuild/project.py
@@ -24,6 +24,7 @@
import os
import sys
+from sysconfig import _POSIX_BUILD
from sipbuild import Option, Project, UserException
@@ -72,7 +73,7 @@
@@ -56,7 +56,7 @@
# Get the details of the default Python interpreter library. Note that
# these are actually non-user options but we need the 'link_full_dll'
# user option in order to set them.
- if self.py_platform == 'win32':
+ if self.py_platform == 'win32' and not _POSIX_BUILD:
+ if self.py_platform == 'win32' and 'MSC' in sys.version:
pylib_dir = os.path.join(sys.base_prefix, 'libs')
debug_suffix = '_d' if self.py_debug else ''

View File

@ -5,7 +5,7 @@ _realname=pyqt-builder
pkgbase=mingw-w64-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}")
pkgver=1.17.0
pkgrel=1
pkgrel=2
pkgdesc="The PEP 517 compliant PyQt build system (mingw-w64)"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clangarm64')
@ -26,7 +26,7 @@ options=(!strip)
source=("https://pypi.io/packages/source/P/PyQt-builder/pyqt_builder-${pkgver}.tar.gz"
001-mingw-python.patch)
sha256sums=('fce0e92346d2a4296525b7ad9f02b74ea425f26210390ae0d3e4ca08c31cf4cc'
'a0127037669e99008bf463750a6bd45d8cc4d16392566d28dc7b2b9e42833c4a')
'f373ea9e84c0340a425ba795b2a3eacabf1e5ec289c13661ba6d34ff373dffb8')
prepare() {
cd ${_realname/-/_}-${pkgver}