File tree Expand file tree Collapse file tree 3 files changed +9
-6
lines changed Expand file tree Collapse file tree 3 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ def get_mono(
7070
7171 libmono = _maybe_path (libmono )
7272 if libmono is None :
73- libmono = find_libmono (sgen = sgen )
73+ libmono = find_libmono (sgen = sgen , assembly_dir = assembly_dir )
7474
7575 impl = Mono (
7676 # domain=domain,
Original file line number Diff line number Diff line change @@ -136,7 +136,7 @@ def initialize(
136136 _MONO = load_mono (libmono )
137137
138138 if assembly_dir is not None and config_dir is not None :
139- _MONO .mono_set_dirs (assembly_dir , config_dir )
139+ _MONO .mono_set_dirs (assembly_dir . encode ( "utf8" ) , config_dir . encode ( "utf8" ) )
140140
141141 # Load in global config (i.e /etc/mono/config)
142142 global_encoded = global_config_file or ffi .NULL
Original file line number Diff line number Diff line change @@ -105,7 +105,7 @@ def find_runtimes() -> Iterator[DotnetCoreRuntimeSpec]:
105105 return find_runtimes_in_root (dotnet_root )
106106
107107
108- def find_libmono (* , sgen : bool = True ) -> Path :
108+ def find_libmono (* , assembly_dir : str = None , sgen : bool = True ) -> Path :
109109 """Find a suitable libmono dynamic library
110110
111111 On Windows and macOS, we check the default installation directories.
@@ -137,9 +137,12 @@ def find_libmono(*, sgen: bool = True) -> Path:
137137 )
138138
139139 else :
140- from ctypes .util import find_library
141-
142- path = find_library (unix_name )
140+ if assembly_dir == None :
141+ from ctypes .util import find_library
142+ path = find_library (unix_name )
143+ else :
144+ libname = "lib" + unix_name + ".so"
145+ path = Path (assembly_dir ) / "lib" / libname
143146
144147 if path is None :
145148 raise RuntimeError ("Could not find libmono" )
You can’t perform that action at this time.
0 commit comments