mirror of
https://github.com/conan-io/conan-center-index.git
synced 2025-08-17 20:12:32 +00:00
(#14693) prepare Meson for v2
* prepare Meson for v2 * restoring package_id() with self.info.clear
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
import os
|
||||
import textwrap
|
||||
|
||||
from conan import ConanFile, conan_version
|
||||
from conan.tools.files import copy, get, rmdir, save
|
||||
from conan.tools.layout import basic_layout
|
||||
from conan.tools.scm import Version
|
||||
import os
|
||||
import textwrap
|
||||
|
||||
required_conan_version = ">=1.52.0"
|
||||
|
||||
@@ -15,18 +16,13 @@ class MesonConan(ConanFile):
|
||||
url = "https://github.com/conan-io/conan-center-index"
|
||||
homepage = "https://github.com/mesonbuild/meson"
|
||||
license = "Apache-2.0"
|
||||
settings = "os", "arch", "compiler", "build_type"
|
||||
no_copy_source = True
|
||||
|
||||
@property
|
||||
def _settings_build(self):
|
||||
return getattr(self, "settings_build", self.settings)
|
||||
|
||||
def layout(self):
|
||||
basic_layout(self, src_folder="src")
|
||||
|
||||
def requirements(self):
|
||||
if self.conf.get("tools.meson.mesontoolchain:backend", default=False, check_type=str) in (False, "ninja"):
|
||||
if self.conf.get("tools.meson.mesontoolchain:backend", default="ninja", check_type=str) == "ninja":
|
||||
self.requires("ninja/1.11.1")
|
||||
|
||||
def package_id(self):
|
||||
@@ -36,24 +32,6 @@ class MesonConan(ConanFile):
|
||||
get(self, **self.conan_data["sources"][self.version],
|
||||
destination=self.source_folder, strip_root=True)
|
||||
|
||||
# FIXME: https://github.com/conan-io/conan/issues/10726
|
||||
def _fix_symlinks(root, files):
|
||||
if not self._settings_build.os == "Windows":
|
||||
return
|
||||
for filename in files:
|
||||
filename = os.path.join(root, filename)
|
||||
if os.path.islink(filename):
|
||||
target = os.readlink(filename)
|
||||
if "/" in target:
|
||||
self.output.info(f"fixing broken link {target}")
|
||||
target = target.replace("/", "\\")
|
||||
os.unlink(filename)
|
||||
os.symlink(target, filename)
|
||||
|
||||
for root, dirs, files in os.walk(self.source_folder):
|
||||
_fix_symlinks(root, dirs)
|
||||
_fix_symlinks(root, files)
|
||||
|
||||
def build(self):
|
||||
pass
|
||||
|
||||
|
@@ -1,8 +1,9 @@
|
||||
import os
|
||||
|
||||
from conan import ConanFile
|
||||
from conan.tools.build import can_run
|
||||
from conan.tools.layout import basic_layout
|
||||
from conan.tools.meson import Meson
|
||||
import os
|
||||
|
||||
|
||||
class TestPackageConan(ConanFile):
|
||||
|
Reference in New Issue
Block a user