-
-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci(actions): Split out LuaRocks handling so it they can be cached
- Loading branch information
Showing
3 changed files
with
53 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
SUPPORTED_LUAS = 5.3 5.2 5.1 | ||
|
||
LUAROCKS := luarocks --tree lua_modules --lua-version $(LUA_VERSION) | ||
|
||
if !SYSTEM_LUAROCKS | ||
nobase_nodist_pkgdata_DATA = $(LUAMODULES) | ||
LUAMODLOCK := sile-dev-1.rockslock | ||
LUAMODSPEC := sile-dev-1.rockspec | ||
genrockslock := $(LUAROCKS) $(LUAROCKSARGS) list --porcelain | awk '{print $$1 " " $$2}' | ||
rocksmatch := cmp -s $(LUAMODLOCK) <($(genrockslock)) | ||
endif | ||
|
||
.PHONY: installrocks disallow-dist-with-system-luarocks | ||
if !SYSTEM_LUAROCKS | ||
installrocks: $(LUAMODLOCK) $(shell $(rocksmatch) || echo lua_modules) | ||
|
||
lua_modules: $(LUAMODSPEC) $(shell $(rocksmatch) || echo force) | ||
if test -e .git; then | ||
$(LUAROCKS) $(LUAROCKSARGS) install --only-deps $< | ||
else | ||
rm -rf lua_modules | ||
cp -a lua_modules_dist lua_modules | ||
$(foreach LUA,$(filter-out $(LUA_VERSION),$(SUPPORTED_LUAS)), | ||
find lua_modules -maxdepth 3 -type d -name "*$(LUA)" -execdir rm -rf {} \;) | ||
fi | ||
|
||
$(LUAMODLOCK): lua_modules $(LUAMODSPEC) | ||
$(genrockslock) > $@ | ||
|
||
sile: installrocks | ||
|
||
disallow-dist-with-system-luarocks: ; | ||
else | ||
disallow-dist-with-system-luarocks: | ||
$(error In order to make dist you must configure --without-system-luarocks) | ||
exit 1 | ||
endif | ||
|
||
.PHONY: lua_modules_dist | ||
lua_modules_dist: LUAROCKS = luarocks --tree lua_modules_dist | ||
lua_modules_dist: $(LUAMODSPEC) force disallow-dist-with-system-luarocks | ||
$(foreach LUA,$(SUPPORTED_LUAS), | ||
$(LUAROCKS) $(LUAROCKSARGS) --lua-version $(LUA) install --only-deps $<) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters