mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-10 16:52:14 -04:00
Compare commits
2 commits
719c2ce5c6
...
7c3d40b368
Author | SHA1 | Date | |
---|---|---|---|
|
7c3d40b368 | ||
|
ac70ea7403 |
2 changed files with 16 additions and 9 deletions
|
@ -24,8 +24,20 @@ from functools import cached_property
|
||||||
|
|
||||||
import gi # type: ignore
|
import gi # type: ignore
|
||||||
|
|
||||||
gi.require_version("GIRepository", "3.0")
|
try:
|
||||||
from gi.repository import GIRepository # type: ignore
|
gi.require_version("GIRepository", "3.0")
|
||||||
|
from gi.repository import GIRepository # type: ignore
|
||||||
|
|
||||||
|
_repo = GIRepository.Repository()
|
||||||
|
except ValueError:
|
||||||
|
# We can remove this once we can bump the minimum dependencies
|
||||||
|
# to glib 2.80 and pygobject 3.52
|
||||||
|
# dependency('glib-2.0', version: '>= 2.80.0')
|
||||||
|
# dependency('girepository-2.0', version: '>= 2.80.0')
|
||||||
|
gi.require_version("GIRepository", "2.0")
|
||||||
|
from gi.repository import GIRepository # type: ignore
|
||||||
|
|
||||||
|
_repo = GIRepository.Repository
|
||||||
|
|
||||||
from . import typelib, xml_reader
|
from . import typelib, xml_reader
|
||||||
from .errors import CompileError, CompilerBugError
|
from .errors import CompileError, CompilerBugError
|
||||||
|
@ -42,8 +54,7 @@ def add_typelib_search_path(path: str):
|
||||||
|
|
||||||
|
|
||||||
def get_namespace(namespace: str, version: str) -> "Namespace":
|
def get_namespace(namespace: str, version: str) -> "Namespace":
|
||||||
repo = GIRepository.Repository()
|
search_paths = [*_repo.get_search_path(), *_user_search_paths]
|
||||||
search_paths = [*repo.get_search_path(), *_user_search_paths]
|
|
||||||
|
|
||||||
filename = f"{namespace}-{version}.typelib"
|
filename = f"{namespace}-{version}.typelib"
|
||||||
|
|
||||||
|
@ -74,9 +85,8 @@ def get_available_namespaces() -> T.List[T.Tuple[str, str]]:
|
||||||
if len(_available_namespaces):
|
if len(_available_namespaces):
|
||||||
return _available_namespaces
|
return _available_namespaces
|
||||||
|
|
||||||
repo = GIRepository.Repository()
|
|
||||||
search_paths: list[str] = [
|
search_paths: list[str] = [
|
||||||
*repo.get_search_path(),
|
*_repo.get_search_path(),
|
||||||
*_user_search_paths,
|
*_user_search_paths,
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
|
@ -7,9 +7,6 @@ datadir = join_paths(prefix, get_option('datadir'))
|
||||||
|
|
||||||
py = import('python').find_installation('python3')
|
py = import('python').find_installation('python3')
|
||||||
|
|
||||||
dependency('glib-2.0', version: '>= 2.80.0')
|
|
||||||
dependency('girepository-2.0', version: '>= 2.80.0')
|
|
||||||
|
|
||||||
subdir('docs')
|
subdir('docs')
|
||||||
|
|
||||||
configure_file(
|
configure_file(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue