Skip to content

Instantly share code, notes, and snippets.

@gvvaughan
Last active December 19, 2015 00:08
Show Gist options
  • Save gvvaughan/5866136 to your computer and use it in GitHub Desktop.
Save gvvaughan/5866136 to your computer and use it in GitHub Desktop.
Patch upstream luarocks-2.0.13 for parallel Lua interpreter installations per http://lua-users.org/wiki/LuaRocksConfig
diff --git a/Makefile b/Makefile
index 67c3ce0..2d149c7 100644
--- a/Makefile
+++ b/Makefile
@@ -81,8 +81,13 @@
for f in $(BIN_FILES) ;\
do \
sed "1d" src/bin/$$f > src/bin/$$f.bak ;\
- echo "#!$(LUA_BINDIR)/lua$(LUA_SUFFIX)" > src/bin/$$f ;\
- echo "package.path = [[$(LUADIR)/?.lua;$(LUADIR)/?/init.lua;]]..package.path" >> src/bin/$$f ;\
+ printf '%s\n' \
+ '#!/bin/sh' \
+ 'SH=--[[' \
+ 'exec "$${LUA-$(LUA_BINDIR)/lua$(LUA_SUFFIX)}" "$$0" $${1+"$$@"}' \
+ ']]SH' \
+ 'package.path = [[$(LUADIR)/?.lua;$(LUADIR)/?/init.lua;]]..package.path' \
+ > src/bin/$$f ;\
cat src/bin/$$f.bak >> src/bin/$$f ;\
chmod +x src/bin/$$f ;\
rm -f src/bin/$$f.bak ;\
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment