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(
70
70
71
71
libmono = _maybe_path (libmono )
72
72
if libmono is None :
73
- libmono = find_libmono (sgen = sgen )
73
+ libmono = find_libmono (sgen = sgen , assembly_dir = assembly_dir )
74
74
75
75
impl = Mono (
76
76
# domain=domain,
Original file line number Diff line number Diff line change @@ -136,7 +136,7 @@ def initialize(
136
136
_MONO = load_mono (libmono )
137
137
138
138
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" ) )
140
140
141
141
# Load in global config (i.e /etc/mono/config)
142
142
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]:
105
105
return find_runtimes_in_root (dotnet_root )
106
106
107
107
108
- def find_libmono (* , sgen : bool = True ) -> Path :
108
+ def find_libmono (* , assembly_dir : str = None , sgen : bool = True ) -> Path :
109
109
"""Find a suitable libmono dynamic library
110
110
111
111
On Windows and macOS, we check the default installation directories.
@@ -137,9 +137,12 @@ def find_libmono(*, sgen: bool = True) -> Path:
137
137
)
138
138
139
139
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
143
146
144
147
if path is None :
145
148
raise RuntimeError ("Could not find libmono" )
You can’t perform that action at this time.
0 commit comments