83 lines
3.3 KiB
Diff
83 lines
3.3 KiB
Diff
--- a/pyqtbuild/builder.py
|
|
+++ b/pyqtbuild/builder.py
|
|
@@ -57,7 +57,7 @@
|
|
# be on PATH).
|
|
if tool != 'pep517':
|
|
self._sip_distinfo = os.path.join(
|
|
- os.path.abspath(os.path.dirname(sys.argv[0])),
|
|
+ os.path.abspath(os.path.dirname(sys.argv[0]).replace('\\', '/')),
|
|
self._sip_distinfo)
|
|
|
|
# Check we have a qmake.
|
|
@@ -242,8 +242,12 @@
|
|
['install_' + installable.name
|
|
for installable in project.installables])))
|
|
pro_lines.append('distinfo.extra = {}'.format(' '.join(args)))
|
|
+ if self.project.py_platform == 'win32' and "MSYSTEM" in os.environ:
|
|
+ distinfo_dir = os.popen(' '.join(['cygpath', '--unix', target_dir])).readline().strip()
|
|
+ else:
|
|
+ distinfo_dir = target_dir
|
|
pro_lines.append(
|
|
- 'distinfo.path = {}'.format(self.qmake_quote(target_dir)))
|
|
+ 'distinfo.path = {}'.format(self.qmake_quote(distinfo_dir)))
|
|
pro_lines.append('INSTALLS += distinfo')
|
|
|
|
pro_name = os.path.join(project.build_dir, project.name + '.pro')
|
|
@@ -338,7 +342,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:
|
|
@@ -470,8 +474,8 @@
|
|
# TODO: is this still necessary for Python v3.8?
|
|
if not buildable.static:
|
|
pro_lines.extend(['win32 {',
|
|
- ' LIBS += -L{}'.format(
|
|
- self.qmake_quote(project.py_pylib_dir)),
|
|
+ ' LIBS += -L{} -l{}'.format(
|
|
+ self.qmake_quote(project.py_pylib_dir), self.qmake_quote(project.py_pylib_lib)),
|
|
'}'])
|
|
|
|
# Add any installables from the buildable.
|
|
@@ -501,6 +505,8 @@
|
|
"Unexpected output from qmake: '{0}'".format(line))
|
|
|
|
name, value = tokens
|
|
+ if sysconfig._POSIX_BUILD and "MSYSTEM" in os.environ and value != "":
|
|
+ value = os.popen(' '.join(['cygpath', '--unix', value])).readline().strip()
|
|
else:
|
|
name = tokens
|
|
value = None
|
|
@@ -632,7 +636,7 @@
|
|
|
|
if install:
|
|
args.append('install')
|
|
- elif project.py_platform != 'win32' and self.jobs:
|
|
+ elif args[0] == 'make' and self.jobs:
|
|
args.append('-j')
|
|
args.append(str(self.jobs))
|
|
|
|
--- 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 @@
|
|
# 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:
|
|
pylib_dir = os.path.join(sys.base_prefix, 'libs')
|
|
|
|
debug_suffix = '_d' if self.py_debug else ''
|