Browse Source

add mingw meson patches

before_cleanup
Alexandros Theodotou 3 years ago
parent
commit
6b168f21a8
Signed by: alex
GPG Key ID: 022EAE42313D70F3
  1. 11
      mingw-meson/0002-Default-to-sys.prefix-as-the-default-prefix.patch
  2. 33
      mingw-meson/0003-Strip-the-prefix-from-all-paths-when-installing-with.patch
  3. 11
      mingw-meson/color-term.patch
  4. 11
      mingw-meson/install-man.patch

11
mingw-meson/0002-Default-to-sys.prefix-as-the-default-prefix.patch

@ -0,0 +1,11 @@ @@ -0,0 +1,11 @@
--- meson-0.54.0/mesonbuild/mesonlib.py.orig 2020-03-30 08:16:34.854854700 +0200
+++ meson-0.54.0/mesonbuild/mesonlib.py 2020-03-30 08:16:45.815838600 +0200
@@ -736,6 +736,8 @@
def default_prefix() -> str:
+ if is_windows() and 'MSYSTEM' in os.environ:
+ return sys.prefix
return 'c:/' if is_windows() else '/usr/local'

33
mingw-meson/0003-Strip-the-prefix-from-all-paths-when-installing-with.patch

@ -0,0 +1,33 @@ @@ -0,0 +1,33 @@
Strip the prefix from all paths when installing with DESTDIR
Otherwise we end up with <destdir>/<prefix>/<path>
--- meson-0.47.0/mesonbuild/scripts/__init__.py
+++ meson-0.47.0/mesonbuild/scripts/__init__.py
@@ -12,7 +12,18 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+import os
+from ..mesonlib import is_windows
+
def destdir_join(d1, d2):
+ # When the installation path starts with PREFIX, strip it away
+ if d1 and is_windows() and 'MSYSTEM' in os.environ:
+ assert os.path.isabs(d2) and 'MESON_INSTALL_PREFIX' in os.environ
+ prefix = os.environ['MESON_INSTALL_PREFIX']
+ rel_to_prefix = os.path.relpath(d2, prefix)
+ if not rel_to_prefix.startswith(os.pardir + os.sep):
+ return os.path.join(d1, rel_to_prefix)
+
# c:\destdir + c:\prefix must produce c:\destdir\prefix
if len(d1) > 1 and d1[1] == ':' \
and len(d2) > 1 and d2[1] == ':':
--- meson-0.47.0/mesonbuild/minstall.py.orig
+++ meson-0.47.0/mesonbuild/minstall.py
@@ -286,6 +286,7 @@
with open(datafilename, 'rb') as ifile:
d = pickle.load(ifile)
d.destdir = os.environ.get('DESTDIR', '')
+ os.environ['MESON_INSTALL_PREFIX'] = d.prefix
d.fullprefix = destdir_join(d.destdir, d.prefix)
if d.install_umask is not None:

11
mingw-meson/color-term.patch

@ -0,0 +1,11 @@ @@ -0,0 +1,11 @@
--- meson-0.50.1/mesonbuild/mlog.py.orig 2019-03-06 21:48:10.000000000 +0100
+++ meson-0.50.1/mesonbuild/mlog.py 2019-04-17 17:46:10.229092600 +0200
@@ -31,7 +31,7 @@
stdout = kernel.GetStdHandle(-11)
mode = DWORD()
if not kernel.GetConsoleMode(stdout, byref(mode)):
- return False
+ return os.isatty(sys.stdout.fileno())
# ENABLE_VIRTUAL_TERMINAL_PROCESSING == 0x4
# If the call to enable VT processing fails (returns 0), we fallback to
# original behavior

11
mingw-meson/install-man.patch

@ -0,0 +1,11 @@ @@ -0,0 +1,11 @@
--- meson-0.48.0/setup.py.orig 2018-09-22 15:22:03.000000000 +0200
+++ meson-0.48.0/setup.py 2018-09-23 13:48:10.509756600 +0200
@@ -36,7 +36,7 @@
'mesonbuild.scripts',
'mesonbuild.wrap']
data_files = []
-if sys.platform != 'win32':
+if sys.platform != 'win32' or 1:
# Only useful on UNIX-like systems
data_files = [('share/man/man1', ['man/meson.1']),
('share/polkit-1/actions', ['data/com.mesonbuild.install.policy'])]
Loading…
Cancel
Save