extra/meson to 1.4.0-2

This commit is contained in:
Kevin Mihelich 2024-03-14 04:02:45 +00:00
parent 85e2f08ef2
commit 3086b5f01f
5 changed files with 179 additions and 32 deletions

View file

@ -1,7 +1,7 @@
pkgbase = meson
pkgdesc = High productivity build system
pkgver = 1.4.0
pkgrel = 1
pkgrel = 2
url = https://mesonbuild.com/
arch = any
license = Apache
@ -64,7 +64,9 @@ pkgbase = meson
source = cross-lib32
source = native-clang
source = 0001-Skip-broken-tests.patch
source = 0002-tests-Fix-unit-tests-with-high-parallelism.patch
source = 0002-unittests-Add-a-helper-for-copying-source-trees.patch
source = 0003-tests-Fix-unit-tests-with-high-parallelism.patch
source = 0004-Revert-rust-recursively-pull-proc-macro-dependencies.patch
validpgpkeys = 19E2D6D9B46D8DAA6288F877C24E631BABB1FE70
b2sums = 7f742ef870c182e552c1ff3508d65f251009d610def6a08e01fddb6c6a4ed6d608ead0d52cf8ca7d66b5bd7a4732dccd7ab5d98f141a4a61e275398885f79486
b2sums = SKIP
@ -74,6 +76,8 @@ pkgbase = meson
b2sums = 9b16477aa77a706492e26fb3ad42e90674b8f0dfe657dd3bd9ba044f921be12ceabeb0050a50a15caee4d999e1ec33ed857bd3bed9e4444d73bb4a4f06381081
b2sums = 7d88929d5a3b49d91c5c9969f19d9b47f3151706526b889515acaeda0141257d5115875ac84832e9ea46f83a7700d673adcc5db84b331cd798c70ae6e90eac1e
b2sums = b0e050d6cfa7e9cb5692e6aa12185632313536bd4ad59c704cfa2b655ad52e3f34d038da3e2f01d47b16f910db8d458b69f3b2b07bd8d74b92622b00bfc7d120
b2sums = 13bfa022f97745dd072c418c5e77b08b9105e7e357b47ab8634e45dc92a7ceaca0d7483a05b66767d97d9f3ca8e0a67e8015c08b8c466d4a083c15c68e30473f
b2sums = a5206ac07afa0c3cde982109f52e208a30e59daf1200b42946005bc6db09e647dc9ce220eb359fc0820d2ab1d401c5547e44bbadc0c5e1d7c942865951b9fdd7
b2sums = 655fdebe13d1857505889c5c8bd4605c989e1c92ac930f42e0162bb75fc53e460c15d929c93e2e9740a99ea49b5ed36f264da5a99dc6110eb1509d665a33ccf9
b2sums = 62e19e7ec8c3448989167fdda724104389176440ead253e8f1665f6f383542fbc9afae9d6c64f6365e8b2878863416554266e6e651d6e58981fa8e145d321e49
pkgname = meson

View file

@ -0,0 +1,57 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Dylan Baker <dylan@pnwbakers.com>
Date: Mon, 11 Mar 2024 11:31:05 -0700
Subject: [PATCH] unittests: Add a helper for copying source trees
This is a useful thing to do when a test needs to modify the source
tree, as it prevents races between tests.
---
unittests/baseplatformtests.py | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/unittests/baseplatformtests.py b/unittests/baseplatformtests.py
index 6125ed933209..93bfc8905b73 100644
--- a/unittests/baseplatformtests.py
+++ b/unittests/baseplatformtests.py
@@ -1,14 +1,17 @@
# SPDX-License-Identifier: Apache-2.0
# Copyright 2016-2021 The Meson development team
+# Copyright © 2024 Intel Corporation
+from __future__ import annotations
from pathlib import PurePath
from unittest import mock, TestCase, SkipTest
import json
import io
import os
import re
import subprocess
import sys
+import shutil
import tempfile
import typing as T
@@ -492,3 +495,23 @@ class BasePlatformTests(TestCase):
def assertLength(self, val, length):
assert len(val) == length, f'{val} is not length {length}'
+
+ def copy_srcdir(self, srcdir: str) -> str:
+ """Copies a source tree and returns that copy.
+
+ ensures that the copied tree is deleted after running.
+
+ :param srcdir: The locaiton of the source tree to copy
+ :return: The location of the copy
+ """
+ dest = tempfile.mkdtemp()
+ self.addCleanup(windows_proof_rmtree, dest)
+
+ # shutil.copytree expects the destinatin directory to not exist, Once
+ # python 3.8 is required the `dirs_exist_ok` parameter negates the need
+ # for this
+ dest = os.path.join(dest, 'subdir')
+
+ shutil.copytree(srcdir, dest)
+
+ return dest

View file

@ -12,25 +12,26 @@ source directory.
To fix this, make `install_subdir_invalid_symlinks` copy the entire test
into a tmpdir before modifying it.
---
unittests/linuxliketests.py | 39 +++++++++++++++++++------------------
1 file changed, 20 insertions(+), 19 deletions(-)
unittests/linuxliketests.py | 21 +++++++++------------
1 file changed, 9 insertions(+), 12 deletions(-)
diff --git a/unittests/linuxliketests.py b/unittests/linuxliketests.py
index f66dc9769a8f..c8dc0195bc72 100644
index f66dc9769a8f..ce4d36fe024c 100644
--- a/unittests/linuxliketests.py
+++ b/unittests/linuxliketests.py
@@ -1413,25 +1413,26 @@ class LinuxlikeTests(BasePlatformTests):
@@ -1413,25 +1413,22 @@ class LinuxlikeTests(BasePlatformTests):
Test that installation of broken symlinks works fine.
https://github.com/mesonbuild/meson/issues/3914
'''
- testdir = os.path.join(self.common_test_dir, testdir)
- subdir = os.path.join(testdir, subdir_path)
- with chdir(subdir):
- # Can't distribute broken symlinks in the source tree because it breaks
- # the creation of zipapps. Create it dynamically and run the test by
- # hand.
- src = '../../nonexistent.txt'
- os.symlink(src, 'invalid-symlink.txt')
+ testdir = self.copy_srcdir(os.path.join(self.common_test_dir, testdir))
subdir = os.path.join(testdir, subdir_path)
with chdir(subdir):
# Can't distribute broken symlinks in the source tree because it breaks
# the creation of zipapps. Create it dynamically and run the test by
# hand.
src = '../../nonexistent.txt'
os.symlink(src, 'invalid-symlink.txt')
- try:
- self.init(testdir)
- self.build()
@ -42,23 +43,11 @@ index f66dc9769a8f..c8dc0195bc72 100644
- self.assertFalse(os.path.isfile(link), msg=link)
- finally:
- os.remove(os.path.join(subdir, 'invalid-symlink.txt'))
+ # We can't distribute broken symlinks in the source tree because it
+ # breaks the creation of zipapps. Create the symlink dynamically and run
+ # the test by hand. Do this in a tmpdir in order to not tread on
+ # parallel tests' toes.
+ with tempfile.TemporaryDirectory() as tmpdir:
+ orig_testdir = os.path.join(self.common_test_dir, testdir)
+ tmp_testdir = os.path.join(tmpdir, testdir.split(os.path.sep)[-1])
+ shutil.copytree(orig_testdir, tmp_testdir)
+ src = '../nonexistent.txt'
+ dst = 'invalid-symlink.txt'
+ subdir = os.path.join(tmp_testdir, subdir_path)
+ os.symlink(src, os.path.join(subdir, dst))
+ self.init(tmp_testdir)
+ self.init(testdir)
+ self.build()
+ self.install()
+ install_path = subdir_path.split(os.path.sep)[-1]
+ link = os.path.join(self.installdir, 'usr', 'share', install_path, dst)
+ link = os.path.join(self.installdir, 'usr', 'share', install_path, 'invalid-symlink.txt')
+ self.assertTrue(os.path.islink(link), msg=link)
+ self.assertEqual(src, os.readlink(link))
+ self.assertFalse(os.path.isfile(link), msg=link)

File diff suppressed because one or more lines are too long

View file

@ -7,7 +7,7 @@
pkgname=meson
pkgver=1.4.0
pkgrel=1
pkgrel=2
pkgdesc="High productivity build system"
url="https://mesonbuild.com/"
arch=(any)
@ -76,7 +76,9 @@ source=(
cross-lib32
native-clang
0001-Skip-broken-tests.patch
0002-tests-Fix-unit-tests-with-high-parallelism.patch
0002-unittests-Add-a-helper-for-copying-source-trees.patch
0003-tests-Fix-unit-tests-with-high-parallelism.patch
0004-Revert-rust-recursively-pull-proc-macro-dependencies.patch
)
b2sums=('7f742ef870c182e552c1ff3508d65f251009d610def6a08e01fddb6c6a4ed6d608ead0d52cf8ca7d66b5bd7a4732dccd7ab5d98f141a4a61e275398885f79486'
'SKIP'
@ -86,7 +88,9 @@ b2sums=('7f742ef870c182e552c1ff3508d65f251009d610def6a08e01fddb6c6a4ed6d608ead0d
'9b16477aa77a706492e26fb3ad42e90674b8f0dfe657dd3bd9ba044f921be12ceabeb0050a50a15caee4d999e1ec33ed857bd3bed9e4444d73bb4a4f06381081'
'7d88929d5a3b49d91c5c9969f19d9b47f3151706526b889515acaeda0141257d5115875ac84832e9ea46f83a7700d673adcc5db84b331cd798c70ae6e90eac1e'
'b0e050d6cfa7e9cb5692e6aa12185632313536bd4ad59c704cfa2b655ad52e3f34d038da3e2f01d47b16f910db8d458b69f3b2b07bd8d74b92622b00bfc7d120'
'13bfa022f97745dd072c418c5e77b08b9105e7e357b47ab8634e45dc92a7ceaca0d7483a05b66767d97d9f3ca8e0a67e8015c08b8c466d4a083c15c68e30473f')
'a5206ac07afa0c3cde982109f52e208a30e59daf1200b42946005bc6db09e647dc9ce220eb359fc0820d2ab1d401c5547e44bbadc0c5e1d7c942865951b9fdd7'
'655fdebe13d1857505889c5c8bd4605c989e1c92ac930f42e0162bb75fc53e460c15d929c93e2e9740a99ea49b5ed36f264da5a99dc6110eb1509d665a33ccf9'
'62e19e7ec8c3448989167fdda724104389176440ead253e8f1665f6f383542fbc9afae9d6c64f6365e8b2878863416554266e6e651d6e58981fa8e145d321e49')
validpgpkeys=(
19E2D6D9B46D8DAA6288F877C24E631BABB1FE70 # Jussi Pakkanen <jpakkane@gmail.com>
)
@ -98,7 +102,11 @@ prepare() {
patch -Np1 -i ../0001-Skip-broken-tests.patch
# https://github.com/mesonbuild/meson/pull/12937
patch -Np1 -i ../0002-tests-Fix-unit-tests-with-high-parallelism.patch
patch -Np1 -i ../0002-unittests-Add-a-helper-for-copying-source-trees.patch
patch -Np1 -i ../0003-tests-Fix-unit-tests-with-high-parallelism.patch
# Fix lib32-mesa
patch -Np1 -i ../0004-Revert-rust-recursively-pull-proc-macro-dependencies.patch
}
build() {