Cross-Platform build scripts for audio plugins
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

162 lines
5.7KB

  1. diff -uNr sip-4.16.2/configure.py sip-4.16.2-mingw/configure.py
  2. --- sip-4.16.2/configure.py 2014-07-03 12:08:46.000000000 +0200
  3. +++ sip-4.16.2-mingw/configure.py 2014-07-30 10:41:38.510622892 +0200
  4. @@ -20,6 +20,7 @@
  5. import glob
  6. import optparse
  7. from distutils import sysconfig
  8. +_POSIX_BUILD = True
  9. try:
  10. from importlib import invalidate_caches
  11. @@ -157,7 +158,9 @@
  12. build_platform = "none"
  13. if py_platform == "win32":
  14. - if py_version >= 0x030500:
  15. + if _POSIX_BUILD:
  16. + build_platform = "win32-g++"
  17. + elif py_version >= 0x030500:
  18. build_platform = "win32-msvc2015"
  19. elif py_version >= 0x030300:
  20. build_platform = "win32-msvc2010"
  21. @@ -219,7 +219,7 @@
  22. plat_py_venv_inc_dir = sysconfig.get_python_inc(prefix=sys.prefix)
  23. plat_py_conf_inc_dir = os.path.dirname(sysconfig.get_config_h_filename())
  24. - if sys.platform == "win32":
  25. + if sys.platform == "win32" and not _POSIX_BUILD:
  26. bin_dir = sys.exec_prefix
  27. try:
  28. @@ -245,9 +245,22 @@
  29. else:
  30. lib_dir = sysconfig.get_python_lib(plat_specific=1, standard_lib=1)
  31. - plat_py_lib_dir = lib_dir + "/config"
  32. - plat_bin_dir = sys.exec_prefix + "/bin"
  33. - plat_sip_dir = sys.prefix + "/share/sip"
  34. + if "MSYSTEM" in os.environ:
  35. + plat_py_site_dir = os.popen(' '.join(['cygpath', '--unix', plat_py_site_dir])).readline().strip()
  36. + plat_py_inc_dir = os.popen(' '.join(['cygpath', '--unix', plat_py_inc_dir])).readline().strip()
  37. + plat_py_conf_inc_dir = os.popen(' '.join(['cygpath', '--unix', plat_py_conf_inc_dir])).readline().strip()
  38. + lib_dir = os.popen(' '.join(['cygpath', '--unix', lib_dir])).readline().strip()
  39. +
  40. + plat_py_lib_dir = lib_dir + "/config"
  41. + temp_sys_exec_prefix = os.popen(' '.join(['cygpath', '--unix', sys.exec_prefix])).readline().strip()
  42. + plat_bin_dir = temp_sys_exec_prefix + "/bin"
  43. + temp_sys_prefix = os.popen(' '.join(['cygpath', '--unix', sys.prefix])).readline().strip()
  44. + plat_sip_dir = temp_sys_prefix + "/share/sip"
  45. + plat_py_venv_inc_dir = os.popen(' '.join(['cygpath', '--unix', plat_py_venv_inc_dir])).readline().strip()
  46. + else:
  47. + plat_py_lib_dir = lib_dir + "/config"
  48. + plat_bin_dir = sys.exec_prefix + "/bin"
  49. + plat_sip_dir = sys.prefix + "/share/sip"
  50. def patch_files():
  51. @@ -398,7 +413,10 @@
  52. if not opts.static:
  53. # These only need to be correct for Windows.
  54. debug_suffix = "_d" if opts.debug else ""
  55. - link_lib_dir = quote("-L" + cfg.py_lib_dir)
  56. + if "MSYSTEM" in os.environ:
  57. + link_lib_dir = quote("-L" + sys.prefix + "/" + cfg.py_lib_dir)
  58. + else:
  59. + link_lib_dir = quote("-L" + cfg.py_lib_dir)
  60. pro.write("""
  61. win32 {
  62. diff -uNr sip-4.16.2/siputils.py sip-4.16.2-mingw/siputils.py
  63. --- sip-4.16.2/siputils.py 2014-05-10 17:00:48.000000000 +0200
  64. +++ sip-4.16.2-mingw/siputils.py 2014-07-30 10:41:24.250623520 +0200
  65. @@ -22,7 +22,8 @@
  66. import stat
  67. import string
  68. import re
  69. -
  70. +from distutils import sysconfig
  71. +_POSIX_BUILD = True
  72. # These are installation specific values created when SIP was configured.
  73. # @SIP_CONFIGURATION@
  74. @@ -321,7 +322,7 @@
  75. self.extra_libs = []
  76. # Get these once and make them available to sub-classes.
  77. - if sys.platform == "win32":
  78. + if sys.platform == "win32" and not "MSYSTEM" in os.environ:
  79. def_copy = "copy"
  80. def_rm = "del"
  81. def_mkdir = "mkdir"
  82. @@ -440,7 +441,7 @@
  83. incdir.append(self.config.py_inc_dir)
  84. incdir.append(self.config.py_conf_inc_dir)
  85. - if sys.platform == "cygwin":
  86. + if sys.platform == "cygwin" or _POSIX_BUILD:
  87. libdir.append(self.config.py_lib_dir)
  88. py_lib = "python%u.%u" % ((self.config.py_version >> 16), ((self.config.py_version >> 8) & 0xff))
  89. @@ -1625,7 +1626,7 @@
  90. mfile is the file object.
  91. """
  92. if self.static:
  93. - if sys.platform == "win32":
  94. + if sys.platform == "win32" and not _POSIX_BUILD:
  95. ext = "lib"
  96. else:
  97. ext = "a"
  98. @@ -2021,7 +2026,7 @@
  99. s is the string.
  100. """
  101. # On Qt5 paths often includes forward slashes so convert them.
  102. - if sys.platform == "win32":
  103. + if sys.platform == "win32" and not _POSIX_BUILD:
  104. s = s.replace("/", "\\")
  105. if s.find(" ") >= 0:
  106. diff -uNr sip-4.16.2/specs/win32-g++ sip-4.16.2-mingw/specs/win32-g++
  107. --- sip-4.16.2/specs/win32-g++ 2011-05-11 20:39:21.000000000 +0200
  108. +++ sip-4.16.2-mingw/specs/win32-g++ 2014-07-30 10:41:24.250623520 +0200
  109. @@ -69,23 +69,16 @@
  110. QMAKE_LIBS_COMPAT = -ladvapi32 -lshell32 -lcomdlg32 -luser32 -lgdi32 -lws2_32
  111. QMAKE_LIBS_QT_ENTRY = -lmingw32 -lqtmain
  112. -MINGW_IN_SHELL = $$(MINGW_IN_SHELL)
  113. -isEqual(MINGW_IN_SHELL, 1) {
  114. - QMAKE_DIR_SEP = /
  115. - QMAKE_COPY = cp
  116. - QMAKE_COPY_DIR = xcopy /s /q /y /i
  117. - QMAKE_MOVE = mv
  118. - QMAKE_DEL_FILE = rm
  119. - QMAKE_MKDIR = mkdir
  120. - QMAKE_DEL_DIR = rmdir
  121. -} else {
  122. - QMAKE_COPY = copy /y
  123. - QMAKE_COPY_DIR = xcopy /s /q /y /i
  124. - QMAKE_MOVE = move
  125. - QMAKE_DEL_FILE = del
  126. - QMAKE_MKDIR = mkdir
  127. - QMAKE_DEL_DIR = rmdir
  128. -}
  129. +MAKEFILE_GENERATOR = UNIX
  130. +QMAKE_DIR_SEP = /
  131. +QMAKE_COPY = cp
  132. +QMAKE_COPY_DIR = cp -r
  133. +QMAKE_MOVE = mv
  134. +QMAKE_DEL_FILE = rm
  135. +QMAKE_MKDIR = mkdir -p
  136. +QMAKE_DEL_DIR = rmdir
  137. +QMAKE_CHK_DIR_EXISTS = test -d
  138. +
  139. QMAKE_MOC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}moc.exe
  140. QMAKE_UIC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}uic.exe
  141. QMAKE_IDC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}idc.exe
  142. @@ -98,5 +91,4 @@
  143. QMAKE_STRIP = strip
  144. QMAKE_STRIPFLAGS_LIB += --strip-unneeded
  145. -QMAKE_CHK_DIR_EXISTS = if not exist
  146. load(qt_config)