1
1
import os
2
2
import re
3
3
4
- from conan .tools .microsoft import is_msvc
5
- from conans import ConanFile , Meson , tools
4
+ from conan import ConanFile
5
+ from conan .tools import (
6
+ build ,
7
+ files ,
8
+ microsoft ,
9
+ scm
10
+ )
11
+ from conans import Meson , tools
6
12
from conans .errors import ConanInvalidConfiguration
7
13
8
14
required_conan_version = ">=1.33.0"
@@ -44,7 +50,7 @@ def export_sources(self):
44
50
def config_options (self ):
45
51
if self .settings .os == "Windows" :
46
52
del self .options .fPIC
47
- if is_msvc (self ):
53
+ if microsoft . is_msvc (self ):
48
54
# Static builds not supported by MSVC
49
55
self .options .shared = True
50
56
@@ -68,15 +74,18 @@ def _minimum_compilers_version(self):
68
74
69
75
def validate (self ):
70
76
if self .settings .compiler .get_safe ("cppstd" ):
71
- tools .check_min_cppstd (self , self ._minimum_cpp_standard )
77
+ build .check_min_cppstd (self , self ._minimum_cpp_standard )
78
+
72
79
min_version = self ._minimum_compilers_version .get (str (self .settings .compiler ))
73
80
if not min_version :
74
81
self .output .warn ("{} recipe lacks information about the {} compiler support." .format (
75
82
self .name , self .settings .compiler ))
76
83
else :
77
- if tools .Version (self .settings .compiler .version ) < min_version :
78
- raise ConanInvalidConfiguration ("{} requires C++{} support. The current compiler {} {} does not support it." .format (
79
- self .name , self ._minimum_cpp_standard , self .settings .compiler , self .settings .compiler .version ))
84
+ if scm .Version (self .settings .compiler .version ) < min_version :
85
+ raise ConanInvalidConfiguration (
86
+ f"{ self .name } requires C++{ self ._minimum_cpp_standard } support. " +
87
+ f"The current compiler { self .settings .compiler } { self .settings .compiler .version } does not " +
88
+ f"support it." )
80
89
81
90
def build_requirements (self ):
82
91
self .build_requires ("meson/0.62.2" )
@@ -87,18 +96,18 @@ def requirements(self):
87
96
# gtkmm has a direct dependency on cairo-gobject which is not explicit in the meson configuration
88
97
self .requires ("cairo/1.17.4" )
89
98
self .requires ("glibmm/2.72.1" )
90
- self .requires ("glib/2.73.0 " )
99
+ self .requires ("glib/2.73.3 " )
91
100
self .requires ("gtk/4.7.0" )
92
101
self .requires ("libsigcpp/3.0.7" )
93
102
self .requires ("pangomm/2.50.0" )
94
103
95
104
def source (self ):
96
- tools .get (** self .conan_data ["sources" ][self .version ], strip_root = True , destination = self ._source_subfolder )
105
+ files .get (self , ** self .conan_data ["sources" ][self .version ], strip_root = True , destination = self ._source_subfolder )
97
106
98
107
def _patch_sources (self ):
99
- if is_msvc (self ):
108
+ if microsoft . is_msvc (self ):
100
109
for patch in self .conan_data .get ("patches" , {}).get (self .version , []):
101
- tools .patch (** patch )
110
+ files .patch (self , ** patch )
102
111
103
112
def _configure_meson (self ):
104
113
meson = Meson (self )
@@ -156,13 +165,12 @@ def package(self):
156
165
meson .install ()
157
166
158
167
self .copy (pattern = "COPYING" , src = self ._source_subfolder , dst = "licenses" )
159
- tools .rmdir (os .path .join (self .package_folder , "lib" , "pkgconfig" ))
160
- tools .remove_files_by_mask (os .path .join (self .package_folder , "bin" ), "*.pdb" )
161
- tools .remove_files_by_mask (os .path .join (self .package_folder , "lib" ), "*.pdb" )
168
+ files .rmdir (self , os .path .join (self .package_folder , "lib" , "pkgconfig" ))
169
+ files .rm (self , "*.pdb" , self .package_folder , recursive = True )
162
170
163
171
@property
164
172
def _libname (self ):
165
- if is_msvc (self ):
173
+ if microsoft . is_msvc (self ):
166
174
return f"gtkmm-{ self ._msvc_toolset_suffix } -4.0"
167
175
return "gtkmm-4.0"
168
176
0 commit comments