Skip to content

Commit 2c5ea3e

Browse files
committed
fix(rusile): Adjust module loader to Darwin's shared module extension
1 parent 3fb891a commit 2c5ea3e

3 files changed

Lines changed: 8 additions & 3 deletions

File tree

Makefile.am

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,11 @@ if FONT_VARIATIONS
178178
CARGO_FEATURE_ARGS += --features variations
179179
endif
180180

181-
rusile.so: $(rusile_so_SOURCES) $(bin_PROGRAMS)
181+
@builddir@/target/@RUST_TARGET_SUBDIR@/librusile.$(SHARED_LIB_EXT): $(rusile_so_SOURCES) $(bin_PROGRAMS)
182182
$(CARGO_ENV) $(CARGO) build $(CARGO_VERBOSE) --target $(CARGO_TARGET_TRIPLE) $(RUSILE_FEATURE_ARG) $(CARGO_RELEASE_ARGS) -p rusile
183-
$(INSTALL) @builddir@/target/@RUST_TARGET_SUBDIR@/lib$@ $@
183+
184+
rusile.so: @builddir@/target/@RUST_TARGET_SUBDIR@/librusile.$(SHARED_LIB_EXT)
185+
$(INSTALL) $< $@
184186

185187
DEPDIR := .deps
186188
LOCALFONTS := FONTCONFIG_FILE=$(PWD)/fontconfig.conf

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ AC_SUBST([ICU_LIBS])
247247

248248
case $host_os in
249249
darwin*)
250-
SHARED_LIB_EXT="so"
250+
SHARED_LIB_EXT="dylib"
251251
;;
252252
cygwin*|mingw*)
253253
SHARED_LIB_EXT="dll"

core/pathsetup.lua.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ end
4343
-- Prepend paths specifically for C modules.
4444
local function prependCPath (path)
4545
package.cpath = prepend_and_dedup(path .. "/?.@SHARED_LIB_EXT@", package.cpath)
46+
if "@SHARED_LIB_EXT@" ~= "so" then
47+
package.cpath = prepend_and_dedup(path .. "/?.so", package.cpath)
48+
end
4649
end
4750

4851
-- Take a given path and iterate over permutations of paths that LuaRocks might have installed a rock to that are

0 commit comments

Comments
 (0)