diff --git a/f233b7b98dc77937ba3448488fe7c66575c20aa6.patch b/f233b7b98dc77937ba3448488fe7c66575c20aa6.patch new file mode 100644 index 0000000..a50850d --- /dev/null +++ b/f233b7b98dc77937ba3448488fe7c66575c20aa6.patch @@ -0,0 +1,66 @@ +From 91caf7aa56ba622926f7056d4a42083a75c24e5a Mon Sep 17 00:00:00 2001 +From: U2FsdGVkX1 +Date: Sun, 4 Feb 2024 14:07:54 +0800 +Subject: [PATCH 1/2] Fix ninja cannot find the library when libraries contain + symlinks. + +--- + mesonbuild/compilers/mixins/gnu.py | 11 ++++------- + 1 file changed, 4 insertions(+), 7 deletions(-) + +diff --git a/mesonbuild/compilers/mixins/gnu.py b/mesonbuild/compilers/mixins/gnu.py +index 9c0c3f290531..ef7f120f8956 100644 +--- a/mesonbuild/compilers/mixins/gnu.py ++++ b/mesonbuild/compilers/mixins/gnu.py +@@ -469,16 +469,13 @@ def _split_fetch_real_dirs(self, pathstr: str) -> T.List[str]: + # paths under /lib would be considered not a "system path", + # which is wrong and breaks things. Store everything, just to be sure. + pobj = pathlib.Path(p) +- unresolved = pobj.as_posix() + if pobj.exists(): ++ resolved = pobj.resolve().as_posix() ++ if resolved not in result: ++ result.append(resolved) ++ unresolved = pobj.as_posix() + if unresolved not in result: + result.append(unresolved) +- try: +- resolved = pathlib.Path(p).resolve().as_posix() +- if resolved not in result: +- result.append(resolved) +- except FileNotFoundError: +- pass + return result + + def get_compiler_dirs(self, env: 'Environment', name: str) -> T.List[str]: + +From 7a60218dcaf0e11694ff1cb0531168fe576dc390 Mon Sep 17 00:00:00 2001 +From: U2FsdGVkX1 +Date: Mon, 5 Feb 2024 17:24:21 +0800 +Subject: [PATCH 2/2] Turn on strict mode, as it is no longer the default since + Python 3.6 + +--- + mesonbuild/compilers/mixins/gnu.py | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +diff --git a/mesonbuild/compilers/mixins/gnu.py b/mesonbuild/compilers/mixins/gnu.py +index ef7f120f8956..79f271607434 100644 +--- a/mesonbuild/compilers/mixins/gnu.py ++++ b/mesonbuild/compilers/mixins/gnu.py +@@ -470,9 +470,12 @@ def _split_fetch_real_dirs(self, pathstr: str) -> T.List[str]: + # which is wrong and breaks things. Store everything, just to be sure. + pobj = pathlib.Path(p) + if pobj.exists(): +- resolved = pobj.resolve().as_posix() +- if resolved not in result: +- result.append(resolved) ++ try: ++ resolved = pobj.resolve(True).as_posix() ++ if resolved not in result: ++ result.append(resolved) ++ except FileNotFoundError: ++ pass + unresolved = pobj.as_posix() + if unresolved not in result: + result.append(unresolved) diff --git a/meson.spec b/meson.spec index 36485d7..b026d65 100644 --- a/meson.spec +++ b/meson.spec @@ -14,6 +14,9 @@ License: Apache-2.0 URL: https://mesonbuild.com/ Source: https://github.com/mesonbuild/meson/releases/download/%{version_no_tilde .}/meson-%{version_no_tilde %{quote:}}.tar.gz +# Upstream fix for symlinks on riscv64 +Patch: https://github.com/mesonbuild/meson/commit/f233b7b98dc77937ba3448488fe7c66575c20aa6.patch + BuildArch: noarch BuildRequires: python3-devel