Skip to content

Commit

Permalink
fix(rusile): Adjust module loader to Darwin's shared module extension
Browse files Browse the repository at this point in the history
  • Loading branch information
alerque committed Dec 7, 2024
1 parent 3fb891a commit 2c5ea3e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
6 changes: 4 additions & 2 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,11 @@ if FONT_VARIATIONS
CARGO_FEATURE_ARGS += --features variations
endif

rusile.so: $(rusile_so_SOURCES) $(bin_PROGRAMS)
@builddir@/target/@RUST_TARGET_SUBDIR@/librusile.$(SHARED_LIB_EXT): $(rusile_so_SOURCES) $(bin_PROGRAMS)
$(CARGO_ENV) $(CARGO) build $(CARGO_VERBOSE) --target $(CARGO_TARGET_TRIPLE) $(RUSILE_FEATURE_ARG) $(CARGO_RELEASE_ARGS) -p rusile
$(INSTALL) @builddir@/target/@RUST_TARGET_SUBDIR@/lib$@ $@

rusile.so: @builddir@/target/@RUST_TARGET_SUBDIR@/librusile.$(SHARED_LIB_EXT)
$(INSTALL) $< $@

DEPDIR := .deps
LOCALFONTS := FONTCONFIG_FILE=$(PWD)/fontconfig.conf
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ AC_SUBST([ICU_LIBS])

case $host_os in
darwin*)
SHARED_LIB_EXT="so"
SHARED_LIB_EXT="dylib"
;;
cygwin*|mingw*)
SHARED_LIB_EXT="dll"
Expand Down
3 changes: 3 additions & 0 deletions core/pathsetup.lua.in
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ end
-- Prepend paths specifically for C modules.
local function prependCPath (path)
package.cpath = prepend_and_dedup(path .. "/?.@SHARED_LIB_EXT@", package.cpath)
if "@SHARED_LIB_EXT@" ~= "so" then
package.cpath = prepend_and_dedup(path .. "/?.so", package.cpath)
end
end

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

0 comments on commit 2c5ea3e

Please sign in to comment.